feat(ai): centralize durable usage
Add a content-free usage ledger with legacy backfill. Reserve Workspace and durable Strategy/CV work before execution so deleted history or duplicate admission cannot reset limits.
This commit is contained in:
@@ -19,6 +19,7 @@ CV upload previously saved an artifact and held the HTTP request while extractio
|
||||
- Upload/reprocess reopen the stored owner artifact in the worker. Rebuild/improve pass the worker cancellation token to the metadata-capable generation call.
|
||||
- Successful processing stops at `pending_review`. It does not update profile text/structure/current-version pointers until the existing accept endpoint is called. Discard remains available.
|
||||
- The UI shows queued, local processing, retry wait, approved-fallback wait, failed, cancelled and cancellation-requested states with cancel/retry actions. The upload spinner now ends after admission and reports the queued run rather than false extraction success.
|
||||
- Admission creates one content-free conservative usage reservation atomically with the operation. Active duplicates reuse it. CV processing intentionally retains the 16,000-token reservation because the multi-stage sidecar does not yet return complete per-stage usage telemetry.
|
||||
|
||||
No dependency, schema, migration, proxy timeout or production switch changed. `Workers:AiOperationsEnabled` remains false by default.
|
||||
|
||||
@@ -40,7 +41,7 @@ No dependency, schema, migration, proxy timeout or production switch changed. `W
|
||||
- The generic lease tests cover restart recovery, but no CV parser/model process was interrupted and resumed in a runtime canary.
|
||||
- MariaDB, selected Ollama model, worker telemetry, production activation and rollback canary remain unverified. The worker stays default-off.
|
||||
|
||||
The focused CV/operation/store regression slice is now 17/17 and the full backend is 660/660 after dormant-row cancellation/deadline/retry coverage.
|
||||
The focused accounting/operation/lifecycle regression slice passes 28/28 and the full backend is 663/663 after durable usage and dormant-row lifecycle coverage.
|
||||
|
||||
## Rollback
|
||||
|
||||
|
||||
Reference in New Issue
Block a user