Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Lighthouse

Lighthouse is a Reddit Devvit moderation app for reviewing posts and comments that look AI-generated. It is built as an advisory workflow: the app flags suspicious content, shows the evidence, and lets moderators decide whether the item is AI, human, or unclear.

What Works Now

  • Post and comment submit triggers score new content on r/LighthouseLab.
  • The local detector extracts linguistic signals, stores verdicts in Redis, and renders explainable evidence.
  • Borderline items can be reviewed by an LLM when the subreddit has an API key, LLM review is enabled, and the daily budget allows it.
  • Gemini 2.5 Flash is the default LLM provider. OpenAI is also exposed in settings because its domain is allow-listed.
  • LLM review uses redaction, JSON validation, retry handling, a SHA-256 result cache, daily budget checks, and circuit breakers.
  • Moderator surfaces include badges, the review panel, dashboard, queue, settings, action buttons, audit activity, weekly digest, removal-reason install flow, and mod-note actions.
  • Dashboard filters support 7d, 30d, and 90d ranges for metrics and charts.

App Setup

The development app slug is lighthouse-lh.

The current uploaded build is installed on r/LighthouseLab. To install the uploaded build on another subreddit, use the Devvit install flow from the app page or run:

npm.cmd exec -- devvit install YourSubreddit lighthouse-lh

For a public App Directory listing, upload the build and publish it publicly:

npm.cmd run deploy
npm.cmd exec -- devvit publish --public

Policy links for the Devvit listing:

Moderators configure Lighthouse from the dashboard Settings tab or Reddit's app settings page:

  • Choose Gemini Flash or OpenAI.
  • Paste the provider API key for that subreddit.
  • Enable LLM review when the community is ready to spend provider credits.
  • Set the daily budget cap, gray-zone bounds, flag threshold, and mod-note threshold.
  • Use Lighthouse: Test connection from the subreddit menu or the settings screen before relying on LLM review.

If LLM review is off, the key is missing, or the budget is exhausted, Lighthouse still scores content with the local detector and explains why the LLM was skipped.

Development

Prerequisites:

  • Node.js 22+
  • npm 10+
  • Devvit CLI authenticated with devvit login
  • Access to the lighthouse-lh Devvit app

Install dependencies:

npm.cmd install

Run the local verification set:

npm.cmd run typecheck
npm.cmd run lint
npm.cmd run test
npm.cmd run build

Start playtest against the configured test subreddit:

npm.cmd run dev

Stream logs:

npm.cmd exec -- devvit logs LighthouseLab lighthouse-lh --show-timestamps --since 0m

Useful commands:

  • npm.cmd run deploy: typecheck, lint, test, then upload with Devvit.
  • npm.cmd run eval -- --stage2: run the combined detector evaluation.
  • npm.cmd run loadtest:replay: replay the generated load-test corpus.
  • npm.cmd run edgetest: run edge-case detector checks.
  • npm.cmd run screenshots: capture the app screenshot set.
  • npm.cmd run dashboard:seed-content: create dashboard demo content from the local script.
  • npm.cmd run validation:seed-feedback: seed validation feedback, calibration, and dashboard rows.

Data And Privacy

Lighthouse stores verdicts, feedback, calibration events, audit records, and dashboard aggregates in the app Redis namespace. Before LLM review, content is redacted to remove usernames, subreddit names, URLs, and email-like values. LLM cache keys are SHA-256 hashes of normalized content and prompt metadata.

API keys are subreddit app settings. They are not committed to this repository. Moderators who can manage app settings may be able to view or replace those values, so each community should use a key and budget appropriate for that community.

Benchmark And Reports

The benchmark fixtures live under test/fixtures. Generated reports live under test/reports; large transient cache files are ignored by Git.

Common checks:

npm.cmd run benchmark:validate
npm.cmd run benchmark:split
npm.cmd run eval
npm.cmd run eval -- --stage2

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages