feat(write-skill): client-dossier ops — thirdparty update (allowlisted) + idempotent contacts

Part of erp#65 (phase 1). Ledger grammar "thirdparty complete" gets its
op: allowlisted non-ledger fields, per-field diff read-back. Contacts
are born idempotent (dedupe by email then name). Promote ops wired both
targets, offline stub tests, SKILL.md workflows, KM dossier manifest
(unsigned-contract truth fix + EIN-to-collect note).

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
2026-07-15 19:49:13 +02:00
co-authored by Claude Fable 5
parent 6b546e77da
commit 35b227eb6d
9 changed files with 562 additions and 23 deletions
@@ -0,0 +1,52 @@
# Replay pack — KM client dossier 2026-07-15
Completes the KissMetrics fiche (socid 1) with the full contractual dossier and creates
the principal contact — erp#65 phase 1, triggered by operator direction 2026-07-15
(« il faut ces informations relatives au client KM dans Dolibarr »). Two ops:
1. **`thirdparty_update` socid 1** — identity/address/typology + the contract dossier in
`note_public` (allowlisted dossier fields only; the op refuses anything ledger-side).
2. **`contact`** — Hendrik Rootering, COO, `[email protected]` (idempotent: dedupes
by email, then lastname+firstname, so a replay can never mint a duplicate).
## Provenance — and the two truth fixes
Source: the operator's prepared payloads in erp trunk `test/kissmetrics_update.json` +
`test/hendrik_contact_fix.json`, cross-checked against the 2026-07-15 contract-facts
extraction (erp#53 comment). Two deliberate deviations from the WIP payloads:
- **The contract is NOT signed.** The WIP note said « contrat cadre signé 2026-04-23 » —
the repo proves otherwise: the contract is *effect-dated* 2026-04-23 (rétro-daté), the
eIDAS signature is **in progress** (signable set SAFE TO SIGN 2026-06-28; PR
kissmetrics_contract_proposal#1 merged 2026-07-15, branch gone → repo state = `main`).
The note also now carries: invoicing in **USD** (EUR lock 1.1650 removed 2026-06-28),
the 4 % window = 6 months **post-launch** (not post-signature), CCIP-CA + CMAP dispute
chain, Kissmetrics Holdings Inc wires, and **« US EIN : à collecter (→ idprof1) »** —
the EIN is a [HUMAN] item (W-8BEN-E exchange is the natural moment); until then the
`dolibarr-thirdparty-completeness` audit keeps showing exactly that one gap.
- **`poste`, not `soc2`.** The WIP contact payload carried the job title in `soc2`, which
is not a Dolibarr field (the API silently drops it). The manifest uses `poste`;
`contact-create.sh` refuses `soc2` outright.
## How to promote
```sh
cd .claude/skills/dolibarr-sandbox-write
scripts/promote-plan.sh replay-packs/2026-07-15-km-dossier/manifest.json # review
scripts/promote-apply.sh replay-packs/2026-07-15-km-dossier/manifest.json --target sandbox # rehearse
# idempotency proof: apply twice — run 2 must print changed=0 (no-op) + deduped=true
```
**Prod step = the orchestrator's, human-gated — not this pack's job.** The prod replay
(`--target prod`) needs `DOLIBARR_PROD_WRITE_KEY` in the environment (never stored) and
`ARCO_PROMOTE_CONFIRM=I-UNDERSTAND-THIS-WRITES-PROD`, per ADR-0003. Pair with
`dolibarr-data-snapshot` before/after, then re-run `dolibarr-thirdparty-completeness` on
socid 1 — expected result: only the EIN gap remains.
## Rehearsal record (sandbox, 2026-07-15)
Run 1: fiche diff = `changed=1 [note_public]` (the sandbox already carried the WIP
payload — the diff IS the truth fix) + contact Hendrik created (id 3). Run 2:
`changed=0 (no-op)` + `deduped=true` (same id 3). Read-back: all 13 dossier fields
correct; note carries « SIGNATURE eIDAS EN COURS », « US EIN : à collecter »,
« FACTURÉ EN USD ». Full outputs in the phase-1 PR on erp#65.
@@ -0,0 +1,24 @@
[
{ "op": "thirdparty_update", "ref": "km",
"input": {
"socid": 1,
"fields": {
"name": "KissMetrics",
"name_alias": "KissMetrics Inc.",
"address": "2850 34th Street North, 307",
"zip": "33713",
"town": "St. Petersburg",
"state_id": "1167",
"region_id": "297",
"country_id": "11",
"country_code": "US",
"email": "[email protected]",
"typent_id": "3",
"effectif_id": "1",
"note_public": "Client Arcodange. Delaware corp, CEO Evan Sforzo, COO Hendrik Rootering (contact principal, Slack-first). Contrat cadre à effet du 2026-04-23 (rétro-daté) — SIGNATURE eIDAS EN COURS (set signable SAFE TO SIGN 2026-06-28 ; PR kissmetrics_contract_proposal#1 mergée 2026-07-15). 6 mois actifs (→2026-10-23), différé jusqu'à 2027-01-23, base engagée $33,000. Rémunération : $5 500/mois ($2 500 fixe net 30 + $3 000 différé +3 mois), FACTURÉ EN USD, réglé EUR au taux BCE du jour du paiement (lock 1.1650 supprimé le 2026-06-28). 4 % cash collected sur clients net-new signés dans les 6 mois post-launch (launch ~juil. 2026, date à confirmer), sur les 12 premiers mois de chaque client, payé au fil des encaissements net 30, sans plafond. Capacité ~10 j-h/mois au référentiel 500 €/j, Arcodange organise à sa discrétion. Droit français, T. com. Paris (CCIP-CA), médiation CMAP. Wires possibles via l'affilié Kissmetrics Holdings Inc (Art. 1). W-8BEN-E à déposer chez KM ; US EIN : à collecter (→ idprof1). Repo : arcodange-org/kissmetrics_contract_proposal (main). Darnis Operations = apport d'affaires (10 % an 1, 5 % perpétuel, sur fee standard différé inclus, 4 % exclu)."
} } },
{ "op": "contact", "ref": "hendrik",
"input": { "socid": "1", "lastname": "Rootering", "firstname": "Hendrik",
"poste": "COO", "email": "[email protected]" } }
]