Tasks: Mission creation degod

Mission: mission-creation-degod-01M44467 · Spec: spec.md · Plan: plan.md Planning base / merge target: issue-5634-mission-creation-degod · Topology: lanes

Subtask completion is event-sourced: spec-kitty agent tasks mark-status Txxx --status done. The rows below are reference rows, not checkboxes.

Subtask Index

IDDescriptionWPParallel
T001Golden harness: real-repo fixture, observable capture, whitelisted normaliser, snapshot I/OWP01
T002Success cells: branch-flat and coordination-routed familiesWP01[P]
T003Success cells: protected single_branch, owned checkout, flag cross-productsWP01[P]
T004Refusal cells (13 named + malformed protection config) with post-state captureWP01
T005Capture on base, regen reproducibility, per-dimension planted breaksWP01
T006CLI golden harness (CliRunner + chdir, zero patches)WP02
T007Derived default-topology cells incl. no-origin/HEAD fallbackWP02
T008One success + one refusal CLI smoke per behaviour familyWP02
T009Decision-level topology fallback pin naming both Primary Branch inputsWP02[P]
T010Protected-mint branch coverage (checkout -b failure)WP03[P]
T011Meta/events branch coverage (corroboration, payload mismatch, coord commit failure, bootstrap skip)WP03[P]
T012Duplicates/rollback branch coverage (missing meta, abandonment read failure, neighbour guard, rollback early return)WP03[P]
T013FR-011 invariant pins not observable in the snapshotWP03
T014Static patch scanner (f-strings, constants, object forms; any namespace for family-read names)WP04
T015Runtime patch-application counter (opt-in pytest plugin)WP04
T016patched_names_on() API for the routing checkWP04
T017Self-test with positive and negative controls; baseline reportWP04
T018mission_creation_decisions.py skeleton + protection/applies coresWP05
T019Protected-mint facts/decision core, wired into the mintWP05
T020Coordination-routed predicate: one definition for the two topology-based sites (third site per WP05 fold 4)WP05
T021Meta flag patch core, wired into _build_create_metaWP05
T022Duplicate match + abandonment cores, wiredWP05
T023Rollback cores (orphan plan, coord rollback action, disposable refusal), wiredWP05
T024Scaffold-commit outcome + created/uncommitted file-set cores, wiredWP05
T025Purity AST check + positive control; per-core planted-break evidenceWP05
T026Scripted verbatim move into leaf modules + façade re-exports + exactly-once proofWP06
T027Patch-interception routing (_mc.) in leavesWP06
T028Family source helper + self-testWP06
T029Family checks: re-export identity, no module-scope façade import, logger pin, local-import pinWP06
T030Routing set-equality check + two planted controlsWP06
T031Re-pin the architectural gates (6)WP06
T032Module map (façade docstring + docs) and CHANGELOG Internal entryWP06
T033Protection resolved at most once, memoised at first-use pointWP07
T034Protected mint invoked from the orchestrator, not the meta builderWP07
T035Typed rollback journal replaces the list holderWP07
T036Split _build_create_result fan-out from the pure file setsWP07
T037Structural checks: one predicate definition, no mint in the meta builderWP07
T038is_worktree_context patches → allow flag / chdir; 3 refusal guards on real worktreesWP08
T039locate_project_root dead patches retired with coverage-context proofWP08
T040is_git_repo patches retired; guard re-proved by planted breakWP08
T041get_current_branch patches → real main repos (faked-branch tests rewritten)WP08
T042Routing list update + interim census reportWP08
T043_commit_feature_file patches → real commits / adapter fault injectionWP09
T044ULID / now_utc_iso → injected identity and clock; sleeps removedWP09
T045preflight_commit, safe_commit, _commit_create_scaffold, _consume_pending_origin_if_present → owning modulesWP09
T046Global subprocess.run patch → adapter fault injectionWP09
T047test_agent_feature.py create assertions → golden CLI smoke; final routing listWP09
T048Final census report with per-name disposition tableWP09

Phase 1 — Behaviour freeze (test-only; parallel)

WP01 — Core golden behaviour matrix

  • Goal: freeze today's observable create_mission_core behaviour with zero patches (FR-001, FR-011 snapshot dimensions, SC-001).
  • Priority: P1 (the MVP; every later WP is judged against it).
  • Independent test: green on the unchanged base; red on one planted break per captured dimension.
  • Subtasks: T001, T002, T003, T004, T005.
  • Dependencies: none.
  • Prompt: tasks/WP01-core-golden-matrix.md (~330 lines).
  • Risks: normaliser too broad; fixture cost; the #5706 fan-out leak (baseline-red).

WP02 — CLI golden cells and topology fallback pin

  • Goal: pin the CLI surface (envelope, error code, exit code) and the derived default topology, including the no-origin/HEAD fallback (FR-002, FR-010).
  • Subtasks: T006, T007, T008, T009. Dependencies: none.
  • Prompt: tasks/WP02-cli-golden-topology-pin.md (~240 lines).

WP03 — Uncovered decision branches and create invariants

  • Goal: cover the ten untested branches and the FR-011 invariants that the snapshot cannot observe (FR-008, FR-011, SC-004).
  • Subtasks: T010, T011, T012, T013. Dependencies: none.
  • Prompt: tasks/WP03-branch-coverage-invariants.md (~260 lines).

WP04 — Patch census tool

  • Goal: a committed reporting tool (not a gate) that counts static and runtime patch use for the module family. It also exposes the patched-name set the WP06 routing check needs (NFR-004 baseline, FR-005 input).
  • Subtasks: T014, T015, T016, T017. Dependencies: none.
  • Prompt: tasks/WP04-patch-census.md (~220 lines).

Phase 2 — Decision cores and the split (sequential)

WP05 — Pure decision cores, wired in place

  • Goal: introduce mission_creation_decisions.py and make the existing functions delegate to it, without moving anything else (FR-003, FR-009 predicate).
  • Subtasks: T018–T025. Dependencies: WP01, WP02, WP03.
  • Prompt: tasks/WP05-pure-decision-cores.md (~420 lines).

WP06 — Verbatim module split, routing and gate re-pins

  • Goal: move each responsibility to its leaf module verbatim, route patched names through the façade, and re-pin every gate (FR-004, FR-005, FR-006).
  • Subtasks: T026–T032. Dependencies: WP04, WP05.
  • Prompt: tasks/WP06-module-split-routing-gates.md (~430 lines).

WP07 — Behaviour-neutral seam cleanups

  • Goal: protection resolved once (at first use), mint called from the orchestrator, typed rollback journal, fan-out split (FR-009).
  • Subtasks: T033–T037. Dependencies: WP06.
  • Prompt: tasks/WP07-seam-cleanups.md (~250 lines).

Phase 3 — Tests onto the seams (sequential)

WP08 — Retire the environment patch stack

  • Goal: remove the is_worktree_context / locate_project_root / is_git_repo / get_current_branch patch stack (203 sites) using real repos, allow flags and proofs (FR-007).
  • Subtasks: T038–T042. Dependencies: WP07.
  • Prompt: tasks/WP08-retire-environment-patch-stack.md (~300 lines).

WP09 — Move commit, identity and effect patches to their seams

  • Goal: move the remaining patches to their owning modules or to injected inputs, and report the final census against NFR-004 (FR-007, SC-003).
  • Subtasks: T043–T048. Dependencies: WP08.
  • Prompt: tasks/WP09-move-effect-patches-final-census.md (~320 lines).

Dependency graph

WP01 ─┐
WP02 ─┼─► WP05 ─┐
WP03 ─┘         ├─► WP06 ─► WP07 ─► WP08 ─► WP09
WP04 ───────────┘

Parallelization and MVP

  • WP01–WP04 run in parallel lanes (disjoint files, test-only).
  • WP05 onward is a chain. They share src/specify_cli/core/mission_creation*.py and the patch-carrying test files, and the dependency order exempts them from the ownership-overlap check.
  • MVP: WP01. It is the behaviour-preservation proof that makes every later WP reviewable.

Post-tasks squad findings (disposition)

FindingLensDispositionEvidence
Golden fixture helpers outside the freeze set (WP08 edits coord_mission.py)revieweracceptedWP01 fold 1 (vendored builder), spec NFR-001 freeze set, WP08/WP09 fold 1
No re-capture protocol for a rebase that brings real upstream changerevieweracceptedplan "Rebase protocol", WP06 fold 1, NFR-001
Routing check loopholes (aliases, module scope, other façade aliases, getattr)revieweracceptedWP06 fold 2
Census misses laundering forms; hand-listed read namesrevieweracceptedWP04 folds 1–4
Not one planted break per capture key; padding risk; unreachable-cell escaperevieweracceptedWP01 folds 5–7
"Today's order, stopping early" unverifiable; "resolved at most once" unprovenrevieweracceptedWP05 fold 3, WP07 fold 1 (GIT_TRACE command-sequence tests)
Per-gate planted removal missingrevieweracceptedWP06 fold 4
Exactly-once comparison flags every routed function; no frozen façade attribute listrevieweracceptedWP06 T026 text, WP06 fold 3
Free-form planted-break recordsrevieweraccepted"as git diff patch blocks" in every WP's folds
mid8-dependent cells flaky under loadimplementeracceptedWP01 fold 3 (predict-then-plant with assertion)
Normaliser cannot handle a second mission's mid8implementeracceptedWP01 fold 2, WP02 fold 2
"Create the same slug twice" does not refuse (genesis prior is abandoned)implementeracceptedWP01 T004 #1, WP02 T008, WP03 fold 2
exc_type qualified name breaks after the moveimplementeracceptedWP01 T001 (__qualname__ only)
WP05 purity ban contradicts the cores that need specify_cli.git typesimplementerchangedWP05 Objectives + fold 1 (runtime I/O ban, TYPE_CHECKING allowed, classification stays in adapters)
Dead-symbol gate covers decision variantsimplementeracceptedWP05 fold 2
Unprotected unborn target creates instead of refusingimplementeracceptedWP01 T004 #4
Malformed config has two raise pointsimplementeracceptedWP01 fold 4, WP07 fold 2
CLI envelope spec_kitty_version would freeze a versionimplementeracceptedWP02 fold 1
tasks README vs spec.md commit stateimplementeracceptedWP03 invariant 5
The three predicate "copies" differimplementeracceptedWP05 fold 4
Issue-matrix finalization unassignedplannerchangedthe orchestrator sets the #5634 terminal verdict at accept (code WPs cannot own kitty-specs/); row re-pointed to WP09
WP03 files in WP08 ownershipplanneracceptedremoved from WP08; WP09 keeps them (it moves their fault injections)
Trim WP08/WP09 owned_filesplannerdeferred_with_rationalewhich files each WP edits is only known once WP06 lands; sequential ownership is legal and the review records the touched set
Split WP06plannerdeferred_with_rationalethe gate re-pins must be atomic with the move (otherwise the surface-resolver collection error turns about 20 gates red mid-chain), and the family checks are WP06's own review evidence