GeezerVison is showing github.com — id: build: grant service — pending-transfer grants (register/vest/void) with control-plane grant records · Issue #2294 · developing-today/code
id: build: grant service — pending-transfer grants (register/vest/void) with control-plane grant records #2294DescriptionFollow-up from the #2065 design (doc/2026-10-29T12-10-00Z_design_refundable_grants_pending_transfers/, PR #2293). Buildable once the control-plane/gateway shape in #2062 is settled.
Scope
- Control-plane
grant table exactly as §2.3 of the design: id, steam_key_hash, user_id, ledger, amount, state, pending_transfer_id, resolution_transfer_id, window_started_at/ends_at, attempt counters.
- Endpoints (§2.4):
POST /grants (idempotent on steam_key_hash), POST /grants/{id}/vest, POST /grants/{id}/void, GET /grants/{id}, GET /users/{id}/grants.
- TigerBeetle side: one
flags.pending transfer per key from issuer.grant_pool to the holder account, dedicated grant code range, user_data_128 = grant id, user_data_64 = key hash; vest via post_pending_transfer + pending_id; refund via void_pending_transfer.
- Partial refunds: void-and-reissue (§4) — TigerBeetle's void is all-or-nothing, so a partial refund voids the hold and issues a new pending transfer for the remainder, linked by
correction_of.
- Treat
pending_transfer_already_posted / _voided / _expired as idempotent outcomes (409 at the API, success internally).
Not in scope
Vesting automation and drift detection — that is the reconciler issue. The refund-window value comes from the decision issue; use it as a config, never hard-coded.
Done when
Register → vest and register → void both work against a dev TigerBeetle cluster with targeted tests, double-resolution returns 409, and a partial refund leaves no posted credit behind.
Acceptance criteria
- Grant table matches design §2.3 exactly (fields incl. pending/resolution transfer ids, window bounds, attempt counters)
- Endpoints live: POST /grants (idempotent on steam_key_hash), vest, void, GET one, GET per-user
- Register → vest and register → void both pass against a dev TigerBeetle cluster with targeted tests
- Double-resolution returns 409; already-posted/voided/expired treated as idempotent outcomes internally
- Partial refund via void-and-reissue leaves no posted credit behind; refund-window value comes from config, never hard-coded
Activitydeveloping-today commented on Oct 29, 2026 dezren39 commented on Oct 29, 2026 Intake review
Related: #2065 design (PR #2293, §2.3/§2.4/§4), #2062 (control-plane shape — buildable once settled), the refund-window decision issue #2296, epic #2056
Notes: Foundational build for the refundable-grants family; #2295 (reconciler) depends on this table.
Risks: TigerBeetle void is all-or-nothing — partial-refund correctness lives entirely in the void-and-reissue path; test it hardest.
Suggested approach: Settle #2062 shape first, then table + endpoints, then the partial-refund tests.
🤖 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
dezren39 commented on Nov 3, 2026 🤖 Agent note · done — triage verdict: CONFIRMED, ORDERED (buildable design; two sibling dependencies + one Drew decision ahead of it)
Verified fresh (2026-11-03)
Blockers / ordering (recorded per the acceptance)
- id: build: TigerBeetle cluster provisioning — RTT mesh gate, 6-replica format, dead-replica runbook + rehearsal #2292 — TigerBeetle cluster provisioning (open, sibling): this issue's acceptance requires register → vest and register → void to pass against a dev TigerBeetle cluster. id: build: TigerBeetle cluster provisioning — RTT mesh gate, 6-replica format, dead-replica runbook + rehearsal #2292 is the sibling that provisions that cluster (RTT mesh gate, 6-replica format, rehearsal). Order: id: build: TigerBeetle cluster provisioning — RTT mesh gate, 6-replica format, dead-replica runbook + rehearsal #2292 first, or the build must stand up its own throwaway dev cluster and say so.
- id: decide: grant refund window length and whether pending tokens are spendable #2296 — refund-window decision (open,
user/review, priority/high, Drew's): the window length (design recommends 14 days, Steam's window) and whether pending tokens are spendable are deliberately NOT to be defaulted in code — id: decide: grant refund window length and whether pending tokens are spendable #2296 was filed "so it is decided deliberately rather than defaulted in code". The build can plumb the value as config without the decision, but it must not ship a hard-coded or silently-chosen default; the decision gates calling this done.
- id: build: grant vesting reconciler and control-plane↔ledger drift alarm #2295 — vesting reconciler (open, sibling): explicitly out of scope here (per the body), listed only to fix the set order: id: build: TigerBeetle cluster provisioning — RTT mesh gate, 6-replica format, dead-replica runbook + rehearsal #2292 → id: build: grant service — pending-transfer grants (register/vest/void) with control-plane grant records #2294 → id: build: grant vesting reconciler and control-plane↔ledger drift alarm #2295, with id: decide: grant refund window length and whether pending tokens are spendable #2296 decided before id: build: grant service — pending-transfer grants (register/vest/void) with control-plane grant records #2294 is called done.
Verdict
Still live, correctly scoped, not yet startable as a clean single build until #2292 lands (or a dev-cluster substitute is declared) and #2296 is decided. No packet defect; routing stays a build task at effort/l once the ordering clears. 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 17, 2026
Agent note — task 19739 parked for capacity as build vehicle (lane any-d, 2026-11-17)
Fresh verification this shift: issue #2294 OPEN (effort/l, status/triaged, epic/id-program, no hard-stop labels); gates #2062/#2065 CLOSED, design PR #2293 merged; gate #2292 still OPEN (TigerBeetle provisioning — gates only dev-cluster acceptance, not the build). No grant-service code exists in the repo yet (verified today: only the design docs doc/2026-10-29T12-10-00Z_design_refundable_grants_pending_transfers/ and doc/2026-10-30T11-55-00Z_design_grant_lifecycle.md) — this is a greenfield effort/l build (grant table, 5 endpoints, TigerBeetle pending transfers, partial-refund correction_of, 409 double-resolution, dev-cluster tests), not completable inside one 240-minute lane shift. Task 19739 is parked for capacity as the build vehicle with the full build brief in its park reason, for a dedicated build session. dezren39 commented on Nov 17, 2026 Agent note (lane code-b, queue task 19739): first build slice landed.
Merged: PR #11196 (merge commit 87cccd6) — new grants module in id-currency-registry:
Grant record + GrantState per design §2.3, plus correction_of (§4); GrantStore trait + in-memory impl with the duplicate-key rule (a voided grant's steam_key_hash may recur only via its own correction).
PendingLedger trait + StubLedger with TigerBeetle two-phase semantics (at-most-once resolution; pending/posted balances as the test oracle); grant transfers use code 0xF000 (reserved PendingHoldRedemption range).
GrantService: idempotent register on the sha256 key hash (key itself never stored), vest/void with double-resolution returning the 409 outcome and syncing the row to the ledger's truth, partial refund as void-and-reissue keeping the original vesting window. Window from config (14 days, id: decide: grant refund window length and whether pending tokens are spendable #2296 — never hard-coded); pending timeout = window + 72h (§6.3).
- Migration
0002_grants (up/down) for the grant_record table.
- Tests: 9 new acceptance tests; full crate suite green (11 lib + 6 factory + 9 grants); new module clippy-clean.
Remaining for the full build (task 19739 stays the build vehicle, parked resumable): gateway HTTP endpoints (§2.4), Postgres GrantStore implementation, real TigerBeetle PendingLedger, and dev-cluster acceptance — the last gated by #2292, the build itself is not. dezren39 commented on Nov 17, 2026 Agent note (openchamber scheduled lane any-o, queue task 19739): triage verdict.
Fresh state checked 2026-11-17: #2294 is OPEN. Slice 1 is MERGED as PR #11196 (merge 87cccd6): grants module, migration 0002, 9 acceptance tests, in-memory GrantStore and StubLedger seam.
Verdict: not resolved and not closeable. Remaining slices, in the order the issue already records: gateway HTTP endpoints (design 2.4), Postgres GrantStore impl, real TigerBeetle PendingLedger. Dev-cluster acceptance is gated by #2292.
No new follow-on packet is enqueued in this pass. The next slice is a build, so it should be packetized by the build owner when it starts, with this comment as the reference. Triaged; no status change on the issue. dezren39 commented on Nov 22, 2026 Merged work, still open. Every pull request that references this issue has merged (#11196) and none is open, but the issue kept status:in-review. Tasks that name it as a blocker have been waiting on it.
status:in-review is removed. Whoever takes this next: run the issue's done check against main. Close the issue if it passes; if not, list what is left here and carry on with it (AGENTS.md, "Finishing work").
By: Claude, 2026-11-22 flow review.
Generated by Claude Code dezren39 commented on Nov 24, 2026 Agent note (openchamber scheduled lane oc-code-01, queue task 21791, second-pass verify-and-route).
Fresh state checked 2026-11-24: #2294 is OPEN. PR #11196 (grant service core) is MERGED and no PR referencing #2294 is open. The grant module, migration 0002 and in-memory GrantStore/StubLedger seam are on main.
Verdict: not resolved, not closeable. Remaining work, in the issue's order: gateway HTTP endpoints (design 2.4), Postgres GrantStore impl, real TigerBeetle PendingLedger. Dev-cluster acceptance remains gated by #2292.
No code changed in this pass. The follow-on build stays on this issue's remaining slices; no new packet enqueued here. developing-today-fleet commented on Nov 26, 2026
Agent note — triage (lane oc-code-02, task 24904)
State: triaged — reconciliation pass; prior verdicts (any-o/19739, oc-code-01/21791) confirmed still correct.
Fresh evidence (checked 2026-11-26T23:58Z via fleet gh):
- Issue id: build: grant service — pending-transfer grants (register/vest/void) with control-plane grant records #2294 OPEN, labels task/triage, status/parked + queue/parked + status/triaged, priority/normal, effort/l, epic/id-program. No held / user/owned / do-not-merge / do-not-auto-edit labels. Parked labels stay — the resume condition below is not a person.
- Slice 1 stands MERGED: PR feat(id): grant service core — record, store, pending-ledger seam, register/vest/void/partial-refund (#2294) #11196 (grants module, migration 0002, 9 acceptance tests, in-memory GrantStore + StubLedger seam). No PR referencing id: build: grant service — pending-transfer grants (register/vest/void) with control-plane grant records #2294 is open.
- Remaining slices in issue order: gateway HTTP endpoints (design §2.4), Postgres GrantStore impl, real TigerBeetle PendingLedger. Dev-cluster acceptance still gated by id: build: TigerBeetle cluster provisioning — RTT mesh gate, 6-replica format, dead-replica runbook + rehearsal #2292 (TigerBeetle cluster provisioning, OPEN, status/triaged).
Triage verdict: not resolved, not closeable. No new packet from triage — the next slice is a build for the build owner to packetize, and the dev-cluster acceptance resumes when #2292 closes. Task 24904 completes as triaged.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|