rfc: add RFC 0044, derived edge identity via @key on edge types - #592
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
azimafroozeh
force-pushed
the
edge-keys-rfc
branch
from
September 1, 2026 09:32
69b1435 to
d8c8c0f
Compare
5 tasks
Contributor
|
Small fixes:
|
This was referenced Sep 1, 2026
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.
What & why
Adds RFC 0044, "Edge keys: derived edge identity" (maintainer track, draft). This is the design for issue #583.
What it is: an edge key is declared identity for a relationship.
@key(src, dst)on an edge type says there is at most one such edge between two endpoints, and the endpoint pair is its identity. Nodes already have exactly this (@key(name)means one Person row per name); edges don't, the parser refuses@keyon them.Why we need it: without declared identity every edge insert mints a random ULID id, and branch merge keys rows on
id. When two branches insert the same relationship (Alice knows Bob, once per side of a fork), the merge sees two different ids and keeps both rows (#583). The duplicate is silent: edge counts and bound-edge traversals go wrong and no conflict is raised. Branch-and-merge is the core write workflow, so any graph with two writers hits this.The proposal: for a keyed edge type the id is derived from the key instead of minted, using the canonical encoding keyed nodes already use. Both branches then derive the same id and the merge converges to one row; the same key with different non-key properties surfaces a typed
divergent_insertconflict instead of silence. Unkeyed edge types are untouched: parallel edges stay legal and existing graphs are unaffected.Diff: the RFC file plus its registry row, no code.
Backing issue / RFC
Checklist
Local verification
python3 scripts/check-docs.py: OK, 114 files (frontmatter, registry row, and links validate)cargo test: not run, docs-only diffNotes for reviewers
ir_versionquestion from review is settled for this RFC: the edge-key number is 3, fixed at acceptance, not at implementation time (Design change 6, Compatibility). The cross-feature scheme raised on rfc: add RFC 0040, the system column namespace #546 (independent features against one linear scalar) is deliberately out of scope here and deferred to a dedicated versioning RFC (tracked by RFC 0040's unresolved question 1).implementation: in-progress: the full implementation (engine changes, tests, DST updates, user docs) is open as feat(engine): add edge keys with derived identity #593; bug: merge duplicates an edge added on both sides of the fork, and plain traversal hides the extra row #583 is closed there, not by this PR.