Repository navigation
feat: prepare default-disabled fleet budget admission ledger - #1615
Conversation
Add shared atomic reservations, one-shot dispatch, conservative reconciliation and explicit provider cost coverage. Code and synthetic tests only; activation remains pending under #1602.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
Public API boundary omission in Kody rule violation: Every exported schema or utility ships with tests and must typecheck |
|
❌ Error processing validation An error occurred while processing the system response. Please try again. Details
|
Add a session-only Money-page monitor with explicit cost coverage and bounded refreshes. Validate durable price snapshots and bound ledger retries; keep all admission flags and Kody callers disabled.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
NBSP policy violation in Kody rule violation: Use two spaces between sentences in every human-facing string and agent-written paragraph |
|
❌ Error processing validation An error occurred while processing the system response. Please try again. Details
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
❌ Error processing validation An error occurred while processing the system response. Please try again. Details
|
#1615 added fleet-budget visual assertions without PNGs, and the money page grew after FleetBudgetCard landed. These three files are the ubuntu-latest Playwright actuals from the PR E2E smoke job so the suite matches the runner font stack. Co-authored-by: Jay Wedgeworth <jaywedgeworth22@users.noreply.github.com>
#1615 added fleet-budget visual assertions without PNGs, and the money page grew after FleetBudgetCard landed. These three files are the ubuntu-latest Playwright actuals from the PR E2E smoke job so the suite matches the runner font stack. Co-authored-by: Jay Wedgeworth <jaywedgeworth22@users.noreply.github.com>
Scope
Prepares the server-side foundation for #1602. This draft does not close the issue or activate a Kody caller. Shared workflow PR congress-trading-shared#336 and caller #1603 are unchanged.
Assumptions and remaining gates
Policy values come from #1602 and are code defaults for review, not an activation approval. Calls and late settlements are attributed to the admission day. Outstanding reservations count toward the soft transition. No model price is preconfigured.
FLEET_BUDGET_ENABLED and FLEET_BUDGET_ADMISSION_ENABLED both default off. Admission can be stopped while settlement continues. No provider call, credential/protected-environment setup, permission change, merge or deployment was performed.
A trusted shared proxy must still enforce the actual payload/input/output ceiling and obtain a separate permit for every provider request/retry. It must validate the receipt's expiry immediately before upstream invocation and map cache/reasoning/streamed usage correctly. The server cannot enforce a caller that bypasses this contract. Pricing verification, client/security setup, existing usage-telemetry integration, operational recovery, reviewed rollout and rollback remain gates before activation. Do not automatically reclaim ambiguous liabilities.
Verification
Coordination
Board 93ce23c98f8944bbb9d9750876a1e47c is in progress. App and agent-sync reservations were posted. Only relevant code/schema/test and visual-fixture files are included; task notes are here. SDK #1611, reporter #1612 and iOS #1614 remain separate. Keep this PR draft and keep #1602 open until the remaining integration and rollout work is complete.
Read-only monitoring and review follow-up
Current head adds a session-only Money-page Fleet Daily Budget card, explicit read timestamp, disabled/paused/blocked states, exact micro-USD formatting and per-provider unknown/estimated/unverified-report coverage. No activation controls are exposed. A ten-second read deadline clears stale figures and leaves a working Retry action. Cookie auth is checked with the existing verified helper; middleware and dedicated mutator authentication are unchanged.
The HTTP helper now has an explicit server-only marker and typed public test port. Static test SQL uses tagged APIs. Persisted price snapshots and stored bounds are revalidated, and SQLite retry time has a monotonic total budget. Dedicated budget tokens grant trusted gateway/settlement authority, including the ability to fail closed for the fleet after a reported overrun. They must never be issued to ordinary telemetry producers, end users or untrusted model inputs. A lower-trust settlement path needs independently verified provider evidence or separate authority; clamping genuine overruns would hide spend and is not used. Requests that do not fit the selected provider fail explicitly; they do not silently select an unchecked paid fallback.
48 focused tests, full TypeScript, scoped lint, production build and an independent exact-delta review pass. Backend checkpoint e496c40 passed all hosted verify/coverage, Docker, E2E, CodeQL, gitleaks and pin gates. The changed Money layout and new mobile/desktop fixtures still require runner-generated visual baselines and screenshot inspection; that is pending and is not claimed as passed. New UI board reservation:33a735da221040e8aac60ce4a44bed4a.