chore(env): config-surface reduction tranche 4 β env-var cleanup (review request)#111584
chore(env): config-surface reduction tranche 4 β env-var cleanup (review request)#111584steipete wants to merge 10 commits into
Conversation
3c86554 to
c516441
Compare
|
Codex review: needs real behavior proof before merge. Reviewed July 20, 2026, 9:34 AM ET / 13:34 UTC. Summary PR surface: Source -34, Tests +163, Docs +83, Config +1, Generated 0, Other +151. Total +364 across 73 files. Reproducibility: not applicable. this is a cleanup and compatibility-boundary PR rather than a report of one reproducible broken behavior. The relevant before/after paths are operator configuration lookup and ACPX wrapper launching. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Have the responsible maintainer ratify the supported environment compatibility boundary, preserve or migrate any supported external use discovered in review, then add redacted real runtime proof for config-path resolution and ACPX wrapper launch before resolving the remaining failing lanes. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a cleanup and compatibility-boundary PR rather than a report of one reproducible broken behavior. The relevant before/after paths are operator configuration lookup and ACPX wrapper launching. Is this the best way to solve the issue? Unclear: centralizing test-only gates and reducing duplicate names is maintainable, but the proposed removal boundary is not ready to accept until maintainers explicitly confirm which environment variables remain supported. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8d4d02a3cfa4. Label changesLabel justifications:
Evidence reviewedPR surface: Source -34, Tests +163, Docs +83, Config +1, Generated 0, Other +151. Total +364 across 73 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
What Problem This Solves
The production env-var surface reached ~645 distinct
OPENCLAW_*names, 444 of them undocumented, with no unified mechanism: test-only flags steered core path resolution (OPENCLAW_TEST_FASTwas read insidesrc/config/paths.ts), build/dev controls lived in shipped runtime code, several vars existed twice under different names, and_ENV/_ARGindirection pairs named other variables instead of carrying values.Tranche 4 of the config-surface reduction program (maintainer-directed). This PR is intentionally left unmerged for maintainer review.
Why This Change Was Made
refactor(env): isolate test-only controls):OPENCLAW_TEST_*and QA leak-set reads moved out of production paths into test seams or behind the central test-runtime detection insrc/infra/env.ts; prod builds no longer consult them._ENV/_ARGname-of-a-var pairs replaced with direct variables where both producer and consumer are in-repo.OPENCLAW_CONFIGvsOPENCLAW_CONFIG_PATHand temp-dir aliases unified to the documented names.docs/help/environment.md): the supported operator-facing set is now enumerated, with an explicit note that undocumentedOPENCLAW_*names are internal and may vanish without notice.scripts/check-env-var-count.mjs+ trackedconfig/env-var-count-budget.txt(shrink-only, max-lines-ratchet pattern). Initialized at the post-cleanup count of 529 distinct production names (down from ~645).User Impact
No documented operator-facing variable was renamed or removed (docs/help/environment.md set is treated as public contract). Behavior for production reads that remain is unchanged. Undocumented internal/test/build vars were removed or isolated; anyone depending on those was outside the documented contract, which this PR now states explicitly.
Config-surface metric (ClawSweeper): production
OPENCLAW_*names ~645 β 529, direction: shrinking; new shrink-only budget prevents regrowth.Evidence
node scripts/check-env-var-count.mjs: 529/529 green.fix(env): remove stale provider helper import,fix(env): make ratchet sorting explicit,test(env): keep test seam in dead-code audit).