docs(ai): record strategy queue evidence
This commit is contained in:
@@ -289,3 +289,13 @@
|
||||
- **Consequences:** `AI_ROUTING_MODE` supports `local_only`, `local_first` and explicitly gated `external_only`; invalid values fail closed. New durable task IDs stay local until allowlisted. The current circuit is process-local and one AI worker is the effective single-model concurrency limit. Per-request prompt size limits external spend/exposure, but complete monthly cross-feature accounting and model selection remain rollout gates.
|
||||
- **User approval required:** No; this directly implements the approved local-first programme without invoking a provider or production service.
|
||||
- **Reversible:** Yes. Set `EXTERNAL_AI_ENABLED=false` or `AI_ROUTING_MODE=local_only`; the older `AI_PROVIDER`/model configuration is retained. Existing nullable operation fields and AI history remain readable.
|
||||
|
||||
## DEC-030 — Strategy generation is one typed operation and one structured inference
|
||||
|
||||
- **Date:** 2026-08-09
|
||||
- **Decision:** Make Focus Plan GET cache-only and move generation to typed `strategy.snapshot` work on the shared queue. Encode only job and at most four attachment IDs, reuse active operations, and replace four sequential model calls with one bounded JSON response whose complete shape is validated before the unique cache row is updated. Keep Strategy absent from the external fallback allowlist.
|
||||
- **Reason/evidence:** the traced button/GET path owned four serial model calls and had no restart/cancel/retry identity. AI-001/002 already provide every needed state/policy/routing primitive. One structured inference reduces timeout exposure and makes publication atomic without a second queue or schema.
|
||||
- **Alternatives considered:** increase HTTP/proxy timeouts; keep GET as a command; add a Strategy queue/table; store prompts/private text in operation payload; four model calls inside the worker; race external/local providers. These retain the root failure, duplicate infrastructure/private data/output, or violate established routing safety.
|
||||
- **Consequences:** existing cached `FocusPlanDto` remains readable, while generation now returns 202 and the UI resumes by operation ID/context. Retry can overwrite only the same unique result row. Worker activation and real-model tuning remain rollout gates; operation records provide deduplication/provenance, not full monthly billing accounting.
|
||||
- **User approval required:** No; both programmes explicitly require durable Strategy work and consolidation with AI-001/002.
|
||||
- **Reversible:** Yes. Keep the worker off and revert `a621226`; no schema/dependency changed. Cancel or drain queued `strategy.snapshot` rows before removing the handler.
|
||||
|
||||
Reference in New Issue
Block a user