Repository navigation
fix(scanner): allow reviewed fixtures in unchanged patch context - #1595
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: needs maintainer review before merge. Reviewed September 15, 2026, 5:11 PM ET / 21:11 UTC. ClawSweeper reviewWhat this changesThe scanner admits approved synthetic URI fixtures in unchanged Git patch context after checking both committed source blobs, and qualifies the browser create-profile redaction fixture. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still rejects reviewed fixtures appearing in patch context. The bounded implementation and recorded native admission proof support keeping it as a landing candidate, with no blocking findings. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper scans review prompts and Git source material before starting an agent. This change lets its fixture classifier recognize qualified patch context while preserving refusal of other credential findings. flowchart TD
A[Prompt and Git source] --> B[Native secret scan]
B --> C{Reviewed fixture finding?}
C -->|Patch context| D[Verify both committed blobs]
D --> E[Apply existing fixture policy]
E --> F[Admission and audit notices]
C -->|Unqualified finding| G[Refuse agent launch]
D -->|Mismatch| G
E -->|Mismatch| G
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Retain complete native scanning while admitting only fixture findings whose unchanged context is independently bound to both committed sources. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main rejects a native fixture finding attributed to staged patch material because it requires a blob origin. The PR also records hosted refusals; this read-only review did not rerun them. Is this the best way to solve the issue? Yes. Reusing the existing fixture classifier after verifying both Git witnesses is a narrow solution that preserves complete scan input and existing rejection rules. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1ed7bd4e13fb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Related: openclaw/openclaw#149354
What Problem This Solves
Fixes review refusing a small edit near an approved synthetic credential when the generated Git patch repeats that fixture in unchanged context.
User Impact
Maintainers can review changes around qualified synthetic URI fixtures without repeated false refusals. The existing OpenClaw create-profile redaction fixture is also qualified by its exact URI, complete source line, path, regular-file mode, and observed plain-text/HTML attribution.
Why This Change Was Made
The complete raw diff, patch, and source blobs remain scanned. Every occurrence of a matched URI in patch material must map to an unchanged line in both committed source blobs, with matching paths, Git object identities, and hunk coordinates. Both source witnesses then pass through the existing fixture classifier. Added or removed occurrences, unqualified paths or metadata, verified credentials, and incomplete scans remain refused.
Audit notices retain the original patch location and decoder plus the source witnesses. One scan shares its existing literal cache across those witnesses, avoiding repeated full-blob scans for repeated fixtures.
OpenClaw Bay Impact
Bay is unaffected: this changes scanner admission and host-side proof notices, not dashboard APIs or public action surfaces.
Documentation Impact
README.md is the active scanner contract and now documents unchanged-context attribution and the exact profile fixture qualification. The scanner modules own that behavior. The new docs/proof/agent-input-scan-context page is historical proof tied to the cited OpenClaw revisions; its executable recipe can be rerun on a checkout pinned to the supplied head. Update the active README when scanner admission changes and refresh proof when its source inputs change. CHANGELOG.md records the fix under Unreleased.
Evidence
CodeQL traced the synthetic test fixtures into fixture-identity hashes. The test-only clarification makes those known inputs explicit. Alerts 123 and 124 were verified and classified as used in tests: these SHA-256 values identify scanner bytes and do not implement password storage. The production rule and fixture-identity contract remain enabled.
Real Behavior Proof
The production scanAgentInput entry point ran with native TruffleHog 3.97.4, native verification enabled, a controlled prompt, and the complete committed OpenClaw range. The original hosted refusals are recorded in runs 35012046356 and 35014912047.
The candidate admitted the original browser head b8382f64ea7db05db1b0a6ac3c7ae80b68025fc3 in 1.9 seconds, then admitted the patch-identical rebased head 1a4d2267526d18a9d5dffb2101f9864c236181f8 in 1,993 ms on macOS arm64, Node 26.8.2, pnpm 12.4.1. Both produced four safe notices, including the original patch finding and its two source witnesses.
Reproduction, with the target checkout pinned to the supplied head:
Observed trace:
result=admitted,notices=4. The JSON receipt retains source identities and safe witness metadata, without matched values. This proof runs no model; hosted review must still scan its own prompt, schema, and source inputs. Regression tests separately cover coherent added/removed occurrences, wrong sources and modes, changed bytes, malformed mappings, duplicate handling, and scan integrity.