Skip to content

fix(review): preserve non-executable live-proof reports - #1277

Merged
steipete merged 2 commits into
mainfrom
steipete/empty-step-report-20260827
Aug 28, 2026
Merged

fix(review): preserve non-executable live-proof reports#1277
steipete merged 2 commits into
mainfrom
steipete/empty-step-report-20260827

Conversation

@steipete

@steipete steipete commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where a valid non-executable live-proof plan caused ClawSweeper's review job to fail before it could finish publishing the review. Both declined_suspicious and not_applicable plans legitimately have an empty entry and no steps. The report renderer wrote that empty list as - none, but the report parser tried to JSON-parse none and marked the plan invalid before the inspector reached its normal no-execution skip.

This was observed in the retained report from the earlier PR 1269 review run. That PR's unrelated findings were subsequently fixed and merged; this follow-up does not alter PR 1269 or the separate single-line generation fix.

Why This Change Was Made

The fix belongs at the report renderer/parser boundary. New reports encode empty Steps: as bare []; nonempty steps keep their existing JSON-object-per-bullet encoding. The named legacy-empty-list-v1 contract preserves already-produced reports containing a solitary - none, with surrounding whitespace allowed.

The dedicated payload parser accepts exactly one complete representation. Missing, malformed, mixed, duplicated, or noncanonical empty payloads fail closed. Only exact standalone production verification/recording markers delimit an attached suffix; its validation remains with the existing owner. The decision parser still validates the result, so recommended plans with empty steps remain invalid. The inspector's invalid-plan-before-skip guard, execution gates, strict command parsing, terminal completion, one-shot sequencing, and attached-verification guards are unchanged.

User Impact

Valid declined or non-applicable plans survive persisted-report inspection and execution orchestration without launching anything. Their review results can proceed through the existing publication path rather than failing on an empty-list formatting mismatch. Malformed plans still fail before target work starts; this does not create an execution fallback or permission.

OpenClaw Bay Impact

None. Observer schemas, public APIs, lifecycle states, dashboard projections, and publication ownership do not change. This is an internal persisted-report codec correction.

Documentation Impact

Updated the active docs/live-proof.md runbook with the canonical empty representation, the narrowly scoped legacy contract, strict rejection rules, and attachment boundaries; added a one-line changelog entry. Reviewed AGENTS.md and CONTRIBUTING.md. No policy, schema-version, dependency, configuration, or workflow changes.

Review Finding Disposition

Accepted and corrected P2: Match attachment-marker parsing exactly. At the previous head fae183ab38e015259231bc762420e7efe112c9c2, the plan parser trimmed marker lines (and the outer section), while attached verification required exact raw lines. Parent reproduction confirmed three malformed reports were admitted as candidate 42 even though verification reported the marker absent.

The correction preserves raw section boundaries, including EOF and CRLF pairs, and matches raw marker lines before trimming only scalar/Steps payload data. The existing verifier, inspector and execution guards are unchanged. Added regression coverage spans leading/trailing spaces, tabs and Unicode whitespace; both marker types; LF/CRLF; report EOF and next-section boundaries; exact-marker positive controls; and separate malformed-attachment validation ownership. The original three report fixtures were replayed unchanged and now fail closed in both real CLI modes. No bot autofix/automerge command or policy override was used.

Evidence

  • 145 focused tests passed, with no failures or skips, covering the new codec cases and existing decision/live-proof behavior. Builds, static checks, lint, formatting, documentation checks, and diff whitespace checks passed.
  • Fresh independent pre-commit Codex review of the correction, with the unchanged verification/inspection/attachment owners supplied as context, found no actionable P0/P1/P2 defects.
  • The full local pnpm run check of the pre-correction source later committed as fae183ab38e015259231bc762420e7efe112c9c2 failed: 3,910 passed, 12 failed, 9 skipped (3,931 total; separate changed-surface coverage tests passed 12/12). The failures are deadline/dispatch/setup-budget assertions and terminal cleanup failures in four unchanged test files. Source/path diagnosis found no codec rejection behind them: the retry/deadline fixtures do not invoke this codec, direct terminal cases bypass it, and the sanitized-child case accepted the report and failed later in terminal cleanup.
  • All 12 failures passed a precisely selected serial rerun with the same Node 24 runtime, unchanged timeouts, and coverage instrumentation retained. This establishes isolated success, not a green full run or a proven host-load diagnosis.
  • Full-run aggregate coverage could not be reported because Node encountered an empty child coverage JSON file. No empty files were filtered, no coverage setting or threshold was weakened, and no full aggregate coverage success is claimed. The previous head passed its complete hosted CI gate. That result is historical after this correction: the new committed head must pass the unchanged full hosted CI gate before merge. No post-correction local full-suite success is claimed.

Focused command:

node --test test/live-proof-report.test.ts test/decision-parser.test.ts test/live-proof.test.ts

Real Behavior Proof

Claim and source. Valid non-executable plans must complete the actual ClawSweeper report/CLI path with no candidates and no target execution, while malformed plans still fail. The tested source is 9e784ab9bc5767288dd9eceabb65ca852654a441, integrated onto 9bad4750e84b4666c0b5e616d0f8c7f191744496; continuity from the tested pre-commit files to the committed tree is verified before publication. Before-fix proof ran at f3883a32631b930965fbeaeae4dc70761f2b7647; the pre-patch renderer, report parser, and inspector are byte-identical at that baseline and the integration base.

Environment. Local macOS arm64, Node 24.20.0, pnpm 11.10.0; installed Bash 5.3.15 for workflow fixtures. AGENTS.md's Docker-backed Crabbox clause explicitly applies to a Windows host; this proof ran on macOS. This is not a proof waiver: the general requirement for actual controlled runtime behavior is satisfied below, and no policy or gate has been changed. No container/image/lease claim is made.

Actual production path, not a mocked substitute. The production decision parser and renderer generate the reports, then separate real dist/clawsweeper.js live-proof-review processes run in both --inspect and execution-orchestration modes. The repository profile is enabled. The independent child processes have Node filesystem-read permission only and no filesystem-write or child-process grant, with a minimal environment and no injected hooks or mocks. For this change, launching a target would be a failure of the claim; correct behavior is completing ClawSweeper's own runtime path without target execution.

Before the fix, the original producer's empty reports failed with live proof plan for 42 is invalid. After the empty-plan fix and raw-marker correction:

  • The broadened raw-boundary proof exercised 233 cases and 430 actual CLI invocations across marker/payload whitespace, LF/CRLF, EOF/section boundaries and valid/invalid plan shapes. All assertions passed with no target/output creation. Valid recommended controls used inspection only; no recommended target command was executed.
  • After the correction, the parent independently reran 24 unmocked CLI invocations across 12 empty-plan fixtures. Both statuses passed in canonical and already-produced legacy formats. Eight malformed/recommended-empty controls failed with exit 1 and the expected invalid-plan error.
  • The parent additionally replayed the three immutable before-correction padded-marker reports: all six inspection/orchestration invocations now exit 1 with the invalid-plan error. Two exact raw LF/CRLF marker controls remain valid and agree with attached verification; they were inspected only.
  • Every successful non-executable-plan CLI invocation returned exactly:
{"candidates":[],"recordMedia":false,"requiresBrowser":false,"requiresTerminal":false}

No target checkout or output directory was created. The absence of target execution is also enforced by the child permission boundary, not just inferred from an empty result.

Normalized CLI commands below use fixture-path variables. The records directory contains the generated synthetic 42.md; the target/output paths do not exist. Each case uses its own fresh fixture directory. The production build was created through the repository's build wrapper:

pnpm run build
node --permission --allow-fs-read='*' dist/clawsweeper.js live-proof-review --repo openclaw/clawsweeper --records-dir "$RECORDS_DIR" --checkout "$NONEXISTENT_CHECKOUT" --output "$ABSENT_OUTPUT" --item-numbers 42 --inspect
node --permission --allow-fs-read='*' dist/clawsweeper.js live-proof-review --repo openclaw/clawsweeper --records-dir "$RECORDS_DIR" --checkout "$NONEXISTENT_CHECKOUT" --output "$ABSENT_OUTPUT" --item-numbers 42

Original incident artifact. After the marker correction, the parent also reran the fixed built CLI in --inspect mode against the actual retained 1269.md, without changing it, granting write/child permissions, or executing any command contained in it. It returned exit 0 and the exact empty inspection object above. The retained report and failed-step log hashes matched before and after. This was read-only local artifact inspection, not a PR review rerun or live operator action.

Artifact fingerprints. Full per-invocation reports, arguments, stdout/stderr, and receipts are retained locally. The public proof above contains the observed outputs without publishing agent transcripts.

Artifact SHA-256
Renderer source 7663b497752bdf9a1408fcb788b46dc8d8635fc5c94688de70228553c2b413da
Report parser source 591232e076430f432d51e049c29d78120975df94310aa6e35dc3d48fc6efc77a
Focused regression test 304a0927bf3fb209150223c8aa67fc864495ab52d54ed9582aadae7a10007be2
Independent CLI proof summary 3bdd6d23880fa53727357260739c6347caa9f04be43dff121712e256f5db99c1
Raw-marker correction proof summary ccc572167ab409ea645bfee810cf1b42d1fb773d3146564b1b91cbd816afe486
Original retained report f0ef09cb76c1b918401845a79d0f2bce82ce9c4c0fdb89a38975609aa744521d
Original failed-step log 6248238a1726b78d24cde54a10b4e9313776719bc8e08971615b539a8d77b53f

Scope and Limits

The proof exercises actual local ClawSweeper report parsing and CLI inspection/orchestration. It does not claim target execution, hosted publication, media/UI behavior, a live queue operation, or a deployed rollout. Existing unit/integration tests exercise their own synthetic fixtures. Historical reports and logs were not rewritten, and no live apply/close, repair, or workflow dispatch was used for this proof.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 3:06 AM ET / 07:06 UTC.

ClawSweeper review

What this changes

The PR writes empty live-proof step lists as [], preserves legacy solitary - none reports, and strictly separates raw attachment markers from plan steps.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this is a coherent, narrow correction to persisted live-proof report parsing, with current-head terminal evidence and no actionable introduced defect found.

Priority: P2
Reviewed head: 9e784ab9bc5767288dd9eceabb65ca852654a441

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): ClawSweeper live verification passed on the reviewed terminal surface.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): ClawSweeper live verification passed on the reviewed terminal surface.
Evidence reviewed 5 items Canonical empty rendering: The renderer emits a bare [] only when the typed step list is empty, while retaining JSON Markdown bullets for nonempty plans.
Strict persisted-plan parsing: The parser recognizes only the canonical empty array or the solitary legacy sentinel, requires exactly one Steps payload, and locates attachment markers before whitespace normalization.
Focused regression coverage: The new test covers canonical and legacy empty forms, malformed combinations, raw LF/CRLF marker boundaries, and nonempty step ordering through the production parsing and inspection owners.
Findings None None.
Security None None.

Live Verification

Command: pnpm run build && node --input-type=module -e 'import { reportLiveProofPlan } from "./dist/clawsweeper-report-parser.js"; console.log(typeof reportLiveProofPlan)'

Result: PASS (completed)

$ tsc -p tsconfig.json
function
















































Assertions:

  • PASS expect_output: function

How this fits together

ClawSweeper renders review decisions into persisted Markdown reports, then parses those reports before deciding whether a live-proof plan should be skipped or prepared for execution. This change sits at that renderer/parser boundary and affects review-job automation rather than target-repository code.

flowchart LR
A[Review decision] --> B[Report renderer]
B --> C[Persisted Markdown report]
C --> D[Report parser]
D --> E{Runnable plan?}
E -->|No| F[Skip target execution]
E -->|Yes| G[Inspect and drive proof]
Loading

Before merge

  • Resolve merge risk (P1) - This parser is on the review-automation boundary, so an overlooked report-format edge case could fail closed for valid reports or reject malformed reports incorrectly; the raw-marker coverage and current-head CLI proof materially reduce that risk.
  • Complete next step (P2) - No repair-lane action is needed: the patch is coherent and no actionable introduced defect was found.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 5 files affected The change is limited to two runtime files, one focused regression test, documentation, and release notes.
Code and test delta production +29/-19, tests +365 The relatively small parser/renderer correction is backed by broad boundary and malformed-input coverage.

Merge-risk options

Maintainer options:

  1. Land with the strict report contract (recommended)
    The reviewed head preserves fail-closed parsing and has current-head CLI proof for both valid skips and malformed controls.

Technical review

Best possible solution:

Land the canonical empty-array format with narrowly scoped legacy support while retaining strict malformed-payload and raw-marker rejection.

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

Yes. The prior renderer represented an empty list as - none while the parser treated every list item as JSON; the supplied current-head CLI proof exercises the resulting skip and fail-closed paths.

Is this the best way to solve the issue?

Yes. Correcting the renderer/parser codec while retaining one explicitly constrained legacy representation is the narrowest maintainable fix.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): ClawSweeper live verification passed on the reviewed terminal surface.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded review-automation correctness repair with limited user-facing blast radius.
  • merge-risk: 🚨 automation: The PR changes persisted report parsing that controls review-job inspection and proof execution.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): ClawSweeper live verification passed on the reviewed terminal surface.
  • proof: sufficient: Contributor real behavior proof is sufficient. ClawSweeper live verification passed on the reviewed terminal surface.

Evidence

What I checked:

  • Canonical empty rendering: The renderer emits a bare [] only when the typed step list is empty, while retaining JSON Markdown bullets for nonempty plans. (src/clawsweeper-report-document.ts:310, 9e784ab9bc57)
  • Strict persisted-plan parsing: The parser recognizes only the canonical empty array or the solitary legacy sentinel, requires exactly one Steps payload, and locates attachment markers before whitespace normalization. (src/clawsweeper-report-parser.ts:190, 9e784ab9bc57)
  • Focused regression coverage: The new test covers canonical and legacy empty forms, malformed combinations, raw LF/CRLF marker boundaries, and nonempty step ordering through the production parsing and inspection owners. (test/live-proof-report.test.ts:118, 9e784ab9bc57)
  • Current-head runtime proof: The PR body records production CLI inspection and orchestration at the reviewed head, including valid empty-plan skips and malformed-plan rejection without target execution. (9e784ab9bc57)
  • Feature history: The parser path has recent review-automation work from Peter Steinberger, while Vincent Koc introduced the attached-verification gate whose raw markers this change preserves. (src/clawsweeper-report-parser.ts:172, f3883a32631b)

Likely related people:

  • Peter Steinberger: Recent history includes the reviewed parser correction and earlier live-proof/report-rendering work. (role: recent live-proof and report-parser contributor; confidence: high; commits: 9e784ab9bc57, fae183ab38e0, 44eb7ed2e43d; files: src/clawsweeper-report-parser.ts, src/clawsweeper-report-document.ts)
  • Vincent Koc: He introduced the existing attached-verification gate and recent authoritative terminal-result handling that share this report boundary. (role: attached-verification feature owner; confidence: high; commits: f3883a32631b, d103c0cf5c98; files: src/live-proof/verification.ts, src/clawsweeper-report-parser.ts)

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-28T05:58:25.163Z sha fae183a :: needs changes before merge. :: [P2] Match attachment-marker parsing exactly
  • reviewed 2026-08-28T06:57:58.463Z sha 9e784ab :: found issues before merge. :: [P2] Refresh proof for the current marker-parser commit

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 28, 2026
@steipete
steipete merged commit a2f044f into main Aug 28, 2026
19 checks passed
@steipete
steipete deleted the steipete/empty-step-report-20260827 branch August 28, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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