Repository navigation
feat(bin): require an explicit per-task delivery contract - #1563
Merged
Merged
Conversation
A ship brief's definition of done was shaped by a silent per-project registry lookup, so an adjusted brief and the task's recorded delivery could disagree and no one had to decide anything per task. fm-brief now requires --mode on ship scaffolds, validates it against the closed set, refuses the conditional no-mistakes-prod-only registry policy as a task mode, and records the choice as a fixed machine-readable "Delivery contract: mode=<mode>" line that fm-spawn can check. --mode is refused on scout and secondmate scaffolds, and --yolo is refused outright because the worker never owns approval decisions.
…omotion fm-spawn resolved every ship and scout task's mode and yolo from the project registry, so the delivery posture was never a per-task decision and could contradict the brief the worker was about to follow. fm-spawn now requires --mode and --yolo on ship spawns, validates both against their closed sets, and reads the brief's recorded delivery contract line and refuses a mismatch before any endpoint exists; a brief scaffolded before that line existed warns once and launches on the flag. A batch carries one shared contract that each pair still checks against its own brief. Scout and secondmate spawns refuse the flags, and a scout now records no mode or yolo at all, which teardown and the snapshot already tolerate. When the explicit mode carries less rigor than the project's standing posture, a deviation notice is printed and the spawn continues, so the registry stays advisory rather than an enforced default. fm-promote requires the same two flags, because a scout carries no posture to inherit, and writes them into the task record with the kind flip. fm-project-mode keeps its one registry parser for the mechanical consumers that have no task in hand, accepts the conditional no-mistakes-prod-only annotation and maps it to its most rigorous leg for them, and grows --raw so the deviation notice can tell a conditional policy apart from a flat mode.
AGENTS.md section 7 now owns how each ship task's mode and yolo are resolved at intake, including the surface classification for a no-mistakes-prod-only project and the unregistered-project fallback, and the project-management skill defines that conditional policy as a registration-time posture with its defaults and initialization consequences. The registry blurb, script table, and architecture section follow: the registry records the captain's standing posture, and task delivery is decided per task and passed explicitly.
The shared spawn helper also launches a secondmate, which refuses the flags, so the contract belongs at each ship call site rather than inside the helper.
Both suites scaffold or spawn an ordinary ship task as the control case for a secondmate assertion, so each needs the explicit contract the ship path now requires.
Implements the revised explicit delivery-mode contract adopted from scout
fm-delivery-explicit-mode-design-r1(report Q7 contract, Q8 slices). Supersedes #1480, which is closed; only its project-management prose and test scenarios were salvaged, not its.deliveryrecord architecture.Problem
A task's delivery mode and
yoloposture were resolved by a silent per-project registry lookup, independently, in two places:fm-brief.shwhen shaping the definition of done, andfm-spawn.shwhen writing task metadata. Nothing forced a per-task decision, and an adjusted brief could say one thing while the recorded task delivery said another.What changes
fm-brief.shrequires--modeon ship scaffolds, validates the closed set, and records the choice as a fixed machine-readableDelivery contract: mode=<mode>line in the generated definition of done.--modeis refused on scout and secondmate scaffolds;--yolois refused outright, since the worker never owns approval decisions.fm-spawn.shrequires--modeand--yoloon ship spawns and validates both closed sets. Before any endpoint exists it reads the brief's recorded contract line and refuses a mismatch; a brief scaffolded before that line existed warns once and launches on the flag. A batch carries one shared contract that every pair still checks against its own brief. Scout and secondmate spawns refuse the flags, and a scout now records nomode=/yolo=at all - teardown already defaults an absent mode tono-mistakesand the snapshot renders it empty. When the explicit mode carries less rigor than the project's standing posture, a one-line deviation notice prints and the spawn continues, so the registry stays advisory rather than an enforced default.fm-promote.shrequires the same two flags, because a scout carries no posture to inherit, and writes them into the task record alongside thekind=flip. The mode is now decided by the firstmate that just read the scout report rather than frozen from scout-spawn time.fm-project-mode.shremains the single registry parser for the mechanical consumers that have no task in hand (fleet sync'slocal-onlyskip, home seeding's refusal and no-mistakes init). It accepts the conditionalno-mistakes-prod-onlyannotation and maps it to its most rigorous leg for them, and grows--rawso the deviation notice can tell a conditional policy apart from a flat mode.Instruction surface: AGENTS.md section 7 owns the intake resolution, including the
no-mistakes-prod-onlysurface classification and the unregistered-project fallback; the project-management skill defines the conditional policy as a registration-time posture with its defaults and initialization consequences; the registry blurb, script table, and architecture section follow.Deliberate boundaries
no-mistakes>direct-PR>local-only). Registeredlocal-onlyshipped asdirect-PRis not announced, matching the adopted contract; that case exposes a remote and may be worth revisiting.no-mistakesstanding default, so a downgrade there is announced too. The notice names the standing posture rather than a registry line, because for an unregistered project there is none.Verification
bin/fm-lint.shclean;bin/fm-doc-audience-check.shok (61 surfaces, 175 local links);bin/fm-test-run.sh --check-coverageok.bin/fm-test-run.sh --changed --base main: 35 scripts, 0 failed.tests/fm-task-delivery.test.shcovers the spawn contract (required and closed-set flags with no metadata written, scout/secondmate refusal, brief agreement plus the legacy-brief warning, the deviation-notice matrix, scouts recording no posture), promotion, and the registry mapping. Extendedtests/fm-brief.test.shcovers the brief contract, including that the explicit mode wins over the registered posture.