Skip to content

fix(scripts): document AI review-pipeline self-host env vars#7143

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:fix-selfhost-env-reference-ai-review-vars-6993-v2
Jul 18, 2026
Merged

fix(scripts): document AI review-pipeline self-host env vars#7143
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:fix-selfhost-env-reference-ai-review-vars-6993-v2

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown
Contributor

Closes #6993

gen-selfhost-env-reference.mjs's DEFAULT_SOURCE_ROOTS never scanned the AI review pipeline (src/services/ai-review.ts, src/queue/ai-review-orchestration.ts, src/queue/processors.ts), so the self-host AI_* knobs read there — AI_SUMMARIES_ENABLED, AI_PUBLIC_COMMENTS_ENABLED, AI_MAX_OUTPUT_TOKENS, AI_BYOK_DAILY_REPO_LIMIT — were missing from the generated reference despite being real self-host config.

Change

  • Add the three AI review-pipeline files to DEFAULT_SOURCE_ROOTS.
  • Regenerate apps/loopover-ui/src/lib/selfhost-env-reference.ts. The four named vars now appear, along with the sibling self-host vars those files read (previously undocumented for the same scan-gap reason) — the generator documents what the scanned files actually read.

Tests

  • Regression test asserting collectSelfHostEnvVars picks up all four vars from the real repo, with AI_MAX_OUTPUT_TOKENS's first reference pinned to src/services/ai-review.ts.

Validation

  • npx vitest run test/unit/selfhost-env-reference-script.test.ts — 6 passed.
  • npm run selfhost:env-reference:check — committed reference in sync.
  • 100% patch coverage on the changed scripts/** lines (apps/** generated file is outside Codecov coverage.include).

gen-selfhost-env-reference.mjs's DEFAULT_SOURCE_ROOTS never scanned the AI
review pipeline (src/services/ai-review.ts, src/queue/ai-review-orchestration.ts,
src/queue/processors.ts), so the self-host AI_* knobs read there —
AI_SUMMARIES_ENABLED, AI_PUBLIC_COMMENTS_ENABLED, AI_MAX_OUTPUT_TOKENS,
AI_BYOK_DAILY_REPO_LIMIT — were missing from the generated reference despite
being real self-host config a self-hoster needs.

Add those three files to the scan roots and regenerate
apps/loopover-ui/src/lib/selfhost-env-reference.ts. The four named vars (plus
the sibling self-host vars those files read, previously undocumented for the
same scan-gap reason) now appear, matching what the code actually reads.

Closes JSONbored#6993
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.75%. Comparing base (0a6a780) to head (8419bab).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7143   +/-   ##
=======================================
  Coverage   93.75%   93.75%           
=======================================
  Files         692      692           
  Lines       68832    68832           
  Branches    18781    18781           
=======================================
  Hits        64535    64535           
  Misses       3302     3302           
  Partials      995      995           
Flag Coverage Δ
shard-1 43.75% <ø> (ø)
shard-2 36.91% <ø> (ø)
shard-3 33.14% <ø> (ø)
shard-4 34.44% <ø> (ø)
shard-5 32.27% <ø> (-0.01%) ⬇️
shard-6 45.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 18, 2026
@loopover-orb

loopover-orb Bot commented Jul 18, 2026

Copy link
Copy Markdown

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-18 00:43:23 UTC

3 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds three AI review-pipeline source files (`src/services/ai-review.ts`, `src/queue/ai-review-orchestration.ts`, `src/queue/processors.ts`) to `DEFAULT_SOURCE_ROOTS` in the env-reference generator, then regenerates the committed reference file, which now includes the four named vars from #6993 plus sibling vars from those same files. The change is mechanical, narrow, and correctly scoped to the linked issue. The regression test pins `AI_MAX_OUTPUT_TOKENS` to `src/services/ai-review.ts` as proof the new root is the source of the fix, which is a solid, non-fabricated assertion since the generator's file-scan behavior is exercised against the real repo.

Nits — 3 non-blocking
  • The generated `selfhost-env-reference.ts` file now sits at ~612 lines per the external size check, but this is an auto-generated artifact (`Do not edit manually`) so file-length norms don't really apply — no action needed.
  • test/unit/selfhost-env-reference-script.test.ts:164 the new `describe` block runs `collectSelfHostEnvVars({})` against the real repo filesystem rather than a fixture, which is appropriate here (it's explicitly testing real-repo drift) but is a different testing style from the rest of the file's fixture-based tests — worth a one-line comment noting why, which the PR already partially provides.
  • Consider whether `AI_DAILY_NEURON_BUDGET`, `AI_GATEWAY_ID`, and `AI_REVIEW_PLAN` (newly surfaced sibling vars in ai-review.ts) need corresponding rows in the self-hosting-configuration docs page per the `selfhost-docs-audit.ts` drift guard — worth confirming `npm run docs:drift-check` covers descriptions for these, not just presence.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6993
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 191 registered-repo PR(s), 99 merged, 14 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jaytbarimbao-collab; Gittensor profile; 191 PR(s), 14 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The PR adds the three AI review-pipeline files to DEFAULT_SOURCE_ROOTS, regenerates selfhost-env-reference.ts to include all four required vars (AI_SUMMARIES_ENABLED, AI_PUBLIC_COMMENTS_ENABLED, AI_MAX_OUTPUT_TOKENS, AI_BYOK_DAILY_REPO_LIMIT) with correct firstReference paths, and adds a regression test asserting the generator picks up these vars from the new source roots.

Review context
  • Author: jaytbarimbao-collab
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Rust
  • Official Gittensor activity: 191 PR(s), 14 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit c060b2a into JSONbored:main Jul 18, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

selfhost-env-reference generator misses AI review-pipeline env vars

1 participant