Data Model: Residue-safe migration sweep and fabricated-identity audit

Residue decision (value, computed)

InputSource
patha kitty-specs/<slug>/ child
repo_rootthe parent of kitty-specs/ unless given
trackedoptional batched tracked_mission_paths(repo_root), computed once per walk
git-aware modegit can run and tracked is non-empty
ModeResidue when
git-awarenot is_mission_dir(path) and neither spec.md nor meta.json exists on disk
file-presence (fallback)none of the Mission content files exist (spec.md, meta.json, plan.md, tasks.md, tasks/, status.events.jsonl, status.json, lanes.json) and not is_mission_dir(path)

Invariants:

  • A folder whose meta.json carries a mission_id is never residue, and the decision costs 0 git calls.
  • A folder whose tracked spec.md or meta.json is deleted on disk is never residue.
  • A folder outside kitty-specs/ is never residue.

Successor migration (class-level metadata)

FieldValue
migration_id<predecessor version>_residue_safe_<name> (e.g. 2.0.6_residue_safe_consistency_sweep)
target_version= predecessor's
orderimmediately after the predecessor, # tie:
runs_on_worktrees / requires_git_repository / clone_local_effect= predecessor's
detect()False if the predecessor is settled (selection view); else the predecessor's detection over non-residue folders
apply()the predecessor's repairs over non-residue folders; one RESIDUE_NOTICE warning per skipped folder

Supersession table entry: predecessor_id -> successor_id; the registry registers a SupersededMigration substitute for the predecessor (content hash unchanged).

Ledger states that decide a successor's work

Predecessor recordPending adoption settles predecessor?Successor detect()
successn/aFalse
none, skipped or failedyesFalse (dry run and live)
none, skipped or failednothe predecessor's own detection, minus residue

Residue notice

RESIDUE_NOTICE.format(slug=...): one constant in mission_resolver. It names the folder, says it is not a Mission, and gives the remedy: add a spec.md or meta.json to make it one, or remove the folder. The runner keys its collapse on (folder, RESIDUE_NOTICE) and passes every other warning through unchanged.

Fabricated-identity finding

FieldValue
codeFABRICATED_IDENTITY_SUSPECTED
severityWARNING (not in TEAMSPACE_BLOCKER_CODES)
artifact_pathmeta.json
detailthe three matched signals; the manual remedy; no run-varying values

Flagged only when all hold: 1. meta.json is git-tracked, and the folder contains nothing outside the allow-list {meta.json, status.json, status.events.jsonl, decisions/, *.lock}. 2. meta.json's slug-derived fields equal baseline_slug_fields(slug): blank equals "", null or absent, and a numeric prefix matches as text or int. 3. mid8_from_slug(slug) is non-empty and differs from mission_id[:8].