Repository navigation
feat(pii-kr): report every hit, not the first - #103
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Groundwork for #102. No behaviour change at the proxy.
checkstops 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_allkeeps the same allow-wins ordering. Text anallowrule 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
checkdenies,check_allmust find something incheckallows,check_allmust return empty forThose 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::inspectmaps 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