Skip to content

id: poc: currency gateway boundary — UserDO snapshot cache, signed transfer + hold, idempotent retry across hibernation #2298

Open

Description

@dezren39

Gated PoC — follow-up from the #2066 design (PR #2297, doc/2026-10-29T12-20-00Z_design_currency_centralised_exception/).

Gate: do not start until (a) the currencies v1 synthesis #2043 accepts the #2066 boundary (one gateway API for both editions; hosted tier holds signed balance snapshots only, never ledger truth), and (b) the #2062 control-plane design fixes the gateway's registry/account-factory shape. This is a proof of concept that makes its own simplifications — flag it for a review round; do NOT build the permanent currency service on top of it unreviewed.

Prove, end to end:

  1. A stub gateway (single process, the only TigerBeetle client) in front of a single-node development TigerBeetle, exposing POST /v1/transfers, POST /v1/holds + post/void, and GET /v1/balances/{account} returning a gateway-signed snapshot (balance + transfer watermark).
  2. A hosted-edition client: one UserDO that persists {request ID, intent hash, state} in its SQLite before the gateway fetch, caches the signed snapshot, and reconciles by request-ID lookup on wake.
  3. One client-signed transfer and one hold → post cycle driven through the UserDO relay (the Worker/DO never holds the signing key; signing happens client-side).
  4. An idempotency test: kill/restart the DO between submit and response (hibernation), retry with the same request ID, and show exactly one transfer exists; a retry with a mutated field under the same ID must surface TigerBeetle's exists_with_different_* as a hard error.

Out of scope: conversions, corrections, registry UI, multi-replica cluster, production auth — all synthesis/#2062 territory.

Acceptance: a short results doc in doc/ linked here, with the four proofs above demonstrated (commands/output), and an explicit list of every simplification the PoC made.

Program: ID wave-1 follow-on. Parent epic #2056. Source design: #2066 / PR #2297.

Acceptance criteria

Activity

  1. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 29, 2026
  2. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  3. added
    kind/featureNew feature or capability request
    priority/normalOrdinary priority (the default)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 29, 2026
  4. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: #2066 / PR #2297 (source design), #2062 (control-plane shape), #2043 (currencies synthesis gate), epic #2056

    Notes: Gated PoC with unusually crisp prove-end-to-end items already in the body; the appended criteria restate them as checkable items.

    Risks: Building before the #2062/#2043 gates land risks a gateway shape that gets thrown away; the body flags this itself.

    Suggested approach: Wait for the gates; then implement in the order transfers → holds → snapshot cache → hibernation test.

    🤖 Agent note · filed

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: repo-fleet-monitor run 2026-10-29T12:12Z (07:12 CDT)
    • Found via: monitor reconciliation
    • Task: Duty 2 intake enrichment — acceptance criteria appended (original body preserved verbatim above it), labels normalized, meta/enriched applied. Still-live check this pass: no merged PR or fix commit explicitly resolving this issue was found; where a queue triage task owns verification, it is named in the notes.
    • Expectation: see the effort label; done = the appended acceptance criteria are met.
    • Links: this issue
  5. added
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 3, 2026
  6. 7 remaining items

  7. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  8. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  9. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — picked up (queue task 8731)

  11. added
    queue/blockedQueue or user escalation state
    user/escalatedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 4, 2026
  12. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — escalated (queue task 8731)

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

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)queue/blockedQueue or user escalation statesource/creatorFiled by the new-issue-creator jobstatus/blockedQueue or user escalation statetask/triageQueue packet kind: verify, reproduce, and route this itemuser/escalatedQueue or user escalation state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions