GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(id): grant service core — record, store, pending-ledger seam, register/vest/void/partial-refund (#2294) by dezren39 · Pull Request #11196 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

First build slice for #2294 (refundable grants / pending transfers), implementing the merged design in doc/2026-10-29T12-10-00Z_design_refundable_grants_pending_transfers/.

What lands

New grants module in id-currency-registry:

  • Grant record + GrantState (pending/posted/voided/expired/clawback_pending/clawback_settled/debt) per design §2.3, plus correction_of from §4.
  • GrantStore trait + in-memory implementation. Duplicate-key rule: a voided grant's steam_key_hash may recur only via its own correction (partial unique index in the migration matches).
  • PendingLedger trait + StubLedger enforcing TigerBeetle two-phase semantics (at-most-once resolution; credits_pending/credits_posted balances as the test oracle). GRANT_TRANSFER_CODE = 0xF000, the reserved PendingHoldRedemption range start.
  • GrantService: idempotent register on steam_key_hash (sha256; the key itself is never stored), vest/void with double-resolution returning the API 409 outcome and syncing the row to the ledger's truth, refund_partial as void-and-reissue keeping the original vesting window. Vesting window comes from config (14 days per id: decide: grant refund window length and whether pending tokens are spendable #2296, never hard-coded); pending-transfer timeout = window + 72h slack (§6.3).
  • Migration 0002_grants (up/down): grant_record table, u128 ids as text, amount numeric(39,0), unix-second times.

Tests

tests/grants_acceptance.rs: 9 acceptance tests (register→vest, register→void, double-resolution 409, partial refund leaves no posted credit, register idempotency, refund bounds, expiry sync, unknown grant, sha256 vector). Full crate suite green: 11 lib + 6 factory + 9 grants. Clippy clean for the new module (the two remaining crate warnings are pre-existing in factory.rs / factory_acceptance.rs).

Not in this slice

Gateway HTTP endpoints (§2.4), the Postgres GrantStore implementation, the real TigerBeetle PendingLedger, and dev-cluster acceptance (gated by #2292). Queue task 19739 remains the build vehicle for the follow-on slices.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
repo-worker-tmp-code-b
feat(id): grant service core — grant record, store, pending-ledger se…
0757153
…am, register/vest/void/partial-refund (#2294)
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 09:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T09:59:05.114206Z
We couldn’t complete this review. Comment @codex review to try again.
0757153 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 02574c15-d3dc-4c81-9ba8-83904ad71fef
Commits

Reviewing files that changed from the base of the PR and between 3b20b9d and 0757153.

Files ignored due to path filters: 1

  • pkgs/id/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 6

  • pkgs/id/crates/id-currency-registry/Cargo.toml
  • pkgs/id/crates/id-currency-registry/migrations/0002_grants.down.sql
  • pkgs/id/crates/id-currency-registry/migrations/0002_grants.up.sql
  • pkgs/id/crates/id-currency-registry/src/grants.rs
  • pkgs/id/crates/id-currency-registry/src/lib.rs
  • pkgs/id/crates/id-currency-registry/tests/grants_acceptance.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit 87cccd6 into main Nov 17, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the queue/19739-2294-grant-service branch November 17, 2026 09:59
This was referenced Nov 17, 2026
id: build: grant service — pending-transfer grants (register/vest/void) with control-plane grant records #2294
Open
id: build: grant vesting reconciler and control-plane↔ledger drift alarm #2295
Open
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.