Skip to content

refactor(scripts): remove duplicate parser test facades - #124167

Merged
steipete merged 1 commit into
mainfrom
test/remove-duplicate-script-parsers
Aug 15, 2026
Merged

steipete merged 1 commit into
mainfrom
test/remove-duplicate-script-parsers

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes script-private helper exports and tests that duplicated their shared owners or compared an executable's output to the same helper that generated it.

The affected scripts retained direct testing surfaces for build usage text, strict non-negative parsing, and bounded response reading even though production calls the shared numeric/bounded-response implementations and stronger owner tests already cover those algorithms.

Why This Change Was Made

Script helpers are private again. The build and gateway-watch suites continue to test exact executable argument behavior, and the memory FD repro still exercises its real memory_search invocation path. Numeric and response-size algorithms remain covered once at their shared owners.

User Impact

No behavior changes. Script tests are less coupled to helper exports and focus on executable outcomes.

Evidence

  • Build-all, memory FD repro, gateway-watch regression, numeric-option, and bounded-response owners: 5 files, 120 tests passed.
  • The scripts, testRoot, and tooling changed gate passed through the documented trusted-source local fallback because no Crabbox/Testbox provider was ready. Script/root typechecks, formatting, lint, Docker boundaries, and raw HTTP/2 guards passed.
  • git diff --check passed.
  • Fresh structured autoreview reported no accepted/actionable findings on the final branch.

Production tooling delta: +3/-9, net -6. Tests: +11/-81, net -70. Total: +14/-90, net -76. No behavior, docs, config, schema, protocol, dependency, or changelog change.

AI-assisted: yes.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Aug 15, 2026
@steipete
steipete marked this pull request as ready for review August 15, 2026 12:17
@steipete steipete self-assigned this Aug 15, 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 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 8:23 AM ET / 12:23 UTC.

ClawSweeper review

What this changes

The PR makes script-local parser, usage, and bounded-response helpers private and removes tests that duplicate canonical shared-helper coverage.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for normal maintainer review: the narrow cleanup removes test-only facades without changing the scripts’ executable paths, and no patch defect was found. The exact-head CI gate is currently failing and needs resolution before merge.

Priority: P3
Reviewed head: cfe21300246b4b242dea8acf32fadb3749c9b58f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative cleanup with retained owner-boundary coverage and no source-level defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, behavior-neutral script refactor does not require external real-setup proof; the relevant evidence is retained executable and owner-boundary coverage.
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, behavior-neutral script refactor does not require external real-setup proof; the relevant evidence is retained executable and owner-boundary coverage.
Evidence reviewed 5 items Executable behavior retained: The build script still routes invalid arguments and help output through its private usage formatter, and the test invokes the executable to assert both outputs.
Canonical numeric owner remains covered: The gateway-watch script still parses all numeric flags through the shared strict-decimal helper; its integration test retains invalid CLI-input assertions, while the helper’s owner suite covers accepted, malformed, and unsafe inputs.
Canonical bounded-response owner remains covered: The memory FD repro still reads its HTTP response through the shared bounded-response helper, whose owner suite covers byte limits, streamed text, cancellation, and malformed content-length handling.
Findings None None.
Security None None.

How this fits together

Maintenance scripts parse developer and CI inputs, run gateway diagnostics, and produce build or repro output. Shared numeric and bounded-response helpers own reusable algorithms, while script tests exercise command behavior and integration outcomes.

flowchart LR
  A[Developer or CI arguments] --> B[Diagnostic scripts]
  B --> C[Shared numeric and response helpers]
  C --> D[Script-specific validation]
  D --> E[Build and gateway diagnostics]
  F[Script test suites] --> C
  F --> D
Loading

Before merge

  • Resolve merge risk (P1) - The supplied exact-head check rollup reports openclaw/ci-gate as failed; inspect and resolve that failure before merging.
  • Resolve merge risk (P1) - The latest ClawSweeper comment body was not available in the supplied context and GitHub was unreachable, so confirm any outstanding Rank-up moves before landing.
Agent review details

Security

None.

PR surface

Tests -70, Other -6. Total -76 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 11 81 -70
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 3 9 -6
Total 6 14 90 -76

Review metrics

Metric Value Why it matters
Production versus test LOC production tooling +3/-9 (net -6); tests +11/-81 (net -70) The patch is net-negative and removes test-only export surface rather than adding runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the helpers private, retain executable-boundary assertions plus the canonical shared-helper tests, and merge only after the exact-head CI gate and any prior review moves are clear.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the helpers private, retain executable-boundary assertions plus the canonical shared-helper tests, and merge only after the exact-head CI gate and any prior review moves are clear.

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

Not applicable: this PR refactors internal script test seams rather than reporting a user-visible defect.

Is this the best way to solve the issue?

Yes. Removing exports used only as test facades while preserving executable assertions and centralized helper tests is the narrowest maintainable ownership boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 25dda7968c1e.

Labels

Label changes:

  • add P3: This is a focused internal test/tooling cleanup with no user-visible 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, behavior-neutral script refactor does not require external real-setup proof; the relevant evidence is retained executable and owner-boundary coverage.

Label justifications:

  • P3: This is a focused internal test/tooling cleanup with no user-visible 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, behavior-neutral script refactor does not require external real-setup proof; the relevant evidence is retained executable and owner-boundary coverage.

Evidence

What I checked:

  • Executable behavior retained: The build script still routes invalid arguments and help output through its private usage formatter, and the test invokes the executable to assert both outputs. (scripts/build-all.mts:405, cfe21300246b)
  • Canonical numeric owner remains covered: The gateway-watch script still parses all numeric flags through the shared strict-decimal helper; its integration test retains invalid CLI-input assertions, while the helper’s owner suite covers accepted, malformed, and unsafe inputs. (test/scripts/numeric-options.test.ts:7, cfe21300246b)
  • Canonical bounded-response owner remains covered: The memory FD repro still reads its HTTP response through the shared bounded-response helper, whose owner suite covers byte limits, streamed text, cancellation, and malformed content-length handling. (scripts/lib/bounded-response.mjs:110, cfe21300246b)
  • Current-main comparison: The PR head directly descends from the supplied current-main SHA, so its removal of the test facades is not already present on main. (scripts/check-memory-fd-repro.mts:65, cfe21300246b)
  • Feature provenance: Blame attributes the exported facades and their surrounding executable paths to the preceding script cleanup commit by the same recent area contributor. (scripts/check-gateway-watch-regression.mts:21, f1ced37ce5df)

Likely related people:

  • steipete: Introduced the immediately preceding script facades and authored this focused cleanup; blame covers the affected helper exports and executable paths. (role: recent script-area contributor; confidence: high; commits: f1ced37ce5df, cfe21300246b; files: scripts/build-all.mts, scripts/check-gateway-watch-regression.mts, scripts/check-memory-fd-repro.mts)

Rank-up moves

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

  • Resolve the exact-head openclaw/ci-gate failure and confirm the latest ClawSweeper Rank-up moves 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

Land-ready proof for cfe21300246b4b242dea8acf32fadb3749c9b58f:

Production tooling delta: +3/-9, net -6. Tests: +11/-81, net -70. Total: +14/-90, net -76. No behavior, docs, config, schema, protocol, dependency, or changelog change.

@steipete
steipete merged commit c98ae0f into main Aug 15, 2026
365 of 367 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the test/remove-duplicate-script-parsers branch August 15, 2026 12:37
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
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. scripts Repository scripts size: S 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