Repository navigation
feat(api): PII scrubbing Phase 3b — historical backfill CLI - #475
Merged
Merged
Conversation
Add a scoped, idempotent backfill job with dry-run reporting, batched per-row updates, optional session/fingerprint scrubbing, and resilient partial-failure handling. Co-authored-by: Cursor <[email protected]>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 692799e. Configure here.
Require exactly one of --project-id/--org-id and exit non-zero when the resolved project query is empty so operators cannot mistake a no-op for a successful scrub. Co-authored-by: Cursor <[email protected]>
Share the per-table row budget across projects under --org-id so limit is not multiplied by project count. Empty-scope failure was already fixed on this branch. Co-authored-by: Cursor <[email protected]>
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.

Summary
Implements the remaining historical backfill work from #470.
pnpm --filter api pii-scrub-backfill(requires--project-idor--org-id; no global runs)properties), occurrences (stack/context), groups (message/top_stack)--include-sessionsand projectscrubSessionUserEmail--scrub-fingerprintsis opt-in and skips unique conflictsSafety verification
--dry-runnever writes--fail-fast)Example summary:
Final #470 status
After this PR merges, #470 is complete for:
Track separately (not in this PR):
Please close #470 after merge (do not use
Closeshere so merge can proceed independently of follow-up issues).Test results
Test plan
pnpm --filter api pii-scrub-backfill -- --help--dry-run --project-id …shows scanned/modified with no DB writes--include-sessionswithout project flag → sessions untouched--scrub-fingerprintswith colliding fingerprints → conflict count > 0, group associations intactMade with Cursor