Skip to content

feat(api): support SBA budgetScope and scopeId metadata#34

Merged
naory merged 3 commits intomainfrom
feat/sba-budget-scope
Mar 8, 2026
Merged

feat(api): support SBA budgetScope and scopeId metadata#34
naory merged 3 commits intomainfrom
feat/sba-budget-scope

Conversation

@naory
Copy link
Copy Markdown
Owner

@naory naory commented Mar 8, 2026

Summary

  • add budgetScope and optional scopeId to signed Session Budget Authorization envelopes for forward-compatible non-session scopes
  • enforce current implementation scope by rejecting non-SESSION SBA scopes during decision verification
  • propagate budgetScope and scopeId into SBA timeline metadata (including nested envelope fallback) for operator/debug consumers
  • document explicit Budget Scope values and clarify cumulative enforcement semantics for broader scopes keyed by scopeId
  • add focused tests for scope defaulting, scopeId propagation, non-session scope rejection, and timeline metadata extraction

Test plan

  • pnpm test -- test/services/sessionBudgetAuthorization.test.ts
  • pnpm test -- test/db/queries.session-events.test.ts
  • pnpm test -- test/routes/sessions.test.ts

Made with Cursor

NAOR YUVAL added 2 commits March 8, 2026 20:55
Include budgetScope in signed SBA envelopes and timeline metadata, default issuance to SESSION, and reject non-session scopes during current decision verification to align behavior with the updated SBA spec.

Made-with: Cursor
Introduce optional scopeId in signed SBA payloads, propagate it through emitted timeline metadata, and document scope semantics for future non-session budget scopes.

Made-with: Cursor
@naory naory changed the title feat(api): support SBA budgetScope in issuance and timeline feat(api): support SBA budgetScope and scopeId metadata Mar 8, 2026
Make the SESSION-scope relationship explicit by stating that scopeId should equal sessionId when budgetScope is SESSION.

Made-with: Cursor
@naory naory merged commit c36c0f8 into main Mar 8, 2026
@naory naory deleted the feat/sba-budget-scope branch March 8, 2026 19:54
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