Repository navigation
fix(review): require opt-in for retained local output - #1488
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 9, 2026, 7:54 PM ET / 23:54 UTC (Revision 14). ClawSweeper reviewWhat this changesMakes local review output retention opt-in, bounds managed output and checkout preparation, and preserves native final answers and complete JSON failure output. Merge readiness⛔ Blocked before merge - 2 items remain The PR remains useful and is not superseded by the merged normalization refactor. Current evidence resolves the earlier recovery and proof concerns; no actionable correctness finding remains. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s review runner takes repository source and GitHub context, prepares an isolated checkout, and invokes the review engine. Its output owner controls temporary files, retained reports, and evidence consumed by downstream publication. flowchart TD
A[Review command and source] --> B[Retention selection]
B --> C[Output and checkout admission]
C --> D[Review engine]
D --> E[Bounded result capture]
E --> F[Report and ledger evidence]
F --> G[Retain selected output or clean scratch]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one output-admission owner with explicit retention choices, bounded native capture, and the documented, maintainer-accepted upgrade contract. Do we have a high-confidence way to reproduce the issue? Not applicable to the retention-policy choice; the separate JSON truncation defect has concrete before/after real-CLI evidence in the matching PR body. Is this the best way to solve the issue? Yes: shared admission and native authoritative output avoid competing budget and final-answer implementations, and the compatibility choices have explicit maintainer acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 97c9a7b45caf. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
93245b4 to
025f04f
Compare
|
@clawsweeper re-review Please review exact head 4a78370. The main PR body now contains the cumulative run-admission finding disposition, current controlled behavior proof and limits, passing full check, and fresh native review. Review only; no repair or merge request. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Please review exact head The body now records accepted retention/checkout/output/retry contracts, current native recovery and JSON pipe-drain proof, independently verified canonical native evidence, fresh/existing-destination behavior, and both revision 12 rank-up dispositions. Exact-head CI passed all required jobs. The canary proves configured direct-tool transport, not default tool selection, external repositories, publication, or queue lifecycle; prior failures remain explicitly bounded. Only the task-owned earlier technical hold was superseded. The PR remains draft pending the fresh review and independent final landing gate. This is a review-only request, not repair or automerge. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Fixes an issue where local ClawSweeper reviews retained reports, prompts, streams,
and scratch without explicit consent. Sequential debug batches also reset media
allowances between items, and immediate CLI exit could truncate a JSON failure
written through a pipe.
Why This Change Was Made
One run-owned budget admits managed media, reports, result capture, thread state,
and metadata across the sequential batch. Existing debug output consumes that
budget; replacement reports are not counted twice. Cached and fresh reports use
the same writer. Checkout materialization separately admits bounded source and
missing-object acquisition before their respective writes.
This removes implicit local retention and per-item allowance resets, consolidates
report admission at the output owner, and replaces reconstructed native final
answers with bounded capture of Codex's authoritative final stdout. Completed
output can survive a later shutdown error; failed or incomplete turns cannot
publish partial results.
These are producer-admission and retained-output limits, not a hard peak-disk quota
for arbitrary child-process scratch. No persistent budget database, background
watcher, production tool-routing change, or broader tool acceptance is introduced.
User Impact
noneis the default: return text or JSON and remove run-owned transientoutput after ordinary completion or handled failure.
summaryrequires a fresh, exclusively owned destination and retains finalreports only. An existing destination is refused without deleting its contents.
debugrequires an explicit destination. Existing regular directories aresupported; their files and bytes count before new output. Explicit legacy
--artifact-dirand--report-dirpaths retain debug compatibility.outside the bounded materialization contract and are refused. Bounded EOL
expansion is admitted conservatively. Checkout-preparation refusals are not
universally nonretryable.
4 KiB. They cannot establish authoritative terminal denials or diagnostics.
Existing bounded retry policy still applies.
79/78or generic failure1; empty selections emit one completed envelope.Managed transient output is capped at 96 MiB/256 files; retained summary at
16 MiB/128 files; debug at 1 GiB/4,096 files. Review checkout admission caps
projected and actual materialization at 200,000 files/2 GiB, with a 1 GiB reserve
on each affected filesystem, charged once when shared. The private Git attribute
index admits at most two files/128 MiB and is removed after inspection.
Existing oversized output is refused before new managed writes. Non-media pools
are reserved before another media producer starts. Ordinary and caught-failure
cleanup is run-owned; older or unrelated output is never pruned. Unhandled signals,
including
SIGKILL, may leave private scratch. curl/ffmpeg can temporarily exceedrequested sizes, and arbitrary model-written files are not quota-controlled.
OpenClaw Bay Impact
No Bay schema, navigation, canonical publication, or mutation-authority change is
needed. Retry-classification effects are described above, not represented as
unchanged runtime behavior. The existing oversized-review reservation, lease
tuple, fence, refreshed metadata, and ledger-before-prune ordering remain intact.
The native canary does not claim queue-lifecycle or publication coverage.
Documentation Impact
Updated active documentation in
README.md,docs/commit-sweeper.md, anddocs/private-inference.md, the generated example, and the changelog. Outputownership remains in
src/review-output-policy.ts; source admission remains insrc/clawsweeper-review-blobs.ts; native result and failure handling remains withthe Codex process/runtime owners. These documents were checked against the
candidate below. Retention, admission limits, native transport, or coverage-boundary
changes require matching documentation and proof updates.
Real Behavior Proof
JSON Failure Drain
The real built
dist/clawsweeper.js review --local-only --target-repo openclaw/clawsweeper --result-format json --output-retention <invalid>entrypointwas exercised through a real POSIX pipeline with a delayed reader, ledger disabled,
and ambient
EXACT_REVIEW_DECISIONremoved. The large escaped invalid argumentwas below operating-system argument limits. Console, process, streams, and the
entrypoint were not mocked.
Before the fix,
run_472b509a35e6received only 65,536 of 84,147 expected bytes,producing invalid JSON. The writer exited 1 and the reader 0: pipeline-final status
alone did not qualify the result.
After the fix,
run_b51601213406received 84,147 of 84,147 bytes, exactly oneexpected JSON document, empty stderr, writer exit 1, reader exit 0, and bounded EOF
at 277 ms. Its seven affected test files passed 235/235. The final test-only
closure,
run_151f198f01e3, passed 28/28, including the same large delayed-pipecase and an ordinary small invalid-retention argument through the real built CLI:
exact single JSON, status 1, empty stderr, bounded completion.
This used the existing secretless Docker-backed Crabbox
local-containerleasecbx_fd4b3499e9c8, arm64, Node 24.20.0, pinned imagenode@sha256:be23f54a88d34e8824c741b19b91064094f92c1c97b194144bfc8b50d67258e2,without host socket, Git seed, credential hydration, or host dependency changes.
Three required builds passed in
run_1045c6190df4. Source manifests bound theoverlay before and after execution; they are not a substitute for remote Git-head
qualification. The subsequent canary-only change left production TypeScript
unchanged; its two focused files passed 145/145 in
run_a5808e1b40b5, with thesame 1,563-file source digest before and after:
cc7cbfb6d87a090e657a126c8c566f07c08e31a5d764b46446b309767bb9a441.Exact-Head Native Canary
Native job 102684210323
passed on
491bb0dc9d69634713f72f7663702595101397cc, attempt 1.Canonical artifact 10129512370,
hosted-review-scan-proof, was independently verified against that exact run/head:one 614-byte ZIP containing one 1,251-byte boolean/count-only JSON document,
archive SHA-256
6ea2f0781523763cb7355ad85ef510fcf26c94a8560de098f0a89d97e7c4a1b5.Actual canonical fields establish:
launches, the production review path, valid decision schema, and owner-only
admission artifact.
diagnostic empty, terminal denial false, result absent, checkout unchanged.
child and two synthetic metadata requests. Credentials absent, exact head
verified, checkout unchanged, and no retained media.
review after the tool, one terminal turn, and 22 events. Strict arguments,
call/session/turn identity, ordering, nonce, exit status, output, extra-action,
budget, and cleanup checks remain enforced; checkout unchanged.
The canary explicitly sets
features.code_mode.direct_only_tool_namespaces=["functions"]for that invocationonly. This is configured direct-tool transport, not default model selection:
defaultToolSelectionCovered: false.externalRepositoryCovered,reviewPublicationCovered, andqueueLifecycleCoveredare also false.Production routing, model metadata, and ordinary review configuration are
unchanged. Custom wrappers and additional actions still fail the strict proof.
Raw commands, prompts, rollout contents, and runtime identities were not published.
Fresh and Existing Destinations
Current focused/full tests cover fresh exclusive summary creation, existing-summary
refusal, existing-debug byte/file admission before writes, replacement charging
once, sequential remaining media allowances, zero-capacity pre-producer refusal,
partial-output charging after failure, and preservation of existing history.
Checkout tests exercise active-transform refusals, bounded EOL expansion, a private
Git 2.39-compatible attribute index, shared/separate filesystem admission, exact
head binding, and missing-object admission before the actual sanitized child.
Historical compiled-CLI receipt
run_b9bb5e34a65cdemonstrated none/summary/debugretention and owned cleanup using the real CLI, Git, and filesystem with synthetic
scanner/Codex events: none retained zero files and a null artifact path; summary
one report; debug two files. This is retained provenance, not current-head
qualification or live-model proof.
Historical real-media assertions in
run_6ae990676ca3used a controlled HTTPfixture and real curl/ffprobe/ffmpeg. Two sequential items produced media; zero
metadata allowance refused before producer/destination creation; existing output
exhausting media capacity prevented both later items' producers; an over-cap
known-length download left no retained media. Its later synthetic CLI scenario
failed, so the aggregate run is not claimed green.
Failure Boundaries
failed with
response_kind, nine observed response records, first rejectedcustom_tool_call,unexpectedTool: code_mode_exec. This proved an attemptedwrapper, not successful execution or the complete advertised tool catalogue.
Diagnostic additions did not expand accepted response kinds. The current
configured-direct canary addresses only its explicitly stated coverage boundary.
assertions were not promoted into a canonical successful aggregate artifact.
run_2d73cb3f4698failed before tests with commandinvocation exit 126; the corrected native invocation produced the 145/145
receipt above. No source or assertion was relaxed.
failure, remain historical failures rather than being attributed solely to
contention. Current exact-head hosted qualification is listed separately below.
Evidence
Signed head:
491bb0dc9d69634713f72f7663702595101397ccTree:
c852fafc1c1e1e2453271079af98d2c5f0b95992Base:
97c9a7b45caf20f6d580fe0ae5cc48db31da15f4Main-relative full-index binary diff SHA-256:
aa2372edb5add0519814bfacefb08cb43704511cebb624b09e05816d1446e9d5.Exact-head CI run 34417075202,
attempt 1, succeeded:
pnpm run check, 5,956 passed, 18 skipped, zero failed, plus 13/13targeted checks; completed September 9, 2026 at 23:37:59 UTC.
7 passed, 1 skipped.
HTTPS proof passed.
without actionable findings. Signature, tracked-clean source, targeted
formatting, and privacy checks passed.
Scope and LOC: 61 files against the base above. Production: +2,837/-418
(net +2,419); tests: +6,496/-457 (net +6,039); tooling: +1,831/-130
(net +1,701); docs: +107/-28 (net +79). Production growth implements explicit
retention/admission owners, bounded source/result capture, and failure handling.
Tooling growth is principally strict hosted attestation and lifecycle proof.
No persistent budget ledger, parallel production routing framework, or background
system was added.
Dependency evidence: Personally inspected pinned OpenAI Codex
b1a547b1f73ce86205d9222ac19cff334b3b7a2e(0.153.3):authoritative human final-output and recovery handling,
direct-only namespace configuration,
tool selection,
default-namespace test,
and tool-name namespace semantics.
Finding and Rank-Up Dispositions
existing output, non-media reservations, and pre-producer refusal.
checkout; summary failure cleanup remains exclusive-owner-only; empty/partial
JSON outcomes remain single documents with preserved failure codes.
completion/bounds checks. Multiline human text supplies positive-only retry
hints, never authoritative terminal diagnostics.
actual built entrypoint for small and large errors.
applied in the current proof and failure-boundary sections above.
transform/output limits: applied in User Impact and the destination proof above.
No rank-up move is silently skipped.
Named follow-up, not part of this PR: non-JSON stderr still uses forced exit
at
src/clawsweeper.ts:26. Its pipe-drain behavior deserves a separate boundedrepair and real-entrypoint proof. This PR changes only the JSON catch branch;
no new issue or unrelated production change is included.
Maintainer Disposition
The stated retention, checkout-transform refusal, output-limit, and bounded
positive-only retry contracts are explicitly accepted under the existing
fix-and-land authorization, including their effect on previously working
invocations and existing destinations. The configured-direct canary's false
default-selection/publication/queue coverage is accepted as a scoped proof
boundary, not a claim that those surfaces were exercised.
The earlier task-owned technical hold is superseded by the exact-head proof above.
Other maintainer holds are untouched. Landing still requires a fresh review of
this head and body, resolution of every actionable finding, and the independent
final landing gate. This body update does not merge, deploy, or enable automerge.