Repository navigation
A merge keeps the identity evidence of the name it dedupes - #1466
Merged
WaylandYang merged 2 commits intoOct 30, 2026
Merged
WaylandYang merged 2 commits into
WaylandYang merged 2 commits into
Conversation
…surviving fact, and undoing the merge should take back only what it copied. Signed-off-by: Aschenbath <Aschenbath@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WaylandYang
approved these changes
Oct 30, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this reads well and the supersedes walk is the right call. Merging.
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.
Closes #1426.
What this does
merge_entitiesinvalidates a duplicate fact (same subject, predicate, object andvalid_fromafter the merge) but copied only itstyped_fact_sources, not itsfact_evidence. If the duplicate was a name with evidence from an identity source (0071) and the survivor was the same name from prose, recorded earlier, the survivor lost its identity status. Decision 2's exact-name attach and decision 7's hold (#1425) then stopped applying to it.ON CONFLICT DO NOTHING). If a copied row is identity evidence, the survivor's name vector is deleted in the same transaction (0071 decision 5), through a newname_vectors::drop_with_identity_evidence.entity_merges.copied_evidence_facts/copied_evidence_chunks(migration0125).revert_mergedeletes those pairs before it revives the duplicates, which still carry their own evidence. It followssupersedesfrom each recorded fact, the chainwith_rewriteswalks, because a corrected interval, a timeline close or the revert's own rehome copies evidence onto a new row. Evidence the survivor had before the merge stays. If the survivor no longer has identity evidence, its name is pending again and the next extraction gives it back a vector, as when a source turns the identity flag off (decision 6).The duplicate's evidence is copied, not moved, as the
typed_fact_sourcescopy just above it is, so the revert has it in place.Record
This makes ADR 0071 hold across a merge and doesn't overturn any of its decisions. Its status line now names migration
0125, a revision note below decision 7 records the change, anddocs/design/identity.mdsays whatrevert_mergetakes back.Open
(fact, chunk)pair is written again by an extraction after the merge, the insert sees the copied row and leaves it. A revert then deletes it, and the evidence returns with the next extraction of that chunk. The ledger can't tell those apart without changing every evidence writer, and I think that trade is acceptable.CURRENT_SCHEMA_VERSIONgoes to 111. A base can opt into confirming well-grounded mapping definitions, and a person can take any of them back #1332 also takes 111 with0124, so whichever lands second moves to 112.How it was checked
In a Linux container with
pgvector/pgvector:pg16, commit516c22cfondev1d94b532:cargo fmt --all --checkandcargo clippy --locked --workspace --all-targets -- -D warnings: clean.cargo test --locked --workspace --no-fail-fast: 1,809 passed, 6 ignored, 1 failed. The failure isreal_postgres_backup_and_restore_require_force_and_preserve_files_on_sql_failure, which needspg_dump. My check image doesn't have it, so CI is the evidence for that test.a_merge_keeps_the_identity_evidence_of_the_name_it_dedupesfails.(fact, chunk)pairs,undoing_a_merge_takes_the_copied_evidence_off_a_rewritten_namefails: the corrected name still holds both chunks. It passes with thesupersedeswalk, for a survivor from either side of the merge.🤖 Generated with Claude Code