Skip to content

fix(scanner): requalify rewritten OpenClaw logging redaction fixtures - #1716

Merged
steipete merged 7 commits into
mainfrom
steipete/confident-poincare-05823b
Sep 30, 2026
Merged

steipete merged 7 commits into
mainfrom
steipete/confident-poincare-05823b

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

openclaw/openclaw#160879 rewrote OpenClaw's src/logging/redact.test.ts. Since then, the exact-review input scan refuses every OpenClaw PR that touches that file. On openclaw/openclaw#160888 (head 08d64d3b, base 9b5b439d), run 36514869480 ended with AgentInputScanError: findings (exit 79). Its failure diagnostic was finding 2 of 10: URI detector 17, decoder HTML, reason finding_not_reviewed, head blob a2d4c9ad, line 751.

Root cause

The problem wasn't simply "the rows match old bytes." Four of the five remaining connection-string fixtures kept their complete source lines byte-for-byte. Two other things changed:

  • The rewrite changed the surrounding chunk content. The pinned TruffleHog 3.97.4 now labels every remaining identity PLAIN, ESCAPED_UNICODE, or HTML, nondeterministically between runs of identical bytes (24 direct scans plus 17 full admission runs). The exact attribution table never permitted HTML for this path.
  • The redacted secret:*** Postgres fixture moved into a differently indented assertion, so its complete-line digest no longer matched (literal_mismatch).

The base blob 1a6fb18e is identical to current OpenClaw main, so any PR touching the file was refused even through its unchanged base.

Change

  • Seven new REVIEWED_ATTRIBUTIONS rows:

    • HTML for the four unchanged identities.
    • PLAIN, ESCAPED_UNICODE, and HTML for the re-indented Postgres line.

    Each row binds the detector ID and name, decoder, Raw, RawV2, complete-line SHA-256, path, mode 100644, and committed base/head roles, as before.

  • validateReviewedAttributions accepts HTML for src/logging/redact.test.ts only. No other source, detector, or decoder widens, and the classifier is unchanged.

  • The pre-rewrite rows stay. PRs whose merge base predates #160879 still stage the old blob in the base role.

  • A focused production-policy regression in test/agent-input-scan-fixtures.test.ts rebuilds the five post-rewrite lines from fragments, so ClawSweeper's source gains no contiguous credential-shaped literal. It covers:

    • All three decoders, mixed decoders, reversed order, and emitted subsets.
    • Refusals for:
      • changed line bytes
      • BASE64
      • verified findings
      • another path, mode, or role
      • duplicate native records
      • extra occurrences
      • incomplete scans
    • The pre-rewrite Postgres line: it still admits PLAIN and ESCAPED_UNICODE but refuses HTML.
    • A BASE64 policy row, which the validator rejects.
  • README scanner-policy paragraph, CHANGELOG entry, and docs/proof/logging-redaction-fixtures/.

Behavior proof

  • Claim: under the pinned native scanner, host policy admits the exact post-rewrite OpenClaw logging fixtures, and only those fixtures, for every decoder label the scanner assigns.
  • Surface: the real scanAgentInput committed-source staging and admission path (docs/proof/marketplace-telemetry-fixtures/run-proof.mjs), checksum-pinned TruffleHog 3.97.4, normal verification, no model call. Environment: macOS, Node 26.10.0. Every candidate run is bound to the committed policy file by policySourceSHA256 in the artifact (dff03217… at this head).
  • Scenario: the exact hosted refusal range, OpenClaw base 9b5b439dcb6e11b929c982d9b40e8ddcb4c9b2e5, head 08d64d3b5ec802237eff61e10e0f1a3aeb8761b0 (blobs 1a6fb18e = OpenClaw main, a2d4c9ad), against a baseline built from ClawSweeper main at the PR base (ad9ac7f28) and this candidate built from the committed head.
  • Result:
    • Baseline refused 3 of 3, via the base blob that equals current OpenClaw main: literal_mismatch (rewritten Postgres line under PLAIN) and finding_not_reviewed (HTML MongoDB).
    • Candidate admitted 8 of 8, classifying 66 findings; every identity appeared as HTML in the base role, and four of five under all three labels. Emitted subsets varied between 4 and 5 identities per run.
  • Artifact: docs/proof/logging-redaction-fixtures/native-results.json and its README. Bounded diagnostics and digests only, no fixture values.
  • Limits:
    • Source-admission proof, not a hosted review. Hosted runs scan their own complete inputs.
    • Known limit, recorded natively in the artifact and tracked in openclaw/clawsweeper#1724: a decoded (HTML/ESCAPED_UNICODE) URI finding is attributed to the plain literal wherever it occurs, so an entity-encoded copy of an approved value elsewhere in the file borrows the plain witness (2/2 admitted in a blob scenario and a patch scenario). See Review disposition.
    • The classifier can only judge findings the scanner emits. TruffleHog 3.97.4's emission for lines inside a chunk-overlap region is nondeterministic (an earlier replay of this range recorded one duplicate_finding refusal; 0 of 24 direct scans duplicated). That scanner property predates this PR and is unchanged.
    • A diff hunk that itself contains the MongoDB/Postgres fixture lines still hits the existing refusal for patch-embedded non-URI findings.
    • Reviews already held after a terminal scanner refusal still need a fresh explicit re-review; EXACT_REVIEW_RETRY_POLICY_EPOCH is intentionally not bumped.

Validation

  • pnpm run build:node
  • node --test test/agent-input-scan-fixtures.test.ts
  • pnpm run format:check
  • pnpm run check:docs
  • pnpm run lint
  • git diff --check
  • node --test test/agent-input-scan.test.ts
  • Pre-commit $autoreview (Codex): scoped-clean for P0–P2 on each commit.

Review disposition

  • ClawSweeper Revision 2 (head 1e1abebec), P2 Bind the native replay to the submitted scanner policy: accepted. The first artifact was generated before the rebase merged fix(scanner): qualify the cron webhook FTP fixture #1713's FTP rows into the same policy file, so its policySourceSHA256 no longer matched the committed file. The replay was rerun from the committed head (baseline 0f5162431), and the artifact and README now carry the matching digest.

  • ClawSweeper Revision 4 (head c2f088d1b), P1 Bind HTML URI findings to their actual source bytes: maintainer exception, not fixed here, with a follow-up in openclaw/clawsweeper#1724.

    • The mechanism is real and is recorded natively in the artifact (known-limit scenarios). It is the existing exact-path behavior for every row that permits HTML on main today (Gateway config, marketplace entries, custodian, plugins-help, browser config); this PR extends HTML to one more source. fix(scanner): qualify the cron webhook FTP fixture #1713 closed the same shape for the FTP row with whole-blob pins, which cannot apply to a file that pull requests keep changing.
    • What a borrowed attribution admits is only the same digest-bound synthetic value (Raw/RawV2 digests must match an approved row), so no new secret can pass; the gap is attribution hygiene.
    • The requested coordinate binding was prototyped and measured against the pinned scanner and is unsound: the engine counts lines in decoded chunk data, so five consecutive blank lines shift an HTML finding by −4, three \u000a escapes shift ESCAPED_UNICODE by +3, and block-level HTML tags in a string shift HTML by +3, each refusing a legitimate fixture. The prototype is not in this PR.
    • The sound fix is a masked native re-scan (the mechanism already used for Cloudflare metadata) applied across all exact HTML/ESCAPED_UNICODE URI rows, blob and patch paths, with fake-scanner updates for the second call. That is a cross-cutting change with its own proof and belongs in the follow-up.

OpenClaw Bay

Unaffected. There are no lifecycle, queue, status, telemetry, publication, or dashboard data-contract changes, only host scanner fixture policy.

@clawsweeper

clawsweeper Bot commented Sep 30, 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.

OpenClaw #160879 rewrote src/logging/redact.test.ts. The pinned TruffleHog
3.97.4 scan now labels its synthetic connection-string fixtures PLAIN,
ESCAPED_UNICODE, or HTML nondeterministically, and the redacted Postgres
assertion changed indentation. The exact attribution rows only permitted
PLAIN/ESCAPED_UNICODE for that path, so every OpenClaw PR touching the file
was refused before review (hosted run 36514869480 on openclaw/openclaw#160888).

Add seven exact rows for the post-rewrite identities and permit HTML for this
one source. Rows still bind detector, decoder, Raw/RawV2 and complete-line
digests, path, mode, and committed roles. Pre-rewrite rows stay for merge
bases that predate #160879.

Proof: source-admission replay of the #160888 range with pinned native
3.97.4: original policy refused 5/5 runs; candidate admitted 12/12 (104
classified findings). Focused production-policy regression added.

OpenClaw Bay is unaffected; no status, queue, publication, telemetry, or
observer contract changes.
@clawsweeper clawsweeper Bot added P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 30, 2026, 3:25 PM ET / 19:25 UTC (Revision 6).

ClawSweeper review

What this changes

The branch updates ClawSweeper’s secret-scan policy for rewritten OpenClaw logging test fixtures and adds focused regression coverage, documentation, and a native scanner replay.

Regression provenance

Possible regression — probable (failure trace; known regression link). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Current main still refuses the affected OpenClaw review input, while the committed native replay supports this PR’s narrow qualification. The decoded-source attribution limit is documented, expressly accepted for these synthetic values by the repository admin, and tracked separately at #1724.

Priority: P1
Reviewed head: b8cf2a46f81f094ba8962cb2a4de19c40afbb913

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The narrow policy update has strong committed native proof and focused tests, with its bounded attribution limitation documented and accepted.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The committed macOS replay exercised real committed-source staging and admission with pinned TruffleHog 3.97.4: three current-policy runs refused, while eight candidate runs admitted 66 classified findings. The artifact’s policy digest matches this head; its separate blob and patch scenarios disclose the accepted encoded-copy limit. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The committed macOS replay exercised real committed-source staging and admission with pinned TruffleHog 3.97.4: three current-policy runs refused, while eight candidate runs admitted 66 classified findings. The artifact’s policy digest matches this head; its separate blob and patch scenarios disclose the accepted encoded-copy limit. No stored-data contract changes.
Evidence reviewed 9 items Introduced qualification: The introduced patch adds seven exact rows for the rewritten logging fixtures and permits the HTML decoder for that source.
Current-main gap: Current main retains the earlier logging rows but lacks the new HTML rows and rewritten Postgres line digest.
Production admission path: The native scan feeds the fixture classifier; a refusal raises AgentInputScanError before review proceeds.
Findings None None.
Security None None.

How this fits together

ClawSweeper scans committed source and review inputs before starting a review agent. Its fixture policy either admits a precisely reviewed synthetic scanner finding or stops the review.

flowchart LR
  A[Review request] --> B[Committed source]
  B --> C[Native secret scan]
  C --> D[Fixture policy]
  D --> E[Admit reviewed fixture]
  D --> F[Refuse unknown finding]
  E --> G[Review agent]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and test delta production +9/−1 lines; tests +261 lines Production growth is confined to fixture policy, with focused regression coverage.

Technical review

Best possible solution:

Keep the narrow fixture qualification and resolve decoded URI source binding across the shared exact-attribution path through #1724 with native blob and patch proof.

Do we have a high-confidence way to reproduce the issue?

Yes. The committed native replay records three refusals using the current-main policy on the affected OpenClaw range; this read-only review inspected the artifact and policy digest but did not rerun the scanner.

Is this the best way to solve the issue?

Yes. Requalifying exact fixture identities follows the existing policy boundary; the broader decoded-origin repair has a separate tracked scope.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ad9ac7f287fd.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The current scanner policy blocks a real OpenClaw exact-review workflow before review can start.
  • merge-risk: 🚨 automation: The changed host policy determines whether exact-review automation admits or refuses scanned source.
  • merge-risk: 🚨 security-boundary: HTML qualification extends a documented same-value decoded-attribution limit to this source; the repository admin expressly accepts that bounded tradeoff.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The committed macOS replay exercised real committed-source staging and admission with pinned TruffleHog 3.97.4: three current-policy runs refused, while eight candidate runs admitted 66 classified findings. The artifact’s policy digest matches this head; its separate blob and patch scenarios disclose the accepted encoded-copy limit. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The committed macOS replay exercised real committed-source staging and admission with pinned TruffleHog 3.97.4: three current-policy runs refused, while eight candidate runs admitted 66 classified findings. The artifact’s policy digest matches this head; its separate blob and patch scenarios disclose the accepted encoded-copy limit. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-30T01:09:50.858Z sha d59ec48 :: blocked before merge. :: [P2] Bind native admission proof to the committed policy
  • reviewed 2026-09-30T01:15:22.727Z sha 1e1abeb :: blocked before merge. :: [P2] Bind the native replay to the submitted scanner policy
  • reviewed 2026-09-30T04:17:31.161Z sha b1f67f5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-30T04:33:33.215Z sha c2f088d :: needs real behavior proof before merge. :: [P1] Bind HTML URI findings to their actual source bytes
  • reviewed 2026-09-30T17:55:02.439Z sha 209e35a :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/confident-poincare-05823b branch from d59ec48 to 1e1abeb Compare September 30, 2026 01:10
The first native-results.json was generated before the rebase merged the cron
FTP rows into src/agent-input-scan-fixtures.ts, so its policySourceSHA256 no
longer matched the committed file. Rerun the source-admission replay from the
committed head against a baseline built at the pull request base: original
policy refused 5/5 runs; candidate admitted 11/12 and classified 86 findings.
Record the one duplicate_finding refusal as a native chunk-overlap duplicate
record handled by the existing guard.
@clawsweeper clawsweeper Bot added 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. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 30, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed 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 30, 2026
…-witness limit

Regenerate native-results.json from the merged head so policySourceSHA256
matches the committed policy: baseline (main at the pull request base)
refused 5/5 runs; candidate admitted 12/12 and classified 106 findings.

Record the known limit natively: decoded HTML/ESCAPED_UNICODE URI findings are
attributed to the plain literal wherever it occurs, so an entity-encoded copy
of an approved synthetic value borrows the plain witness (3/3 admitted in a
blob and a patch scenario). Explain why scanner-line binding is unsound under
the pinned scanner and point to the masked native re-scan follow-up in #1724.
@clawsweeper clawsweeper Bot added 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 30, 2026
Regenerate native-results.json from the merged head (main gained SDK CDP rows
in the same policy file) so policySourceSHA256 matches the committed file:
baseline refused 3/3 runs, candidate admitted 8/8 and classified 66 findings,
known-limit scenarios admitted 2/2 each.
@steipete
steipete merged commit 8c7a382 into main Sep 30, 2026
13 of 16 checks passed
@steipete
steipete deleted the steipete/confident-poincare-05823b branch September 30, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. 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