Skip to content

id: graph token object formats + snapshot anchoring spec (#2251) - #2741

Merged
dezren39 merged 6 commits into
mainfrom
queue/3406-2251-graph-token-spec
Oct 31, 2026
Merged

dezren39 merged 6 commits into
mainfrom
queue/3406-2251-graph-token-spec

Conversation

@dezren39

@dezren39 dezren39 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Design spec for #2251, delivering the follow-on from the #2041 investigation (queue task 3406). Spec only — no implementation, per the program rule that no permanent feature is built on the unreviewed #2041 investigation.

Lands: doc/2026-10-30T13-25-00Z_design_graph_token_formats_snapshot_anchoring.md (the pkgs/id/doc/ path — a symlink to the repo-root doc/).

Covers all five points from #2251:

  1. Wire formats for the seven token object types as bodies of the existing signed-event envelope (pkgs/id/src/chain.rs), incl. currency-ID derivation (issuer, BLAKE3(definition)) and gcd-reduced exact rational rates.
  2. Fold rules for graph-native balances/supply: per-author chain ordering, overdraft → void (applied/void split), fork treatment, and what a id: investigate: trust/visibility model — servers accept all signed objects; views count only allowed writers #2030 counting view must refuse (over-cap issuance, overdrawn transfers, unresolved-fork objects).
  3. Snapshot format + the mechanical three-way reconciliation join against TigerBeetle via user_data_128 (low 128 bits of the event ID; conversion legs share the receipt's conversion ID).
  4. App-function API surface (define_currency / issue / award / pay / balance / supply / accept_payment / convert / snapshot) with error semantics, identical across both bindings; binding-specific verification steps spelled out for accept_payment.
  5. Conversion execution checklist: offer-version citation, frontier freshness, rounding in the LP's favour with the spread as a separate auditable leg, receipt emission.

Each #2041 abuse case (1–7) is traced to a spec mechanism or an explicitly accepted residual risk (§6). Questions the spec cannot settle — snapshot signer/cadence for the developing-today deployment, issuer key-rotation mechanics, shared fold/index service, #2042 receipt interplay — are listed for the #2043 synthesis (§7), not decided silently. #2043 remains gated on #2042.


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

@dezren39
dezren39 requested a review from a team as a code owner October 30, 2026 13:21
@coderabbitai

coderabbitai Bot commented Oct 30, 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 32 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: a55fd8b5-60ad-4778-937a-d0d452693f41
Commits

Reviewing files that changed from the base of the PR and between 72545cb and e1feebd.

Files selected for processing: 1
  • doc/2026-10-30T13-25-00Z_design_graph_token_formats_snapshot_anchoring.md
  • 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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T00:42:14.407890Z e1feebd Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60cf9a3545

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- §2: define the cross-author credit frontier (causal ancestry) used by the fold
- §3: normalize ledger accounts to holder pubkeys before comparing balance roots
- §3: conversion-aware reconciliation join (conversion-ID -> receipt leg-set validation)
- §1.5/§5: single rate convention (destination minor units per source minor unit), no scale adjustment
- §5 step 6: durable cap reservations + recovery - executed conversions count before receipt publication
- §1.5/§5 step 2: explicit expiry policy (Unix seconds, executor clock, anchored service authoritative, +-300s tolerance)
- §1.8: new non-monetary token.receipt kind for payment acknowledgments; §4 accept_payment emits it
- header: placement note - pkgs/id/doc is a tracked symlink to ../../doc, so the spec already sits at pkgs/id/doc/

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a614e8a08e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- §2: cap checks evaluated over the issuance causal ancestry (burn frontier) - concurrent burns cannot make validity fold-order dependent
- §2: anchored execution states (pending/executed/rejected) - a service-rejected intent consumes no spending authorization
- §5 step 6: graph-native cap reservations release only on a definitive condition (window expiry or signed cancellation), never on mere absence of legs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13ce252410

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- §3: mint-source account excluded from both balance roots, reconciled by the exact offset equation mint_source == -(executed issued - executed burned); issuer holder account still maps to issuer pubkey
- §5 step 6: recovery distinguishes complete vs partial leg sets - a one-sided graph-native swap yields the signed claim (CounterpartyLegMissing), never a success receipt

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8bae5e6ad0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note (queue task 3954, Lane C): parked — Codex review rounds are still producing new P2 findings on this spec. Rounds 1–3 (12 findings) are addressed in a614e8a / 13ce252 / 8bae5e6, each replied to on its thread and resolved. Round 4 on head 8bae5e6 raised 4 new unresolved P2s (anchored conversion movements in the graph fold; reject conversions rounding to a zero destination amount; include backlinks in the causal ancestry used for cap checks; specify the complete canonical Merkle-tree construction). Per the Codex gate this PR does not merge with undispositioned findings; the task is parked with this exact resume state. All other acceptance items are done: spec covers all five #2251 points, is linked from #2251, and sits at pkgs/id/doc/ via the tracked symlink.

@dezren39

Copy link
Copy Markdown
Member Author

@codex review

Round-4 fixes are in a8c0517 (conversion fold semantics with taker identity, zero-output conversion rejection, backlink-inclusive causal ancestry, complete canonical Merkle construction). All four round-4 threads are replied to and resolved. Please re-review the new head.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a8c051718d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dezren39

Copy link
Copy Markdown
Member Author

@codex review — round-5 fixes pushed in e1feebd (taker-signed intent: §1.6 taker_intent row, §5 step 3 Taker authorization, §2 fold-input rule; atomic cap check-and-reserve: §5 step 6 + step 2 cross-ref). Both round-5 threads replied to and resolved. Please re-review the new head.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: e1feebd975

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant