Skip to content

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

Closed
jaytbarimbao-collab wants to merge 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:fix-selfhost-env-reference-ai-review-vars-6993
Closed

fix(scripts): document AI review-pipeline self-host env vars#7141
jaytbarimbao-collab wants to merge 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:fix-selfhost-env-reference-ai-review-vars-6993

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 (npm run selfhost:env-reference). 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

  • Added a 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 (proving the new root is the source).

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 (a624234) to head (fb7ddbb).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7141   +/-   ##
=======================================
  Coverage   93.75%   93.75%           
=======================================
  Files         692      692           
  Lines       68853    68853           
  Branches    18781    18781           
=======================================
  Hits        64556    64556           
  Misses       3302     3302           
  Partials      995      995           
Flag Coverage Δ
shard-1 43.76% <ø> (ø)
shard-2 36.92% <ø> (ø)
shard-3 33.13% <ø> (ø)
shard-4 34.46% <ø> (ø)
shard-5 32.29% <ø> (-0.01%) ⬇️
shard-6 45.91% <ø> (ø)

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

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-18 00:31:24 UTC

3 files · 1 AI reviewer · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
This PR closes #6993 by adding three AI review-pipeline source files to `DEFAULT_SOURCE_ROOTS` in the env-reference generator and regenerating the derived `selfhost-env-reference.ts` file, which now surfaces the four named AI_* knobs plus their sibling vars from the same files. The change is narrow, mechanical, and matches its stated intent; the regression test confirms all four target vars are collected and pins `AI_MAX_OUTPUT_TOKENS`'s source to `src/services/ai-review.ts`, proving the new root is what surfaces it. CI failures on `validate` and `validate-code` are worth checking but aren't visible defects in this diff.

Nits — 4 non-blocking
  • The generated file flagged as `long-file` (612 lines) is auto-generated output from the script, not hand-maintained code, so the size threshold isn't a meaningful maintainability signal here — worth excluding generated files from that check if not already done.
  • The regression test in `test/unit/selfhost-env-reference-script.test.ts` calls `collectSelfHostEnvVars({})` against the real repo rather than a fixture, which is appropriate for this proof but makes the test fragile to unrelated future additions of new source roots or removed AI_* vars — a comment noting that tradeoff would help future maintainers.
  • Consider verifying the CI failures on `validate` and `validate-code` aren't related to the new source roots (e.g. lint/type issues in the newly-scanned files being pulled into some check) before merging.
  • The PR could briefly note why `AI_DAILY_NEURON_BUDGET`, `AI_GATEWAY_ID`, `AI_REVIEW_PLAN`, `GITHUB_PUBLIC_TOKEN`, etc. (undocumented siblings) are also now included — the description mentions this in passing but it's easy for a reviewer to conflate with scope creep; a one-line clarification avoids that confusion.

CI checks failing

  • validate
  • validate-code

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: moderate
Linked issue satisfaction

Addressed
The PR adds the three AI review-pipeline files to DEFAULT_SOURCE_ROOTS, regenerates selfhost-env-reference.ts which now includes all four named vars (AI_SUMMARIES_ENABLED, AI_PUBLIC_COMMENTS_ENABLED, AI_MAX_OUTPUT_TOKENS, AI_BYOK_DAILY_REPO_LIMIT), and adds a regression test asserting the generator picks these up with AI_MAX_OUTPUT_TOKENS pinned to ai-review.ts.

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 commented Jul 18, 2026

Copy link
Copy Markdown

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 18, 2026
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