Skip to content

feat(pii-kr): report every hit, not the first - #103

Merged
CharmingGroot merged 1 commit into
mainfrom
feat/pii-kr-all-hits
Sep 1, 2026
Merged

CharmingGroot merged 1 commit into
mainfrom
feat/pii-kr-all-hits

Conversation

@CharmingGroot

Copy link
Copy Markdown
Owner

Groundwork for #102. No behaviour change at the proxy.

check stops at the first match. That is enough to refuse on, and it is the reason masking cannot be built yet: redacting one occurrence and forwarding the rest is not redacting.

The priority rule is preserved, deliberately

check_all keeps the same allow-wins ordering. Text an allow rule excuses is empty here too — two functions that judge the same text differently would put blocking and masking out of step, and one passing what the other hides means one of them is wrong.

Tested as a relationship, not in isolation

  • whatever check denies, check_all must find something in
  • whatever check allows, check_all must return empty for

Those two together are the property that matters. Either alone would keep passing while the pair drifted apart.

Plus: multiple occurrences yield multiple hits with distinct spans, and the no-value-in-the-hit property holds regardless of count.

The adapter

PiiKr::inspect maps every hit instead of the first, so a redactor reading findings will see all of them. At the proxy this changes nothing today — one finding refuses a request exactly as before, and refusing on the first of several is the same refusal.

🤖 Generated with Claude Code

check stops at the first match. That is enough to refuse on, and it is the
reason masking cannot be built yet: redacting one occurrence and forwarding the
rest is not redacting.

check_all returns all of them, and keeps the priority rule identical. Text that
an allow rule excuses is empty here too, because two functions that judge the
same text differently would put blocking and masking out of step — one passing
what the other hides means one of them is wrong.

Tested as a relationship rather than in isolation: whatever check denies,
check_all must find something in; whatever check allows, check_all must return
empty for. Those two together are the property that matters, and either alone
would pass while the pair drifted.

The proxy adapter now maps every hit instead of the first, so a redactor reading
findings will see all of them when there is one.

Groundwork for #102. No behaviour change at the proxy: one finding refuses a
request exactly as before, and refusing on the first of several is the same
refusal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@CharmingGroot
CharmingGroot merged commit 978c990 into main Sep 1, 2026
7 checks passed
@CharmingGroot
CharmingGroot deleted the feat/pii-kr-all-hits branch September 1, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant