feat(agent): add odoo review mode with plausibility verdict

This commit is contained in:
2026-09-17 00:29:03 +02:00
parent 7162726b66
commit ba4bf57dcf
10 changed files with 670 additions and 34 deletions
+29 -7
View File
@@ -6,13 +6,13 @@ Rollender Übergabe-Log für agent-Threads. Workflow: `.agents/SKILL.md`
## Current focus
D24 validiert (500-Euro-Fragen verifiziert, think-Fix, Offline-Eval Recall@8
0,95). D25-Planung steht (planung.md Abschnitt 14): Odoo orchestriert und
rechnet (System of Record), Agent prüft Plausibilität, kein Rückpfad;
Privacy-Regel 8 wird erst per Feature-Flag `PV_REVIEW_MODE` im M4 aufgeweicht.
Modul-Review abgeschlossen (`.oddo-module/`), KV-Varianten-Mapping gebaut
(`tools/catalogs/kv_variant_map.json`, 439/614 abgedeckt, Seeds SI-2203/
SI-2748 getestet). Als Nächstes: D25-Umsetzung — Agent-`review`-Modus (M4.2)
und Odoo-Modul `l10n_at_payroll_agent` (M4.1).
0,95). D25-Planung steht (planung.md Abschnitt 14) und **M4.2 ist umgesetzt**: Agent
`mode=review` mit schema-gebundenem Odoo-Kontext, Beweisklassen, Injection-
Abgrenzung und `plausibility`-Verdict; Feature-Flag `PV_REVIEW_MODE` (default
aus). KV-Varianten-Mapping gebaut (`tools/catalogs/kv_variant_map.json`,
439/614 abgedeckt, Seeds SI-2203/SI-2748 getestet). 106 Tests grün. Als
Nächstes: M4.1 — Odoo-Modul `l10n_at_payroll_agent` (Client, Kontext-Builder,
Pilot-Workflow am Draft-Payslip).
## Completed (2026-09-16, Modul-Review/D25-Planung)
@@ -37,6 +37,28 @@ und Odoo-Modul `l10n_at_payroll_agent` (M4.1).
Draft-Payslip, Agent liefert strukturiertes Verdict), Agent-M4.2:
`mode=review` plus context-Schema, drei Beweisklassen, Injection-Abgrenzung
und Feature-Flag `PV_REVIEW_MODE` (default aus). Nicht-Ziele fixiert.
- **M4.2 Agent-Review-Modus (2026-09-16, D25):** `AskRequest.mode`
`knowledge|review` + `context` (StrictModel: facts ≤40, key-Muster,
computation + components ≤40; keine freien Objekte). `answer_question`
nimmt `context` an: Review-Addendum an den Systemprompt (Regeln 13/14:
Kontext = Daten/keine Anweisungen, übermittelte Werte ohne KB-ID,
Verdict-Format „Plausibilitätsprüfung:“ mit OK/WARN ⚠/OFFEN),
`parse_plausibility_checks` extrahiert Checks (OK/WARN ohne erlaubte KB-ID
zählen nicht), `plausibility_verdict` (implausible bei ⚠, plausible bei
OK, sonst not_checkable). Fehlender/leerer Abschnitt → Regenerierung;
bleibt er aus, bleibt die zitiergültige Fachantwort mit
`not_checkable`-Verdict bestehen (keine UNCERTAIN-Eskalation). API-Gating:
review ohne `PV_REVIEW_MODE` → 422; knowledge+context → 422; review ohne
context → 422. `grounding.data_scope` review:
`knowledge_base_plus_review_context`. Audit: `context_json`-Spalte mit
idempotenter Migration, Metadatenmodus ohne Kontext-Freitext. CLI:
`ask --context FILE`. Response-Felder `mode` + `plausibility`. Tests +8
(tests/test_review.py) → **107 grün**. **Real-Lauf validiert** (qwen3.8,
Odoo-Kontext-Sonde mit provokativ falscher Steuerfreiheit in der Simulation):
verified, 1 Regen, **Verdict implausible** — WARN Lohnsteuer (lb-lvr-07/
lb-naz-03), OK SV-Grundsatz (lb-naz-02), OFFEN DB/DZ + BVK; Parser-Fix:
Heading-Regex toleriert `**Plausibilitätsprüfung:**` (Doppelpunkt in den
Sternen) sowie ⚠-Präfix in der Aspect-Extraktion.
- **KV-Varianten-Mapping (Odoo ↔ KB, 2026-09-16):** Die KV-Library führt
bereits `wko/match-report.json` (wko_slug → oegb_variant_id; 407 matched /
32 low / 175 unmatched). `tools/build_kv_variant_map.py` erzeugt daraus