refactor(env): retire GITTENSORY_<X>/LOOPOVER_<X> dual-read across the worker - #5652
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 3621f4a | Commit Preview URL Branch Preview URL |
Jul 14 2026, 01:14 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5652 +/- ##
==========================================
- Coverage 95.04% 95.04% -0.01%
==========================================
Files 577 576 -1
Lines 45987 45980 -7
Branches 14708 14724 +16
==========================================
- Hits 43707 43700 -7
Misses 1527 1527
Partials 753 753
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-14 01:17:44 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 6 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agent
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 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.
|
…e worker Deletes src/utils/env.ts (dualPrefixEnvString/Flag/StrictFlag) now that every call site reads its LOOPOVER_<X> var directly. This is the largest and highest-risk piece of the #4774 dual-read cleanup: auth/security.ts and selfhost/preflight.ts (API/MCP token auth + preflight secret checks) move in lockstep so a self-hoster's preflight and auth gate agree on the same var names; selfhost/ai.ts and selfhost/health.ts keep ENABLE_UNSAFE_CODEX_REVIEWER as a strict `=== "1"` check; the ~20 review/** feature flags (safety, grounding, RAG, unified comment, reputation, ops, selftune, content-lane, parity-audit, draft, planner, impact-map, culture-profile, memory, inline-comments, fix-handoff, e2e-tests, improvement-signal, enrichment, continuous) and the REVIEW_REPOS cutover allowlist all move together with their existing precedence logic untouched; notify-discord.ts's per-repo webhook map now points 'jsonbored/gittensory' straight at LOOPOVER_DISCORD_WEBHOOK instead of deriving it from a GITTENSORY_ name at runtime. wrangler.jsonc's `vars` block is renamed alongside src/env.d.ts -- the deployed Worker's own var bindings were still declaring the pre-rebrand GITTENSORY_REVIEW_* keys, which would have left every LOOPOVER_REVIEW_* read unbound on deploy once the dual-read helper was gone. worker-configuration.d.ts and apps/gittensory-ui/src/lib/selfhost-env-reference.ts are regenerated to match. scripts/gen-selfhost-env-reference.mjs drops the dual-prefix AST recognition branch now that no call site needs it. .env.example and .env.selfhost.example flip to LOOPOVER_<X> as the live, uncommented default with the retired GITTENSORY_<X> name left as a commented "no longer read" note. Self-hosting docs pages and their stray GITTENSORY_REVIEW_* wildcard-family prose mentions are updated to match, including a couple of comment-only references in packages/gittensory-engine that had drifted from the actual env var names. Tests are the mechanical counterpart: utils-env.test.ts is deleted, auth.test.ts loses its "legacy alone" case, and every *-wire/selfhost/notify test fixtures on the new LOOPOVER_ names. Fields with no LOOPOVER_ sibling (SKIP_AUTOMATION_BOT_PRS, the DRIFT_ISSUE_* and MAINTAINER_RECAP families, PUBLIC_STATS, SWEEP_WATCHDOG, PR_RECONCILIATION, EXPERIMENTAL_GITTENSOR, DUPLICATE_WINNER, OPEN_PR_FILE_COLLISION, UPLOAD_SOURCE, CONTRIBUTOR_ISSUE_TOKEN, and the bespoke REVIEW_STATS_TOKEN secret name) are left on their existing GITTENSORY_ prefix -- they were never part of the dual-read family. Part of #4777
… tool refs to loopover_ The local CLI's stdio tools were already renamed in #5648; these AGENT_PROFILES recommendedTools/prompt-guidance strings and their matching test assertions were the remaining stale references. Also fixes a leftover .gittensory.yml mention in a visual-wire.ts comment. Part of #4777
2eb87ce to
b10fa35
Compare
…R_REVIEW_STATS_TOKEN src/review/stats.ts's STATS_TOKEN_SECRET constant, its self-host docs entry (docs.tuning.tsx), and .env.example still named the old GITTENSORY_REVIEW_ prefix. Missed by npm run cf-typegen:check since it's a secret (set via wrangler secret put / a self-host .env), not a wrangler.jsonc var, so codegen never sees it. Verified before renaming: `wrangler secret list` shows no secret by this name on the hosted Worker, and the self-hosted server's real .env has no match either (only its .env.example, commented out) -- this token has never actually been configured anywhere, so the rename carries zero live- cutover risk. Part of #4777
…nfigured and cool down its breaker (#7473) The GITTENSORY_→LOOPOVER_ env rebrand (#5652) retired dual-read of GITTENSORY_ENABLE_UNSAFE_CODEX_REVIEWER and hardcoded a strict LOOPOVER_ENABLE_UNSAFE_CODEX_REVIEWER === "1" check. An operator whose .env still uses the legacy name silently reverts to fully-disabled and gets the exact same generic codex_credential_isolation_required error as someone who never opted in at all — no signal telling them to rename the var. Recognize the retired flag name in assertCodexCredentialIsolation (without honoring it) and throw an actionable "rename it to LOOPOVER_ENABLE_UNSAFE_CODEX_REVIEWER" message, but only when the current flag isn't already correctly set so a mounted CODEX_HOME isn't mislabeled a rename problem. The message keeps the codex_credential_isolation_required prefix so the structural circuit breaker still recognizes it. Read via a constant rather than env.GITTENSORY_... so the retired name stays out of the generated self-host env reference. Also widen isStructuralProviderConfigError's regex to match codex_credential_isolation_required (bare or with a ": rename …" suffix). It's a deterministic config failure, so it now earns the hour-long structural cooldown instead of retrying every 60s — the flood pattern that breaker exists to prevent. Closes #7466 Co-authored-by: bitfathers94 <237535319+bitfathers94@users.noreply.github.com>




Summary
Deletes
src/utils/env.ts(dualPrefixEnvString/Flag/StrictFlag) now that every call site reads itsLOOPOVER_<X>var directly. This is the largest and highest-risk piece of the dual-read cleanup:src/auth/security.tsandsrc/selfhost/preflight.ts(API/MCP token auth + preflight secret checks) move in exact lockstep so a self-hoster's preflight and auth gate agree on the same var names.src/selfhost/ai.tsandsrc/selfhost/health.tskeepENABLE_UNSAFE_CODEX_REVIEWERas a strict=== "1"check (not loose truthy).review/**feature flags (safety, grounding, RAG, unified comment, reputation, ops, selftune, content-lane, parity-audit, draft, planner, impact-map, culture-profile, memory, inline-comments, fix-handoff, e2e-tests, improvement-signal, enrichment, continuous) and theREVIEW_REPOScutover allowlist move together with their existing precedence logic (master kill-switch, allowlist fallback, manifest-only opt-in) fully preserved.src/services/notify-discord.ts's per-repo webhook map now pointsjsonbored/gittensorystraight atLOOPOVER_DISCORD_WEBHOOKinstead of deriving it from aGITTENSORY_name at runtime.wrangler.jsonc'svarsblock is renamed alongsidesrc/env.d.ts— the deployed Worker's own var bindings were still declaring the pre-rebrandGITTENSORY_REVIEW_*keys, which would have left everyLOOPOVER_REVIEW_*read unbound on deploy once the dual-read helper was gone.worker-configuration.d.tsandapps/gittensory-ui/src/lib/selfhost-env-reference.tsare regenerated to match.scripts/gen-selfhost-env-reference.mjsdrops the dual-prefix AST recognition branch now that no call site needs it..env.example/.env.selfhost.exampleflip toLOOPOVER_<X>as the live default with the retiredGITTENSORY_<X>name left as a commented "no longer read" note; self-hosting docs pages (and a couple of comment-only references inpackages/gittensory-enginethat had drifted) are updated to match.Fields with no
LOOPOVER_sibling (SKIP_AUTOMATION_BOT_PRS, theDRIFT_ISSUE_*/MAINTAINER_RECAPfamilies,PUBLIC_STATS,SWEEP_WATCHDOG,PR_RECONCILIATION,EXPERIMENTAL_GITTENSOR,DUPLICATE_WINNER,OPEN_PR_FILE_COLLISION,UPLOAD_SOURCE,CONTRIBUTOR_ISSUE_TOKEN, and the bespokeREVIEW_STATS_TOKENsecret name) are left untouched — they were never part of the dual-read family.Part of #4777
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — fullnpm run test:cirun green end to end (826 test files, 0 failures)npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderate— 0 vulnerabilitiesSafety
No visible UI change — the touched
apps/gittensory-uifiles are docs-page prose/<code>references only, so no UI Evidence section is needed.Notes
Ran the full local gate (
npm run test:ci) end to end after the fix below, exit 0, 826 test files / 0 failures, plusnpm audit --audit-level=moderateclean.