feat(ai): enforce local-first routing

Keep external providers behind server consent, task, and prompt-cost gates while persisting actual provider provenance.
This commit is contained in:
cesnimda
2026-08-09 12:30:11 +02:00
parent c3f4a57195
commit 5eb9b3cb96
29 changed files with 967 additions and 145 deletions
+11
View File
@@ -463,3 +463,14 @@ Status: Implemented; real-handler/browser/production verification incomplete (20
- **Findings:** no new schema/raw private queue payload; multi-replica capacity needs a future database reservation; actual 202 producers and provider controls remain AI-003/004 and AI-002.
- **Blockers:** browser, MariaDB and production unavailable; worker intentionally off.
- **Next phase:** AI-002 Ollama adapter and central local-first routing.
## Post-audit programme execution — AI-002
Status: Implemented; browser/model/provider/production verification incomplete (2026-08-09).
- **Work completed:** revalidated every AI endpoint/caller; replaced direct configured-provider dispatch with one sequential local-first router; added task/consent/config/prompt-cost gates, bounded circuit/health state, typed sanitized failures and actual provider/model/route persistence for AI history and durable operations.
- **Commands/evidence:** verification-log V-098V-100; `docs/verification/ai-002-provider-routing.md`; `docs/audits/evidence/ai-002/README.md`.
- **Findings:** no schema/dependency change and no provider race. New durable tasks fail safe to local until allowlisted. Per-request prompt ceiling exists, but complete monthly cross-feature accounting remains incomplete. Circuit state is process-local for the current single-sidecar design.
- **Checks that remain:** real AI-003/004 handlers/producers; selected-model benchmark; browser disclosure; MariaDB; controlled synthetic external fallback; production health/restart/canary/rollback.
- **Blockers and limitations:** no browser, production access, model benchmark or provider authority/configuration; no real/private input used.
- **Next phase:** AI-003 Strategy Snapshot durable-operation migration.