-
Notifications
You must be signed in to change notification settings - Fork 1
feat(email): deterministic dedupe provenance — gate strong fingerprints on genuine Date (naruon#1086) #1195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
47
commits into
develop
Choose a base branch
from
claude/contextualwisdomlab-audit-governance-qyxe67
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 46 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
d948528
feat(email): preserve dedupe provenance from genuine Date headers
seonghobae 8682434
chore(pr1195): materialize reviewed provenance fixes
seonghobae e249788
ci: fix source-bound email deduplication
seonghobae a2124fb
chore(pr1195): remove superseded review-fix workflow
seonghobae 6580d40
chore(pr1195): repair source-dedupe materializer
seonghobae 138157b
fix(ci): trigger PR 1195 materializer repair on review transition
seonghobae f9efcf7
fix(ci): make PR 1195 materializer repair structural
seonghobae 1c4c781
fix(ci): preserve escaped POP3 assertion in PR 1195 repair
seonghobae 112c2d5
ci: make source-bound dedupe repair deterministic
seonghobae 7a76bb4
ci: replace brittle PR 1195 materializer
seonghobae cd68cbe
ci: remove superseded PR 1195 repair helper
seonghobae 08a7cb1
ci: finalize PR 1195 source-bound dedupe
seonghobae 3a35907
ci: harden PR 1195 source-identity finalizer
seonghobae 97bf6d4
ci: repair PR 1195 source-identity finalizer
seonghobae 3b7fa3c
ci: remove superseded PR 1195 repair helper
seonghobae 1f72d4d
ci: repair PR 1195 finalizer date cleanup
seonghobae 0cc519f
fix(ci): execute PR 1195 date cleanup helper
seonghobae 8557cad
ci(pr-1195): bootstrap finalizer guard repair
seonghobae d05a500
ci(pr-1195): activate finalizer bootstrap
seonghobae 0508cc7
fix(ci): trigger PR 1195 cleanup on synchronization
seonghobae 1ab3939
fix(ci): consolidate PR 1195 finalizer repair
seonghobae 4d584bf
fix(ci): make PR 1195 helper workflow valid
seonghobae e4b0c59
ci: repair empty replacement handling in PR 1195 finalizer
seonghobae 121d5ac
chore(pr-1195): remove temporary finalizer bootstrap
seonghobae fa48028
chore(pr-1195): remove temporary finalizer hotfix
seonghobae ca63640
chore(pr-1195): remove temporary date repair workflow
seonghobae 7fd7d48
chore(pr-1195): remove temporary source finalizer
seonghobae c51131c
test(email): prove source-bound fallback identity
seonghobae 6e69b8e
chore(email): add one-shot source identity repair script
seonghobae 96fd422
test(email): add source-bound fallback regressions
seonghobae 64d5a84
fix(ci): make source-identity repair workflow valid
seonghobae 898201e
docs(email): record source-bound identity contract
seonghobae 2412770
ci(email): repair POP3 source-byte reconstruction
seonghobae 4c6b21a
fix(email): bind fallback dedupe to immutable source
github-actions[bot] 6622f65
Merge branch 'develop' into claude/contextualwisdomlab-audit-governan…
opencode-agent[bot] 4369f80
test(email): reject unsupported canonical source values
seonghobae 375d6c5
fix(email): validate canonical source value types
seonghobae 24efad3
docs(email): summarize record-linkage evidence model
seonghobae 596aeb6
Merge protected develop into email dedupe provenance
seonghobae 26dfa22
Merge branch 'develop' into claude/contextualwisdomlab-audit-governan…
opencode-agent[bot] bee6519
merge(develop): refresh email dedupe provenance
seonghobae 510ec77
Merge branch 'develop' into claude/contextualwisdomlab-audit-governan…
seonghobae f6e60ef
Merge branch 'develop' into claude/contextualwisdomlab-audit-governan…
seonghobae f98c6fe
Merge branch 'develop' into claude/contextualwisdomlab-audit-governan…
cursoragent 6aeda8f
Merge branch 'develop' into claude/contextualwisdomlab-audit-governan…
opencode-agent[bot] c7aedc6
Merge remote-tracking branch 'origin/develop' into HEAD
seonghobae 0b74bef
Merge branch 'develop' into claude/contextualwisdomlab-audit-governan…
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| """add date_provenance to email_records | ||
|
|
||
| Revision ID: 0018_email_date_provenance | ||
| Revises: 0017_merge_newsdom_carddav_heads | ||
| Create Date: 2026-07-30 00:00:00.000000 | ||
|
|
||
| Records the provenance of each stored email ``date`` so a synthetic | ||
| collection-time fallback (missing/invalid RFC822 Date header) is never treated | ||
| as original sender metadata when seeding a strong auto-dedupe fingerprint | ||
| (naruon#1086). Nullable-free with a ``"unknown"`` server default so existing | ||
| rows backfill safely: their date provenance is genuinely unknown, and only | ||
| ``"parsed"`` rows are eligible to seed a strong fingerprint, so the backfill is | ||
| conservative (it can only widen review, never manufacture a duplicate). | ||
| """ | ||
|
|
||
| from alembic import op | ||
| import sqlalchemy as sa | ||
|
|
||
| revision = "0018_email_date_provenance" | ||
| down_revision = "0017_merge_newsdom_carddav_heads" | ||
|
|
||
| _EMAIL_TABLE = "email_records" | ||
| _PROVENANCE_COLUMN = "date_provenance" | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| """Add the ``date_provenance`` column, backfilling existing rows to unknown.""" | ||
| connection = op.get_bind() | ||
| inspector = sa.inspect(connection) | ||
| columns = {column["name"] for column in inspector.get_columns(_EMAIL_TABLE)} | ||
| if _PROVENANCE_COLUMN not in columns: | ||
| op.add_column( | ||
| _EMAIL_TABLE, | ||
| sa.Column( | ||
| _PROVENANCE_COLUMN, | ||
| sa.String(), | ||
| nullable=False, | ||
| server_default="unknown", | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| """Drop the ``date_provenance`` column if present.""" | ||
| connection = op.get_bind() | ||
| inspector = sa.inspect(connection) | ||
| columns = {column["name"] for column in inspector.get_columns(_EMAIL_TABLE)} | ||
| if _PROVENANCE_COLUMN in columns: | ||
| op.drop_column(_EMAIL_TABLE, _PROVENANCE_COLUMN) |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.