Skip to content

perf(logging): speed up secret redaction for large text - #166701

Merged
steipete merged 2 commits into
mainfrom
steipete/perf-micro-core-redactor-throughput-20260919
Oct 7, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/perf-micro-core-redactor-throughput-20260919

Conversation

@steipete

@steipete steipete commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Large model contexts and log strings repeatedly scan the built-in redaction rules even when most rule families cannot match. Reconnect-storm CPU profiles attributed 383–503 ms of a roughly 5.8-second main-thread window to redaction.

User Impact

Reduces redaction CPU for large contexts, logs, and structured content fields while retaining the same matching rules, replacement bytes, and modes, including mode: "tools". No configuration or migration is required.

Why This Change Was Made

Compiled default rules and registered-value matchers were already cached; repeated scanning was the remaining cost. Reject impossible AWS candidate windows, gate assignment/vendor families by necessary characters, attach per-rule probes at compilation, and reuse vendor admission only while the current input is unchanged. Compiled-regex mutation invalidates the associated probe, skipped global replacements still reset lastIndex, and the outer word-admission gate remains conservative for shared mutable rules. Registered secret values retain their existing revision-owned matcher and snapshot lifecycle.

The runtime grows by 151 lines, plus 33 lines in the existing benchmark. The growth preserves ordered replacements and full-context matching while attaching necessary-condition probes to their rules; mutable shared regexes require source/flags/executor/replacement-hook validity checks. In the earlier AWS ablation, a smaller variant without per-rule probes took 25.34 ms for a matched 200 KiB context versus 11.39 ms for the full candidate. Dropping both the per-rule and vendor probes took 19.94 ms for clean source versus 7.13 ms. Neither simpler measured design retained the speedup. The line-cap gate also required moving the existing token-mask helpers into a 66-line module; the main redactor shrinks by 20 lines, and this extraction changes no masking logic. Its new module is included in the trusted PR-wrapper source inventory. No old redaction implementation or cross-call output cache is retained; the large new JSON file is a synthetic test fixture, not runtime code. The requested non-test path filter reports 2,668 insertions and 129 deletions (+2,539): +151 runtime lines, +33 benchmark lines, +2,354 fixture-data lines, and one wrapper-inventory entry.

Evidence

Final comparative Linux measurements (Node 24.19.0, Hetzner Crabbox cbx_70204d6e74ab, alternating baseline/candidate in one process, five rounds of five calls; synthetic inputs and an empty exact-value registry during timing; registry lifecycle is checked separately):

200 KiB input Text before → after Speedup Content field before → after Speedup
Prose, clean 6.228 → 1.525 ms 4.09× 6.782 → 1.526 ms 4.44×
Prose, synthetic secret 18.859 → 6.321 ms 2.98× 19.529 → 6.399 ms 3.05×
Context, clean 13.814 → 2.410 ms 5.73× 14.263 → 2.423 ms 5.89×
Context, synthetic secret 14.751 → 5.798 ms 2.54× 15.367 → 5.781 ms 2.66×
Source, clean 14.107 → 3.869 ms 3.65× 14.536 → 3.858 ms 3.77×
Source, synthetic secret 16.165 → 7.014 ms 2.30× 16.911 → 7.137 ms 2.37×

The fresh differential harness passed 8,984/8,984 comparisons across all 124 compiled patterns, including seven API/mode combinations, padded inputs, near misses, registry lifecycle/snapshots, and ordered custom replacements. The permanent corpus adds 468 baseline-hashed cases covering seven API/mode combinations alongside the existing 250-case byte fixture. All 58 logging test files have passing behavior evidence (807 tests), including the final 97-case focused entrypoint run and the corrected 11-case structured-probe file. The replacement-hook, lastIndex, and default-gate mutation regressions each demonstrably fail when their corresponding fix is removed. The new corpus section takes 132 ms in the final run. Preserving the original outer admission behavior gives up part of the experimental clean-input speedup; the table reports the compatible final candidate. Measured pnpm test <file> --maxWorkers=1 wall times: byte identity 4.838 s, reentrancy 4.414 s, pattern families 3.616 s, redaction 4.782 s, structured properties 4.261 s. The full staged changed-file gate passed on the final runtime; the subsequent one-line wrapper-inventory change passed its scoped gate and all 20 closure tests. Full core lint reported five existing max-lines warnings outside this diff and zero errors. Final-head CI run 37675013684 passed: 54 successful jobs, 721 seconds workflow wall time, and 2,583 summed Node-test job seconds across 15 jobs (whole-job cost, not per-file attribution). The first run was cancelled after its byte-level private-key scanner matched a synthetic PEM marker in the JSON fixture; the marker is now serialized with a standard JSON Unicode escape, with all 468 decoded cases and expected hashes verified identical.

Benchmark: pnpm perf:redaction --large covers 1 KiB, 64 KiB, and 200 KiB prose/context/source strings, each with and without a synthetic secret.

Final differential/benchmark proof: https://crabbox.openclaw.ai/portal/runs/run_df42bfdf5bebe1f464925ea958eb4bca — all 8,984 comparisons passed in 48.18 seconds. The same payload completed node scripts/check-changed.mjs --staged successfully before the separate closure tests identified the missing inventory entry. After that entry was added, https://crabbox.openclaw.ai/portal/runs/run_5ebd80f41c7061619d5a249069523ecc passed the scoped inventory gate, 97 focused tests, and the published benchmark command (payload exit 0, 209.84 seconds).

Remote commands and recovery results

All runs used source hashes and the pinned baseline. No heavy validation ran on the Mac. Every lease is stopped/released.

Provider / lease Command or proof Result
Blacksmith Testbox tbx_01m4bfr86q12m45q0x7p95ba3d crabbox warmup --keep --timing-json No runner after 15 minutes; stopped.
AWS cbx_054ccde1eefe Warmup, frozen install, differential/benchmark and smaller-design comparisons; run run_9f3613b6a000a849fcd40f8d24fc1c1f Earlier candidate: 8,984 comparisons identical; exit 0. Standard instance types hit quota, so actual host was t3.small.
AWS cbx_054ccde1eefe Focused pnpm test files, then logging siblings; run run_f58aada71e2f03bce102535c050e42e2 78 focused tests passed; compiled-subprocess preparation killed with exit 137 on the 2 GiB host. Released.
Hetzner cbx_70204d6e74ab (ccx33) Initial source/Node preflight; run run_0d16127b5cf224743a2992c203189362 Source verified; stopped before tests because Node was absent. Installed checksum-verified Node 24.19.0 and pinned pnpm 12.5.1.
Hetzner, same lease Negative control, focused tests, logging siblings; run run_8d722b7f90d361d5fde9759df5b20d66 Replacement-hook regressions failed without the fix and passed with it. Three old probe-observer assertions failed because they matched the retired regex source text; corrected to observe the existing prefilter functions.
Hetzner, same lease Corrected structured tests, export-name/closure guards, staged gate; run run_53d8e4c42ff5ede45aa10894859303c5 11 structured tests and 20 closure tests passed; line-cap gate required moving unchanged mask helpers and relocating the CLI cases.
Hetzner, same lease node scripts/check-changed.mjs --staged; run run_93b3ad037df40806b0d812c532ac9296 Types and earlier guards passed. Corrected three new lint issues: an ambiguous regex literal and two identity-only method references.
Hetzner, same lease State/default-admission negative controls, focused lint/tests, final differential, full staged gate; run run_df42bfdf5bebe1f464925ea958eb4bca Controls failed for the intended reasons; final cases, all 8,984 comparisons, and full gate passed. Separate closure tests caught the new module missing from the wrapper inventory; added that entry.
Hetzner, same lease Both closure files and scoped inventory gate; run run_5c6122a0164f175c89e132b38d54e2e3 All 20 closure cases passed; inventory gate needed rg, absent from the base image.
Hetzner, same lease Install rg; scoped inventory gate; final focused entrypoints; scripts/bench-redaction-prefilters.ts --large; run run_5ebd80f41c7061619d5a249069523ecc All passed, exit 0. Lease released.
Blacksmith Testbox tbx_01m4bvzpas4dbgj7vdm883jkxk Warmup for the fixture-only CI correction No runner after 15 minutes; stopped.
AWS cbx_22ff5e954d11 (c7a.8xlarge) Trusted base private-key scanner negative/positive control and pnpm test src/logging/redact-byte-identity.test.ts --maxWorkers=1; run run_734a0333861550d6bfce98967aeb3622 Original fixture reproduced the failure; corrected tracked tree scanned 52,784 files with zero findings; all 3 tests passed in 4.458 s. Exit 0; released.

Independent autoreview: scoped-clean through P2 for the final runtime and wrapper-inventory change, with complete production source supplied. The fixture-only CI correction also passed independent review through P2. The earlier replacement-hook finding was fixed and verified with failing/passing regression evidence.

Security review: the modified logging paths match the credentials category in the security-review policy. No current CODEOWNERS rule names an owner for these files; the SecOps-only ownership paths are unchanged. Required GitHub security/review gates remain applicable.

Limits: synthetic throughput measurements do not predict total Gateway CPU savings. No production Gateway replay or deployment is included.

Skip impossible AWS windows and built-in rule scans while retaining match
order, masks, modes, registered-secret lifecycle, and mutable regex behavior.
Keep the outer word-admission gate conservative and preserve native global
replacement state when a scan is skipped.

Record synthetic byte-identity fixtures and exercise shared-regex mutation.
Move existing mask helpers into one small module so the main redactor
shrinks. Extend the existing redaction benchmark with
1 KiB, 64 KiB, and 200 KiB text and content-field workloads.
@clawsweeper

clawsweeper Bot commented Oct 7, 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-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 7, 2026
@steipete
steipete marked this pull request as ready for review October 7, 2026 18:53
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 735448c48f5ecf3fc817497a2483256a75a4111d
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/logging/redact-mask.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/logging/redact-pattern-runtime.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/logging/redact-patterns.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/logging/redact-prefilter.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/logging/redact.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@steipete
steipete enabled auto-merge (squash) October 7, 2026 18:56
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 3:37 PM ET / 19:37 UTC (Revision 2).

ClawSweeper review

What this changes

The PR speeds up secret masking in large text and structured content by skipping impossible matches, while adding benchmarks and byte-equivalence coverage.

Merge readiness

✅ Ready for maintainer review

This optimization remains useful on current main. The pinned patch has no actionable correctness or security findings, and the fixture correction preserves decoded inputs and expected hashes.

Priority: P2
Reviewed head: 735448c48f5ecf3fc817497a2483256a75a4111d

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused production changes have strong comparative measurements, byte-equivalence coverage, and mutation regressions, with no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured Linux measurements exercise the production text and content-field redactors with clean and synthetic-secret large inputs, showing faster after-fix results alongside differential byte equality. This proves the bounded optimization, without claiming total Gateway savings; no stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured Linux measurements exercise the production text and content-field redactors with clean and synthetic-secret large inputs, showing faster after-fix results alongside differential byte equality. This proves the bounded optimization, without claiming total Gateway savings; no stored-data contract changes.
Evidence reviewed 8 items Pinned introduced scope: Reviewed the merge-base-to-head production, benchmark, inventory, and test changes. Base-only Android changes are not attributed to this PR; the stale test merge was not used to infer merge regressions.
Mutation-safe rule probes: Attached probes become permissive when source, flags, executor, or replacement-hook identity changes. Skipped global replacements reset lastIndex, and vendor admission is recalculated whenever earlier replacements change the current input.
Existing output contract: The logging documentation defines ordered masking before output and persistence, distinguishes model-visible source assignments from diagnostic masking, and documents existing masks and custom-pattern behavior. The patch retains those contracts without changing config or persisted formats.
Findings None None.
Security None None.

How this fits together

OpenClaw’s redaction subsystem receives log records, transcript text, and tool content before they reach output or persistence. It applies registered-secret masking and ordered credential rules, returning sanitized text and records.

flowchart TD
  A[Logs and tool content] --> B[Registered secret masking]
  B --> C[Conservative admission probes]
  C --> D[Ordered credential rules]
  C --> E[No possible rule match]
  D --> F[Sanitized output]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +2505, Tests +189, Other +34. Total +2728 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 6 2609 104 +2505
Tests 4 202 13 +189
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 59 25 +34
Total 12 2870 142 +2728

Review metrics

Metric Value Why it matters
Production and test growth runtime +151 lines; test code +189; fixture data +2,354 The runtime growth has a measured justification comparing simpler designs, while most branch growth is baseline-equivalence data.

Technical review

Best possible solution:

Retain one ordered redaction owner with conservative, mutation-aware probes that reduce scanning without changing masking bytes or operator settings.

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

Not applicable to a functional bug; the existing benchmark provides a concrete performance comparison through the changed text and content-field entrypoints.

Is this the best way to solve the issue?

Yes. The probes supplement the existing ordered rules, and the recorded simpler-design comparisons justify the additional runtime machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 53393f7d8668.

Labels

Label changes:

  • add P2: This is a bounded performance improvement for large redaction inputs with useful measured savings and no demonstrated urgent user-facing regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured Linux measurements exercise the production text and content-field redactors with clean and synthetic-secret large inputs, showing faster after-fix results alongside differential byte equality. This proves the bounded optimization, without claiming total Gateway savings; no stored-data contract changes.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured Linux measurements exercise the production text and content-field redactors with clean and synthetic-secret large inputs, showing faster after-fix results alongside differential byte equality. This proves the bounded optimization, without claiming total Gateway savings; no stored-data contract changes.

Label justifications:

  • P2: This is a bounded performance improvement for large redaction inputs with useful measured savings and no demonstrated urgent user-facing regression.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured Linux measurements exercise the production text and content-field redactors with clean and synthetic-secret large inputs, showing faster after-fix results alongside differential byte equality. This proves the bounded optimization, without claiming total Gateway savings; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured Linux measurements exercise the production text and content-field redactors with clean and synthetic-secret large inputs, showing faster after-fix results alongside differential byte equality. This proves the bounded optimization, without claiming total Gateway savings; no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced scope: Reviewed the merge-base-to-head production, benchmark, inventory, and test changes. Base-only Android changes are not attributed to this PR; the stale test merge was not used to infer merge regressions. (src/logging/redact.ts:181, 735448c48f5e)
  • Mutation-safe rule probes: Attached probes become permissive when source, flags, executor, or replacement-hook identity changes. Skipped global replacements reset lastIndex, and vendor admission is recalculated whenever earlier replacements change the current input. (src/logging/redact-pattern-runtime.ts:326, 735448c48f5e)
  • Existing output contract: The logging documentation defines ordered masking before output and persistence, distinguishes model-visible source assignments from diagnostic masking, and documents existing masks and custom-pattern behavior. The patch retains those contracts without changing config or persisted formats. Public docs: docs/gateway/logging.md. (docs/gateway/logging.md:222, 735448c48f5e)
  • Current-main necessity: Authenticated read-only GitHub contents requests at fetched main 53393f7 confirmed that the prefilter remains the original combined admission expression and the pattern runtime lacks the new attached probes. Local blob hydration failed with HTTP 403; GitHub API reads supplied the needed source. (src/logging/redact-prefilter.ts:7, 53393f7d8668)
  • Re-review continuity: The previous completed review at 13cb52e contained no findings. An authenticated contents read of that revision’s fixture, parsed and compared with the checkout fixture, established identical decoded JSON, including all 468 cases and hashes. The new head’s raw commit record identifies the fixture encoding correction. (src/logging/redact-prefilter-fixture.json:1, 735448c48f5e)
  • Recorded production-entrypoint measurements: The captured PR body reports Node 24.19.0 Linux runs through redactSensitiveText and redactSensitiveFieldValue, with 200 KiB clean and synthetic-secret workloads improving 2.30–5.89 times and 8,984 differential comparisons passing. It links run_df42bfdf5bebe1f464925ea958eb4bca and run_5ebd80f41c7061619d5a249069523ecc. These are author-recorded boundary measurements, not reviewer execution or a production Gateway replay. Captured discussion source identity: 54534f32d707f270b8ccfb9a6be19b6d978e31fb671a23c6d39c239abdde860c. (scripts/bench-redaction-prefilters.ts:73, 735448c48f5e)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • eleqtrizit: 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-07T18:58:52.825Z sha 13cb52e :: needs maintainer review before merge. :: none

Use a JSON Unicode escape in synthetic key markers so the byte-level
private-key scanner accepts the fixture without any policy exception.
All 468 decoded cases and recorded output hashes remain identical.
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 7, 2026
@steipete
steipete merged commit 05e6660 into main Oct 7, 2026
144 checks passed
@steipete
steipete deleted the steipete/perf-micro-core-redactor-throughput-20260919 branch October 7, 2026 19:44
auto-merge was automatically disabled October 7, 2026 19:45

Pull Request is not mergeable

steipete added a commit that referenced this pull request Oct 8, 2026
Culprit de7c3b7 (#166539) moved health device-identity reads into the
shared SQLite worker. The threaded wizard fixture lacks its host broker.
Register the unchanged test with the existing isolated fork-based owner,
preserving real health authentication and ambient-endpoint isolation.

Validation: focused finalization/health/Doctor tests, whole wizard and
unit-fast configs, registry and planner guards, full test-types, typed and
boundary lint, complete check-changed, four real manifest shapes, and P2.
Whole tooling completed with 941 files passed and 7 skipped; its sole
failure is the inherited logging-suppression inventory from #166701.

Full infra config gate waived by coordinator: fleet at cap; registry/planner/tooling proof passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
)

* perf(logging): speed up secret redaction for large text

Skip impossible AWS windows and built-in rule scans while retaining match
order, masks, modes, registered-secret lifecycle, and mutable regex behavior.
Keep the outer word-admission gate conservative and preserve native global
replacement state when a scan is skipped.

Record synthetic byte-identity fixtures and exercise shared-regex mutation.
Move existing mask helpers into one small module so the main redactor
shrinks. Extend the existing redaction benchmark with
1 KiB, 64 KiB, and 200 KiB text and content-field workloads.

* test(logging): encode synthetic PEM fixture markers

Use a JSON Unicode escape in synthetic key markers so the byte-level
private-key scanner accepts the fixture without any policy exception.
All 468 decoded cases and recorded output hashes remain identical.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
Culprit 8b189ec (openclaw#166539) moved health device-identity reads into the
shared SQLite worker. The threaded wizard fixture lacks its host broker.
Register the unchanged test with the existing isolated fork-based owner,
preserving real health authentication and ambient-endpoint isolation.

Validation: focused finalization/health/Doctor tests, whole wizard and
unit-fast configs, registry and planner guards, full test-types, typed and
boundary lint, complete check-changed, four real manifest shapes, and P2.
Whole tooling completed with 941 files passed and 7 skipped; its sole
failure is the inherited logging-suppression inventory from openclaw#166701.

Full infra config gate waived by coordinator: fleet at cap; registry/planner/tooling proof passed
RomneyDa pushed a commit that referenced this pull request Oct 11, 2026
* perf(logging): speed up secret redaction for large text

Skip impossible AWS windows and built-in rule scans while retaining match
order, masks, modes, registered-secret lifecycle, and mutable regex behavior.
Keep the outer word-admission gate conservative and preserve native global
replacement state when a scan is skipped.

Record synthetic byte-identity fixtures and exercise shared-regex mutation.
Move existing mask helpers into one small module so the main redactor
shrinks. Extend the existing redaction benchmark with
1 KiB, 64 KiB, and 200 KiB text and content-field workloads.

* test(logging): encode synthetic PEM fixture markers

Use a JSON Unicode escape in synthetic key markers so the byte-level
private-key scanner accepts the fixture without any policy exception.
All 468 decoded cases and recorded output hashes remain identical.

(cherry picked from commit 05e6660)

Backport of 05e6660 (#166701) adapted for 2026.10.2.
parsePattern takes main's shared-policy shape (linear matchers fall through the
regex path's policy registration, from 7e27d6c); structured-properties test
takes main's consolidated form (f3698fa test-only reshuffle).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL 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