Skip to content

chore: lower OPENCLAW_* env var budget to 503 - #121644

Closed
steipete wants to merge 1 commit into
mainfrom
chore/env-var-budget-503
Closed

steipete wants to merge 1 commit into
mainfrom
chore/env-var-budget-503

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Main's environment-variable count gate is red because the production count is 503 while config/env-var-count-budget.txt still records 507. The stale budget makes check-changed fail for unrelated pull requests.

Why This Change Was Made

Commit 3b3c540896ab (refactor: remove dead branches and test-only helpers (#121345)) moved two test-only agent helpers out of production-counted paths. That removed these four names from the production surface:

  • OPENCLAW_LIVE_ANTHROPIC_CACHE_MODEL
  • OPENCLAW_LIVE_OPENAI_CACHE_MODEL
  • OPENCLAW_LIVE_MODEL_FILE_PROBE
  • OPENCLAW_LIVE_MODEL_IMAGE_PROBE

The literals remain only in tests and src/agents/test-helpers/**; there are no runtime callers or other production locations missed by the collector. This lowers the budget from 507 to 503, which is the ratchet's sanctioned direction per its own header. No source, test, other ratchet, baseline, or expected-failure list changes.

User Impact

No runtime behavior changes. The environment-variable ratchet passes again on main and no longer blocks unrelated pull requests.

Evidence

Before:

OPENCLAW_* count 503 is below budget 507; update config/env-var-count-budget.txt

After:

OPENCLAW_* count 503/503

git diff --check passes. Structured autoreview reported no accepted/actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 10, 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 10, 2026
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 10, 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 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 11:51 AM ET / 15:51 UTC.

ClawSweeper review

What this changes

Updates the internal OPENCLAW_* production environment-variable budget from 507 to 503.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open: current main still records 507 while the verified production-source count is 503, so this maintainer-owned PR is the necessary focused repair.

Priority: P3
Reviewed head: 4b9058b939553ef05a00bcc5000c437592876e5e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-verified ratchet correction with exact-head CI still pending.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal CI-baseline update has no user-visible runtime behavior requiring contributor real-setup proof.
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 internal CI-baseline update has no user-visible runtime behavior requiring contributor real-setup proof.
Evidence reviewed 7 items Current-main mismatch: Current main still records 507 at the budget line; its immediate commit changes only a generated plugin-SDK baseline, so the collector and relevant source tree remain the reviewed base state.
Ratchet owner and invariant: The collector counts distinct matching names only in src, packages, and extensions, excludes test/helper paths, and rejects a count that differs from the budget.
Independent source reconstruction: A read-only reconstruction of the collector’s roots, extension, and exclusion predicates returned 503 distinct names; none of the four cited names occurred in a counted path.
Findings None None.
Security None None.

How this fits together

OpenClaw’s CI ratchet scans production source roots for distinct OPENCLAW_* names and compares the result with a shrink-only budget. The changed-check gate invokes it when production source or its budget changes, preventing stale configuration headroom from masking cleanup.

flowchart LR
A[Source cleanup] --> B[Production source roots]
C[Test and helper paths] --> D[Excluded paths]
B --> E[Environment-variable collector]
D --> E
E --> F[Budget comparison]
F --> G[Changed-check gate]
Loading

Before merge

  • Complete next step (P2) - The active maintainer-owned PR already contains the focused repair; await exact-head CI rather than dispatching another fix lane.
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 1 1 0
Total 1 1 1 0

Review metrics

Metric Value Why it matters
Production/test delta production 0, tests 0; CI ratchet baseline 1 changed line The patch changes no runtime or test code; it synchronizes the strict internal count baseline with the verified source surface.

Root-cause cluster

Relationship: canonical
Canonical: #121644
Summary: The merged cleanup reduced the counted production surface; this PR is the canonical baseline repair for that consequence.

Members:

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

Technical review

Best possible solution:

Retain the strict 503 baseline and merge once exact-head CI confirms the ratchet result.

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

Yes—current-main source inspection reproduces the mismatch: the collector’s matching rules yield 503 while the budget remains 507. The repository lacks tsx locally, so exact-head CI should run the canonical command.

Is this the best way to solve the issue?

Yes—the equality check owns this invariant, so lowering its shrink-only baseline is the narrowest maintainable repair; restoring test-only literals or retaining unused headroom would violate the ratchet contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5e5cf673141b.

Labels

Label changes:

  • add P3: This is a low-risk internal CI-ratchet correction with no runtime or user-facing 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 internal CI-baseline update has no user-visible runtime behavior requiring contributor real-setup proof.

Label justifications:

  • P3: This is a low-risk internal CI-ratchet correction with no runtime or user-facing 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 internal CI-baseline update has no user-visible runtime behavior requiring contributor real-setup proof.

Evidence

What I checked:

  • Current-main mismatch: Current main still records 507 at the budget line; its immediate commit changes only a generated plugin-SDK baseline, so the collector and relevant source tree remain the reviewed base state. (config/env-var-count-budget.txt:3, 5e5cf673141b)
  • Ratchet owner and invariant: The collector counts distinct matching names only in src, packages, and extensions, excludes test/helper paths, and rejects a count that differs from the budget. (scripts/check-env-var-count.mts:123, 5e5cf673141b)
  • Independent source reconstruction: A read-only reconstruction of the collector’s roots, extension, and exclusion predicates returned 503 distinct names; none of the four cited names occurred in a counted path. (scripts/check-env-var-count.mts:11, c12d3d7a0503)
  • Changed-check integration and regression coverage: Changed-check selects this budget for the environment-variable ratchet, and adjacent tests explicitly reject stale headroom after a count shrinks. (scripts/check-changed.mts:597, c12d3d7a0503)
  • Cleanup provenance: Merged cleanup commit 3b3c540 is an ancestor of the PR base; the moved literals now live under excluded test-helper paths, which explains the lower production count. (src/agents/test-helpers/live-cache-regression-runner.ts:549, 3b3c540896ab)
  • Main-only provenance: The prerequisite cleanup is on origin/main but is not contained in the latest release tag, so this is current-main CI maintenance rather than a shipped runtime behavior change. (config/env-var-count-budget.txt:3, 3b3c540896ab)

Likely related people:

  • steipete: Authored the merged helper relocation that reduced the counted surface and has recurring history in this ratchet area. (role: cleanup author and recent ratchet contributor; confidence: high; commits: 3b3c540896ab, 4b9058b93955; files: src/agents/test-helpers/live-cache-regression-runner.ts, src/agents/test-helpers/live-model-turn-probes.ts, config/env-var-count-budget.txt)
  • Jesse Merhi: Blame attributes the current budget line and collector history to commit 66a4464. (role: current collector and budget-line provenance; confidence: medium; commits: 66a44643d45a; files: config/env-var-count-budget.txt, scripts/check-env-var-count.mts)
  • Vincent Koc: History includes prior environment-variable budget-lowering work in this surface. (role: prior ratchet contributor; confidence: medium; commits: 0892684551fd; files: config/env-var-count-budget.txt)

Rank-up moves

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

  • Let exact-head CI complete and confirm the ratchet reports 503/503 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

Copy link
Copy Markdown
Contributor Author

Superseded by merged #121616. Its main commit 8747575 includes the identical environment-variable budget ratchet from 507 to 503; current main independently counts 503 production names against budget 503.

@steipete steipete closed this Aug 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #121616, which landed the same 507 → 503 ratchet update in 87475758dca4.

Verified on current main:

OPENCLAW_* count 503/503

Closing this PR rather than duplicating the already-landed repair.

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