Add review skill and make review stage mandatory in AGENTS.md
- Add .agents/skills/review/SKILL.md with a required review checklist covering project rules, model client rules, pipeline rules, XML rules, and test rules. - Update AGENTS.md with a dedicated 'Review Stage Rules' section that makes review mandatory and maps confidence thresholds to XML generation behavior. - Add review skill to the skills reference. - Add .ruff_cache/ to .gitignore and keep agent XML templates out of the '*.xml' ignore rule.
This commit is contained in:
@@ -69,13 +69,26 @@ Input File
|
||||
|
||||
## Data Flow Rules
|
||||
|
||||
1. Every invoice must produce:
|
||||
1. Every invoice must pass through the **review stage** before XML generation. The review model compares the original image with the extracted JSON and produces a `ReviewResult`.
|
||||
2. Every invoice must produce:
|
||||
- A Pydantic `ExtractedInvoice` object.
|
||||
- A review result (`ReviewResult`) with confidence score and issue list.
|
||||
- An Odoo XML file (unless blocked by low confidence).
|
||||
- A sidecar JSON file with metadata, timings, and confidence.
|
||||
2. If review confidence is below the configured threshold, mark the invoice for human review and do not generate final XML (or generate a draft with a warning flag).
|
||||
3. Never send invoice data outside the local model endpoints.
|
||||
3. If review confidence is below the configured threshold, mark the invoice for human review and do not generate final XML (or generate a draft with a warning flag).
|
||||
4. Never send invoice data outside the local model endpoints.
|
||||
|
||||
## Review Stage Rules
|
||||
|
||||
1. The review stage is **mandatory**, not optional.
|
||||
2. The review VLM must receive both the original invoice image and the extracted `ExtractedInvoice` JSON.
|
||||
3. The review prompt asks the model to verify field presence, arithmetic, and consistency.
|
||||
4. The `ReviewResult` must include a confidence score between 0.0 and 1.0 and a list of issues.
|
||||
5. XML generation must respect the confidence thresholds in `config.yaml`:
|
||||
- `confidence >= 0.90`: generate final XML.
|
||||
- `0.75 <= confidence < 0.90`: generate XML with a human-review flag.
|
||||
- `confidence < 0.75`: do not generate final XML; emit sidecar JSON only.
|
||||
6. See skill `review` for the full review checklist.
|
||||
|
||||
## Odoo XML Target
|
||||
|
||||
@@ -104,3 +117,4 @@ Agents should load the relevant project skills from `.agents/skills/`:
|
||||
- `odoo-ocr-pipeline` — when implementing classifier, branches, OCR, extraction, or review.
|
||||
- `odoo-xml-import` — when generating or validating Odoo XML.
|
||||
- `local-vlm-client` — when writing model clients or prompts.
|
||||
- `review` — when reviewing code, tests, or design decisions before approving changes.
|
||||
|
||||
Reference in New Issue
Block a user