Repository navigation
fix(scanner): requalify rewritten OpenClaw logging redaction fixtures - #1716
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. |
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.
|
Codex review: needs maintainer review before merge. Reviewed September 30, 2026, 3:25 PM ET / 19:25 UTC (Revision 6). ClawSweeper reviewWhat this changesThe 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 provenancePossible 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 Review scores
Verification
How this fits togetherClawSweeper 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]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
d59ec48 to
1e1abeb
Compare
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.
…teipete/confident-poincare-05823b # Conflicts: # CHANGELOG.md
…teipete/confident-poincare-05823b # Conflicts: # CHANGELOG.md
…-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.
…teipete/confident-poincare-05823b # Conflicts: # CHANGELOG.md
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.
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 (head08d64d3b, base9b5b439d), run 36514869480 ended withAgentInputScanError: findings(exit 79). Its failure diagnostic was finding 2 of 10: URI detector 17, decoderHTML, reasonfinding_not_reviewed, head bloba2d4c9ad, 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:
PLAIN,ESCAPED_UNICODE, orHTML, nondeterministically between runs of identical bytes (24 direct scans plus 17 full admission runs). The exact attribution table never permittedHTMLfor this path.secret:***Postgres fixture moved into a differently indented assertion, so its complete-line digest no longer matched (literal_mismatch).The base blob
1a6fb18eis identical to current OpenClawmain, so any PR touching the file was refused even through its unchanged base.Change
Seven new
REVIEWED_ATTRIBUTIONSrows:HTMLfor the four unchanged identities.PLAIN,ESCAPED_UNICODE, andHTMLfor the re-indented Postgres line.Each row binds the detector ID and name, decoder,
Raw,RawV2, complete-line SHA-256, path, mode100644, and committed base/head roles, as before.validateReviewedAttributionsacceptsHTMLforsrc/logging/redact.test.tsonly. 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
baserole.A focused production-policy regression in
test/agent-input-scan-fixtures.test.tsrebuilds the five post-rewrite lines from fragments, so ClawSweeper's source gains no contiguous credential-shaped literal. It covers:BASE64PLAINandESCAPED_UNICODEbut refusesHTML.BASE64policy row, which the validator rejects.README scanner-policy paragraph, CHANGELOG entry, and
docs/proof/logging-redaction-fixtures/.Behavior proof
scanAgentInputcommitted-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 bypolicySourceSHA256in the artifact (dff03217…at this head).9b5b439dcb6e11b929c982d9b40e8ddcb4c9b2e5, head08d64d3b5ec802237eff61e10e0f1a3aeb8761b0(blobs1a6fb18e= OpenClawmain,a2d4c9ad), against a baseline built from ClawSweepermainat the PR base (ad9ac7f28) and this candidate built from the committed head.main:literal_mismatch(rewritten Postgres line underPLAIN) andfinding_not_reviewed(HTMLMongoDB).HTMLin the base role, and four of five under all three labels. Emitted subsets varied between 4 and 5 identities per run.docs/proof/logging-redaction-fixtures/native-results.jsonand its README. Bounded diagnostics and digests only, no fixture values.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.duplicate_findingrefusal; 0 of 24 direct scans duplicated). That scanner property predates this PR and is unchanged.EXACT_REVIEW_RETRY_POLICY_EPOCHis intentionally not bumped.Validation
pnpm run build:nodenode --test test/agent-input-scan-fixtures.test.tspnpm run format:checkpnpm run check:docspnpm run lintgit diff --checknode --test test/agent-input-scan.test.ts$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 itspolicySourceSHA256no longer matched the committed file. The replay was rerun from the committed head (baseline0f5162431), 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.HTMLonmaintoday (Gateway config, marketplace entries, custodian, plugins-help, browser config); this PR extendsHTMLto 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.Raw/RawV2digests must match an approved row), so no new secret can pass; the gap is attribution hygiene.HTMLfinding by −4, three\u000aescapes shiftESCAPED_UNICODEby +3, and block-level HTML tags in a string shiftHTMLby +3, each refusing a legitimate fixture. The prototype is not in this PR.HTML/ESCAPED_UNICODEURI 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.