Skip to content

id: grant lifecycle implementation spec (#2254) - #2722

Merged
dezren39 merged 5 commits into
mainfrom
queue/3409-2254-grant-lifecycle-spec
Oct 30, 2026
Merged

dezren39 merged 5 commits into
mainfrom
queue/3409-2254-grant-lifecycle-spec

Conversation

@dezren39

@dezren39 dezren39 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Design spec for #2254 (implementation spec follow-on from the #2042 investigation, queue task 3353). Spec only — no code, per the #2056 program rule against building permanent features on an unreviewed investigation.

What

New doc pkgs/id/doc/2026-10-30T11-55-00Z_design_grant_lifecycle.md covering all five points #2254 names:

  1. PendingHold mechanics — decision made: TigerBeetle two-phase pending transfers (grant sub-account rejected, with reasons); window parameters per grant source as configuration snapshotted onto the grant record; post flow (idempotent scheduler sweep + timeout-void re-issuance fail-safe) and void flow.
  2. Fingerprint registry — domain-separated SHA-256 over the canonicalised key (raw key never stored or logged), grant_keys table whose primary key is the one-grant-per-key enforcement, first-registration-wins, append-only rows, signed publisher-revocation batch intake using precomputed fingerprints (publishers never send raw keys).
  3. External-event attestations — service-signed record format for refund / chargeback / publisher-revocation with authenticated intake and (source, external_ref) idempotency, plus the exact state transitions each event type may trigger.
  4. Clawback + Shortfall + debt — the amount_outstanding attribution figure (consumption decrements, transfers do not; liability is personal to the grantee), partial-clawback choreography, signed debt record format, FIFO offset against future grants/earnings, suspension effects, public signed write-off.
  5. revocation_policy enforcement — the none | for-cause | issuer-discretion ladder, the issuance-time snapshot rule (no retroactive power), a refusal table checked at execution with auditable refusals, and the signed revocation-notice + grace-window flow. Delisting specified as a separate acceptance act that never touches a balance.

Plus: a state-machine implementation map covering every #2042 state and transition (no orphan states), an abuse-case trace for cases 1–6 (each to a mechanism or an explicitly accepted residual risk), and eight open parameters (OP-1…OP-8) routed to #2043/operator instead of being silently defaulted.

Implementation work is filed as its own issue and linked from #2254 — this PR delivers the spec only.

Queue task 3409 · repo-worker-code Lane C


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

…registry, clawback/shortfall, revocation policy (#2254)
@dezren39
dezren39 requested a review from a team as a code owner October 30, 2026 11:55
@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 46 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: 01cca7e6-d18b-4edd-9c4f-34993bd4b745
Commits

Reviewing files that changed from the base of the PR and between a062548 and 4c01caf.

Files selected for processing: 1
  • doc/2026-10-30T11-55-00Z_design_grant_lifecycle.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-30T12:27:16.773667Z 4c01caf 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: 317f287fa1

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

…ation, frozen canonicalisation, intent-first ledger protocol, sweep resolution, registry-stamped grace, all-debts suspension recompute, expiry shortfall (#2254)
@dezren39

Copy link
Copy Markdown
Member Author

@codex review

@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: bb04ccae8d

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

@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: 736471d462

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

…ecompute-on-rejection, attestation scoping, expiry check on re-issuance (#2254)
@dezren39

Copy link
Copy Markdown
Member Author

@codex review

@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: 6feead06b5

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

…g Presented intent are processed at confirmation (#2254)
@dezren39

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 4c01caf614

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