Data Model: Resolution Legs & Typed-Error Convergence

This is a refactor/convergence mission — the "model" is the set of resolution legs, topology states, and the typed-error taxonomy the collapse converges. No persisted schema changes.

Resolution legs (the three entry points the gate compares)

LegEntry pointRole after collapse
read-pathmissions/_read_path_resolver.resolve_handle_to_read_pathhandle → mid8 → surface dir (mid8-aware); the privatized _resolve_mission_read_path is its internal worker
surfacecoordination/surface_resolver.resolve_status_surface_with_anchorcanonical selection authority
aggregatestatus.aggregate.MissionStatus (_resolve_read_dir)boundary used by agent status CLI

Convergence invariant: for every (slug, mid8, topology) the three legs return the identical directory or the identical typed error (type(a) is type(b) AND equal error_code).

Topology states & target behavior

StateToday (divergent)After collapse (converged)
no-coordagree → primaryunchanged → primary
create→first-write windowagree → primaryunchanged → primary (#1718 preserved)
coord-fresh / coord-behind, <slug>-<mid8>agree → coordunchanged
coord-fresh / coord-behind, bare slugread-path mid8-blind → primary; surface/agg → coordall → coord (IC-01 reroute)
coord-emptyread-path → primary; surface → CoordinationWorktreeEmpty; agg → CoordAuthorityUnavailableall → primary + loud warning (Option B, IC-04)
coord-deletedread-path → primary dir; surface → CoordinationBranchDeleted; agg → CoordAuthorityUnavailableall → CoordinationBranchDeleted hard-fail (IC-05)

Typed errors

Errorerror_codeDisposition
CoordinationWorktreeEmpty (subclass of StatusReadPathNotFound)STATUS_READ_PATH_NOT_FOUNDDELETED (IC-04) — coord-empty no longer raises
CoordinationBranchDeletedCOORDINATION_BRANCH_DELETEDcanonical coord-deleted hard-fail, propagated verbatim across all legs (IC-05)
CoordAuthorityUnavailable (no error_code)kept exported (C-003); aggregate stops raising it for coord-deleted (propagates CoordinationBranchDeleted instead); coord-empty no longer reaches it
StatusReadPathNotFoundSTATUS_READ_PATH_NOT_FOUNDunchanged (genuine missing surface)
MissionSelectorAmbiguous / MISSION_AMBIGUOUS_SELECTORMISSION_AMBIGUOUS_SELECTORunchanged (already equivalent + preserved through next)

Invariants (must hold post-collapse)

  • INV-1 create→first-write window resolves primary on every leg (#1718).
  • INV-2 coord-deleted hard-fails (never a stale primary read) — data loss (C-001).
  • INV-3 the loud coord-empty warning fires and is observable (NFR-003).
  • INV-4 _resolve_mission_read_path has zero external callers (NFR-005).
  • INV-5 the gate's type-AND-error_code assertion is intact; only _XFAIL_* entries retire (NFR-002).