GeezerVison is showing github.com — id(currency): PoC — registry + factory + gateway, single-currency issue→transfer (from #2062) · Issue #2321 · developing-today/code
id(currency): PoC — registry + factory + gateway, single-currency issue→transfer (from #2062) #2321DescriptionFollow-up from the currency control plane design (#2062), §4 and §10 of
doc/2026-10-29T12-42-21Z_design_currency_control_plane/.
This is a proof of concept, not the permanent currency service. It makes its own decisions where the design is silent and must be reviewed before anything permanent is built on it.
Scope
End-to-end, single currency, against the design's interfaces:
- Registry (F1) + factory (F2) + gateway envelope (F3).
register_currency → issue 100 → transfer 40, with a signed graph object per event and a signed receipt returned.
- One constrained holder account rejecting an overdraft at the cluster.
Acceptance
- The full issue→transfer flow runs against a local TigerBeetle cluster, with
user_data_128 resolving to a graph object for each write.
- An overdraft is rejected by the cluster, not by a check-then-write in the gateway.
- A short write-up names every place the PoC guessed, so the review round has something to chew on.
Depends on
F1, F2, F3.
Gate satisfied: this is the PoC gated on "do not start until the #2062 control-plane design fixes the gateway's registry/account-factory shape" (#2298); #2062 now supplies that shape.
Refs #2062, #2298 Activitydeveloping-today commented on Oct 29, 2026 dezren39 commented on Oct 29, 2026 Intake review
Related: #2062 (currency control-plane design, §4/§10), #2317 (registry schema), #2318 (account factory), #2319 (gateway envelope) — the F1/F2/F3 pieces this PoC composes; gate issue #2298
Notes: Single-currency PoC composing registry + factory + gateway: register → issue 100 → transfer 40 against a local TigerBeetle cluster. The body carries a full ## Acceptance list and states its gate (#2062's shape) is satisfied, so this pass is labels-only.
Risks: It is explicitly a proof of concept that guesses where the design is silent — building anything permanent on it unreviewed compounds the guesses; the write-up of guesses is part of the deliverable.
Suggested approach: Build after #2317/#2318/#2319 land; run the overdraft-at-the-cluster case as the headline proof; finish with the guesses write-up.
🤖 Agent note · filed
- Agent: fleet monitor (repo-fleet-monitor)
- Session / ID: repo-fleet-monitor run 2026-10-29T18:12Z (13:12 CDT)
- Found via: monitor reconciliation
- Task: Duty 2 intake enrichment — labels normalized and
meta/enriched applied; acceptance criteria appended to the body only where no acceptance section existed (original body preserved verbatim above it). Still-live check this pass: no merged PR or fix commit explicitly resolving this issue was found in this pass's search.
- Expectation: see the effort label; done = the acceptance criteria are met.
- Links: this issue
dezren39 commented on Nov 14, 2026
Agent note — dep-blocked, task 8511 for issue #2321 (lane code-c)
- Fresh check 2026-11-14T04:20Z: issue id(currency): PoC — registry + factory + gateway, single-currency issue→transfer (from #2062) #2321 is OPEN, no hard-stop labels, no status/needs-triage.
- Dependency gate re-verified fresh (not assumed from the prior park): prerequisite issues id(currency): currency registry schema + ledger-u32 allocator (from #2062) #2317, id(currency): deterministic account factory + per-currency system accounts (from #2062) #2318, and id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 are all still OPEN. The packet acceptance requires all three closed before implementation starts, so no implementation work was started.
- Action: dep-blocked task 8511 structurally on issues id(currency): currency registry schema + ledger-u32 allocator (from #2062) #2317, id(currency): deterministic account factory + per-currency system accounts (from #2062) #2318, id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 (max TTL 3 days) — the broker returns it to the pool automatically when all three close.
dezren39 commented on Nov 17, 2026 🤖 Agent note · triaged (scheduled lane code-j)
- Agent: repo queue worker (repo-worker-code), lane code-j (openchamber-scheduled-lane)
- Session / ID: task 18224 (triage)
- Found via: scheduled queue claim; fresh GitHub state (2026-11-17)
- Verdict: still OPEN, still blocked. No implementation started; no code changed.
- Gate (fresh): id(currency): currency registry schema + ledger-u32 allocator (from #2062) #2317 CLOSED (2026-11-16); id(currency): deterministic account factory + per-currency system accounts (from #2062) #2318 CLOSED (2026-11-16); id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 OPEN. PR feat(id): add currency gateway request envelope (#2319) #7650 (
feat(id): add currency gateway request envelope (#2319)) is MERGED at fa7412c and covers only the F3 envelope slice. Its body says it intentionally does not close id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319, because registry, account-factory and ledger submission/receipt integration remain follow-up scope on id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319.
- Next: the PoC can start once id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319's remaining integration scope is delivered or id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 is formally closed. Until then it stays on the dependency gate. No follow-up fix packet is created here, to avoid a duplicate of the id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 integration work.
- Links: id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319, id: design: currency control plane — registry, account factory, gateway #2062, id: poc: currency gateway boundary — UserDO snapshot cache, signed transfer + hold, idempotent retry across hibernation #2298, PR feat(id): add currency gateway request envelope (#2319) #7650
dezren39 commented on Nov 17, 2026
🤖 Agent note · dependency re-check, still gated — task 8511 (lane code-e)
- Fresh revalidation (2026-11-17): issue id(currency): PoC — registry + factory + gateway, single-currency issue→transfer (from #2062) #2321 OPEN, no hard-stop labels (held / user/owned / do-not-merge / do-not-auto-edit). This claim's execution-lane assignment returned direct (the pre-fix(queue): single-session by default — launch-on-handoff, lane works, inline triage (reverses #8097 Rule 3) #8187 opencode handoff loop on this task — lanes code-h / code-t / code-m, 2026-11-09 — does not repeat).
- Dependency states, fresh: id(currency): currency registry schema + ledger-u32 allocator (from #2062) #2317 CLOSED · id(currency): deterministic account factory + per-currency system accounts (from #2062) #2318 CLOSED · id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 OPEN ("gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs"). Two of the three gates recorded on this task in 2026-11-09 have since landed; the PoC's gateway half cannot be built or verified without id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319's envelope (canonical encoding + verify_strict + idempotency are the gateway's request contract).
- Action: task 8511 is dep-blocked on issue id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 (broker dependency, 3-day TTL, auto-releases when id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 closes). Issue labels already carry queue/blocked + status/blocked from the earlier disposition and are left as they are — they match this state.
- On release: the claiming lane implements the PoC per the task packet (registry + factory + gateway, single-currency issue→transfer) against the landed id(currency): currency registry schema + ledger-u32 allocator (from #2062) #2317/id(currency): deterministic account factory + per-currency system accounts (from #2062) #2318 surfaces and id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319's envelope, in a fresh worktree, per the runbook.
dezren39 commented on Nov 20, 2026 Task 8511 is blocked: prerequisite #2319 remains OPEN. #2317 and #2318 are CLOSED, but implementation must wait until #2319 closes. Resume by rechecking #2319, then continue #2321 only after it is closed. dezren39 commented on Nov 23, 2026
🤖 Agent note · claimed
- Agent: archer (Muse sandbox seat), lane EW — queue task 8511.
- Premise check (fresh, this pass): id(currency): PoC — registry + factory + gateway, single-currency issue→transfer (from #2062) #2321 OPEN; all three ordering dependencies are CLOSED completed — F1 id(currency): currency registry schema + ledger-u32 allocator (from #2062) #2317, F2 id(currency): deterministic account factory + per-currency system accounts (from #2062) #2318, F3 id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 (F3 closed 2026-11-23T03:19Z) — so the packet's park condition no longer holds and the composition may proceed.
- Plan: compose F1+F2+F3 in pkgs/id — a PoC gateway service running the fixed §4.3 pipeline over the F1 registry (in-memory store), the F2 factory (over the id: PoC: conversion executor — linked transfer pairs, write-ahead intent, recovery scanner #2289 ledger seam), and the F3 envelope/authorization/idempotency code — register_currency → issue 100 → transfer 40 against a local TigerBeetle cluster (pinned 0.17.9 harness), signed graph object per write stamped into
user_data_128, signed receipt returned, holder overdraft rejected by the cluster. Write-up of every guess lands in the module docs and the completion record.
dezren39 commented on Nov 23, 2026 Completion record — Lane EW
Landed in PR #12960 (#12960), merged as 48f190e0b41553a885c7e0a8238b64d77c8f17ce (feature commit 224e855e5fc).
The PoC is landed: pkgs/id/src/currency/gateway_poc.rs composes F1 (registry), F2 (account factory), and F3 (gateway envelope) into one service over the #2289 ledger seam, following the §4.3 pipeline: verify envelope → idempotency → resolve → authorize → build batch (factory accounts + one transfer whose user_data_128 stamps the signed graph object) → submit once → signed receipt.
Acceptance, as run:
- Full issue→transfer flow against a local TigerBeetle cluster (pinned 0.17.9 binary): register → record signed definition → issue 100 → transfer 40, balances read back from the cluster, and the stamped transfers found on the cluster via the
user_data_128 lookup, each stamp resolving to its signed graph object in the service's graph log. Live test: issue_transfer_flow_over_tigerbeetle — ok.
- Overdraft rejected by the cluster, not a gateway check-then-write: the gateway never reads a balance before submitting; the holder account's factory-set
debits_must_not_exceed_credits flag makes TigerBeetle refuse a 61-unit transfer against a 60-unit balance with DebitsMustNotExceedCredits, balances unchanged. Proven on both the in-memory backend and the real cluster.
- Idempotent replay returns the original signed receipt and posts nothing new; the supply cap and the minter/issuer checks refuse at the gateway (F3) as designed.
Verification numbers (laptop, nix develop in pkgs/id): gateway_poc unit tests 2/2; all 134 currency* lib tests pass; id-currency-registry suite 12/12; live ignored test 1/1 against TigerBeetle 0.17.9; rustfmt clean; clippy exit 0 (warnings only, same classes as the surrounding code).
Where the PoC guessed (also in the module docs)
- Currency key ↔ registry id. F3 addresses a currency by
[u8; 32]; F1 by a string currency_id. The PoC takes the 32 bytes to be the graph CurrencyId compact hash and keeps a hash → currency_id index.
- Minting the
currency_id. F3's register op carries none and §2.3 gives no scheme; the PoC derives cur-<16 hex> from BLAKE3 over issuer‖name‖symbol‖scale‖cap.
- The definition object arrives out of envelope. It names the ledger registration allocates, so it can only be signed afterwards, and neither F3's op set nor F1's API carries it. The PoC adds
record_definition as a separate step; the registry row's graph_object_id stays unset.
user_data_128 is a truncation. Graph ids are 32-byte hashes; the stamp is the first 16 bytes (little-endian u128), resolved via the graph log. Collision risk is a real production question.
- Minters and issued supply are service-tracked in memory. F1's
Store inserts grants but cannot read them back and holds no supply counter. A production adapter reads the currency_issuer table and issuer-account counters (F4's inputs).
- Liquidity accounts are not created (no directions at registration); fee/burn accounts exist but no fee is charged — the design doesn't price the basic path.
- Account
code. F2's AccountSpec has none; the PoC writes the factory kind byte (issuer 1 … holder 5).
- Receipt shape. §4.3 names contents only; the PoC uses canonical CBOR + ed25519 under domain tag
id.currency.receipt.v1, verified with verify_strict.
- Graph events are client-signed and client-supplied (the gateway holds no user keys, §1.3); the service checks author, kind, payload hash, and field agreement before stamping. §5's gateway-writes-to-graph walkthrough would need key custody or a delegation the design doesn't specify.
- Graph chain state is not validated (sequence/backlink continuity) — chain semantics belong to the fold (id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290).
- Abuse controls (§4.3 step 6, id: investigate: comms abuse controls — blocks, rate limits, and per-counterparty budgets #2032/id: design: abuse-control primitives v1 for ID comms #2033) are not implemented — outside the single-currency flow.
- Minter issuance has no graph object. The graph contracts bind
token.issue events to the issuer's key, so a granted minter cannot produce the per-write graph object this PoC requires; issuance is effectively issuer-only until minter-signed issue events exist.
- Replays short-circuit before authorization. Found by the PoC's first flow test: F3's
authorize re-checks the cap against current supply, so a retry of an already-posted issue is refused once supply has moved. §4.3's ordering (idempotency step 2, authorization step 5) puts the replay answer first; the PoC keeps a receipt store keyed by (device, op, client request id). A production store is durable and keyed by the idempotency ID itself.
One seam fix rode along: the history flag is now carried through the #2289 currency_poc ledger seam (AccountFlags), so F2's per-kind flags (holder history) actually reach the cluster.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|