feat(write-skill): GED attach op — upload the source document onto its invoice #43

Closed
opened 2026-07-11 18:17:22 +02:00 by arcodange · 1 comment
Owner

Part of the AI back-office PRDtask T03 step 7 + compliance (PAF: originals hash-addressed in the GED).

Context. Gap confirmed during the 2026-07-11 regularization: dolibarr-sandbox-write has no document-attach op — the four supplier invoices rehearsed on the sandbox carry no PDF. The PAF and the monthly audit (GED-attachment presence) need it.

Deliverables

  • document-attach.sh in the write skill: upload a file onto a Dolibarr object (Documents API — POST /documents/upload with modulepart facture/facture_fournisseur, base64 content), idempotent by (object, filename, sha256): re-attach = no-op.
  • New promote op attach in promote-plan/promote-apply (OP_SCRIPT), value support for @ref/#lookup object resolution; file path resolved relative to the manifest.
  • bin/arcodange sandbox subcommand + SKILL.md workflow.
  • Rehearse live on the sandbox: attach the four regularization PDFs (F1045/F1046/Anthropic/Mistral — re-fetchable via arcodange-email-ingest; refs listed in the preserved replay pack) to FAF2026010–013.

Acceptance: attach + re-attach proven on sandbox (second run no-op); document listed via the API afterwards.


Execution — Blocked by: none · Blocks: #47, #46 (its step 3), #57 (close condition needs GED docs) · Human gates: none.
Start: claude --worktree ged-attach from the erp repo root; read .claude/skills/dolibarr-sandbox-write/scripts/ conventions + the dolibarr skill's endpoint catalogue (documents/download exists — mirror it).
Done means: evidence comment here (attach + no-op re-attach outputs, API document listing) → PR merged with Closes #43 → SKILL.md workflow in the same PR.

Part of the **AI back-office PRD** — [task T03 step 7](https://gitea.arcodange.lab/arcodange-org/factory/src/branch/main/vibe/PRD/ai-back-office/task-inventory.md) + [compliance](https://gitea.arcodange.lab/arcodange-org/factory/src/branch/main/vibe/PRD/ai-back-office/compliance.md) (PAF: originals hash-addressed in the GED). **Context.** Gap confirmed during the 2026-07-11 regularization: `dolibarr-sandbox-write` has no document-attach op — the four supplier invoices rehearsed on the sandbox carry no PDF. The PAF and the monthly audit (GED-attachment presence) need it. **Deliverables** - `document-attach.sh` in the write skill: upload a file onto a Dolibarr object (Documents API — `POST /documents/upload` with modulepart `facture`/`facture_fournisseur`, base64 content), idempotent by (object, filename, sha256): re-attach = no-op. - New promote op `attach` in `promote-plan`/`promote-apply` (`OP_SCRIPT`), value support for `@ref`/`#lookup` object resolution; file path resolved relative to the manifest. - `bin/arcodange sandbox` subcommand + SKILL.md workflow. - Rehearse live on the sandbox: attach the four regularization PDFs (F1045/F1046/Anthropic/Mistral — re-fetchable via `arcodange-email-ingest`; refs listed in the preserved replay pack) to FAF2026010–013. **Acceptance:** attach + re-attach proven on sandbox (second run no-op); document listed via the API afterwards. --- **Execution** — Blocked by: none · Blocks: #47, #46 (its step 3), #57 (close condition needs GED docs) · Human gates: none. **Start:** `claude --worktree ged-attach` from the erp repo root; read `.claude/skills/dolibarr-sandbox-write/scripts/` conventions + the `dolibarr` skill's endpoint catalogue (documents/download exists — mirror it). **Done means:** evidence comment here (attach + no-op re-attach outputs, API document listing) → PR merged with `Closes #43` → SKILL.md workflow in the same PR.
arcodange added this to the P1 — Flagship pipeline milestone 2026-07-11 18:17:22 +02:00
Author
Owner

Evidence — attach + re-attach proven live on the sandbox (2026-07-19), acceptance PASSED. Shipped in PR #72 (arcodange/ged-attach, commit fb13bdc, 11 files +587/−31).

Live transcript (checkpoint ARMED throughout, no refresh; FAF2026010–013 verified present, refs match the runbook):

  • Run 1: OK — promote complete (4 created) — the four regularization PDFs attached via the new promote attach op (manifest manifest-C-ged-attach.json, portable #supplierinvoice:ref_supplier= lookups).
  • Run 2 (same manifest): OK — promote complete (4 deduped) — every op deduped=true (already on target — no write).
  • API listing after: exactly 1 file per invoice — FAF2026013→F1045_ARCODANGE_2026-06-30.pdf (46043 B) · FAF2026011→F1046_… (46029 B) · FAF2026012→Invoice-9BF0758D-695749.pdf (30632 B) · FAF2026010→invoice-MSTRL-API-814045-001.pdf (74377 B); each downloaded back, stored sha256 == source sha256.
  • Also live-proven: CLI arcodange sandbox attach ref-only lookup (deduped), and the conflict abort (same name, different bytes → exit 1 with both shas printed).

PDF provenance: re-fetched from Zoho via arcodange-email-ingest workflow 2 (prod GED probed — 404, holds no documents yet): F1045/F1046 from /Notification, Anthropic + Mistral from /Inbox/books. All four sha256s match the golden-set sidecar source_sha256 values 4/4 — independent corroboration of erp#39's provenance.

Gaps, honest: invoices-only moduleparts (others refused explicitly); the dedupe key includes the filename (same bytes under another name = second copy, documented); prod replay of manifest-C stays human-gated (promote flow) — that step also closes part of #57's document-gap list.

Built by a Claude subagent lane; reviewed + merged by the session orchestrator under the operator's in-session delegation.

**Evidence — attach + re-attach proven live on the sandbox (2026-07-19), acceptance PASSED.** Shipped in PR #72 (`arcodange/ged-attach`, commit `fb13bdc`, 11 files +587/−31). **Live transcript** (checkpoint ARMED throughout, no refresh; FAF2026010–013 verified present, refs match the runbook): - Run 1: `OK — promote complete (4 created)` — the four regularization PDFs attached via the new promote `attach` op (manifest `manifest-C-ged-attach.json`, portable `#supplierinvoice:ref_supplier=` lookups). - Run 2 (same manifest): `OK — promote complete (4 deduped)` — every op `deduped=true (already on target — no write)`. - API listing after: exactly **1 file per invoice** — FAF2026013→`F1045_ARCODANGE_2026-06-30.pdf` (46043 B) · FAF2026011→`F1046_…` (46029 B) · FAF2026012→`Invoice-9BF0758D-695749.pdf` (30632 B) · FAF2026010→`invoice-MSTRL-API-814045-001.pdf` (74377 B); each downloaded back, **stored sha256 == source sha256**. - Also live-proven: CLI `arcodange sandbox attach` ref-only lookup (deduped), and the conflict abort (same name, different bytes → exit 1 with both shas printed). **PDF provenance**: re-fetched from Zoho via `arcodange-email-ingest` workflow 2 (prod GED probed — 404, holds no documents yet): F1045/F1046 from `/Notification`, Anthropic + Mistral from `/Inbox/books`. All four sha256s match the golden-set sidecar `source_sha256` values 4/4 — independent corroboration of erp#39's provenance. **Gaps, honest**: invoices-only moduleparts (others refused explicitly); the dedupe key includes the filename (same bytes under another name = second copy, documented); **prod replay of manifest-C stays human-gated** (promote flow) — that step also closes part of #57's document-gap list. Built by a Claude subagent lane; reviewed + merged by the session orchestrator under the operator's in-session delegation.
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#43