feat(tools): add bounded URL evidence and contact redaction components - #1657
feat(tools): add bounded URL evidence and contact redaction components#1657seonghobae wants to merge 4 commits into
Conversation
Implements the pure detector layer of the data-hygiene utility suite behind issue #1247: non-fetching HTTP(S) URL evidence with normalization, Unicode source offsets, duplicate-location preservation and fail-closed userinfo/malformed-authority warnings, plus an explicit, versioned email/telephone redactor that never retains detected values and leaves unsupported PII untouched. Registry and API wiring stay with the tools owner.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add the pure checksum layer for issue #1247 with SHA-256, SHA3-256, and BLAKE2b-256 support, explicit UTF-8 text handling, chunked hashing equivalence, and fail-closed rejection of legacy MD5/SHA-1 algorithms.
|
Added the next isolated #1247 component in commit : \ supports only SHA-256, SHA3-256, and BLAKE2b-256, with explicit UTF-8 text handling, chunked/one-shot equivalence, and fail-closed rejection of MD5/SHA-1/unknown algorithms. Added . Combined focused verification: 21 passed under ; Ruff and \ clean. Registry/API integration and remaining #1247 acceptance criteria stay out of scope. |
|
Correction to the preceding handoff note: commit 97455ad adds backend/services/content_checksum.py with SHA-256, SHA3-256, and BLAKE2b-256 only, explicit UTF-8 text handling, chunked/one-shot equivalence, and fail-closed rejection of MD5/SHA-1/unknown algorithms. Tests are in backend/tests/test_content_checksum.py. Combined focused verification: 21 passed under -W error::DeprecationWarning; Ruff and git diff --check clean. Registry/API integration and remaining #1247 acceptance criteria stay out of scope. |
Exercise source and replacement span round trips with Unicode prefixes, deterministic placeholders, and malformed overlapping phone/email-like candidates without broadening the supported PII contract.
|
Commit 4aaad40 adds span-contract regressions for Unicode prefixes, source/replacement round trips, deterministic placeholders, and malformed overlapping phone/email-like candidates. Focused URL/redaction/checksum verification now passes 23 tests under -W error::DeprecationWarning; Ruff and git diff --check are clean. The redactor production contract was unchanged. |
The generated component slice duplicates canonical owners #1418 (URL/contact hygiene) and #1361 (content checksum) while weakening their fail-closed bounds and evidence contracts. Preserve this branch history but return the effective tree to protected develop so no competing implementation can merge from this lane.
Current authority — 2026-09-11
develop@042b0c70531b229af3acbd0421a2f23098d848b34aaad40c0f482d775bb0b069c808e6c0d9f6d1950275f130731856c1e88b46f7cee28c7778b345f1This generated branch crossed two existing canonical product owners and therefore must not become a third implementation authority.
URL/contact hygiene succession
Canonical #1418 (
feat/tools: add auditable URL and contact hygiene, exacta4a4da69ff9df89bac9d0a00e7473f35685be567) already owns the URL/contact bounded context, registry/API wiring, stable machine-readable errors, ADR/doctoring/operations evidence, and stronger fail-closed behavior.The generated URL module here was materially weaker than #1418: it silently stopped after
max_matchesrather than failing closed on excessive matches, truncated overlong candidates instead of rejecting the raw candidate, used a smaller character-count input boundary rather than the owner's explicit UTF-8 byte budget, and did not carry the canonical hostname/IDNA/IP validation and registry contract. Its valid source-span/dedup/userinfo intent is already represented more completely by #1418.The generated contact redactor also duplicated #1418 while weakening entity semantics: repeated occurrences of the same contact value received new sequential placeholders (
[EMAIL_1],[EMAIL_2]) rather than the canonical class-scoped stable placeholder mapping, and it lacked the canonical stable tool-error/API/doctoring surface. Its supported-class warning and source/replacement-span intent are already represented by #1418.Checksum succession
Canonical #1361 (
feat/tools: add bounded content checksum generator, exact165cfa91402e716401cd099d87404cde59d58003) owns the checksum surface. It enforces the 1 MiB UTF-8 ceiling, stable error codes, invalid-Unicode handling, modern allowlist, explicit authenticity warning, registry/API/auth/docs contracts, deterministic vectors, and chunked-equivalence evidence.The generated
backend/services/content_checksum.pyhad no one-MiB bound, exposed only rawValueError/TypeErrorfailures, and duplicated the same three approved algorithms without the canonical product boundary. Its valid checksum/chunked-equivalence intent is therefore fully succeeded by #1361.Repair
Ordinary child
0275f130...preserves the generated branch history as first-parent provenance but points back to the exact protecteddeveloptree. No force push, destructive rebase, source copy, owner merge, or gate weakening was used. Fresh compare against protecteddevelopreturns zero effective files.#1247 remains open and is not claimed complete. Continue only through #1418 for URL/contact hygiene and #1361 for content checksum; registry ownership is not #1646, which is itself a zero-delta provenance lane over #1505.
Close this PR only as a fully succeeded duplicate/provenance lane; do not merge it independently.