beads/cmd/bd/help_supplements
matt wilkie 4103d985d1 fix(create): reject explicit plan ids that already exist
An explicit node id colliding with a stored issue slipped through plan
validation (which only caught intra-plan duplicates) into an insert path
with upsert semantics — the atomic graph create silently rewrote the
existing issue while reporting creation. The upsert behavior is inherited
(bd create --id does the same today), but plans mint ids in bulk, so the
exposure is much larger here.

Add an explicit-ID collision preflight to the shared plan validation:

- graphPlanConfig gains an issueExists probe; embedded supplies it from the
  store (GetIssue spans issues and wisps), proxied from the unit of work's
  per-table getters — bound to the caller's context, so the live proxied
  path probes inside the apply transaction and cannot race a concurrent
  create of the same id. Dry-run validates through the same probe.
- Deliberately not overridable by --force: that flag vouches for a foreign
  prefix, not for destroying existing data.

Also: reword the --mol-type rejection to point at the per-node mol_type
field (the old text claimed plans don't carry molecule semantics, which the
node field contradicts), and document the no-overwrite rule in the --graph
plan supplement.

Agent-Signature: claude-fable-5-xhigh on behalf of matt wilkie
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 21:33:38 -07:00
..
create_graph_plan.md fix(create): reject explicit plan ids that already exist 2026-07-23 21:33:38 -07:00