Skip to content

refactor(selfhost): dual-read GITTENSORY_REVIEW_* feature flags alongside LOOPOVER_#5593

Merged
JSONbored merged 1 commit into
mainfrom
loopover/review-flags-dual-read
Jul 13, 2026
Merged

refactor(selfhost): dual-read GITTENSORY_REVIEW_* feature flags alongside LOOPOVER_#5593
JSONbored merged 1 commit into
mainfrom
loopover/review-flags-dual-read

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Closes Dual-read the GITTENSORY_REVIEW_* feature-flag family (env var migration follow-up) #5555. Closes Environment variable family migration #4774. Follow-up to Environment variable family migration #4774/refactor(selfhost): dual-read LOOPOVER_-prefixed env vars alongside GITTENSORY_ #5561, which covered 7 self-host operational vars but deliberately left out this larger 22-variable GITTENSORY_REVIEW_* feature-flag family. Between the two PRs, all "roughly twenty" vars Environment variable family migration #4774 describes are now dual-read.
  • Applies the already-merged dualPrefixEnvFlag/dualPrefixEnvString helpers (src/utils/env.ts) to all 22 flags, so LOOPOVER_REVIEW_* wins when both prefixes are set, falling back to the legacy GITTENSORY_ name otherwise. An untouched self-host .env keeps working unchanged.
  • Two flags needed special handling rather than a mechanical swap:
    • REVIEW_REPOS is a raw comma-separated allowlist string, not a boolean flag — uses dualPrefixEnvString, not dualPrefixEnvFlag, across its 2 read sites in cutover-gate.ts.
    • REVIEW_SELFTUNE has 2 independent read sites (selftune-wire.ts and a deliberate duplicate in settings/repository-settings.ts, inlined there specifically to avoid an import cycle) — both converted, importing dualPrefixEnvFlag directly from utils/env rather than reintroducing the cycle.
    • CONTENT_LANE's flag.ts previously used a hand-rolled Set-membership truthy check instead of the shared regex; functionally identical for the 4 accepted tokens (1/true/yes/on, trimmed, case-insensitive), so safely replaced with the shared helper.
  • apps/gittensory-ui/src/lib/selfhost-env-reference.ts is not regenerated here — its generator's DEFAULT_SOURCE_ROOTS never included src/review/**, src/queue/**, or src/settings/** (confirmed: none of these 22 vars, even in single-prefix form, appear in that file on main either), so it's genuinely out of scope for that doc. Added LOOPOVER_REVIEW_* companion lines to .env.example/.env.selfhost.example instead, next to each flag's existing GITTENSORY_REVIEW_* line, matching refactor(selfhost): dual-read LOOPOVER_-prefixed env vars alongside GITTENSORY_ #5561's documentation pattern — that's the real documentation surface for these flags.

Note on #5555's history

#5555 was auto-closed by the gate's cross-reference heuristic when PR #5561 merged, even though that PR's body only said "see #5555" (not a closing keyword) and never implemented this scope. Reopened before starting this PR; confirmed via grep that none of the 22 vars had dualPrefixEnvFlag applied before this PR.

Test plan

  • Full local gate (npm run test:ci + npm audit --audit-level=moderate) green.
  • Root tsc --noEmit clean across all 24 touched source files.

…side LOOPOVER_

Closes #5555. Follow-up to #4774/#5561, which covered the 7 self-host
operational vars but deliberately left out this larger 22-variable
GITTENSORY_REVIEW_* feature-flag family.

Applies the already-merged dualPrefixEnvFlag/dualPrefixEnvString
helpers (src/utils/env.ts) to all 22 flags, so LOOPOVER_REVIEW_* wins
when both prefixes are set, falling back to the legacy GITTENSORY_
name otherwise. An untouched self-host .env keeps working unchanged.

Two flags needed special handling rather than a mechanical swap:
- REVIEW_REPOS is a raw comma-separated allowlist string, not a
  boolean flag -- uses dualPrefixEnvString, not dualPrefixEnvFlag,
  across its 2 read sites in cutover-gate.ts.
- REVIEW_SELFTUNE has 2 independent read sites (selftune-wire.ts and
  a deliberate duplicate in settings/repository-settings.ts, inlined
  there specifically to avoid an import cycle) -- both converted,
  importing dualPrefixEnvFlag directly from utils/env rather than
  reintroducing the cycle.

CONTENT_LANE's flag.ts previously used a hand-rolled Set-membership
truthy check instead of the shared regex; functionally identical for
the 4 accepted tokens (1/true/yes/on, trimmed, case-insensitive), so
safely replaced with the shared helper.

apps/gittensory-ui/src/lib/selfhost-env-reference.ts is NOT
regenerated here -- its generator's DEFAULT_SOURCE_ROOTS never
included src/review/**, src/queue/**, or src/settings/** (confirmed:
none of these 22 vars, even in their single-prefix form, appear in
that file on main either), so it's out of scope for this doc,
unrelated to this change. Added LOOPOVER_REVIEW_* companion lines to
.env.example / .env.selfhost.example instead, next to each flag's
existing GITTENSORY_REVIEW_* line, matching #5561's documentation
pattern -- this is the real documentation surface for these flags.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored self-assigned this Jul 13, 2026
@JSONbored
JSONbored merged commit e7af086 into main Jul 13, 2026
13 checks passed
@JSONbored
JSONbored deleted the loopover/review-flags-dual-read branch July 13, 2026 07:43
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 13, 2026
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.01%. Comparing base (b1d3e8d) to head (b8522d2).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5593      +/-   ##
==========================================
- Coverage   95.01%   95.01%   -0.01%     
==========================================
  Files         573      573              
  Lines       45534    45533       -1     
  Branches    14680    14661      -19     
==========================================
- Hits        43263    43262       -1     
  Misses       1520     1520              
  Partials      751      751              
Flag Coverage Δ
shard-1 44.05% <84.61%> (-0.01%) ⬇️
shard-2 35.69% <65.38%> (+0.01%) ⬆️
shard-3 32.17% <53.84%> (+<0.01%) ⬆️
shard-4 30.96% <73.07%> (-1.89%) ⬇️
shard-5 32.80% <65.38%> (+0.94%) ⬆️
shard-6 44.39% <73.07%> (+0.20%) ⬆️

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

Files with missing lines Coverage Δ
src/queue/processors.ts 95.67% <100.00%> (ø)
src/review/content-lane/flag.ts 100.00% <100.00%> (ø)
src/review/cutover-gate.ts 100.00% <100.00%> (ø)
src/review/e2e-test-gen-wire.ts 100.00% <100.00%> (ø)
src/review/enrichment-wire.ts 98.45% <100.00%> (ø)
src/review/fix-handoff.ts 100.00% <100.00%> (ø)
src/review/grounding-wire.ts 96.77% <100.00%> (ø)
src/review/impact-map-wire.ts 100.00% <100.00%> (ø)
src/review/improvement-signal-wire.ts 100.00% <100.00%> (ø)
src/review/inline-comments.ts 100.00% <100.00%> (ø)
... and 13 more
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Dual-read the GITTENSORY_REVIEW_* feature-flag family (env var migration follow-up) Environment variable family migration

1 participant