Skip to content

fix(scanner): allow reviewed fixtures in unchanged patch context - #1595

Merged
steipete merged 2 commits into
mainfrom
codex/browser-profile-fixture-149354
Sep 15, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/browser-profile-fixture-149354

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

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

  • The focused scanner suite passed 278 tests. After the final cache repair, the affected behavior tests and native admission passed again.
  • The implementation passed the full local repository check (6,218 tests passed, 36 skipped, zero failures) and hosted CI, including builds, lint, and coverage gates. A subsequent test-only clarification uses explicit synthetic credential expectations; focused tests, lint, formatting, and fresh review passed with fixture bytes and production policy unchanged.
  • Independent full-context review found a repeated-blob-scan issue; the existing cache now spans recursive witnesses. Fresh review is clean at P0–P2.
  • A synthetic 126 KB patch with 2,000 repeated approved context lines retained all 4,000 source witnesses. The cache-lifetime negative control took 445 ms; the repaired classifier took 29 ms. This is a local classifier measurement, not hosted end-to-end latency, and no timing threshold was added to tests.

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:

pnpm build:node
node docs/proof/agent-input-scan-context/run-proof.mjs \
  /path/to/trusted/openclaw \
  8462ba6998d1bc1f3a777a6c1d41029c3be24310 \
  1a4d2267526d18a9d5dffb2101f9864c236181f8 \
  /path/to/admission-proof.json

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.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete steipete self-assigned this Sep 15, 2026
@steipete
steipete marked this pull request as ready for review September 15, 2026 20:31
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 5:11 PM ET / 21:11 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 4935cc3892dd11fcb956443febfbebd51dc751ca

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant native runtime proof, substantial rejection coverage, and no actionable correctness findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The captured terminal result exercises scanAgentInput with native TruffleHog against the real committed browser range and reports admission with four source-backed notices; the final test-only commit leaves that production path unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured terminal result exercises scanAgentInput with native TruffleHog against the real committed browser range and reports admission with four source-backed notices; the final test-only commit leaves that production path unchanged.
Evidence reviewed 8 items Repository policy and scope: Read the complete root AGENTS.md. No nested AGENTS.md or maintainer-notes directory was found for the changed paths. Applied the read-only review boundary, runtime-proof requirement, and Bay-impact guidance.
Current-main necessity and release check: The fetched main classifier requires findings to originate from staged blobs; it has no patch-context witness path. The latest supplied release, v0.3.0, does not contain this classifier file. Neither establishes an already-shipped replacement for this change.
Context witnesses preserve source identity: The new resolver checks canonical same-path headers, full blob identities, regular-file modes, committed endpoint references, hunk counts, and matching source bytes. Literal occurrences in additions, removals, or headers refuse classification.
Findings None None.
Security None None.

How this fits together

ClawSweeper 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
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test growth Production +250 net lines; tests +280; proof harness +52 Production growth implements explicit Git-context verification rather than broadening fixture matching by path alone.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This repairs bounded scanner false refusals that block otherwise valid reviews around approved fixtures.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured terminal result exercises scanAgentInput with native TruffleHog against the real committed browser range and reports admission with four source-backed notices; the final test-only commit leaves that production path unchanged.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured terminal result exercises scanAgentInput with native TruffleHog against the real committed browser range and reports admission with four source-backed notices; the final test-only commit leaves that production path unchanged.

Label justifications:

  • P2: This repairs bounded scanner false refusals that block otherwise valid reviews around approved fixtures.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured terminal result exercises scanAgentInput with native TruffleHog against the real committed browser range and reports admission with four source-backed notices; the final test-only commit leaves that production path unchanged.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured terminal result exercises scanAgentInput with native TruffleHog against the real committed browser range and reports admission with four source-backed notices; the final test-only commit leaves that production path unchanged.

Evidence

What I checked:

  • Repository policy and scope: Read the complete root AGENTS.md. No nested AGENTS.md or maintainer-notes directory was found for the changed paths. Applied the read-only review boundary, runtime-proof requirement, and Bay-impact guidance. (AGENTS.md:86, 4935cc3892dd)
  • Current-main necessity and release check: The fetched main classifier requires findings to originate from staged blobs; it has no patch-context witness path. The latest supplied release, v0.3.0, does not contain this classifier file. Neither establishes an already-shipped replacement for this change. (src/agent-input-scan-fixtures.ts:617, 1ed7bd4e13fb)
  • Context witnesses preserve source identity: The new resolver checks canonical same-path headers, full blob identities, regular-file modes, committed endpoint references, hunk counts, and matching source bytes. Literal occurrences in additions, removals, or headers refuse classification. (src/agent-input-scan-patch.ts:11, 4935cc3892dd)
  • Existing refusal rules remain authoritative: Patch witnesses recursively pass through the existing classifier, including detector metadata, verified-result rejection, exact fixture identity, and every logical source reference. Native completion checks run before classification; agent-runner calls admission before launching the provider process. (src/agent-input-scan-fixtures.ts:632, 4935cc3892dd)
  • External fixture identity: The PR directly qualifies this dependency's source fixture. At the proof's pinned OpenClaw head, line 376 contains the synthetic loopback URI in a create-response redaction test; surrounding assertions check that credentials are removed from the response while profile authentication is preserved. (extensions/browser/src/browser/profiles-service.test.ts:376, b8382f64ea7d)
  • Recorded production-path proof: The complete captured PR body, sourceRevision 47f756051cc76ef42aa5c24594e1c30ef9607a6aa1046dac3367c5d896e21a0f, records scanAgentInput using native TruffleHog 3.97.4 with verification enabled against complete committed OpenClaw ranges. On macOS arm64 with Node 26.8.2, the rebased source range was admitted in 1,993 ms with four notices, including patch and source witnesses. This proves scanner admission, not model execution or a later hosted prompt. (4935cc3892dd)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit 9d984f1 into main Sep 15, 2026
23 of 25 checks passed
@steipete
steipete deleted the codex/browser-profile-fixture-149354 branch September 15, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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