Skip to content

fix(ci): restore environment variable count ratchet - #125185

Merged
steipete merged 1 commit into
mainfrom
codex/fix-env-budget-ratchet-budget
Aug 17, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-env-budget-ratchet-budget

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #125175

What Problem This Solves

Fixes an issue where the environment-variable count ratchet fails on current main because the recorded budget is one higher than the actual production-source count.

Why This Change Was Made

Restores the shrink-only budget to the measured 501 names after the internal Node-version expression stopped using the OPENCLAW_* prefix. This preserves the ratchet invariant without adding configuration surface or changing runtime behavior.

User Impact

Maintainers can run the environment-variable count gate successfully again, and future OPENCLAW_* growth remains visible instead of being hidden by an unused budget slot.

Evidence

  • Before on e3d553b73419239a0231aaccd2a029983b9f2717: OPENCLAW_* count 501 is below budget 502
  • After: node scripts/check-env-var-count.mts --base origin/main reports OPENCLAW_* count 501/501
  • git diff --check passes.
  • Fresh Codex autoreview is clean with no accepted/actionable findings.

Production/config LOC: +2/-2 (net 0). Tests: unchanged.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete steipete self-assigned this Aug 17, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 5:14 AM ET / 09:14 UTC.

ClawSweeper review

What this changes

This PR lowers the checked-in OPENCLAW_* environment-variable count budget from 502 to 501 after the runtime rename removed a false scanner match.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This PR is still necessary: current main retains budget 502 while the scanner’s current source boundary contains 501 names. The one-line decrease is the correct owner-boundary repair; it remains maintainer-labeled and exact-head CI is still running.

Priority: P3
Reviewed head: 5fda3c1744ff59c04df354a200d3a4957ab34a2b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The minimal baseline correction matches direct scanner and current-main evidence; exact-head CI remains the canonical final check.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored CI-baseline correction has no external-contributor real-behavior-proof requirement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored CI-baseline correction has no external-contributor real-behavior-proof requirement.
Evidence reviewed 6 items Scanner contract: The scanner searches source under src, packages, and extensions, collects distinct matching names, and fails unless the count equals the budget.
Current-main mismatch: Current main records budget 502, while a read-only enumeration reproducing the scanner’s source roots, path filters, extensions, and name pattern found 501 distinct names; the retired node-check identifier is absent.
PR repair: The PR head changes only the budget and explanatory comment, recording 501 without changing scanner behavior or runtime configuration.
Findings None None.
Security None None.

How this fits together

OpenClaw’s CI ratchet scans production source for OPENCLAW_* names and compares the result with a shrink-only checked-in budget. It prevents unnoticed expansion of the environment-variable surface before changes merge.

flowchart LR
  A[Production source] --> B[Environment-name scanner]
  B --> C[Distinct name count]
  D[Checked-in budget] --> E[CI comparison]
  C --> E
  E --> F[Pass or failure]
Loading

Before merge

  • Resolve merge risk (P1) - The canonical check:env-var-count command could not run in this checkout because tsx is unavailable; retain exact-head CI as the final canonical validation.
  • Complete next step (P2) - No repair worker is needed: the maintainer-owned branch already contains the focused correct repair and awaits normal exact-head CI.
Agent review details

Security

None.

PR surface

Other 0. Total 0 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 2 0
Total 1 2 2 0

Review metrics

Metric Value Why it matters
Production versus test LOC production/config +2/-2 (net 0); tests 0 The diff only corrects the ratchet baseline and its rationale; no runtime or test logic changes.
Ratchet budget 1 decreased (502 to 501) The budget now matches the verified distinct-name count after the runtime rename.

Root-cause cluster

Relationship: canonical
Canonical: #125185
Summary: This PR is the remaining canonical correction for the ratchet baseline after the merged runtime rename removed the false match.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Merge the 501 baseline after the exact-head CI ratchet confirms the same count, preserving the shrink-only invariant without changing production behavior.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Merge the 501 baseline after the exact-head CI ratchet confirms the same count, preserving the shrink-only invariant without changing production behavior.

Do we have a high-confidence way to reproduce the issue?

Yes from source: current main has a 502 budget and the scanner-equivalent read-only enumeration finds 501 names. The canonical command was not executable locally because tsx is absent from this checkout.

Is this the best way to solve the issue?

Yes. Updating the shrink-only budget is the narrow canonical repair; changing the scanner or restoring the retired identifier would conceal the actual source count.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7ce934a8b5d0.

Labels

Label changes:

  • add P3: This is a narrow CI-maintenance correction with no user-facing runtime behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored CI-baseline correction has no external-contributor real-behavior-proof requirement.

Label justifications:

  • P3: This is a narrow CI-maintenance correction with no user-facing runtime behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored CI-baseline correction has no external-contributor real-behavior-proof requirement.

Evidence

What I checked:

  • Scanner contract: The scanner searches source under src, packages, and extensions, collects distinct matching names, and fails unless the count equals the budget. (scripts/check-env-var-count.mts:6, 7ce934a8b5d0)
  • Current-main mismatch: Current main records budget 502, while a read-only enumeration reproducing the scanner’s source roots, path filters, extensions, and name pattern found 501 distinct names; the retired node-check identifier is absent. (config/env-var-count-budget.txt:5, 7ce934a8b5d0)
  • PR repair: The PR head changes only the budget and explanatory comment, recording 501 without changing scanner behavior or runtime configuration. (config/env-var-count-budget.txt:5, 5fda3c1744ff)
  • Related runtime provenance: Merged commit 31a4bab renames the embedded worker Node-version expression to PROCESS_NODE_VERSION_CHECK; current main consumes that name, explaining why the scanner count fell while the budget remained unchanged. (node-version.mjs:76, 31a4bab0706e)
  • Main and release provenance: The related runtime rename is contained by origin/main and by no locally available release tag, so this correction targets current-main CI rather than a released behavior. (config/env-var-count-budget.txt:5, 31a4bab0706e)
  • Local validation limitation: The canonical TypeScript command could not run because this read-only checkout lacks tsx; this is an environment limitation, not contributor-proof failure. (scripts/check-env-var-count.mts:120, 7ce934a8b5d0)

Likely related people:

  • steipete: Peter Steinberger authored the merged runtime rename that removed the false match and authored this focused budget correction; recent config history also attributes the budget surface to him. (role: recent ratchet and runtime contributor; confidence: high; commits: 31a4bab0706e, e3d553b73419, 5fda3c1744ff; files: config/env-var-count-budget.txt, node-version.mjs, src/gateway/worker-environments/bootstrap.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Allow the in-progress exact-head CI ratchet to complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 87a0493 into main Aug 17, 2026
141 checks passed
@steipete
steipete deleted the codex/fix-env-budget-ratchet-budget branch August 17, 2026 09:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant