fix(review): classify a reviewed synthetic URI fixture - #1296
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review The current body records the executed native whole-PR scanner proof (unchanged input admitted; altered credential and additional finding refused), sanitized audit verification, 49 passing admission tests, eight passing runner tests, and clean pre-commit and committed-branch Codex reviews. Head is |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 3:45 PM ET / 19:45 UTC. ClawSweeper reviewWhat this changesThe PR permits one exact synthetic URI finding from a staged Git blob after strict TruffleHog-output validation, while retaining refusal for every other finding. Merge readinessKeep open for normal maintainer landing: current main still rejects every TruffleHog finding, while this PR adds a narrowly bound exception and the re-review evidence resolves the earlier field-equality concern. No introduced correctness defect was found. Priority: P1 Review scores
Verification
How this fits togetherReview admission stages prompts and Git-derived inputs, scans them with TruffleHog, and blocks provider invocation on unsafe input. This change adds a narrow classification decision between scanner output and continuing an automated review. flowchart LR
A[Review inputs] --> B[Private host staging]
B --> C[TruffleHog scan]
C --> D{Exact reviewed fixture?}
D -->|Yes| E[Sanitized audit notice]
D -->|No or incomplete| F[Block review]
E --> G[Provider review continues]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the narrowly bound classifier with its pinned scanner contract and refusal coverage, then requalify it deliberately whenever the scanner version or JSON output contract changes. Do we have a high-confidence way to reproduce the issue? Yes: current-main source unconditionally rejects scanner findings, and the PR body supplies redacted native TruffleHog runs showing the fixture triggers that path before the introduced classifier admits it. Is this the best way to solve the issue? Yes: a host-side, exact-value classifier tied to staged Git blobs is a narrower maintainable repair than a scanner ignore rule or a broad URI exception. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against db14db010bf3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
@clawsweeper re-review The main body now includes the disposition of the field-equality finding and stronger proof bound explicitly to clean committed owner head No source or policy change was made: accepting a different full URI just because its abbreviated field matches would broaden the intended classification. The native field trace, candidate source/compiled fingerprints, commands, and finding disposition are in the body. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Resolves a problem where the native review of #1294 repeatedly fails before provider invocation because TruffleHog finds the same existing 45-byte synthetic malformed-configuration URI (no path, query, or fragment) in the complete base and head versions of a changed test file. Removing it only from the new revision would still leave the base finding.
Why This Change Was Made
Keep classification at the host-owned scan boundary. One reviewed fixture is identified by its exact full-value SHA-256, URI detector contract, and literal occurrence at the reported line of a host-staged Git blob for
test/action-ledger-runtime.test.ts. The policy never comes from the reviewed checkout. All findings must qualify, and the native scanner must report complete, error-free output under the pinned 3.97.1 contract. BothRawandRawV2are checked. This exact approved URI has no path, query, or fragment, so native TruffleHog returns the same 45 bytes in both fields. For a different URI with a path, the detector removes that path fromRawbut preserves it inRawV2; that different full value must remain blocked.The complete raw diffs, binary patches, before/head blobs, prompt, schema, and additional input still reach TruffleHog with the original flags. Changed values, mixed findings, prompt/schema/diff/additional-input occurrences, encoded-only occurrences, scan errors, and source drift still refuse admission. There are no ignore comments, excluded detectors or paths, new configuration, or fixture rewrites. A sanitized structured host stderr notice preserves each accepted source/blob/line/decoder/count without raw values or verification diagnostics; successful provider callers cannot hide it by discarding their stderr.
User Impact
Reviews that encounter this existing synthetic fixture can proceed while unrelated sensitive findings remain blocking. The classification deliberately fails closed if the scanner output contract changes; a scanner upgrade requires requalification.
OpenClaw Bay Impact
None. This changes pre-provider input admission and emits an operator log notice; it does not change queue, publication, dashboard, or observer data contracts.
Documentation Impact
Updated the active README Safety Model at the scan owner to describe the exact classification, its limits, audit notice, and scanner-upgrade requirement. Reviewed
docs/commit-sweeper.md; its complete-input scanning contract is unchanged.Evidence
AgentInputScanError: findings, before provider invocation.node --test test/agent-input-scan.test.ts: 49/49 passed, including all 20 new classification/refusal/audit cases and the existing snapshot cases.node --test test/agent-runner.test.ts: 8/8 passed. The full admission run caught a test-helper callback-argument regression during development; the helper signature was restored and the original assertions then passed unchanged.pnpm run check, sparse builds, and Windows launcher; CodeQL also passed.pnpm run build:node,pnpm run check:static,pnpm run lint:src,pnpm run lint:scripts, andgit diff --checkpass.6e0e0a75a46bac1f656069e87e9a379642155450.d68b1861172120fc6429cb346aadce65a46ed5a2, not blame alone. No credential-shaped value is copied into this PR.Real Behavior Proof
Claim: the actual host admission owner accepts the unchanged PR's reviewed fixture and continues refusing altered or additional findings with the native scanner.
Environment: macOS arm64, Node 24.20.0, TruffleHog 3.97.1; trusted compiled candidate modules outside an isolated, clean Git target. Target base
db14db010bf3044be85f25fe40a587a5ca77523a, unchanged head0efc0e7d2ada1f665e5b2c00ad41c5c3d078c65a. The proof invokesscanAgentInput({cwd, prompt, source: {kind: "committed", baseSha, headSha}, timeoutMs})rather than manually selecting scan files. It stages both changed test files and all complete source inputs through the production owner with--results=verified,unknown --fail --fail-on-scan-errors --no-update --json --no-color.Rebuilt and repeated against clean committed candidate
6e0e0a75a46bac1f656069e87e9a379642155450at 2026-08-29 19:38:54 UTC.git rev-parse HEADmatched that commit andgit status --porcelainwas empty before rebuilding, before snapshotting the compiled owner, and after proof. The copied compiled owner matched the rebuild byte-for-byte; the committed source hashes were recorded alongside the compiled hashes. This distinguishes the owner PR head (1296) from the input target PR head (1294).findings, 8.1 secondsfindings, 6.0 secondsRedacted native field trace, freshly observed 19:36:44 UTC on the complete base/head blobs:
RawbytesRawV2bytes706a111e474d4ffff0ba27d49fade1c8c66e1c97a17ba3b4b08d5f4e0673321a1202d3d4d6525a91Both raw-field SHA-256 values in every record are
a728de5dbbef23b8aa5ef2d99060835f4f2fb5a0fa2abb9fe249d08aa09bd09e. These are real TruffleHog 3.97.1 records, not the fake scanner fixture. Completion reported zero verified findings, two unknown findings, and no scan errors. Decoder duplication may vary between native runs; no fixed finding count is assumed by production.A fourth native case at 19:42:00 UTC exercises the review's distinct-field scenario directly. A real two-commit Git fixture contains the complete original test file at its canonical path, with only a path extension added to the URI in the second commit. Native TruffleHog reports
Raw= 45 bytes with the approved digest,RawV2= 49 bytes with digestb146c2ee0e8714569773e6c7113d97ae66bf3c2bd4e6170823d40796c9562a99, equalityfalse, and a path only inRawV2. The actual committed owner refuses withfindingsand emits no classification notice, as required. This bounded field-contract fixture is separate from the three whole-PR runs above. Local redacted receipt:/tmp/clawsweeper-1296-committed-native-2mj7p_ww/path-negative-receipt.json.The successful owner event identifies only the fixture digest and Git blob/line/decoder/count metadata. Captured stdout/stderr were checked for absence of the URI, password, and hostname. Exact committed candidate fingerprints:
src/agent-input-scan.ts8538338d2cbfa1e475ebb34e68641ba6c76392b10a23891903ac4bf60723ff11src/agent-input-scan-fixtures.ts286fa5c7e024795915a99a13e724cd0e2f7ad866c9f8704a9af83fd52fca1d8ddist/agent-input-scan.js9a75c8dbdfdfed1a91d5197b16a8484a7e6309fca9a1404fd730b679ec316926dist/agent-input-scan-fixtures.js95a685771e73b978a68891900ea73cc9a72ccc5dbd8aa1bb9f761fee8845a268Reproduction of the positive admission path from a clean checkout of this PR head, with the native scanner installed outside both checkouts:
Local redacted receipts:
/tmp/clawsweeper-1296-committed-native-2mj7p_ww/receipt.jsonand/tmp/clawsweeper-1294-native-field-shape-rjzxdik5/receipt.json(not hosted artifacts; their material results are reproduced above).Limits: this is real scanner/admission proof, not a provider or hosted-review claim. The target PR remains unchanged and unmerged until this owner repair lands and its normal native review succeeds. No raw scanner findings or credentials are included in proof output.
Review Finding Disposition
The 19:34 UTC review's P1 premise is not supported by the native output: the reviewed fixture has no path, so clearing its already-empty path leaves
Rawequal toRawV2. I re-read the actual pinned detector (uri.go:93–109) and verified the fixture directly from this PR's committed source. A fresh native trace at 19:36:44 UTC reports both fields as 45 bytes, the same approved SHA-256, equalitytrue, and path/query/fragment presencefalsefor both base and head findings. Raw URI presence was measured without WHATWG normalization (which inserts a default slash).The proposed general distinct-field admission is intentionally not adopted: this is one exact fixture classification, not permission for other full URIs sharing its abbreviated
Raw. The existingchanged full URIregression sets a differentRawV2while keepingRawand verifies refusal. Native distinct-field proof and the rebuilt committed-head binding are recorded above. This resolves the P1 premise and associated automation-risk claim without loosening the gate. The requested stronger proof is accepted and supplied; there is no functional source change.Scope and Risk
Production delta is +166/-2 lines; test delta is +125/-2 lines. The production growth is the new strict classification and audit boundary; the previous unconditional rejection remains for every unclassified finding. No configuration, dependency, database, workflow, provider, or review-policy changes. No broad false-positive heuristic or fallback was added.