Repository navigation
fix(security): keep UUIDs intact through Sanitizer phone redaction - #54
Open
minerva-sky wants to merge 1 commit into
Open
minerva-sky wants to merge 1 commit into
minerva-sky wants to merge 1 commit into
Conversation
TaskFailure#initialize runs message and context through Security::Sanitizer. The loose phone pattern matched any UUID whose 2nd and 3rd groups are all digits (~4% of SecureRandom.uuid values), turning e.g. 73fb9a6e-9973-4748-87aa-… into 73fb9a6e-[REDACTED_PHONE]-87aa-… and corrupting dependency_id / task ids. This is the random red on the Ruby 3.2.4 CI job for codenamev#40, codenamev#50, codenamev#51 and codenamev#53 (plan_orchestrator_spec 'skips transitively through the graph'). Mask UUID spans with placeholders before applying PII patterns and restore them after; add a regression spec with a digit-heavy UUID. Co-Authored-By: Claude Fable 5.1 <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.
Problem
The Ruby 3.2.4 CI job goes red at random on #40, #50, #51 and #53 — always the same example,
plan_orchestrator_spec"skips transitively through the graph", with output like:Not a Ruby/Linux/ordering issue — the mask is produced inside the object under test.
TaskFailure#initializesanitizesmessageandcontextthroughSecurity::Sanitizer, whose second phone regex matches any UUID whose 2nd + 3rd groups are all digits (9973-4748). About 4% ofSecureRandom.uuidvalues qualify, so every spec that asserts on adependency_idor an id inside a failure message flakes at that rate. Local runs just got lucky.Fix
Sanitizer#sanitize_stringmasks UUID spans with placeholders before the PII patterns run and restores them afterwards (PROTECTED_SPANS). Fixes message and context together.Probe: 2000 random UUIDs through the sanitizer → 0 mangled (was ~4%).
Verified under ruby 3.2.4,
--order defined: sanitizer + task_failure + plan_orchestrator specs, 57 examples, 0 failures; standardrb clean.Once merged, rebasing #40/#50/#51/#53 (or just re-running their CI after main moves) should turn the 3.2.4 job green.
🤖 Generated with Claude Code