#2565
feat(cli): --if-exists skip|update|fail for the top 409-conflict writes
Summary
An idempotent-write convention --if-exists skip|update|fail (default fail = today's behavior) on the writes that generate the most HTTP 409 conflicts.
Motivation
Telemetry, 30 days, distinct installs hitting 409: pricing availability create 877, review items add 872, metadata push 596, localizations update 562, review submissions-submit 490, review details-create 455, versions create 437, subscriptions setup 424, age-rating edit 409, bundle-ids capabilities add 398. Together the single largest API-error class (~4.7k installs). Agents retry blindly.
Contract
skip: exit 0 with an additive receipt field (e.g.action: "skipped") via the registered renderer.update: route to the matching update/PATCH with the same inputs where meaningful (versions create -> versions update; localizations create/update routing; review details-create -> details-update; pricing availability create -> availability edit; capabilities add / review items add -> skip semantics).- Keyed on Apple's exact 409 error codes; other 409s still fail.
PR plan
- shared helper + receipt +
versions create+review details-create localizations update/create+metadata push(stacked)pricing availability create(stacked)bundle-ids capabilities add+review items add(stacked)review submissions-submit,subscriptions setup,age-rating editanalyzed and listed as follow-ups.
Acceptance criteria
- RED httptest per command reproducing the real 409 body
- default behavior byte-identical
- docs/design/if-exists-idempotent-writes.md + command docs regenerated
Partial work: worktree ~/Developer/CLIs/asc-if-exists-core (branch claude/if-exists-core-20260913).
Activity
0No activity yet.