Update a Map
Read Working safely and Map format and operations.
Resolve the Map through the shared helper using the development repository root. Its returned workspace identifies the registered map/<id> worktree. Inspect its planning HEAD, documents, declared checks, and receipts. Never write into the development checkout, borrow its index, or switch its branch. Existing Maps there require explicit migration. Translate the request into one concrete set of file replacements. Preserve stable IDs, evidence, unrelated edits, and scripts. Define checks before implementing their work; do not weaken checks merely to mark a step done.
Use the shared updater with an explicit expectedHead, expectedFingerprint, and files object. Adding a step means adding its Markdown and its YAML entry in the same update. Changing dependencies means replacing map.yaml; moving a step means changing parent, without moving its physical folder. Removal from the graph preserves its files for history; physical deletion is not supported by this first protocol.
The service verifies the registered planning worktree and independent history, validates the candidate graph/documents, checks the planning revision/content, serializes writers with a common-directory lock, writes a prepared receipt, applies replacements, and finalizes the receipt. A stale precondition is a conflict: re-read and reconcile; do not blindly retry with refreshed tokens. A prepared receipt after an interruption blocks further updates pending reconciliation. Checks execute against the implementation checkout, not the planning checkout: set MAP_ROOT to the selected Map directory and MAP_SOURCE_ROOT to the implementation checkout. Record both the tested source revision/dirty digest and the planning revision used.
To record completion, run the declared checks only when execution is within the user's authorized task. Record actual results and the tested revision, including a dirty-worktree digest when relevant. No checks means explicit human/agent-reviewed manual acceptance evidence, never an invented automated pass. Changed implementation or checks require fresh evidence; reset affected done steps and downstream work for revalidation in the same update.
Report touched paths, graph changes, actual checks and evidence, the before/after fingerprints, base HEAD, and receipt path. This operation does not stage, commit, fetch, merge, or push. Use /map-commit <id> to request publication.