Skip to content

docs(id): design refundable grants as pending transfers (#2065) - #2293

Merged
dezren39 merged 3 commits into
mainfrom
queue/3367-2065-pending-grants
Oct 30, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/3367-2065-pending-grants

Conversation

@dezren39

@dezren39 dezren39 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Design doc for #2065: grant premium tokens as pending TigerBeetle transfers so a Steam refund inside the refund window voids the grant instead of failing as a clawback.

What it says

  • Premise holds, with one correction: pending grants close the id: investigate: TigerBeetle — multi-currency ledgers, conversions, per-coin vs balance model, 3-node cluster topology #2040 clawback gap for refunds that arrive while the grant is pending. Once posted, tokens are spendable and a late refund is a clawback again — so the design makes the vesting window the refund window, and handles the residual explicitly.
  • Window length: recommends 14 days (Steam's own refund window), with the trade surfaced as a product pin rather than a buried default (decision issue filed).
  • Partial posting: partial post is for policy; refunds use void-and-reissue, because TigerBeetle's void is all-or-nothing.
  • UX: pending balance is visible but not spendable, server-authoritative vests_at, distinct error on spend-against-pending.
  • Mechanism failure modes: timeout safety net + reconciler, at-most-once resolution, drift alarm.

Doc: doc/2026-10-29T12-10-00Z_design_refundable_grants_pending_transfers/

Follow-ups filed from it: grant service implementation, vesting reconciler/drift alarm, and the window/spendability decision.

Queue task: 3367 (repo-health-code-pilot).


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

Grants issue as one pending TigerBeetle transfer per Steam key, vesting at
the refund-window close and voidable while pending. Covers window length,
partial posting (void-and-reissue, since void is all-or-nothing), the
pending-grant UX, and shows the #2040 clawback failure mode closed for
refunds inside the window while bounding the post-vest residual.
@dezren39
dezren39 requested a review from a team as a code owner October 29, 2026 12:03
@coderabbitai

coderabbitai Bot commented Oct 29, 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 41 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: 00a04e8d-7689-4e56-a5cb-c3ddfb84dedb
Commits

Reviewing files that changed from the base of the PR and between 5a34fa7 and b77237b.

Files selected for processing: 1
  • doc/2026-10-29T12-10-00Z_design_refundable_grants_pending_transfers/2026-10-29T12-10-00Z_design_refundable_grants_pending_transfers.md
  • 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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T12:16:42.029916Z b77237b New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15a7c7681f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


The cost is delayed usability: pending credits are not spendable posted balance (`credits_pending`, not `credits_posted`), so the user holds tokens they cannot spend until the window closes. That is the whole trade, and it is a product decision, not an engineering one — §3 surfaces it rather than defaulting it.

**Recommendation:** grant per Steam key as one pending transfer; vest (post) at window close; void on refund before close; re-issue the remainder for partial refunds (TigerBeetle cannot partially void). Window: **14 days from key redemption**, the Steam refund window, with an optional early-vest path if we ever get a trustworthy "refund window closed" signal. Partial refund after posting falls back to the bounded clawback + debt policy in §6.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Base the vesting window on the applicable purchase policy

For the key-backed grants described here, Valve's refund policy explicitly excludes third-party CD keys. For eligible Steam-store purchases, the standard 14-day period starts at purchase, or release for pre-purchases—not key redemption. Consequently, the proposed deadline does not establish the claimed alignment with Steam's refund window, and could impose a two-week spend lock without covering the actual seller's refund period. Identify the purchase channel and its applicable refund deadline before recommending a matching vesting window.

Useful? React with 👍 / 👎.

@dezren39
dezren39 enabled auto-merge October 29, 2026 12:14
@dezren39
dezren39 added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Oct 29, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.
@dezren39
dezren39 added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 206da6b Oct 30, 2026
3 checks passed
@dezren39
dezren39 deleted the queue/3367-2065-pending-grants branch October 30, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant