Repository navigation
fix(nodes): validate capture batches before publishing files - #130371
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 5:08 PM ET / 21:08 UTC. ClawSweeper reviewWhat this changesThe PR gathers and validates all requested node-camera responses before writing image artifacts, and consolidates agent camera and photo-library result construction. Merge readinessKeep open for normal maintainer merge handling: current main still publishes each camera capture inside its request loop, while this PR establishes the intended validate-all-before-publish boundary without an actionable correctness finding. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherNode camera commands request media from paired devices, validate native payloads, then publish temporary image files for CLI output or agent tool results. The changed boundary is the handoff from native response handling to filesystem publication. flowchart LR
A[CLI or agent camera request] --> B[Paired node captures]
B --> C[Payload and format validation]
C --> D[Temporary image publication]
D --> E[CLI paths or agent results]
Decision needed
Why: The patch intentionally changes when requested captures occur relative to publication, and the protected maintainer workflow requires a human merge decision even though the source-level repair is sound. Before merge
Agent review detailsSecurityNone. PR surfaceSource -3, Tests +97. Total +94 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the shared gather-then-validate-then-publish flow after exact-head checks pass, while keeping later download or filesystem rollback out of this narrowly defined repair. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible with high confidence: current main writes the first facing=both capture before requesting and validating the second response. The review did not execute the fixture because the target checkout is read-only. Is this the best way to solve the issue? Yes—the shared artifact owner validates all native responses before publication and is narrower than adding rollback logic for independent later network or filesystem failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2df646128092. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Gather and validate each requested camera response before publishing any capture, so a malformed second reply cannot leave the first photo on disk. Reuse photo artifact and result construction for camera snapshots and library photos. Preserve first-payload validation before requesting another camera. Downloads and filesystem failures retain per-file semantics rather than promising batch rollback.
14d88d0 to
1807f20
Compare
|
Addressing the latest ClawSweeper review and rank-up move: the documented patch scope remains native-payload/path preflight, not a new transactional download feature. An explicit request for both cameras authorizes both captures; each returned native payload and generated path is validated before requesting the next capture. After all replies validate, downloads and writes begin. Later network/filesystem failure retains per-file semantics and is not rolled back. This is the reviewed scope of the repair, not a claim of a new product-policy decision. #130352 is now landed. Its actual merge conflict was resolved and independently reviewed at camera head The exact combined source passes 260 tests across ten files, all eleven runtime/declaration build phases, formatting, lint, core and core-test TypeScript. Twenty actual rebuilt CLI invalid-input subprocesses produced the expected diagnostic and zero Gateway TCP connections; a valid canary made one connection. These supersede the review helper's 30-second build/help timeout. Native camera replies are controlled fixtures; publication uses the real filesystem, not physical cameras. The first integration review's two broader rollback findings were retained and checked against complete parser/writer source. A subsequent review with those full contracts found no accepted/actionable issue within the stated scope; both independent final-source/proof reviews pass. Fresh exact-head CI is running and must pass before native landing. |
|
Merged via squash.
|
…w#130371) Gather and validate each requested camera response before publishing any capture, so a malformed second reply cannot leave the first photo on disk. Reuse photo artifact and result construction for camera snapshots and library photos. Preserve first-payload validation before requesting another camera. Downloads and filesystem failures retain per-file semantics rather than promising batch rollback.
What Problem This Solves
The agent camera tool and
nodes camera snap --facing bothpublished the front image before checking the back response. A malformed second native payload could leave a private photo on disk even though the command failed. The photo-library path already preflighted its native batch but duplicated result construction.Why This Change Was Made
Gather and validate native responses before publishing any capture file. Reuse one artifact/result owner for agent camera and photo-library responses; the CLI gathers safe output paths before writing. Invalid first responses still stop before the second camera is invoked. Existing safe CLI format extensions remain accepted.
Production LOC: +98/-101 (net -3). Tests: +97/-0. No config, schema, protocol, dependency, or model tool-result contract changes. This follows the parser hardening in #116927; the older per-capture publishing loop remained in place after that repair.
User Impact
A malformed later native response no longer leaves an earlier private camera image published. This is native-payload/path preflight, not batch rollback for later network or filesystem errors. All requested captures now precede downloads; a later download or write failure can still leave a valid earlier file. Per-file atomic publication remains unchanged.
Evidence
1807f208710b09ddefc906a54aa51dbaa70a03ea, rebased onto landed CLI fix(cli): validate node options before contacting the Gateway #130352 at52beb5e113ead4730b7488c42e97d19feaeaeb9b. Original reviewed camera head was14d88d0a2d91c5ddbb82b9cc51b6d08ba29b6c3a.fs.renameof the first JPG before rejection of malformed base64 or format. They pass with this change; actual published files are read back/cleaned up.The coordinated CLI preflight refactor #130352 is now landed. Its one actual camera-registration merge conflict was resolved by retaining early pure input/timeout validation and the capture preflight array, removing only the duplicated old timeout declaration. The exact combined tree
5867ed2101a8bb1417693684146ee249ca96d9edpassed 260 tests across ten files, all eleven runtime/declaration build phases, formatting, lint, core and core-test TypeScript. Twenty actual rebuilt CLI invalid-input subprocesses produced the expected local diagnostic with zero Gateway TCP connections; a valid canary made one connection. Both independent source/proof reviewers approved the exact tree.Fresh integration review initially asked for broader URL-download/filesystem rollback. The finding was checked against complete parser/writer source and the pre-existing explicit scope above: native-payload/path preflight is repaired; later network/filesystem rollback is not promised. The raw findings and source-based disposition are retained. A fresh review with the full contracts passed without accepted/actionable findings. No production changes were made to obtain that result. Current-head hosted CI must pass before landing.
Named pre-existing follow-ups: the human-duration clip E2E case lacks its neighboring artifact-readback/cleanup assertion; camera docs still mention
--duration-msalthough registration exposes--duration. Neither is claimed fixed here. Maintainer-requested, AI-assisted.