Skip to content

Reserve Curated spend before provider attempts - #135

Merged
R055LE merged 14 commits into
mainfrom
issue-117-curated-reservations
Oct 30, 2026
Merged

R055LE merged 14 commits into
mainfrom
issue-117-curated-reservations

Conversation

@R055LE

@R055LE R055LE commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Curated checked only reported usage before calling the provider, so the next call could cross a daily limit and ambiguous failures could disappear from accounting. Selected request profiles now atomically reserve conservative input, full output and priced USD bounds before each provider attempt. Scheduled evaluations and manual previews share daily workflow and attempt limits, plus a four-call maximum per workflow.

The ledger commits independently of other Store transactions, settles trustworthy usage once, and retains unknown exposure across restarts and midnight. Partial valid usage and reported overruns remain recorded. An unresolved overrun holds further admissions until reconciliation. Status and preview results expose the accounting categories and refusal reason. The selected profile requires explicit positive dollar, workflow and attempt limits; deployed settings and legacy defaults remain unchanged.

Validation: 755 offline tests passed, 88.31% coverage, Ruff and diff checks passed; independent review is clean. Regressions cover last-call overshoot, concurrent admission, unrelated rollback, stale read snapshots, exactly-once settlement, cancellation, malformed/partial usage, midnight carryover, overrun holds, and shared preview/scheduled limits.

An isolated current-Scout no-send preview passed at combined #134/#135 head 6fd942d: one workflow, four calls, every reservation settled within approval, no unknown exposure or overrun, and unchanged story/delivery state. Independent reconciliation matched the response artifacts and SQLite ledger with no double counting. This does not select production capacity or test live history and delivery.

Stacked on #134. Refs #117. The ledger has no automatic release or reconciliation command. Operating capacity, merge, deployment and activation remain separate decisions; production configuration is unchanged.

@R055LE
R055LE marked this pull request as ready for review October 30, 2026 15:47
@R055LE
R055LE enabled auto-merge (squash) October 30, 2026 15:47
@R055LE
R055LE merged commit 4896951 into main Oct 30, 2026
2 checks passed
@R055LE
R055LE deleted the issue-117-curated-reservations branch October 30, 2026 15:48
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