Data Model — Placement-Port Residuals Closure

This mission persists no new entities. The "model" here is the set of partitions, artifact kinds, gates, and capabilities the fixes must respect. Captured so the invariants are explicit for /tasks and review.

Partitions & artifact kinds (existing — src/mission_runtime/artifacts.py)

Artifact kindPartitionHome resolverRelevant FR
PRIMARY_METADATA (meta.json, status_phase)PRIMARYresolve_artifact_surface(...).path (directory)FR-001
STATUS_STATE (status.events.jsonl)COORD (under coord topology)coord ref via portFR-002, FR-008, FR-011
TRACER_FILE (traces/)COORDplacement_seam(...).read_dir(kind)FR-006

Invariant (I-01): resolve_placement_only(kind) returns a branch CommitTarget (a ref); the on-disk directory home comes from resolve_artifact_surface(...).path. FR-001 asserts on the directory, not the ref.

Invariant (I-02): status.events.jsonl is a COORD artifact under coord topology. No fix may relocate it to PRIMARY (bounds FR-002's read/write decoupling).

Legacy runtime state (existing — backfill_runtime_state.py)

  • LegacyWPRuntime.has_evictable_state() → true when shell_pid/agent/assignee/tracker_refs/subtasks/completed review present. Drives the FR-002 silent-loss repro.
  • backfill_runtime_state(dir) currently couples READ (dir/tasks/*.md) and WRITE (append_events_atomic_verified(dir, …)). FR-002 splits these into a read-dir (PRIMARY) and event write-dir (COORD).

Architectural gates (test-side invariants this mission reconciles)

GateInvariantReconciliation
test_no_write_side_rederivationevery CommitTarget/safe_commit ref is seam-derived OR allow-listedFR-008: allow-list executor.py coord-seed (dated rationale)
test_guard_capability_call_sites[MERGE_BOOKKEEPING]each non-standard capability authorizes exactly one flow; others assert STANDARDFR-012: extend _PROTECTED_FLOW_ALLOWLISTS["MERGE_BOOKKEEPING"] with executor.py
_placement_whole_tree_scanevery unsanctioned src/ module scanned; sanctioned via per-file entry or retained prefixFR-003: migration/ prefix → per-file entries (keep mission_runtime/, upgrade/migrations/)
test_no_raw_mission_spec_pathsconstant-based mission-spec path construction stays in constructor filesFR-009: route via constructor OR allow-list mission_repair.py
test_mission_cli_golden_contractmission CLI exposes exactly the frozen command + flag surfaceFR-010: repair_EXPECTED_COMMANDS(9) + _EXPECTED_FLAGS["repair"]; rename count test

State transition touched (status model — unchanged shape)

status_phase flip: legacy → snapshot-authority, written once by _flip_phase. FR-001 changes only where the write target is resolved (through the port); the transition itself is unchanged. FR-002 changes only which leg the seed frontmatter is read from. No new lanes, events, or phases are introduced.