Document testing endpoint policy and mark version as 0.1.0-dev

- Updates AGENTS.md to clarify that production must keep invoice data

  on the same host as the model runtime, while shared LAN endpoints

  are acceptable for integration testing and staging.

- Bumps pyproject.toml version to 0.1.0-dev and adds development status

  classifiers.

- Adds CHANGELOG.md with Unreleased and 0.1.0 entries.
This commit is contained in:
2026-08-21 17:03:03 +02:00
parent da37e91c86
commit 73b3032069
3 changed files with 49 additions and 2 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ Input File
- An Odoo XML file (unless blocked by low confidence). - An Odoo XML file (unless blocked by low confidence).
- A sidecar JSON file with metadata, timings, and confidence. - A sidecar JSON file with metadata, timings, and confidence.
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). 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. 4. Never send invoice data outside the local model endpoints. For production, "local" means a model endpoint reachable on the same host or within a trusted, on-premise runtime. A shared LAN endpoint (e.g. a dedicated Ollama server on the local network) is acceptable for integration testing and staging, but production deployments should keep invoice data on the same host as the model runtime unless explicitly approved.
## Review Stage Rules ## Review Stage Rules
+42
View File
@@ -0,0 +1,42 @@
# Changelog
All notable changes to `odoo-ocr` are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- End-to-end CLI pipeline (`odoo-ocr process`) that orchestrates classifier → OCR branch → extraction → review → XML/sidecar.
- Document classifier with heuristic fallback to a small VLM (`Qwen2.5-VL-3B`).
- Four OCR/processing branches: `digital_pdf`, `scanned_print`, `handwritten`, and `mixed_unknown`.
- Unified `BaseVLMClient` interface supporting Ollama (primary) and future llama.cpp server integration.
- Per-model-call metrics logging (latency, tokens, prompt hash) and exponential-backoff retries for transient failures.
- File-based LLM response cache keyed by prompt, image hashes, model, temperature, response format, and max tokens.
- Structured extraction and review stages using Pydantic `ExtractedInvoice` and `ReviewResult` schemas.
- Vision review stage that compares the original invoice image(s) with the extracted JSON and can emit a corrected invoice.
- Odoo Enterprise vendor-bill XML generation with `res.partner`, `account.move`, `account.move.line`, and deterministic `account.tax` records.
- Confidence-based XML gating:
- `>= 0.90`: final XML.
- `0.750.89`: XML with a human-review advisory comment.
- `< 0.75`: sidecar JSON only; XML generation refused.
- Strict ISO 8601 date validation for `invoice_date` and `due_date`.
- Test coverage: 38 unit/integration tests across schemas, cache, classifier, branches, reviewer, XML builder, and CLI.
### Changed
- Bumped `tool.mypy.python_version` to `3.12` so third-party stubs parse cleanly, while `requires-python` stays at `>=3.11`.
### Project Rules
- Clarified the local-only / privacy constraint: production deployments must keep invoice data on the same host as the model runtime unless explicitly approved; shared LAN endpoints (e.g. a dedicated Ollama server on the local network) are acceptable for integration testing and staging.
## [0.1.0] - 2026-08-21
### Added
- Initial project scaffold: local invoice OCR pipeline with Ollama, classifier branches, structured extraction, review, and Odoo XML export.
[Unreleased]: https://github.com/ixsol/odoo_ocr/compare/v0.1.0...HEAD
+6 -1
View File
@@ -1,8 +1,13 @@
[project] [project]
name = "odoo-ocr" name = "odoo-ocr"
version = "0.1.0" version = "0.1.0-dev"
description = "Local-first invoice OCR pipeline that produces Odoo Enterprise XML." description = "Local-first invoice OCR pipeline that produces Odoo Enterprise XML."
requires-python = ">=3.11" requires-python = ">=3.11"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
]
dependencies = [ dependencies = [
"pydantic>=2.0", "pydantic>=2.0",
"pydantic-settings>=2.0", "pydantic-settings>=2.0",