Context
scripts/gen-selfhost-env-reference.mjs's DEFAULT_SOURCE_ROOTS (lines 8-15) scans src/selfhost, src/server.ts, src/services/notify-discord.ts, src/services/notify-pagerduty.ts, and three scripts — it never scans src/services/ai-review.ts, src/queue/ai-review-orchestration.ts, or src/queue/processors.ts. Four self-host-relevant env vars are read in those unscanned files but missing (or only partially present) from the generated reference:
AI_SUMMARIES_ENABLED — read at src/services/ai-review.ts:2042, src/queue/ai-review-orchestration.ts:243; present in .env.example:629 but missing from the generated apps/loopover-ui/src/lib/selfhost-env-reference.ts.
AI_PUBLIC_COMMENTS_ENABLED — ai-review.ts:2044, ai-review-orchestration.ts:244.
AI_MAX_OUTPUT_TOKENS — ai-review.ts:2057.
AI_BYOK_DAILY_REPO_LIMIT — ai-review.ts:2168, processors.ts:7335.
All four are already declared in src/env.d.ts's self-host doc-comment block (~lines 84-96), so the generator's own source-of-truth already knows about them in principle — it just never scans the files that actually read them at runtime.
Requirements
- Add
src/services/ai-review.ts, src/queue/ai-review-orchestration.ts, and src/queue/processors.ts to DEFAULT_SOURCE_ROOTS in scripts/gen-selfhost-env-reference.mjs.
- Regenerate
apps/loopover-ui/src/lib/selfhost-env-reference.ts (npm run selfhost:env-reference) and commit the result in the same PR — a stale generated file fails CI.
- Do not manually hand-edit the generated file — it must come from running the generator.
Deliverables
Test Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus the regression test above. This is a scripts/** change — confirm it's within the Codecov coverage.include scope for this repo (most scripts/** generator code is covered; verify rather than assume).
Expected Outcome
All four AI review-pipeline env vars are documented in the generated self-host env reference, matching what the code actually reads — a self-hoster configuring these knobs no longer has to read source to find them.
Links & Resources
scripts/gen-selfhost-env-reference.mjs:8-15 (DEFAULT_SOURCE_ROOTS). src/env.d.ts:84-96 — the existing doc-comment declarations these vars already have. src/services/ai-review.ts:2042,2044,2057,2168, src/queue/ai-review-orchestration.ts:243-244, src/queue/processors.ts:7335 — the actual read sites.
Context
scripts/gen-selfhost-env-reference.mjs'sDEFAULT_SOURCE_ROOTS(lines 8-15) scanssrc/selfhost,src/server.ts,src/services/notify-discord.ts,src/services/notify-pagerduty.ts, and three scripts — it never scanssrc/services/ai-review.ts,src/queue/ai-review-orchestration.ts, orsrc/queue/processors.ts. Four self-host-relevant env vars are read in those unscanned files but missing (or only partially present) from the generated reference:AI_SUMMARIES_ENABLED— read atsrc/services/ai-review.ts:2042,src/queue/ai-review-orchestration.ts:243; present in.env.example:629but missing from the generatedapps/loopover-ui/src/lib/selfhost-env-reference.ts.AI_PUBLIC_COMMENTS_ENABLED—ai-review.ts:2044,ai-review-orchestration.ts:244.AI_MAX_OUTPUT_TOKENS—ai-review.ts:2057.AI_BYOK_DAILY_REPO_LIMIT—ai-review.ts:2168,processors.ts:7335.All four are already declared in
src/env.d.ts's self-host doc-comment block (~lines 84-96), so the generator's own source-of-truth already knows about them in principle — it just never scans the files that actually read them at runtime.Requirements
src/services/ai-review.ts,src/queue/ai-review-orchestration.ts, andsrc/queue/processors.tstoDEFAULT_SOURCE_ROOTSinscripts/gen-selfhost-env-reference.mjs.apps/loopover-ui/src/lib/selfhost-env-reference.ts(npm run selfhost:env-reference) and commit the result in the same PR — a stale generated file fails CI.Deliverables
DEFAULT_SOURCE_ROOTSincludes the three additional filesselfhost-env-reference.tsincludesAI_SUMMARIES_ENABLED,AI_PUBLIC_COMMENTS_ENABLED,AI_MAX_OUTPUT_TOKENS,AI_BYOK_DAILY_REPO_LIMITTest Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus the regression test above. This is a
scripts/**change — confirm it's within the Codecovcoverage.includescope for this repo (mostscripts/**generator code is covered; verify rather than assume).Expected Outcome
All four AI review-pipeline env vars are documented in the generated self-host env reference, matching what the code actually reads — a self-hoster configuring these knobs no longer has to read source to find them.
Links & Resources
scripts/gen-selfhost-env-reference.mjs:8-15(DEFAULT_SOURCE_ROOTS).src/env.d.ts:84-96— the existing doc-comment declarations these vars already have.src/services/ai-review.ts:2042,2044,2057,2168,src/queue/ai-review-orchestration.ts:243-244,src/queue/processors.ts:7335— the actual read sites.