feat(scrub): bread-scrub, allowlist-first PII scrubber for breadbug #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/breadbug-scrubber"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of BREAD-15 and BREAD-37: the library half only.
Scope gate (coordinator, 2026-10-13): this PR delivers and is reviewed as the bread-scrub library. The cards' consumer criteria (scrub on breadd ingest and again at report time including notes, and markers staying distinguishable across restarts and multiple ingest scopes) stay open on BREAD-15 and BREAD-37. They are verified on main after the stacked store PR #22 (BREAD-14) and report PR #23 (BREAD-19) land. Merging this PR does not complete either card.
Part of epic ECO-EP1 (breadbug). Spec: ECO-66.
What
New workspace crate
bread-scrub, used twice by breadbug: on ingest into the breadd store and again at report time (including the user's notes).EventAllowlistnames the fields; a dropped payload keeps only_droppedand safe-looking top-level key names.<IP:1>,<IP:2>), the table stores only salted hashes, capped at 4096 per category (<IP:+>beyond).scrub_textruns to a fixpoint.keep_build_id); legacy-mangled Rust symbols are parsed exactly so a_ZNprefix cannot exempt trailing text.stats()gives per-category redaction counts for the preview.Tests
cargo clippy --all-targets -D warnings,cargo fmt,xtask check-docsclean.Known limits (documented in the crate docs)
v1.2.3.4) are treated as IPs; this errs toward redaction.Not in this PR
Wiring into breadd's store (BREAD-14) and the report builder (BREAD-19).
Independent review: changes requested
Issue: BREAD-15. Exact reviewed head:
4dec9ea9f5. Live base main:2b240df78a; diff merge-base:56531bb48a. Expected head matches. Reviewed all 6 changed files, complete actual PR diff; PR and file lists exhausted at page 2. No merge authorized or performed. Primary checkout untouched; isolated detached clone: /home/breadway/.worktrees/bread/feature/bread-15-independent-review.Acceptance mapping
Actionable repair checklist
All lib.rs references below are bread-scrub/src/lib.rs at the reviewed SHA. Reproduced using a separate rustc probe linked against the exact crate rlib, with no tracked source edits. Findings deduplicated and filed as BREAD-37 / bread issue #36.
Commands and CI evidence
56531bbHEAD --check: PASS.4dec9ea9f5, run status success. check.yml runs workspace clippy and tests; release workflows are main/tag-only and not expected on this head. Branch protection list is empty. AGENTS.md/CONTRIBUTING.md claims no branch CI, but actual check.yml and live CI supersede that stale documentation.Verdict: changes_requested, not a CI-only block. Move BREAD-15 to todo for coordinator rework. Preserve stacked dependencies and all branches; no done transition. After defects are repaired, the full two-pass/notes integration requirement still needs reviewed observable evidence. Explicit user authorization remains necessary for any future bread merge.
Independent re-review: changes requested
BREAD-15 and BREAD-37, exact head
3616fcf9cc. Expected head matches. Base main7428366e71; diff merge-base56531bb48a. Read the actual cards/comments and ECO-66, BREAD-14, BREAD-19 dependencies. PR and file lists exhausted (6 files), complete diff reviewed in clean detached worktree feature/review-pr21-3616fcf. No merge, branch deletion, primary checkout edits, remote host or desktop access.Acceptance and prior rejection 4248
Required repairs on this existing PR
Independent checks
cargo test -p bread-scrub --locked: 27 unit + 7 corpus/fuzz PASS, including 2 x 20,000 fuzz iterations. cargo clippy -p bread-scrub --all-targets --locked -- -D warnings PASS; cargo fmt -p bread-scrub -- --check PASS; cargo run -p xtask --locked -- check-docs PASS; git diff merge-base HEAD --check PASS. Probe: /tmp/opencode/pr21-probe/src/main.rs and results.txt. No full-workspace pass claimed: old-head BREAD-30 failures/stall remain unwaived; BREAD-30 has since merged separately and is outside this review's mutation scope.
Exact-head required check / check (push), Actions run 124, is PENDING in live individual status API. Branch protections empty; actual check.yml requires workspace locked clippy and tests. Authenticated reviews API returned [] and comments API showed rejection 4248, which is not fully resolved by these repairs. CI cannot be bypassed, and this code rejection is not hidden behind CI.
Verdict: changes_requested for both cards. Move to todo for coordinator rework, preserve PR #21 and all stacked branches. After repairs, obtain fresh exact-SHA review and CI-green integration evidence. Authorized merge not exercised; neither card is done. Coordinator retains final integrated verification responsibility.
Independent review: blocked
BREAD-15 / BREAD-37 exact head
39ff313058; base main7428366e71. Complete 6-file PR diff reviewed in clean detached feature/review-pr21-39ff313. PR list (22 entries), files (6), comments and reviews paginated to exhaustion. Actual issue/comments and ECO-66, BREAD-14/19/16/17 read. No merge or retarget.Criterion mapping:
Independent commands at PR21: cargo test --locked --workspace PASS377 including28 scrubber units+7 corpus/fuzz; cargo clippy --locked --workspace --all-targets -- -D warnings PASS; cargo fmt --all -- --check PASS; cargo run --locked -p xtask -- check-docs PASS; git diff base...head --check PASS. Logs /tmp/opencode/review-bread15/{tests21,clippy21,fmt21,docs21}.log. Graph query is stale for scrubber, immutable source used.
Required exact-head check / check (push) remains PENDING, Actions129/job0, latest individual status says started. Actual .forgejo/workflows/check.yml requires workspace locked clippy/build/tests; main/tag release workflows not expected on feature head. Branch protection list empty; authenticated reviews API [] and previous comment rejections4248/4284 read. No waived criteria or self-approval.
Blockers: full two-pass consumer integration not accepted; required CI pending. Concrete next action: resolve dependency acceptance strategy without waiving full issue criteria (review/include actual consumers or explicitly reconcile library-only prerequisite scope), repair store defects BREAD-40 and missing journal ingestion, publish report repair when BREAD-39 resolved, then fresh head-bound review and CI. Dependency cycle is not permission to merge stack backwards. Cards remain review; coordinator retains integrated verification before done. All user branches/graph edits preserved.
Independent exact-head review: blocked full-card acceptance, library checks pass
BREAD-15 and BREAD-37. Reviewed head
39ff313058matches expected. Base has advanced from7428366e71to05125ef00c. Fresh API read confirms unchanged head/base and mergeable=true. No merge performed, no branches deleted, no cards marked done.Read actual cards, comments, ECO-66, BREAD-14 and BREAD-19. PR21 explicitly closes BREAD-15 and excludes consumer wiring. Enumerated all 22 PRs and all 6 changed files to empty next pages; complete 1731-line diff reviewed. Comments endpoint repeats the same three IDs on later pages rather than honoring pagination; all three unique comments read. Authenticated reviews endpoint returns [] (no formal outstanding change request); earlier comment rejections 4248/4284/4307 are accounted for below. Graphify lacks scrubber nodes, so immutable source is authoritative.
Criterion mapping
CI and independent integration checks
Required check / check (push) SUCCESS at exact head. Run129 (API id2398), job0/id2403, attempt2: setup, checkout, clippy, workspace build, test and completion individually SUCCESS; 47m49s. Evidence: https://git.breadway.dev/Breadway/bread/actions/runs/129/jobs/0/attempt/2 . Prior failed attempt is historical, not waived. Branch protections [] and actual check.yml read; main/tag release jobs not required on feature head.
Isolated owned clone ~/.worktrees/bread/feature/review-pr21-final-39ff313; primary and existing user worktrees untouched. cargo test -p bread-scrub --locked PASS35; targeted locked clippy PASS; workspace fmt PASS. Conflict-free git merge-tree of live base+head yields tree9900739e7653d9962e96a185da2807138ca8fad8. Checked out that tree without creating a commit: cargo build --workspace --locked PASS; cargo test --workspace --locked PASS377; cargo clippy --workspace --all-targets --locked -- -D warnings PASS; cargo run -p xtask --locked -- check-docs PASS. Main delta is only ram registry and its assertion. Logs /tmp/opencode/review-pr21-final/{scrub-tests,clippy,fmt,combined-build,combined-tests,combined-clippy,combined-docs}.log.
Scope decision and next action
Library implementation is acceptable in isolation, with no newly identified library defect. I reject declaring either entire card PASS under its current acceptance criteria: required consumer behavior remains unverified, and pass requires every criterion verified. This is an external integration/scope blocker, not changes_requested for library code. Merge authorization does not waive acceptance criteria. No merge exercised.
Coordinator can explicitly split/reconcile the actual linked cards and closing references into a library-only prerequisite acceptance gate while retaining all two-pass and restart-marker requirements as tracked downstream acceptance, then request a fresh scope-bound gate. Alternatively review/include the actual consumer implementation and obtain real integrated two-pass/restart/notes evidence. Preserve PR21 and stacked branches; leave BREAD-15 and BREAD-37 in review. A merged prerequisite must never be reported as the completed feature. No implementation changes requested on this head. Full-card verdict: blocked. Library-only assessment: pass, not full-card acceptance.
Scope reconciliation for the review at #21 (comment). PR21 no longer closes BREAD-15; its body now scopes it as the library half of BREAD-15 and BREAD-37. The two-pass ingest and report criteria and the cross-restart, multi-scope marker criterion stay open on both cards. They are verified on integrated main after PR22 and PR23, and neither card moves to done on this merge.
Independent scope-bound pass: library prerequisite only
Exact head39ff3130583485dada208fe3c470954cacb56317; reviewed base05125ef00c1589616c730920995faa3c96dcdf46. Re-read live PR body and both cards/comments: scope reconciliation accepted. Closing reference is absent from live PR body. Breadboard still retains the stale BREAD-22 closes BREAD-15 link; this is sync metadata, not acceptance or completion evidence.
Every library criterion passes with criterion/file/test mapping in review4498: allowlist/default dropping, seeded PII pattern and prior-leak regression coverage, deterministic/idempotent output, useful distinct in-scope markers and existing-marker reservation, golden corpus and panic/non-UTF8 fuzz/property checks. Independent exact-head28 units+7 corpus/fuzz, targeted clippy and workspace fmt passed. Combined current base/head tree9900739e7653d9962e96a185da2807138ca8fad8 passed locked workspace build,377 tests, workspace clippy and docs. Required check / check (push) run129/job0 attempt2 and every job step success at this exact head.
This supersedes the scope blocker in4498 only for the explicitly reconciled library prerequisite. Full BREAD-15/BREAD-37 acceptance remains open: actual two-pass ingest/report notes and cross-restart/multi-scope distinguishability must be independently verified on integrated main after accepted PR22/23. No criteria waived or cards completed. Authorized normal merge will preserve feature/breadbug-scrubber for PR22; final head/base/check/review recheck required immediately before API merge.
Integration result: authorized normal merge confirmed merged=true at4a164fd98a9c749a6afa1ffd7b70ce0a5df83b86, accepted head39ff3130583485dada208fe3c470954cacb56317 into checked base05125ef00c1589616c730920995faa3c96dcdf46. Expected-head condition used; delete_branch_after_merge=false, force_merge=false. Head/base, required individual check, job steps, reviews and mergeability freshly checked immediately before request. feature/breadbug-scrubber preserved for stacked PR22. Scope-bound pass4523 applies only to library prerequisite; BREAD-15 and BREAD-37 both freshly confirmed review, not done. Coordinator must verify integrated behavior and all retained consumer criteria after accepted PR22/23. Stale breadboard closes metadata is not completion evidence.