Skip to content

docs(cards): describe scope-based spending limit inheritance - #1226

Draft
DhruvPareek wants to merge 1 commit into
mainfrom
dp/card-limit-inheritance-docs
Draft

DhruvPareek wants to merge 1 commit into
mainfrom
dp/card-limit-inheritance-docs

Conversation

@DhruvPareek

@DhruvPareek DhruvPareek commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Reason

Make amount/count inheritance and deletion fallback explicit when a rule leaves one cap unset.

Overview

Clarifies that amount and count inherit independently from the next configured scope. Deleting the last cap at a scope restores its broader default until a replacement is created; a failed replacement leaves inheritance in effect.

#1225 has merged the consolidated configuration contract. This documentation-only child now targets main, retaining #1212's real-time authorization definitions. It changes rule descriptions without changing endpoint or model shapes. The matching generated documentation is in webdev #39024, after the consolidated client in #39019; backend consolidation onto stored rules is in #39253. The configuration/ASA branch is independent of this draft inheritance branch.

Test Plan

  • make build — passed; regenerated bundles match the committed files.
  • make lint — passed, 0 errors (191 warnings, 740 infos).
  • Restacked onto main (7a8dec9b); verified the diff contains only the five inheritance-description source/bundle files.

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
grid-cards-demo Ignored Ignored Preview Oct 27, 2026 6:34pm UTC
grid-flow-builder Ignored Ignored Preview Oct 27, 2026 6:34pm UTC
grid-wallet-demo Ignored Ignored Preview Oct 27, 2026 6:34pm UTC

Request Review

DhruvPareek commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

@DhruvPareek
DhruvPareek force-pushed the dp/card-velocity-rules-api branch from 68acaa3 to 305e38f Compare October 26, 2026 21:26
@DhruvPareek
DhruvPareek force-pushed the dp/card-limit-inheritance-docs branch from d176bef to 7ae3617 Compare October 26, 2026 21:26
@DhruvPareek
DhruvPareek force-pushed the dp/card-velocity-rules-api branch from 305e38f to 5151036 Compare October 26, 2026 22:01
@DhruvPareek
DhruvPareek force-pushed the dp/card-limit-inheritance-docs branch 2 times, most recently from 5106f85 to b9b4db5 Compare October 26, 2026 22:54
@DhruvPareek
DhruvPareek force-pushed the dp/card-velocity-rules-api branch 2 times, most recently from fc8b95d to 22cdafc Compare October 26, 2026 22:58
@DhruvPareek
DhruvPareek force-pushed the dp/card-limit-inheritance-docs branch 2 times, most recently from f706502 to ec14dbb Compare October 26, 2026 23:43
@DhruvPareek
DhruvPareek force-pushed the dp/card-velocity-rules-api branch from 22cdafc to 7a52af6 Compare October 26, 2026 23:43
@DhruvPareek
DhruvPareek marked this pull request as ready for review October 27, 2026 00:29
@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This documentation-only PR appears safe to merge.

Summary

Clarifies how card spending limits inherit without changing routes, fields, or enforcement.

  • Card spending caps inherit missing values from broader scopes.
  • The rule list description says which Lightspark rules it leaves out.

No actionable issues found.

Reviews (1) · Last reviewed commit: "docs(cards): describe scope-based spendi..." · Reviewed by Greptile

benwgold
benwgold previously approved these changes Oct 27, 2026
@DhruvPareek
DhruvPareek changed the base branch from dp/card-velocity-rules-api to graphite-base/1226 October 27, 2026 16:43
DhruvPareek added a commit that referenced this pull request Oct 27, 2026
## Reason

Card velocity limits currently have separate configuration fields on card and platform resources. Make the velocity-rule collection the single API configuration surface, with consistent amount/count semantics and documentation.

## Overview

Defines create, list, get, and delete at `/card-velocity-limits` and `/card-velocity-limits/{id}`. Omitting/null `cardId` configures per-card platform defaults; supplying it targets one owned card. Creation returns 201, while an existing target/metric/window/duration returns 409 CONFLICT with the unchanged rule's ID. Delete/recreate is explicit; inheritance governs the interval between requests and a failed replacement leaves deletion in effect.

Removes `maxSpendPerTransaction`, `maxSpendPerDay`, and `maxTransactionsPerDay` from card creation/update, card responses, platform `CardConfig`, and agent card update requests. The surrounding card/config endpoints remain for their other operations. Replaces the three scalar-limit capability flags with `supportsVelocityLimits`. Agent-wide budgets, merchant-category controls, risk ceilings, and provider-enforced constraints remain separate.

All Grid-managed per-authorization, UTC calendar, and rolling amount/count controls use the rule API. Requests/responses have no currency field; amount caps use each card's minor units, including USD cents for USDB-funded USD cards. APPROVED includes $0 approvals; amount usage is holds less releases, while releases do not restore the approval count. Rules apply only where Grid decides authorizations. Platforms cannot access another platform's or Lightspark-managed rules.

Adds the Velocity Limits guide and navigation, updates issuance/wallet/status documentation, removes scalar-limit examples, and refreshes webhook samples. The top-level path follows `/card-disputes/{id}`: `/cards/velocity-limits/{id}` fails Grid's ambiguity lint against existing `/cards/{id}/reveal`, tokenize, and PIN actions. Underlying rule model/ID names are retained.

This is the API contract/documentation change. It does not migrate database settings or backend handlers. The backend must adopt the new route, canonical rule storage, and capability flag before this contract and its generated client are deployed. Generated artifacts are in [webdev #39019](lightsparkdev/webdev#39019), with #1226 inheritance documentation generated in [webdev #39024](lightsparkdev/webdev#39024). These generated PRs require the backend migration before merging; the separate regeneration #39178 has been consolidated into them. Card → platform → program inheritance is described here and refined by child #1226.

## Test Plan

- `make build` and `make lint` on both API branches — passed, 0 errors (187 warnings, 740 infos).
- Parsed the new guide and all three edited snippets with `@mdx-js/mdx` — passed.
- Validated guide request/response examples and updated issuance examples against the bundled OpenAPI schema with AJV — passed.
- Structural assertions confirmed that only the three legacy limit properties were removed from each existing card/config model; unrelated properties, agent spending-policy shapes, and existing non-velocity routes are preserved.
- Searched source specs and card guides for the removed scalar fields, capability flags, and old route names — no remaining references.
- Restacked on current `main` (`4f1963bf`) and rebuilt both generated bundles to resolve conflicts, retaining the upstream agent card hand-over endpoint and SWIFT/UETR models. Removed the API/Lightspark lower-cap wording from the guide and endpoint description; enforcement is unchanged.
@DhruvPareek
DhruvPareek force-pushed the dp/card-limit-inheritance-docs branch from ec14dbb to 3738b00 Compare October 27, 2026 16:43
@graphite-app
graphite-app Bot changed the base branch from graphite-base/1226 to main October 27, 2026 16:44
@graphite-app
graphite-app Bot dismissed benwgold’s stale review October 27, 2026 16:44

The base branch was changed.

@mintlify

mintlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Grid 🟢 Ready View Preview Oct 27, 2026, 6:35 PM

Card spending limits are changing from the strictest value across all scopes to inheritance by specificity. Document the policy so platforms can predict which configured cap will apply.

For each count or currency-specific amount cap and matching metric/window, use card scope first, platform scope second, and program scope last. At the selected scope the lower API or Lightspark-managed cap applies. An unset cap inherits; an explicit zero remains configured and blocks.

Updates create/update/read card fields, platform defaults, and velocity-rule documentation. Amount and count inherit separately; distinct rolling durations remain independent. Provider-enforced account caps remain outside this Grid hierarchy. No request/response shape changes or new lifetime window.

Stacked on #1225. Companion webdev PR implements this policy; the generated client update is kept separate from backend logic.

- `make build` — passed; regenerated both OpenAPI bundles.
- `make lint` — passed (existing warnings only).

This branch was successfully deployed

1 active deployment
staging - mintlify — 23024b61 Deployed Oct 27, 2026 by mintlify[bot]
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.

2 participants