GeezerVison is showing github.com — id: implement ID conversion engine - linked transfer pairs and rate authorisation (design #2063) · Issue #5536 · developing-today/code
id: implement ID conversion engine - linked transfer pairs and rate authorisation (design #2063) #5536DescriptionImplementation of an ID design that has not landed yet (partial implementation as of the 2026-11-04 inventory).
Design issue: #2063
Design doc: doc/2026-11-01_design_id2063.md (in developing-today/code)
Acceptance, in brief: the conversion engine with linked transfer pairs and rate authorisation per the design.
Current state: conversion types + PoC executor landed; the production engine and rate-authorisation flow are incomplete.
The design documents govern. If implementation shows the design is wrong or incomplete, file a design amendment rather than silently diverging.
Scope: pkgs/id and its tests. Filed 2026-11-04 under Drew's order to begin work on all not-implemented ID designs. Inventory: workspace/goals/keep-the-four-repos-healthy/files/id-design-implementation-inventory-2026-11-04.md (in the fleet workspace).
Remainder tracking (2026-11-23): Refs #13788 — the #3802 quote issuance + binding slice (PR open, Felix merges). The gateway-service wiring remainder (composing verified/quoted conversions into the linked transfer chain; production ConversionControl binding) sits under this issue; detail in the 2026-11-23 comment on this issue. Activitydeveloping-today commented on Nov 4, 2026 dezren39 commented on Nov 4, 2026 🤖 Agent note · parked
- Agent: queue worker (repo-worker-code), lane code-j
- Session / ID: task 9603
- Found via: queue claim
- Task: task 9603 (issue id: implement ID conversion engine - linked transfer pairs and rate authorisation (design #2063) #5536) claimed direct and revalidated — issue id: implement ID conversion engine - linked transfer pairs and rate authorisation (design #2063) #5536 is OPEN with no hard-stop labels (held / user/owned / do-not-merge / do-not-auto-edit) and no competing open PR. However the packet's declared blockers are unmet, verified fresh: issue id: implement RateAuthorisation as a signed ID-graph object (design #2290) #5521 (RateAuthorisation as a signed ID-graph object, design issue id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290) and issue id: implement ID currencies v1 (design #2043) #5522 (ID currencies v1, design issue id: design: ID currencies v1 #2043) are both still OPEN and unlanded — their implementation tasks are queued in this same batch. The conversion engine's rate-authorisation flow builds directly on those two, so implementing now would mean inventing the APIs they will define. Parking task 9603 until both land.
- Expectation: resume when issue id: implement RateAuthorisation as a signed ID-graph object (design #2290) #5521 and issue id: implement ID currencies v1 (design #2043) #5522 have landed on main; then implement the conversion engine with linked transfer pairs and rate authorisation per doc/2026-11-01_design_id2063.md, with pkgs/id tests.
- Links: issue id: implement ID conversion engine - linked transfer pairs and rate authorisation (design #2063) #5536; blocker issue id: implement RateAuthorisation as a signed ID-graph object (design #2290) #5521; blocker issue id: implement ID currencies v1 (design #2043) #5522; design issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063
dezren39 commented on Nov 4, 2026 dezren39 commented on Nov 4, 2026 agent-note:v1
event: parked
task: 9603 (repo-health-code-pilot; repo-worker-code; lane code-y)
at: 2026-11-04T17:00Z
found_via: atomic queue claim (lane code-y; direct execution lane)
verified: Issue #5536 OPEN, no hard-stop labels. Its blockers — issue #5521 (RateAuthorisation signed ID-graph object) and issue #5522 (ID currencies v1) — are both still OPEN at fresh check 2026-11-04T17:00Z, so the #5536 conversion-engine implementation cannot land yet. No branch/worktree created, no implementation started.
next: Park 30 minutes; resume task 9603 once issues #5521 and #5522 are both merged/closed, then revalidate issue #5536 fresh. dezren39 commented on Nov 4, 2026 dezren39 commented on Nov 4, 2026 dezren39 commented on Nov 24, 2026
Triage verdict: revalidated 2026-11-24 (lane oc-code-08, task 21697)
Fresh check at origin/main:
- Named gates are closed: id: implement RateAuthorisation as a signed ID-graph object (design #2290) #5521 (CLOSED 2026-11-23), id: implement ID currencies v1 (design #2043) #5522 (CLOSED 2026-11-23), id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801 (gateway verification, PR id(currency): gateway verification flow + revocation consult for conversion submissions (#3801) #13667), id(currency): quote issuance + binding for RateAuthorisation (Phase 3 of #2290) #3802 (quote issuance and binding, PR id(currency): quote issuance + binding for RateAuthorisation (#3802) #13788 MERGED 2026-11-24).
status/waiting-dependency is stale and is removed here.
- Remainder is real:
pkgs/id/src/currency/gateway_service.rs still scopes convert as phase 5, so it is not in the GatewayService write pipeline. The pure batch builder (convert_amount, build_conversion_batch in pkgs/id/src/conversion.rs) already exists.
- Remaining scope: wire
convert through GatewayService (verified or quoted conversion to linked transfer chain, with idempotency, write-ahead and reconciliation), plus the production binding of the ConversionControl seam. The registry account-read gap (F1) applies if it still holds.
Verdict: ACTIVE, not blocked. This is a multi-part slice (effort m or larger), not a small fix. No code was changed in this triage. A follow-on packet for the convert-wiring slice is routed under this issue. dezren39 commented on Nov 24, 2026 Slice 1 sizing (oc-code-03, queue task 23506, 2026-11-24 14:30Z): parked for size, nothing landed.
dezren39 commented on Nov 24, 2026
Slice 1 convert-wiring: three named blockers before code (lane code-f, task 23506)
Attempted the vertical slice (failing-first cargo test -p id gateway_service convert case, then green). Verified at origin/main that the slice needs three prior answers; parking with these recorded so the next pass does not re-discover them. Prior triages (tasks 18321, 21697) declared this ACTIVE/not-blocked, but neither checked the three points below — all three still hold.
- LP tiers have no production home.
ConversionControl (pkgs/id/src/currency/conversion.rs, with its sole impl FixedConversionControl, a fixture) needs lp_tier(issuer, source_ledger, dest_ledger). LpTier/lp_tier/liquidity_binding appear nowhere else in pkgs/id/src: no registry record type, no store, no API mints or reads an LP tier. A production binding cannot be written until id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063/id(currency): production currencies v1 — remainder after the graph-native fold (#5522 successor) #10070 names where LP tiers live (registry record? new store? derived from issuance?). The CurrencyIssuer tier is derivable from the registry today (each currency record has issuer_id); RegisteredLiquidityHolder has no source at all.
- Intents assume exactly one transfer; a conversion is a 2-3-leg chain.
GatewayIntent.transfer: Option<LedgerTransfer> (gateway_service.rs ~L268), submit() takes one transfer (~L1648), recover_recorded (~L1203) and reconcile_intents look up one stored transfer by ID. build_conversion_batch (pkgs/id/src/conversion.rs) emits source [+ fee] + destination linked legs. One intent per conversion (batch field + submit-all + recover-missing + reconcile-all) vs one intent per leg is a schema decision with recovery semantics — needs the phase-F call, not a unilateral lane edit.
- The
Convert op carries no authorisation reference. Convert { source, dest, from, amount } (currency/gateway.rs ~L288) names no rate authorisation, quote, LP issuer, or liquidity accounts, and GatewayService::handle routes it to Unsupported (~L1158) with a single graph object slot. How the ConversionSubmission (presented authorisation objects, quote pinning per id(currency): quote issuance + binding for RateAuthorisation (Phase 3 of #2290) #3802, caller identity) reaches the service through the envelope pipeline is unspecified in the service layer.
Suggested resume: a phase-F note on this issue naming (a) the LP-tier home, (b) batch-intent vs per-leg-intent, (b2) submission assembly through handle(). With those, the slice is: failing-first gateway convert test, convert method mirroring transfer (recorded write-ahead, submit, finalize, recovery, reconcile), registry-backed ConversionControl, done check cargo test -p id gateway_service green. dezren39 commented on Nov 25, 2026 Progress (lane 8): slice 1 landed as #14798 (merged e0fdc0a, closes #14393). convert now runs through GatewayService::handle_convert and quote_convert: rate-authorisation verify, quote check, one linked TigerBeetle chain with derived leg ids, a write-ahead intent with the cap reserved before submit and released on failure, replay from the intent, recovery of a lost answer by leg id, and reconcile over every leg. Remote tests: cargo test -p id --lib currency:: green on the fleet runner.
Generated by Claude Code developing-today-fleet commented on Nov 26, 2026
Agent note — triage (queue task 24867, lane any-n, 2026-11-26)
State: triaged. No packet filed this pass.
Fresh state: #5536 OPEN (status/in-progress, queue/claimed, work/assigned, app/id, epic/id-platform, epic/id-program). Active implementation umbrella, progressing:
dezren39 commented on Nov 27, 2026
Triage verdict — 1837-F (queue task 25372, 2026-11-26)
Fresh code-level scoping against current main (head e21071c at check time), reading this issue and all comments, the design doc doc/2026-11-01_design_id2063.md (§3 invariants, §4 phases A–G), and the current sources.
Landed and verified in code:
- Phases A–C closed: id(currency): RateAuthorisation + revoke schema types and fold in pkgs/id (Phase 1 of #2290) #3800/id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801/id(currency): quote issuance + binding for RateAuthorisation (Phase 3 of #2290) #3802 (PRs feat(id): currency.rate_authorisation + revoke types and fold (#3800) #3888, id(currency): gateway verification flow + revocation consult for conversion submissions (#3801) #13667, id(currency): quote issuance + binding for RateAuthorisation (#3802) #13788). Original blockers id: implement RateAuthorisation as a signed ID-graph object (design #2290) #5521 and id: implement ID currencies v1 (design #2043) #5522 both CLOSED 2026-11-23.
- Phase E: PR id(conversion): production pure quote + linked-batch layer (Phase E of #2063, refs #5536) #5777 — pure quote + linked-batch builder in
pkgs/id/src/conversion.rs.
- Slice 1 / Phase F: PR id(currency): wire convert through GatewayService (slice 1 of #5536) #14798 merged e0fdc0a (closes id(conversion): wire convert through GatewayService (slice 1 of #5536) #14393) —
GatewayService::handle_convert/quote_convert in pkgs/id/src/currency/gateway_service/convert.rs, with 8 convert tests (linked chain + replay, refusal writes nothing, atomic short-inventory failure + cap release, quoted amounts, restart usage rebuild, lost-answer recovery, foreign-leg quarantine).
Correction to the 2026-11-26 triage (task 24867): the production ConversionControl binding does NOT still remain. GatewayConversionControl in convert.rs is exactly that binding — registry + ledger seam, LP tier as currency issuer or registered holder on both ledgers, constrained holder accounts as inventory, fee account binding, frozen/sunset status mapping. Idempotency / write-ahead / reconciliation hardening for convert is likewise already in slice 1 (intent carries every leg; reconcile_intents joins every leg; recorded intents recover by leg id).
Actual remainder — Phase G only, filed as slice 2: #15830
Design §3 invariant 11: the conversion receipt must contain the exact offer version, both (all) leg references, conversion ID, and outcome. Today's signed receipt is the generic gateway Receipt (pkgs/id/src/currency/gateway_poc.rs): first-leg transfer id only, no authorisation version, no quote id, no destination, no amounts — those live only on the intent's ConversionRecord. Reversal reference (invariant 10) is likewise absent. #15830 scopes that work, starting with a design decision on extending the shared signed Receipt wire format vs a conversion-specific receipt body — not a silent wire change.
Verification note: a fresh fleet actions exec session to re-run cargo test -p id --lib currency:: was attempted this lane and failed at dispatch (transport: invalid peer certificate: UnknownIssuer on the fleet-exec workflow dispatch) — no new test run is claimed. The last recorded run for this code is slice 1's: remote cargo test -p id --lib currency:: green on the fleet runner (2026-11-25 comment). #15830's done check names re-running it via Actions exec / repo CI.
Disposition: #5536 stays OPEN as the umbrella; its only remaining scoped work is #15830. Queue task 25372 completes as triaged with #15830 as the follow-up.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|