GeezerVison is showing github.com — id(currency): graph↔ledger reconciliation + supply-audit job (from #2062) · Issue #2320 · developing-today/code
id(currency): graph↔ledger reconciliation + supply-audit job (from #2062) #2320DescriptionFollow-up from the currency control plane design (#2062), §7 of
doc/2026-10-29T12-42-21Z_design_currency_control_plane/.
Scope
The scheduled reconciliation and supply-audit job.
- Supply audit: sum issuer-account debits per currency vs
holders + fee + burn (design §7.3).
- Resolve each recent transfer's
user_data_128 to its signed graph object; report unresolved links (design §7.1–§7.2).
- Report registry↔ledger↔graph drift to an operator surface; ledger wins on balance, graph is flagged for review.
Acceptance
- A seeded cluster with a known supply reports a match; an injected divergence is reported with the currency, the ledger id, and the offending object.
- A transfer whose
user_data_128 has no graph object is reported, not silently ignored.
Depends on
F1, F2.
Refs #2062 Activitydeveloping-today commented on Oct 29, 2026 dezren39 commented on Oct 29, 2026 Intake review
Related: #2062 (design §7), #2317/#2318 (F1/F2 dependencies), #2321 (the PoC whose cluster this audits)
Notes: Graph↔ledger reconciliation + supply-audit job for the currency control plane. The body carries a full ## Acceptance list (seeded match, injected divergence reported with ids, unresolved user_data_128 reported not ignored), so this pass is labels-only.
Risks: Reconciliation that auto-fixes drift would hide exactly the corruption it exists to surface — the design's rule (ledger wins on balance, graph flagged for review) must hold.
Suggested approach: Build after F1/F2; implement audit + link resolution as a scheduled job with operator-surface reporting; test with the seeded-divergence case.
🤖 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
developing-today commented on Nov 3, 2026 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 dezren39 commented on Nov 23, 2026
🤖 Agent note · claimed — Lane JX (archer, sandbox fix lane)
- Task: id(currency): graph↔ledger reconciliation + supply-audit job (from #2062) #2320 F4 slice per the 2026-11-23 decision (comment above): implement the report-only graph↔ledger reconciliation + supply-audit job (§7.1–§7.3 of the currency control plane design) with named-oracle tests.
- Premise check (fresh): id(currency): graph↔ledger reconciliation + supply-audit job (from #2062) #2320 OPEN; id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319 and id(currency): PoC — registry + factory + gateway, single-currency issue→transfer (from #2062) #2321 both CLOSED (PR id(currency): F5 PoC — gateway composition over registry, factory, envelope (#2321) #12960 merged); no live claim on this slice after the decision routed it as task 21144 (queue backend down, so claiming here on the issue).
- Scope guard: report-only — no repair, deletion, rewrite, deployment, or production scheduling, per the decision's own terms.
dezren39 commented on Nov 23, 2026 Lane JX done record — the F4 report-only reconciliation + supply-audit packet has landed.
PR #13139 merged as c2355a3f6ff4cf8dcc747bcffb3ddb9b45ee6cdb (branch head 45fcf5ec9a1b).
What landed, against the acceptance criteria:
- (a) Match on a seeded cluster —
GatewayPoc::reconcile(recent_limit) runs the audit for every registered currency; test reconcile_reports_match_for_seeded_cluster: issue 100 → Alice, transfer 40 → Bob reports supply 100 = 100, no findings, 2 transfers checked.
- (b) Injected divergence reported with currency, ledger, and object —
reconcile_reports_amount_drift_with_currency_ledger_and_object: a transfer posted directly to the ledger reusing a real graph stamp but a different amount reports AmountDrift { ledger, transfer_id, graph_event, graph_amount: 40, ledger_amount: 7 } (ledger wins, graph flagged, per §7.2). reconcile_reports_supply_mismatch_when_supply_leaves_audited_accounts reports SupplyMismatch { issued: 100, accounted: 90 } with the currency and ledger on the report.
- (c) Unresolved objects reported, never dropped —
reconcile_reports_unresolved_graph_link: a stamped transfer with no graph event reports UnresolvedGraphLink. Backend read failures likewise surface as LedgerReadFailed findings — the report states its own blindness rather than reading as a match. Zero-stamp transfers are counted as unstamped_transfers, not findings.
Shape: new currency::reconcile module (design §7.1–§7.3); LedgerBackend gained defaulted fallible enumeration reads (try_accounts_on_ledger / try_transfers_on_ledger) whose default is an explicit error. InMemoryLedger implements both; the TigerBeetle backend implements transfer enumeration via paged query_transfers — the pinned client (0.17.9) has no ledger-scoped account query, so against a real cluster the supply half currently reports LedgerReadFailed until a client capability or an account-id index exists. That is the honest state of the TB leg, recorded here rather than papered over.
Verification: cargo check -p id --features world clean; cargo test -p id --features world,currency-poc-tb --lib currency — 142 passed, 0 failed (10 ignored = live-cluster tests), re-run green on the final formatted tree. Touched files rustfmt-clean (edition 2024). Full-crate clippy was started locally but not completed (laptop under heavy multi-lane load); CI on main carries it.
Scope kept per the 2026-11-23 routing decision: report-only — no repair, deletion, rewrite, deployment, or production scheduling. What remains on this issue: wiring reconcile into a scheduled job against a deployed gateway (production scheduling — needs its own go-ahead), and a TigerBeetle account-enumeration route for the supply half. The queue completion for task 21144 rides the issue record + lease expiry while the sandbox queue leg is down. dezren39 commented on Nov 23, 2026 dezren39 commented on Nov 23, 2026 Progress: PR #13166 remains open. The Fleet run for the focused verification reached a terminal failure before tests ran: Nix aborted during environment setup with home directory "/homeless-shelter" exists; please remove it to assure purity of builds without sandboxing (run: https://github.com/developing-today-forks/fleet/actions/runs/45149906659). This is runner/setup failure, not a test assertion result. Resume by rerunning focused verification on a compatible runner, then verify disposition after the PR merges. #2320 remains open. dezren39 commented on Nov 23, 2026
Agent note — F4 property-oracle verification is green (remote)
- Agent: repo queue worker (repo-worker-code), lane code-g, task 21144
- PR: test(id): property-check currency supply audit #13166 (test-only: 3 property-based supply aggregation/divergence oracles in
pkgs/id/src/currency/reconcile.rs, + rustfmt import-order fix cd6223724fd)
- Local:
cargo test -p id --lib currency:: → 83 passed / 0 failed; reconcile.rs rustfmt-clean (edition 2024)
- Remote (green): dezren39/fleet run 45167178681 —
nix develop ./pkgs/id (pinned cargo 1.99.1, same venue as id-check.yml) → 83 passed; 0 failed on branch lane/oc-code-03/21144-f4-recon-audit @ cd6223724fd, including the 4 gateway_poc::reconcile scenario oracles and the 3 new property oracles.
- Prior remote failures were venue/command mismatches, not test failures: run 45149906659 (Nix
/homeless-shelter during unsandboxed setup), 45159422353 and 45161493393 (cargo/rustup not on the fleet container's root PATH). The green run fixes the invocation: run as the image's nix owner (runuser -u vscode, HOME set), with a writable CARGO_HOME.
- Scope unchanged: report-only reconciliation + supply audit; id(currency): graph↔ledger reconciliation + supply-audit job (from #2062) #2320 stays open until test(id): property-check currency supply audit #13166 merges and the issue-level done check (live scheduling/production surface) is decided separately.
dezren39 commented on Nov 23, 2026
Done — F4 report-only reconciliation + supply audit landed and verified.
Acceptance check (issue done check):
- Seeded cluster reports a match; injected divergence reported with currency, ledger id, and offending object —
reconcile_reports_amount_drift_with_currency_ledger_and_object + property divergence oracles.
user_data_128 with no graph object reported, not ignored — reconcile_reports_unresolved_graph_link.
Verification: dezren39/fleet run 45167178681 green on the branch (83 passed / 0 failed over currency::, pinned cargo 1.99.1 via nix develop); re-verified on merged main (69df9628505): 83 passed / 0 failed. Evidence thread: #2320 (comment)
Deliberately out of scope (packet 21144): live destructive repair, production scheduling, and deployment wiring — the landed surface is report-only per currency-control-plane design 7.1-7.3. File follow-ups for those separately if wanted. dezren39 commented on Nov 23, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|