Skip to content

id(currency): production currencies v1 — remainder after the graph-native fold (#5522 successor) #10070

Open

Description

@dezren39

Production currencies v1 — remainder after the graph-native fold (#5522)

Successor to #5522, filed per its acceptance ("if a further slice must remain, a successor issue is filed and linked instead of closing #5522 silently"). #5522's history is the cautionary tale: it was closed by a slice (PR #6776, graph contracts) with the remainder unrecorded, and had to be reopened by the 90-day review.

Landed so far

Remaining (design #2043 phased plan)

  1. Anchored registry + gateway seam (phase 3). Registry mapping semantic definition → currency_id/ledger, account factory, single-writer gateway, idempotent intents, two-way reconciliation. Design home id: design: currency control plane — registry, account factory, gateway #2062 (closed design); no open implementation issue — this item is its home until split.
  2. Anchored transfer/issuance + snapshots (phase 4). TigerBeetle mint/transfer/burn, stamps, service-signed snapshots, supply-audit/reconciliation reports. Related open PoC: id: poc: currency gateway boundary — UserDO snapshot cache, signed transfer + hold, idempotent retry across hibernation #2298.
  3. Conversion execution (phase 5). Open homes: id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801 (gateway verification flow), id(currency): quote issuance + binding for RateAuthorisation (Phase 3 of #2290) #3802 (quote issuance/binding). Linked-batch executor per id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 (the conversion engine issue id: implement ID conversion engine - linked transfer pairs and rate authorisation (design #2063) #5536 is blocked by id: implement ID currencies v1 (design #2043) #5522's line, not by this successor).
  4. Grant lifecycle implementation (phase 6). id: investigate: tokens for real services — Steam-key grants, returns/refunds, revocation #2042 was the investigation; id: decide: grant refund window length and whether pending tokens are spendable #2296 holds the ruled policy terms. Includes pending-hold/refund windows, adverse attestations, non-monetary receipts, debt/shortfall. Gate: Drew's Q5 modification (pending-unit trading via chained option contracts) has an open escrow/atomic-batch question recorded on id: decide: grant refund window length and whether pending tokens are spendable #2296 — that part is NOT settled design and must not be implemented until Drew confirms.
  5. Supply-account cap exception marker (Decisions Q2). Design detail: the ruled cap exception for supply-account transfers has no representation in the signed v1 bodies, so the fold counts all issuance. Needs a contract marker (or an explicit ruling that counted-all is the v1 semantics) before the exception can be implemented. Also unresolved from Q2, verbatim on id: design: ID currencies v1 #2043: "named like tiger beetle would be", and whether supply-account transfers count against the cap.
  6. Fold extensions. Issuer rotation inside the fold (contracts exist: id-store issuer_rotation, design id: design: issuer key rotation and compromise recovery for currency issuers (from #2041) #2804), currency-scoped snapshot roots over fold state (Merkle roots + frontier, invariant 11), and the client API (phase 7) — open home id: implement: pkgs/id currency client API — the §7 app-facing function surface from #2041 (gated on #2251 spec) #2803.

Acceptance for this successor

Each numbered item lands as its own PR with tests per the design's acceptance-test list, or is split into its own issue and linked here. This issue closes only when items 1–6 are all landed or explicitly split out — not when the next slice merges.

Activity

  1. added
    priority/high
    on Nov 14, 2026
  2. developing-today commented on Nov 14, 2026

    @developing-today
    Contributor
  3. removed their assignment
    on Nov 20, 2026
  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Lane EX (archer) claiming the next feature slice of #10070: item 4 follow-on — policy partial vest for the grant service (design doc/2026-10-29T12-10-00Z_design_refundable_grants_pending_transfers §4: "partial posting is for policy"; named as the follow-on in pkgs/id/crates/id-currency-registry/src/grants.rs — G1 landed the refund path, a policy partial-vest is the recorded remainder).

    Criteria audit against current main (evidence in the slice PR): item 1 registry/factory/gateway-envelope landed (#2317/#2318/#2319), gateway service + two-way reconciliation open; item 2 open (PoC #2298); item 3 split out (#3801/#3802); item 4 G1 core landed (#2294), policy partial-vest = this slice, clawback path and §6.3 reconciler remain; item 5 cap marker open (design questions on #2043); item 6 rotation + snapshot roots landed in the fold, client API split out (#2803). The Q5-gated part of item 4 is not touched.

  5. added a commit that references this issue on Nov 23, 2026
  6. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Slice PR open: #12902 — item 4 follow-on, policy partial vest for the grant service (design #2065 §4). GrantService::vest_partial posts a proper part of a pending hold; the ledger restores the remainder; zero/full amounts are InvalidAmount; a resolved grant stays the 409. Verified on the laptop at f7940f33fb9: cargo test -p id-currency-registry 29 passed / 0 failed (3 new acceptance tests, oracle = §4's table + stub-ledger balances), fmt clean, no new clippy warnings.

    Criteria state after this slice: item 4's remaining parts are the §6 clawback path (late refund after posting: clawback + bounded debt — the GrantState variants exist, no service path yet) and the §6.3 vesting reconciler (separate issue per the grants module doc). Next slice in "after this PR" form: after the clawback slice, cargo test -p id-currency-registry --test grants_acceptance shows a posted grant refunded late reaching ClawbackSettled when the holder's balance covers it and Debt when it does not.

  7. added a commit that references this issue on Nov 23, 2026
  8. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Slice landed: PR #12902 merged (14650b18559, head f7940f33fb9), verified on main — pub fn vest_partial present in pkgs/id/crates/id-currency-registry/src/grants.rs.

    Item 4 (grant lifecycle) state now: register / vest / void / partial refund (void-and-reissue) / policy partial vest (new) are implemented with acceptance tests. Remaining in item 4: the §6 clawback path for late refunds after posting (clawback + bounded debt; the GrantState variants exist, no service path yet) and the §6.3 vesting reconciler (separate issue per the grants module doc). The Q5-gated escrow/atomic-batch part remains untouched, as required — it is not settled design.

    Verification: failing-first E0599 on main; after the change, cargo test -p id-currency-registry on the laptop = 29 passed / 0 failed (grants acceptance 9 → 12), fmt clean, clippy clean in the touched files. #10070 correctly stays open: items 1 (gateway service + two-way reconciliation), 2, and 5 remain, and item 3 is split out (#3801/#3802), item 6's client API split out (#2803).

  9. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Lane IJ (archer) claiming the next slice of #10070 item 4: the §6 clawback path for the grant service — late refund after posting: clawback + bounded debt (the GrantState variants exist; no service path yet). Named as the next slice in Lane EX's done record on PR #12902.

    Acceptance form (from EX's record): after this slice, cargo test -p id-currency-registry --test grants_acceptance shows a posted grant refunded late reaching ClawbackSettled when the holder's balance covers it and Debt when it does not. The Q5-gated escrow/atomic-batch part stays untouched.

  10. added a commit that references this issue on Nov 23, 2026
  11. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Slice landed: PR #13006 merged (1bfa5027c6e, head f2546001462 SHA-guarded) — item 4's §6 clawback path for the grant service, the slice named in Lane EX's done record on PR #12902.

    What landed: GrantService::refund_late — a refund arriving after posting claws the refunded amount back from holder to grant pool under §6.2's adopted clawback then debt policy: balance held → ClawbackSettled; already spent → exceeds_credits moves nothing and the grant is marked Debt (an outcome, not an error). Intent-first ClawbackPending write (attempt recorded before money moves, retry re-enters against that row), confirm-third after. Guards: pending grant → new GrantError::NotPosted; finished clawback / any other resolved state → AlreadyResolved; 0 < amount <= grant.amount else InvalidAmount. Ledger seam: PendingLedger::clawback + ClawbackTransferSpec (CLAWBACK_TRANSFER_CODE = correction-range start), LedgerError::ExceedsCredits verdict; StubLedger records clawback verdicts by transfer id (resubmission never moves money twice) and gains spend_posted to stage the debt case. No schema change — migration 0002 already permits the clawback states. Verified present on main (refund_late + the five late_refund_* acceptance tests).

    Verification: cargo test -p id-currency-registry on the laptop = 34 passed / 0 failed (grants acceptance 12 → 17: settled, debt-after-partial-spend with balances untouched, partial late refund, state guards + at-most-once, amount bounds; oracle = stub balances + row state). fmt clean; clippy shows no new warnings (two doc warnings from the first pass were fixed; the remainder is the pre-existing factory set).

    Item 4 state now: register / vest / void / partial refund (void-and-reissue) / policy partial vest / late-refund clawback + bounded debt (new) are implemented with acceptance tests. Remaining in item 4: the §6.3 vesting reconciler (separate issue per the grants module doc). One scope note recorded on the PR: the grant row carries no posted-amount column, so for a policy partial vest the caller passes the refunded part of the posted fraction; the enforced bound is the grant amount. #10070 correctly stays open (items 1, 2, 5 remain; item 3 split out as #3801/#3802; item 6's client API as #2803).

  12. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note — triage, lane any-n (task 19100)

  13. 5 remaining items

  14. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    oc-code-08, triage task 21343 (2026-11-24): confirmed no free slice, consistent with the 03:56Z note. Items 1, 2 and 5 have no open implementation home and item 4 is owner-lane follow-through; this issue stays the home until those are split. Merged successors #13006, #13343 and #12902 cover the shipped slices. No follow-on filed in this pass.

  15. added
    stray-work
    stray/needs-parent
    on Nov 27, 2026
  16. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    🤖 Census note — 2026-11-29 (lane CEN-C09, full issue census)

    State verified today: the shipped pieces are closed out — graph contracts (PR #6776), the fold, item-3 homes #3801/#3802 closed with PRs #13667/#13788 merged; designs #2043/#2062/#2063 and PoC #2298 closed. Three triage passes (2026-11-24) all confirm the same gap:
    Gap (the pickup): remaining items 1 (anchored registry + gateway seam), 2, and 5 still have NO open implementation home — this issue is their home until they are split; item 4 is owner-lane follow-through (#2803 open parked+claimed, #5536 waiting-dependency). No outside lane can take a slice without either splitting these items into issues or colliding with owner lanes.
    Next step: split items 1/2/5 into scoped implementation issues (per the #5522 lesson recorded in this body: never let a remainder ride unrecorded), then this tracker can follow their progress.
    Census fixes: none — priority/low stands for a remainder tracker.
    Verdict: needs-detail — the split is the missing step.

  17. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): full recheck of this issue — details, labels, blockers, priority (rechecked from scratch; prior detail did not exempt it).

    STRENGTHS:

    GAPS FOUND:

    FIXES I APPLIED:

    • none needed

    REMAINS: nothing — ready for pickup

  18. added
    priority/normal
    and removed
    priority/low
    on Nov 29, 2026
  19. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Priority validation 2026-11-29 (Felix): priority/low → priority/normal — this is the home for real un-split implementation remainders (items 1, 2, 5) of production currencies v1 — substantive feature work that must eventually be split and built, not nice-to-have polish

  20. added
    app/id
    effort/l
    on Nov 29, 2026
  21. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Wave-2 residual pass. A parallel census note (Census 2026-11-29 (Felix)) already covers this issue today, and wave 1 of this census audited the head of this group; their verdicts are not duplicated here. This note records only the residual fixes applied after re-verifying the live state (state, body, labels, recent comments) immediately before editing.

    Residual gaps found: no app/*/area/* label although the owning project is clear from the title/body; no effort/* label.

    Actions taken: labels added: app/id, effort/l.

    Blocker already recorded in the body and restated here: item 4's pending-unit trading part waits on Drew's confirmation of the escrow/atomic-batch question on #2296; item 5's cap-semantics questions are open on #2043.

    Priority: priority/normal retained (a parallel priority-validation pass today raised it from priority/low).

  22. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Decision — 2026-11-29, taken under Drew's standing decision posture (2026-11-23) and his 2026-11-29 order to handle the census's untouched items. Item 4 of this issue waited on the escrow/atomic-batch question carried from #2296.

    Verified today: #2296 is closed — Drew ruled on its grant terms on 2026-11-08, and the open escrow/atomic-batch proposal sits in PR #7722's design record (§3.8), which carries its own recommendation: the sequential chain for v1.

    Decision: adopt the design record's recommendation — sequential chain in v1; the atomic-batch escrow remains a designed option, deferred, not adopted for v1. This matches the more-capable-over-locked-down bias in the standing posture only where the evidence supports it; here the design record's own analysis is the evidence, and it recommends the sequential chain. Item 4 is decided on that basis; a pointer is recorded on #2296.

  23. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Issue census follow-up — 2026-11-29 (untouched-items remediation)

    The Xaltha-seat census (lane CEN-C09) recorded a needs-detail verdict: the split is the missing step. Disposition, in two parts. (1) Item 4 — the part that also sat on the census's needs-Drew list — was decided today (see the decision comment above: sequential chain in v1 per PR #7722's design §3.8; atomic-batch escrow deferred). (2) The remaining needs-detail stands exactly as the census named it: items 1 (anchored registry + gateway seam), 2, and 5 still have no open implementation home and are to be split into scoped implementation issues — owner-lane work, since the census verified an outside lane cannot take a slice without either splitting these items or colliding with the owner lanes (#2803 open parked+claimed, #5536 waiting-dependency). The split is the named next step; this tracker follows their progress once filed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/ideffort/lkind/enhancementpriority/normalstatus/in-reviewstray-workstray/needs-parent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions