Skip to content

id-core: succeeds version DAG with pending ancestry and branch heads - #11976

Merged
dezren39 merged 1 commit into
mainfrom
claude/succeeds-version-dag
Nov 19, 2026
Merged

dezren39 merged 1 commit into
mainfrom
claude/succeeds-version-dag

Conversation

@dezren39

@dezren39 dezren39 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Refs #10223

Before: id-core had no succeeds edge. A new version of an object could not be linked to the version it replaces in the graph, and nothing checked lineage for cycles or kept competing heads visible.

After: graph/version.rs stores (predecessor_v1, succeeds, successor_v2) edges in a version DAG. It rejects self-edges, cross-object and cross-schema edges, and any edge that would close a cycle in complete ancestry. An edge that names a version not yet known stays pending and is re-checked when that version arrives. Every head stays observable, and only an explicit owner selection picks one (no timestamp or arrival-order tie-break). Legacy board Supersede records map onto an edge only through adapt_supersede, which needs the caller's proof of the same signer and checks the same object and schema; the record itself is never rewritten.

How:

  • SucceedsEdge round-trips through a canonical Triple from Typed triple identity and canonical signed records #10196 with a id/succeeds relation-name predicate (type tag 1, provisional until a term-tag registry exists).
  • VersionDag keeps a forward index and a reverse (v2 → v1) index; direction is always stored v1 → v2. Errors carry the design's classes: wrong_logical_object, invalid_successor, lineage_cycle. Pending and concurrent heads are results, not errors.
  • Oracle is the model one from the issue: tests/succeeds_dag.rs has 8 fixtures (direction, cycles, pending then cycle on arrival, branches and merge, owner selection, Supersede mapping) plus a property test that runs the DAG beside an independent dense-matrix model with closure recomputed every step, comparing outcomes, accepted edges, pending edges and heads after every operation (512 cases).
  • Mutation check: 18 hand mutants, all killed after removing two redundant code paths they exposed.
  • Signature checks, edit authorization and the V3 comment carry-forward view stay with their owners. Not wired into graph/mod.rs; slice 9110-09 owns that, so the test includes the file by path.

Test: cargo test -p id-core --test succeeds_dag (9 passed); clippy clean on the new files.


Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Adds graph/version.rs: (v1, succeeds, v2) edges, rejection of self,
cross-object, cross-schema and cyclic edges, pending edges for unknown
versions, every head kept observable with owner selection only, and an
explicit adapter from legacy Supersede records. Tested against an
independent adjacency-matrix model.

Refs #10223

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 requested a review from a team as a code owner November 19, 2026 00:28
@dezren39
dezren39 merged commit 5e74f7d into main Nov 19, 2026
@dezren39
dezren39 deleted the claude/succeeds-version-dag branch November 19, 2026 00:28
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f6f099fb-849f-4ffc-8f12-bebb633c3c64
Commits

Reviewing files that changed from the base of the PR and between 94d353f and 1ad70ee.

Files selected for processing: 2

  • pkgs/id/crates/id-core/src/graph/version.rs
  • pkgs/id/crates/id-core/tests/succeeds_dag.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T00:29:42.130193Z 1ad70ee PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants