Files
erp/fleet/harness/promote/examples/m3-deferred.json
T
arcodangeandClaude Opus 5 a2cafc0d6b feat(harness): gated promote pipeline — rehearse, judge, human gate, apply, judge
The discipline (ADR-0003, the promote flow, the operating rules) was written
down and still depended on whoever was driving choosing to follow it. On
2026-07-25 an agent session wrote five documents into the production ledger
through direct API calls, bypassing the promote flow entirely — a correct result
reached by a path nobody could audit. A rule an operator can skip is a
recommendation.

The five stages are now chained by artefacts on disk. Each refuses to run until
the previous produced its file, and the file says what it needs to hear:
rehearse (sandbox, host-guarded) -> judge --pre -> gate (human) -> apply
(prod) -> judge --post. The gate binds to a manifest digest, so approving a
change-set approves THAT change-set.

An op is defined ONCE, as an API call, and replayed on the sandbox then on
production — because the first design described each write twice (a sandbox
script input and a prod API body) and the pre-gate judge immediately caught them
diverging: the rehearsal was creating a EUR invoice with no due date while
production would have received a USD one at 60 days. Two descriptions of the
same write are two things that can disagree.

Judges are context-free, cross-family per the PRD qa-strategy rule, and
advisory: a BLOCK still lets the operator approve, and the override is recorded
with their name. Blocking authority stays with the human gate and the host
guards — an LLM verdict never silently starts or stops a production write.

Verified end to end against the real 24/08 change-set (M3 deferred, USD 3,000):
- pre-gate judge (Mistral) returned BLOCK twice, correctly — first on the
  sandbox/prod divergence, then on a duplicate left by a repeated rehearsal;
- apply refuses after a rejected gate;
- apply refuses without ARCO_PROD_CONFIRM;
- editing an amount after approval invalidates the gate on digest mismatch.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VRShc4QhLLU73FLHx9vskh
2026-07-26 08:06:45 +02:00

48 lines
2.3 KiB
JSON

{
"title": "M3 deferred part — USD 3,000 due 2026-10-23 (issued at D-60)",
"observe": [
"/invoices?sortfield=t.rowid&sortorder=DESC&limit=3&thirdparty_ids=1"
],
"ops": [
{
"label": "invoice: M3 deferred, USD 3000",
"api": {
"method": "POST",
"path": "/invoices",
"body": {
"socid": 1,
"type": 0,
"date": 1787529600,
"multicurrency_code": "USD",
"note_public": "PART DIFFÉRÉE DU CYCLE M3 — contrat cadre du 23/04/2026 (art. 6) et son avenant (art. 2 et 4).\nMontant dû : 3 000,00 USD, réglé en euros au taux de référence EUR/USD du jour du paiement.\nÉmise le 24/08/2026 pour une échéance au 23/10/2026, soit 60 jours — conforme au plafond de l'art. L.441-10 I.\nPÉNALITÉS DE RETARD — En cas de retard de paiement, sont automatiquement dues, sans rappel préalable : (i) des pénalités calculées au taux BCE de refinancement majoré de 10 points (art. L.441-10 II du Code de commerce) — soit 12,15 % l'an au 1er semestre 2026 et 12,40 % l'an au 2e semestre 2026 ; (ii) une indemnité forfaitaire de recouvrement de quarante euros (40 €) par facture impayée (art. L.441-10 III et décret n° 2012-1115) ; (iii) une indemnisation complémentaire sur justification. Aucun escompte pour paiement anticipé.",
"lines": [
{
"desc": "Conseil et accompagnement infrastructure cloud — Cycle M3 (part différée) — période d'exécution du 23/06/2026 au 23/07/2026. Échéance 23/10/2026. Montant contractuel : 3 000,00 USD.\nPrestation de services au sens des articles 259, 1° et 283-2 du CGI. TVA française non applicable — preneur assujetti établi hors de l'Union européenne (États-Unis).",
"multicurrency_subprice": "3000",
"subprice": "2622.01",
"qty": "1",
"tva_tx": "0",
"product_type": "1"
}
]
}
},
"then": [
{
"label": "validate",
"method": "POST",
"path": "/invoices/{id}/validate",
"body": {}
},
{
"label": "set due date 2026-10-23 (D-60)",
"method": "PUT",
"path": "/invoices/{id}",
"body": {
"date_lim_reglement": 1792749600
}
}
]
}
]
}