feat(write-skill): provenance checker as a promote-plan stage (anti-hallucination) #41

Open
opened 2026-07-11 18:16:56 +02:00 by arcodange · 0 comments
Owner

Part of the AI back-office PRDanti-hallucination contract, operator requirement 2026-07-11.

Context. The books-regularization session (2026-07-11) proved the pattern with a standalone verify-provenance.py — 36 field-level checks against source PDFs + FRESH Qonto/Wise pulls, run before the human gate. The PoC script and the manifests it verified are preserved under .claude/skills/dolibarr-sandbox-write/replay-packs/2026-07-11-books-regularization/ (see its README). Industrialize it.

Deliverables

  • A provenance stage in promote-plan (or a sibling promote-verify): for every critical field in a manifest carrying a provenance anchor {source_sha256, raw_excerpt}, re-extract the source (pdftotext / fresh feed pull via bank-curl) and assert the excerpt exists and parses to the same value. Locale-normalized (219,50219.50; Wise 2,147 = no-decimals thousands format — real case, handled in the PoC).
  • Payment amounts corroborated to the cent against a fresh feed pull at check time (never cached).
  • Refuse, never repair: any failing field blocks the manifest before the approval card.
  • Test suite including seeded-wrong-value fixtures that MUST fail.

Acceptance: a manifest with one seeded wrong amount is blocked with a per-field report; the real regularization pack passes green end-to-end.


Execution — Blocked by: none (promote-plan exists; the PoC is preserved) · Blocks: #47 · Human gates: none.
Start: claude --worktree provenance-stage from the erp repo root; read the preserved PoC verify-provenance.py in the replay pack, then promote-plan in .claude/skills/dolibarr-sandbox-write/scripts/.
Done means: evidence comment here (seeded-wrong fixture blocked + real pack green, both outputs) → PR merged with Closes #41.

Part of the **AI back-office PRD** — [anti-hallucination contract](https://gitea.arcodange.lab/arcodange-org/factory/src/branch/main/vibe/PRD/ai-back-office/agent-architecture.md), operator requirement 2026-07-11. **Context.** The books-regularization session (2026-07-11) proved the pattern with a standalone `verify-provenance.py` — 36 field-level checks against source PDFs + FRESH Qonto/Wise pulls, run before the human gate. The PoC script and the manifests it verified are preserved under `.claude/skills/dolibarr-sandbox-write/replay-packs/2026-07-11-books-regularization/` (see its README). Industrialize it. **Deliverables** - A provenance stage in `promote-plan` (or a sibling `promote-verify`): for every critical field in a manifest carrying a provenance anchor `{source_sha256, raw_excerpt}`, re-extract the source (pdftotext / fresh feed pull via bank-curl) and assert the excerpt exists and parses to the same value. Locale-normalized (`219,50`≡`219.50`; Wise `2,147` = no-decimals thousands format — real case, handled in the PoC). - Payment amounts corroborated to the cent against a fresh feed pull at check time (never cached). - **Refuse, never repair**: any failing field blocks the manifest before the approval card. - Test suite including seeded-wrong-value fixtures that MUST fail. **Acceptance:** a manifest with one seeded wrong amount is blocked with a per-field report; the real regularization pack passes green end-to-end. --- **Execution** — Blocked by: none (promote-plan exists; the PoC is preserved) · Blocks: #47 · Human gates: none. **Start:** `claude --worktree provenance-stage` from the erp repo root; read the preserved PoC `verify-provenance.py` in the replay pack, then `promote-plan` in `.claude/skills/dolibarr-sandbox-write/scripts/`. **Done means:** evidence comment here (seeded-wrong fixture blocked + real pack green, both outputs) → PR merged with `Closes #41`.
arcodange added this to the P1 — Flagship pipeline milestone 2026-07-11 18:16:56 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: arcodange-org/erp#41