Shadow-classify with a self-hosted model; opt-in Jev training capture #33

Merged
backmeupplz merged 2 commits from laya-shadow into main 2026-10-06 18:12:58 +00:00
backmeupplz commented 2026-10-06 17:09:50 +00:00 (Migrated from github.com)

Agentboard #49.

  • Shadow classifier (SHADOW_URL / SHADOW_API_KEY / SHADOW_MODEL / SHADOW_TIMEOUT_MS): every message Jev classifies (incl. spam-cache hits) is also sent to a second Jev-compatible /v1/systemone server (e.g. self-hosted Laya). Logged as shadow_analyzed with the primary decision; never deletes, never delays moderation.
  • Configurable primary (JEV_URL): switching to self-hosted is an env change (JEV_URL, TYPESAFE_API_KEY, JEV_MODEL).
  • Opt-in training capture (TRAINING_CAPTURE=true, needs DATABASE_URL): stores each successful Jev exchange — exact request (message/context/profile text), Jev's per-question answers, verdict, chat/message IDs, no sender IDs — in training_samples, pruned after TRAINING_CAPTURE_DAYS (30) and capped at 200k rows; bounded fire-and-forget writes. Used to distill Laya from Jev. README privacy text updated.
  • scripts/compare-shadow.ts: agreement / Jev-only / shadow-only at several gates from logs.

Tests: bun run check incl. PostgreSQL integration (new capture prune/retention test) passes locally and in CI.

🤖 Generated with Claude Code

Agentboard #49. - **Shadow classifier** (`SHADOW_URL` / `SHADOW_API_KEY` / `SHADOW_MODEL` / `SHADOW_TIMEOUT_MS`): every message Jev classifies (incl. spam-cache hits) is also sent to a second Jev-compatible `/v1/systemone` server (e.g. self-hosted Laya). Logged as `shadow_analyzed` with the primary decision; never deletes, never delays moderation. - **Configurable primary** (`JEV_URL`): switching to self-hosted is an env change (`JEV_URL`, `TYPESAFE_API_KEY`, `JEV_MODEL`). - **Opt-in training capture** (`TRAINING_CAPTURE=true`, needs `DATABASE_URL`): stores each successful Jev exchange — exact request (message/context/profile text), Jev's per-question answers, verdict, chat/message IDs, no sender IDs — in `training_samples`, pruned after `TRAINING_CAPTURE_DAYS` (30) and capped at 200k rows; bounded fire-and-forget writes. Used to distill Laya from Jev. README privacy text updated. - `scripts/compare-shadow.ts`: agreement / Jev-only / shadow-only at several gates from logs. Tests: `bun run check` incl. PostgreSQL integration (new capture prune/retention test) passes locally and in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.