Skip to content

fix(test): keep invalid fixture JSON diagnostics bounded - #139837

Merged
steipete merged 1 commit into
mainfrom
codex/bun-fixture-json-diagnostics
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/bun-fixture-json-diagnostics

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where invalid JSON from a fixture command could be repeated outside its bounded diagnostic tail through an engine-generated parser message or error cause.

Why This Change Was Made

Report the output path and existing bounded tail without forwarding raw parser details. Keep filesystem read errors separate from JSON syntax errors.

User Impact

Failed fixture assertions retain useful output context while respecting the existing diagnostic bound on Node and Bun.

Evidence

  • The strengthened existing invalid-JSON regression failed on both runtimes before repair.
  • All nine workspace and neighboring dispatcher tests pass on Node and true Bun afterward.
  • Complete changed-file gate and independent P0–P2 review pass.
  • The wider Bun campaign remains in progress.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 06:24
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 2:29 AM ET / 06:29 UTC.

ClawSweeper review

What this changes

The PR limits invalid-JSON fixture diagnostics to the output path and existing bounded tail, and strengthens the regression assertion against leaked input prefixes.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main and v2026.9.2 still forward parser details outside the diagnostic tail. No introduced correctness defect was found, and the maintainer-authored PR is protected from cleanup closure.

Priority: P2
Reviewed head: 2410bc8d720e7dfe783562b43473eafdcffc5734

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-level repair with meaningful strengthened regression coverage and no actionable defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER association exempts this fixture-tooling fix from external-contributor proof requirements; its Node/Bun regression results are reported validation, not independently observed execution.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER association exempts this fixture-tooling fix from external-contributor proof requirements; its Node/Bun regression results are reported validation, not independently observed execution.
Evidence reviewed 7 items Verified introduced change: The merge-base-to-head diff matches the supplied introduction evidence. The syntax-error handler no longer forwards the parser message or cause; the filesystem read remains outside that handler.
Still necessary on current main: Fetched main still logs a bounded tail and then throws an error containing the parser message and original cause, leaving a second route for input disclosure.
Latest release comparison: The latest supplied release has the same parser-message and cause forwarding; this repair is not already present there.
Findings None None.
Security None None.

How this fits together

OpenClaw’s end-to-end fixture dispatcher checks captured CLI output from the shared-workspace agent deletion smoke test. Its assertions turn those files into validation results and failure diagnostics.

flowchart TD
  A[Agent deletion smoke test] --> B[Captured CLI output]
  B --> C[Fixture dispatcher]
  C --> D{Valid JSON?}
  D -->|Yes| E[Check deletion and workspace results]
  D -->|No| F[Report path and bounded tail]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +2, Other +4. Total +6 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 1 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 10 6 +4
Total 2 13 7 +6

Review metrics

None.

Technical review

Best possible solution:

Keep syntax failures confined to the existing bounded diagnostic path while preserving filesystem errors and successful fixture assertions.

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

Yes, source inspection identifies a focused reproduction: run the fixture assertion on invalid JSON containing an old prefix outside its trailing 16 KiB. Current main forwards parser details; the existing subprocess regression targets that path, but was not executed during this review.

Is this the best way to solve the issue?

Yes. Removing raw parser details at the diagnostic owner directly closes the extra output path without changing successful parsing or adding another abstraction.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c54319089356.

Labels

Label changes:

  • add P2: This fixes an established diagnostic-bound violation in end-to-end test tooling with limited operational scope.
  • 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: The supplied MEMBER association exempts this fixture-tooling fix from external-contributor proof requirements; its Node/Bun regression results are reported validation, not independently observed execution.

Label justifications:

  • P2: This fixes an established diagnostic-bound violation in end-to-end test tooling with limited operational scope.
  • 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: The supplied MEMBER association exempts this fixture-tooling fix from external-contributor proof requirements; its Node/Bun regression results are reported validation, not independently observed execution.

Evidence

What I checked:

  • Verified introduced change: The merge-base-to-head diff matches the supplied introduction evidence. The syntax-error handler no longer forwards the parser message or cause; the filesystem read remains outside that handler. (scripts/e2e/lib/fixtures/workspace.mjs:38, 2410bc8d720e)
  • Still necessary on current main: Fetched main still logs a bounded tail and then throws an error containing the parser message and original cause, leaving a second route for input disclosure. (scripts/e2e/lib/fixtures/workspace.mjs:43, c54319089356)
  • Latest release comparison: The latest supplied release has the same parser-message and cause forwarding; this repair is not already present there. (scripts/e2e/lib/fixtures/workspace.mjs:43, 3928bad9badf)
  • Meaningful regression coverage: The existing test invokes the actual fixture dispatcher in a child process with invalid input larger than the diagnostic tail but smaller than the output limit. The stronger assertion detects partial parser-quoted prefixes while retaining checks for recent output and the file path. (test/scripts/fixtures-workspace.test.ts:97, 2410bc8d720e)
  • Owning boundary and existing helper: The dispatcher directly calls the workspace assertion. readJson is exactly a UTF-8 file read followed by JSON.parse, so splitting those operations preserves successful parsing. The reused tail helper reads at most the requested trailing bytes. (scripts/e2e/lib/text-file-utils.mjs:21, 2410bc8d720e)
  • Area history and routing: Current-main path history includes Vincent Koc’s bounded-output work and Dallin Romney’s recent fixture-schema maintenance. Exact introduction attribution remains unverified because blame and the older patch required unavailable historical blobs. (scripts/e2e/lib/fixtures/workspace.mjs, c54319089356)

Likely related people:

  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 a3fb2ac into main Sep 6, 2026
185 checks passed
@steipete
steipete deleted the codex/bun-fixture-json-diagnostics branch September 6, 2026 09:25
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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