<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xml:base="https://docs.spec-kitty.ai/migrations/mission-id-canonical-identity/">
  <id>https://docs.spec-kitty.ai/migrations/mission-id-canonical-identity/</id>
  <title>Migration: Mission ID as Canonical Identity</title>
  <updated>2026-10-30T00:00:00.000Z</updated>
  <author><name>Spec Kitty</name></author>
  <link rel="alternate" type="text/html" href="https://docs.spec-kitty.ai/migrations/mission-id-canonical-identity/"/>
  <summary>Migration to mission_id (ULID) as a mission&apos;s canonical identity, shipped with mission 083: the new identity model, the backfill, and the ADR behind it.</summary>
  <content type="html">&lt;blockquote&gt;
&lt;p&gt;Migration note: This page documents a migration path or historical transition. It is not the current 3.2 happy path.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;span id=&quot;migration-mission-id-as-canonical-identity&quot;&gt;&lt;/span&gt;
&lt;p&gt;&lt;strong&gt;Status&lt;/strong&gt;: Shipped with mission &lt;code dir=&quot;auto&quot;&gt;083-mission-id-canonical-identity-migration&lt;/code&gt;.
&lt;strong&gt;ADR&lt;/strong&gt;: &lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/blob/main/docs/adr/3.x/2026-04-09-1-mission-identity-uses-ulid-not-sequential-prefix.md&quot;&gt;2026-04-09-1&lt;/a&gt;
&lt;strong&gt;Issue&lt;/strong&gt;: &lt;a href=&quot;https://github.com/Priivacy-ai/spec-kitty/issues/557&quot;&gt;Priivacy-ai/spec-kitty#557&lt;/a&gt;
&lt;strong&gt;Audience&lt;/strong&gt;: Operators upgrading existing Spec Kitty projects to the 3.x line
that ships the &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; identity model.&lt;/p&gt;
&lt;h2 id=&quot;why-this-matters&quot;&gt;Why This Matters&lt;/h2&gt;
&lt;p&gt;Before mission 083, Spec Kitty used the three-digit numeric prefix
(&lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt;) that shows up in directory names like
&lt;code dir=&quot;auto&quot;&gt;kitty-specs/001-auth-system/&lt;/code&gt; as the canonical identity for every mission.
This caused four distinct failure modes in real projects:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Collision on import.&lt;/strong&gt; Two repositories each had a &lt;code dir=&quot;auto&quot;&gt;001-auth-system&lt;/code&gt;
directory. Merging them or running a cross-repo dashboard scanner produced
silently-merged state, because both missions looked identical to the
selector.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Silent fallback on ambiguous handles.&lt;/strong&gt; A user ran
&lt;code dir=&quot;auto&quot;&gt;spec-kitty agent tasks status --mission 020&lt;/code&gt; in a project that had both
&lt;code dir=&quot;auto&quot;&gt;020-feature-a&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;020-feature-b&lt;/code&gt; (from a botched rebase). The CLI picked
one arbitrarily — and usually the wrong one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Branch and worktree name collisions.&lt;/strong&gt; Two missions with the same
human-chosen slug would fight over the same &lt;code dir=&quot;auto&quot;&gt;.worktrees/&amp;#x3C;slug&gt;-lane-a&lt;/code&gt;
directory and the same &lt;code dir=&quot;auto&quot;&gt;kitty/mission-&amp;#x3C;slug&gt;-lane-a&lt;/code&gt; branch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Early numbering pressure.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; had to be assigned the
moment a mission was created, which meant the number had to be globally
unique at creation time, which forced a cross-checkout lock that did not
actually exist.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Mission 083 fixes all four by making &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; (a ULID) the canonical
machine identity, minted at creation and immutable. &lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; becomes
&lt;strong&gt;display-only metadata&lt;/strong&gt;, &lt;code dir=&quot;auto&quot;&gt;null&lt;/code&gt; until merge time, and assigned as
&lt;code dir=&quot;auto&quot;&gt;max(existing_numbers)+1&lt;/code&gt; inside the merge-state lock — the only place where a
global invariant can actually be enforced.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Breaking (3.2.5+): this backfill is now mandatory for coordination.&lt;/strong&gt;
As of 3.2.5, a pre-3.2.x mission with no resolvable &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt;/&lt;code dir=&quot;auto&quot;&gt;mid8&lt;/code&gt;
&lt;strong&gt;hard-fails&lt;/strong&gt; on coordination operations (status transitions, &lt;code dir=&quot;auto&quot;&gt;move-task&lt;/code&gt;,
review/merge coordination writes) instead of silently degrading — the
coordination-workspace seam refuses to compose a malformed
&lt;code dir=&quot;auto&quot;&gt;kitty/mission-&amp;#x3C;slug&gt;-&lt;/code&gt; ref (#2091). If you see
&lt;code dir=&quot;auto&quot;&gt;COORDINATION_WORKSPACE_MID8_REQUIRED&lt;/code&gt;, run the backfill below
(&lt;code dir=&quot;auto&quot;&gt;spec-kitty migrate backfill-identity&lt;/code&gt;) to modernize the mission; audit
first with &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctor identity&lt;/code&gt;. The dual-era legacy-bridge fallback
is intentionally removed (#2462).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;what-changed&quot;&gt;What Changed&lt;/h2&gt;













































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Field&lt;/th&gt;&lt;th&gt;Before (2.x)&lt;/th&gt;&lt;th&gt;After (083+)&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Canonical machine identity&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; (3-digit string)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; (26-char ULID)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Selector routing&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;mission_slug&lt;/code&gt; prefix match&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;mid8&lt;/code&gt;, or &lt;code dir=&quot;auto&quot;&gt;mission_slug&lt;/code&gt;, disambiguated by &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Mission branch naming&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;kitty/mission-&amp;#x3C;slug&gt;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;kitty/mission-&amp;#x3C;slug&gt;-&amp;#x3C;mid8&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Lane branch naming†&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;kitty/mission-&amp;#x3C;slug&gt;-lane-&amp;#x3C;id&gt;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;kitty/mission-&amp;#x3C;slug&gt;-lane-&amp;#x3C;id&gt;&lt;/code&gt; (unchanged — see footnote)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Lane worktree naming†&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.worktrees/&amp;#x3C;slug&gt;-lane-&amp;#x3C;id&gt;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.worktrees/&amp;#x3C;slug&gt;-lane-&amp;#x3C;id&gt;&lt;/code&gt; (unchanged — see footnote)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Ambiguous selector&lt;/td&gt;&lt;td&gt;Silent first-match fallback&lt;/td&gt;&lt;td&gt;Structured &lt;code dir=&quot;auto&quot;&gt;MISSION_AMBIGUOUS_SELECTOR&lt;/code&gt; error&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;When &lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; is assigned&lt;/td&gt;&lt;td&gt;At mission creation&lt;/td&gt;&lt;td&gt;At merge time, under the merge-state lock&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;mid8&lt;/code&gt; is the first 8 characters of the ULID. It is the short disambiguator
used in the Mission branch and coordination identifiers.&lt;/li&gt;
&lt;li&gt;Pre-083 missions without a &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; are called &lt;strong&gt;legacy missions&lt;/strong&gt;. The
doctor and backfill commands below mint a &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; for them.&lt;/li&gt;
&lt;li&gt;† &lt;strong&gt;Lane branch and worktree naming never derived from &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt;.&lt;/strong&gt;
Mission 083 originally documented lane names as embedding &lt;code dir=&quot;auto&quot;&gt;mid8&lt;/code&gt; the same
way the Mission branch does. That was never what lane &lt;em&gt;creation&lt;/em&gt; produced
— lanes were always named from the slug and lane id alone — and the gap
between what six other read sites assumed and what creation actually did
caused a merge defect (#5108). ADR
&lt;a href=&quot;/adr/3.x/2026-09-26-2-lane-naming-keyed-on-creation-input/&quot;&gt;&lt;code dir=&quot;auto&quot;&gt;2026-09-26-2&lt;/code&gt;&lt;/a&gt;
makes the created (slug-only) name the only name any caller can compose.
&lt;code dir=&quot;auto&quot;&gt;mid8&lt;/code&gt; appears in a lane name only when the recorded Mission &lt;strong&gt;slug&lt;/strong&gt;
happens to embed it (see
&lt;a href=&quot;/architecture/execution-lanes/#naming&quot;&gt;Execution Lanes §Naming&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;step-1--upgrade-spec-kitty-cli&quot;&gt;Step 1 — Upgrade &lt;code dir=&quot;auto&quot;&gt;spec-kitty-cli&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Install the pre-release that contains the 083 work:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;pipx&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;install&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;--force&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;--pip-args=&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;--pre&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;spec-kitty-cli&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;spec-kitty&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;--version&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Expected: a version at or above the 083 release tag.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;spec-kitty-cli&lt;/code&gt; is installed via &lt;code dir=&quot;auto&quot;&gt;pipx&lt;/code&gt;, not &lt;code dir=&quot;auto&quot;&gt;pip&lt;/code&gt;. See the
project’s &lt;code dir=&quot;auto&quot;&gt;CLAUDE.md&lt;/code&gt; for the rationale.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;step-2--run-the-identity-audit&quot;&gt;Step 2 — Run the identity audit&lt;/h2&gt;
&lt;p&gt;From the root of each project you want to migrate:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;spec-kitty&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;doctor&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;identity&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;--json&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The command walks &lt;code dir=&quot;auto&quot;&gt;kitty-specs/&lt;/code&gt; and classifies every mission into one
of four states, and every &lt;code dir=&quot;auto&quot;&gt;kitty-specs/&lt;/code&gt; folder that is not a Mission as
&lt;code dir=&quot;auto&quot;&gt;residue&lt;/code&gt; (the same contract &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctor identity --help&lt;/code&gt; prints and
&lt;code dir=&quot;auto&quot;&gt;docs/api/cli-commands.md&lt;/code&gt; carries):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;assigned&lt;/code&gt; — &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; present AND &lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; non-null (fully
migrated, post-merge).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;pending&lt;/code&gt; — &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; present AND &lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; null (pre-merge;
the number is assigned at merge time).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;legacy&lt;/code&gt; — &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; missing AND &lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; present (needs
backfill).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;orphan&lt;/code&gt; — both fields missing, or &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; unreadable (needs triage).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;residue&lt;/code&gt; — the folder is not a Mission, and selection does not list it.
It has no &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt;; or, in a git repository, git tracks neither its
&lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; nor its &lt;code dir=&quot;auto&quot;&gt;spec.md&lt;/code&gt;, and the &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; has no &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; or
cannot be read. Each row’s &lt;code dir=&quot;auto&quot;&gt;residue_reason&lt;/code&gt; names which, and the report
prints one remedy per reason (&lt;code dir=&quot;auto&quot;&gt;residue_remedies&lt;/code&gt; under &lt;code dir=&quot;auto&quot;&gt;--json&lt;/code&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;no_meta&lt;/code&gt;: delete the folder if it is leftover. If it is a real Mission
whose &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; was deleted, run &lt;code dir=&quot;auto&quot;&gt;git restore &amp;#x3C;path&gt;/meta.json&lt;/code&gt; when
&lt;code dir=&quot;auto&quot;&gt;git status&lt;/code&gt; shows the deletion; when the deletion was committed, find it
with &lt;code dir=&quot;auto&quot;&gt;git log --diff-filter=D --format=%h -1 -- &amp;#x3C;path&gt;/meta.json&lt;/code&gt;, then
run &lt;code dir=&quot;auto&quot;&gt;git checkout &amp;#x3C;sha&gt;~1 -- &amp;#x3C;path&gt;/meta.json&lt;/code&gt;. If its &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; was
never committed, re-create it with &lt;code dir=&quot;auto&quot;&gt;spec-kitty agent mission create&lt;/code&gt; and
move its &lt;code dir=&quot;auto&quot;&gt;spec.md&lt;/code&gt; in.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;untracked_idless_meta&lt;/code&gt;: for a real Mission, commit its &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; or
run &lt;code dir=&quot;auto&quot;&gt;spec-kitty migrate backfill-identity&lt;/code&gt;; otherwise delete the folder.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;corrupt_meta&lt;/code&gt;: the Mission content is corrupt (the row’s &lt;code dir=&quot;auto&quot;&gt;error&lt;/code&gt; says
why); do not delete the folder before checking. Fix its permissions or
JSON. If &lt;code dir=&quot;auto&quot;&gt;git status&lt;/code&gt; shows it staged as deleted, run
&lt;code dir=&quot;auto&quot;&gt;git checkout HEAD -- &amp;#x3C;path&gt;/meta.json&lt;/code&gt;. If a commit removed it, find
that commit with &lt;code dir=&quot;auto&quot;&gt;git log --diff-filter=D --format=%h -1 -- &amp;#x3C;path&gt;/meta.json&lt;/code&gt;
and run &lt;code dir=&quot;auto&quot;&gt;git checkout &amp;#x3C;sha&gt;~1 -- &amp;#x3C;path&gt;/meta.json&lt;/code&gt;. Otherwise re-create
the Mission with &lt;code dir=&quot;auto&quot;&gt;spec-kitty agent mission create&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;--fail-on residue&lt;/code&gt; makes the audit exit 1 while any remain. A git index
that cannot be read makes the audit exit 1 with one error line
(&lt;code dir=&quot;auto&quot;&gt;GIT_INDEX_UNREADABLE&lt;/code&gt; under &lt;code dir=&quot;auto&quot;&gt;--json&lt;/code&gt;); run &lt;code dir=&quot;auto&quot;&gt;git reset&lt;/code&gt;, and if that
fails too, delete the index file (&lt;code dir=&quot;auto&quot;&gt;git rev-parse --git-path index&lt;/code&gt; prints
its path) and run &lt;code dir=&quot;auto&quot;&gt;git reset&lt;/code&gt; again.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Expected output&lt;/strong&gt; for a project with one legacy mission, one pending
mission and one leftover residue folder (&lt;code dir=&quot;auto&quot;&gt;path&lt;/code&gt; values are absolute;
&lt;code dir=&quot;auto&quot;&gt;residue_remedies&lt;/code&gt; appears only when at least one folder is &lt;code dir=&quot;auto&quot;&gt;residue&lt;/code&gt;):&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;assigned&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;pending&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;legacy&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;orphan&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;residue&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;missions&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;/srv/my-project/kitty-specs/001-auth-system&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;slug&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;001-auth-system&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_id&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_number&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;state&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;legacy&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;error&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;residue_reason&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;/srv/my-project/kitty-specs/002-dashboard&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;slug&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;002-dashboard&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_id&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;01J6XW9VMJ5Z3QRXPFW5K2H1MA&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_number&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;state&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;pending&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;error&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;residue_reason&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;/srv/my-project/kitty-specs/leftover-junk&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;slug&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;leftover-junk&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_id&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_number&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;state&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;residue&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;error&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;residue_reason&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;no_meta&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;duplicate_prefixes&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: {},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;ambiguous_selectors&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: {},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;fail_on_triggered&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;residue_remedies&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;no_meta&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;No meta.json on disk, so Mission selection does not list it. If it is leftover residue, delete the folder. If it is a real Mission whose meta.json was deleted: when `git status` shows the deletion, run `git restore &amp;#x3C;path&gt;/meta.json`; when the deletion was committed, find it with `git log --diff-filter=D --format=%h -1 -- &amp;#x3C;path&gt;/meta.json` and run `git checkout &amp;#x3C;sha&gt;~1 -- &amp;#x3C;path&gt;/meta.json`. If its meta.json was never committed, re-create the Mission with `spec-kitty agent mission create` and move its spec.md into the new folder.&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Every row in &lt;code dir=&quot;auto&quot;&gt;missions[]&lt;/code&gt; carries &lt;code dir=&quot;auto&quot;&gt;path&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;slug&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt;,
&lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;state&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;error&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;residue_reason&lt;/code&gt; (&lt;code dir=&quot;auto&quot;&gt;null&lt;/code&gt; unless the
row is &lt;code dir=&quot;auto&quot;&gt;residue&lt;/code&gt;). &lt;code dir=&quot;auto&quot;&gt;duplicate_prefixes&lt;/code&gt; reports every 3-digit numeric
prefix shared by two or more missions, and &lt;code dir=&quot;auto&quot;&gt;ambiguous_selectors&lt;/code&gt; every
selector handle that would resolve to more than one mission — &lt;code dir=&quot;auto&quot;&gt;residue&lt;/code&gt;
folders are in neither, because Mission selection does not list them.
&lt;code dir=&quot;auto&quot;&gt;fail_on_triggered&lt;/code&gt; is &lt;code dir=&quot;auto&quot;&gt;true&lt;/code&gt; when &lt;code dir=&quot;auto&quot;&gt;--fail-on&lt;/code&gt; matched at least one row (the
command then exits 1).&lt;/p&gt;
&lt;p&gt;If &lt;code dir=&quot;auto&quot;&gt;duplicate_prefixes&lt;/code&gt; or &lt;code dir=&quot;auto&quot;&gt;ambiguous_selectors&lt;/code&gt; is non-empty, resolve the
collision before you rely on short handles: rename one of the colliding
directories, or delete a stale checkout. An ambiguous handle fails with a
structured &lt;code dir=&quot;auto&quot;&gt;MISSION_AMBIGUOUS_SELECTOR&lt;/code&gt; error, without fallback — see
Step 6. The CLI does not guess.&lt;/p&gt;
&lt;h2 id=&quot;step-3--run-the-backfill&quot;&gt;Step 3 — Run the backfill&lt;/h2&gt;
&lt;p&gt;Once the audit reports no &lt;code dir=&quot;auto&quot;&gt;legacy&lt;/code&gt; missions (and no &lt;code dir=&quot;auto&quot;&gt;orphan&lt;/code&gt; or &lt;code dir=&quot;auto&quot;&gt;residue&lt;/code&gt; rows
you need to triage):&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;spec-kitty&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;migrate&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;backfill-identity&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;This command:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Loads every legacy mission.&lt;/li&gt;
&lt;li&gt;Mints a fresh &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; (ULID) per mission.&lt;/li&gt;
&lt;li&gt;Writes &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; into &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt;. &lt;strong&gt;No other field’s value is touched&lt;/strong&gt; —
&lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;mission_slug&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;created_at&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;target_branch&lt;/code&gt;,
&lt;code dir=&quot;auto&quot;&gt;friendly_name&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;mission_type&lt;/code&gt; all keep their values, except
that a legacy string-typed &lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; (for example &lt;code dir=&quot;auto&quot;&gt;&quot;042&quot;&lt;/code&gt;) is
coerced to an integer.&lt;/li&gt;
&lt;li&gt;Leaves the change in your working tree for you to review and commit; it
does not commit by itself.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Expected output&lt;/strong&gt; (live run on a project with one legacy mission):&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;backfill-identity summary&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Total missions scanned : 2&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Written (mission_id)   : 1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Skipped (already set)  : 1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Errors                 : 0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Number coerced         : 0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Done. 1 mission(s) received a ``mission_id``.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Rows with &lt;code dir=&quot;auto&quot;&gt;Errors &gt; 0&lt;/code&gt; name the failing mission and the reason; the command
exits 1 when any row errors.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Backfill is additive-only.&lt;/strong&gt; Existing data is never overwritten. The
backfill is safe to re-run: missions that already have a &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; are
skipped.&lt;/p&gt;
&lt;h2 id=&quot;step-4--re-run-the-audit&quot;&gt;Step 4 — Re-run the audit&lt;/h2&gt;
&lt;p&gt;Confirm the project is clean:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;spec-kitty&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;doctor&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;identity&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;--json&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Expected output&lt;/strong&gt; (the same project after the backfill and after
triaging the leftover residue folder — &lt;code dir=&quot;auto&quot;&gt;legacy&lt;/code&gt; is 0,
the backfilled mission is now &lt;code dir=&quot;auto&quot;&gt;assigned&lt;/code&gt;, and &lt;code dir=&quot;auto&quot;&gt;residue_remedies&lt;/code&gt; is absent
because no residue row remains; the backfill itself does not remove
residue folders):&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;assigned&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;pending&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;legacy&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;orphan&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;residue&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;missions&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;/srv/my-project/kitty-specs/001-auth-system&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;slug&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;001-auth-system&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_id&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;01M669SYJ4RPTTHW57DMY2KPY6&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_number&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#F78C6C;--1:#AA0982&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;state&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;assigned&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;error&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;residue_reason&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;/srv/my-project/kitty-specs/002-dashboard&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;slug&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;002-dashboard&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_id&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;01J6XW9VMJ5Z3QRXPFW5K2H1MA&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;mission_number&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;state&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#C789D6;--1:#7C5686&quot;&gt;pending&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;error&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;residue_reason&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;null&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;duplicate_prefixes&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: {},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;ambiguous_selectors&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: {},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#7FDBCA;--1:#096E72&quot;&gt;&quot;fail_on_triggered&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#FF6A83;--1:#A24848&quot;&gt;false&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;A &lt;code dir=&quot;auto&quot;&gt;pending&lt;/code&gt; mission is healthy: its &lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; is assigned at merge
time. If any mission is still &lt;code dir=&quot;auto&quot;&gt;legacy&lt;/code&gt;, rerun backfill against that mission
directly (&lt;code dir=&quot;auto&quot;&gt;spec-kitty migrate backfill-identity --mission &amp;#x3C;slug&gt;&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;what-backfill-does-not-change&quot;&gt;What Backfill Does Not Change&lt;/h2&gt;
&lt;p&gt;Backfill mints &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; and writes it into &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt;; it does &lt;strong&gt;not&lt;/strong&gt;
touch &lt;code dir=&quot;auto&quot;&gt;lanes.json&lt;/code&gt; or rename anything already created on disk:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lane branches and worktrees keep their created names.&lt;/strong&gt; Backfilling a
legacy mission’s identity does not rename its lane branches or lane
worktrees, because lane naming never took the identity as an input in the
first place (see the footnote in &lt;strong&gt;What Changed&lt;/strong&gt; above and ADR
&lt;a href=&quot;/adr/3.x/2026-09-26-2-lane-naming-keyed-on-creation-input/&quot;&gt;&lt;code dir=&quot;auto&quot;&gt;2026-09-26-2&lt;/code&gt;&lt;/a&gt;).
A lane created before backfill and a lane created after backfill compose
the identical name, for the identical slug and lane id.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;lanes.json&lt;/code&gt;’s recorded &lt;code dir=&quot;auto&quot;&gt;mission_branch&lt;/code&gt; is preserved across
re-finalize (FR-011).&lt;/strong&gt; Only the &lt;em&gt;first&lt;/em&gt; &lt;code dir=&quot;auto&quot;&gt;finalize-tasks&lt;/code&gt; for a mission
defines its recorded Mission branch. Backfilling the identity and then
re-running &lt;code dir=&quot;auto&quot;&gt;finalize-tasks&lt;/code&gt; leaves that recorded value byte-identical —
it is never recomposed from the (now-different) identity. This is what
keeps a backfilled mission’s later &lt;code dir=&quot;auto&quot;&gt;implement&lt;/code&gt;/&lt;code dir=&quot;auto&quot;&gt;merge&lt;/code&gt; steps targeting the
Mission branch that was actually created, instead of a phantom name that
was never created.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;step-5--understanding-the-new-branch-and-worktree-naming&quot;&gt;Step 5 — Understanding the new branch and worktree naming&lt;/h2&gt;
&lt;p&gt;This step applies only to a Mission’s &lt;strong&gt;first&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;finalize-tasks&lt;/code&gt; — the one
that defines &lt;code dir=&quot;auto&quot;&gt;lanes.json&lt;/code&gt;’s recorded Mission branch for the first time. Once
a mission has a &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt;, that first finalize (via the following
&lt;code dir=&quot;auto&quot;&gt;spec-kitty implement&lt;/code&gt; cycle) produces a &lt;strong&gt;Mission branch&lt;/strong&gt; that embeds
&lt;code dir=&quot;auto&quot;&gt;mid8&lt;/code&gt;. A &lt;strong&gt;re-finalize&lt;/strong&gt; on an already-finalized Mission is a different
case: it preserves the already-recorded Mission branch byte-identically (see
&lt;strong&gt;What Backfill Does Not Change&lt;/strong&gt; above) rather than recomputing it. Lane
branches and lane worktrees are keyed on the slug and lane id only in either
case, never on &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; directly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Case A — a legacy Mission backfilled after it was already finalized.&lt;/strong&gt;
Its lanes were created from the pre-backfill slug, so its lane names do not
change:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Mission branch: kitty/mission-auth-system&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Lane branch:    kitty/mission-auth-system-lane-a&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Lane worktree:  .worktrees/auth-system-lane-a/&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Backfilling this Mission’s identity does not by itself change any of the
above — see &lt;strong&gt;What Backfill Does Not Change&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Case B — a Mission created fresh on 083+.&lt;/strong&gt; Its recorded slug already
embeds the mid8 (minted at &lt;code dir=&quot;auto&quot;&gt;mission create&lt;/code&gt;, before the first &lt;code dir=&quot;auto&quot;&gt;finalize&lt;/code&gt;
ever runs), so the Mission branch &lt;strong&gt;and&lt;/strong&gt; the lane names both contain it —
not because lane naming looked up the identity, but because it is already
part of the slug it composes from:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Mission branch: kitty/mission-auth-system-01J6XW9K&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Lane branch:    kitty/mission-auth-system-01J6XW9K-lane-a&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Lane worktree:  .worktrees/auth-system-01J6XW9K-lane-a/&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Where &lt;code dir=&quot;auto&quot;&gt;01J6XW9K&lt;/code&gt; is the first 8 characters of
&lt;code dir=&quot;auto&quot;&gt;mission_id = 01J6XW9KQT7M0YB3N4R5CQZ2EX&lt;/code&gt;. Compare Case A: there, the slug
never embedded a mid8, so the lane names never picked one up either — lane
naming only ever reflects whatever the recorded slug already contains, never
the identity directly (see ADR
&lt;a href=&quot;/adr/3.x/2026-09-26-2-lane-naming-keyed-on-creation-input/&quot;&gt;&lt;code dir=&quot;auto&quot;&gt;2026-09-26-2&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What this means in practice:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You may see both legacy and new Mission branches side-by-side during the
transition. That is expected.&lt;/li&gt;
&lt;li&gt;Existing worktrees for a mission do &lt;strong&gt;not&lt;/strong&gt; rename automatically. Lane
worktrees never need to — they were never keyed on the identity.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;step-6--what-to-do-if-a-selector-is-ambiguous&quot;&gt;Step 6 — What to do if a selector is ambiguous&lt;/h2&gt;
&lt;p&gt;The &lt;code dir=&quot;auto&quot;&gt;--mission&lt;/code&gt; flag on every command now accepts three forms:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt;&lt;/strong&gt; — full 26-char ULID. Always unique. Always works.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;mid8&lt;/code&gt;&lt;/strong&gt; — first 8 chars of the ULID. Unique in practice; the resolver
falls through to a structured error if two missions somehow share &lt;code dir=&quot;auto&quot;&gt;mid8&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;mission_slug&lt;/code&gt;&lt;/strong&gt; — human-readable slug. Preferred for interactive use;
the resolver disambiguates by &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; when two missions share a slug.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If the resolver cannot disambiguate, you get a &lt;code dir=&quot;auto&quot;&gt;MISSION_AMBIGUOUS_SELECTOR&lt;/code&gt;
error &lt;strong&gt;without fallback&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Error: Handle &apos;auth-system&apos; matches 2 missions:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- mission_id=01J6XW9KQT7M0YB3N4R5CQZ2EX slug=auth-system number=1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- mission_id=01J7YZ0DPN5A2B3C4D5E6F7G8H slug=auth-system number=14&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Pass the full mission_id or mid8 to disambiguate, e.g. --mission 01J6XW9K.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Copy the &lt;code dir=&quot;auto&quot;&gt;mid8&lt;/code&gt; from the error and re-run the command. This is deliberate —
mission 083 removed silent fallback (work package WP07) because it was the
root cause of the collision class of bugs.&lt;/p&gt;
&lt;h2 id=&quot;rollback-plan&quot;&gt;Rollback Plan&lt;/h2&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; is a &lt;strong&gt;forward-only, additive&lt;/strong&gt; change. If something breaks
after the migration:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The stored data is safe.&lt;/strong&gt; Backfill only adds &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; to
&lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt;; it never removes or modifies existing fields. A project
whose &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; files have both &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt; is in
the normal state for 083+.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pin the CLI back.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;pipx install spec-kitty-cli==&amp;#x3C;pre-083-version&gt;&lt;/code&gt;
returns you to the 2.x line. The old CLI will ignore the new
&lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; field in &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; and continue to route by
&lt;code dir=&quot;auto&quot;&gt;mission_number&lt;/code&gt;. The new Mission branches created under 083 will
remain on disk but will not be used by the old CLI; you can either
&lt;code dir=&quot;auto&quot;&gt;git worktree remove&lt;/code&gt; them or leave them as archived state.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Report the failure.&lt;/strong&gt; File an issue at
&lt;a href=&quot;https://github.com/Priivacy-ai/spec-kitty/issues/557&quot;&gt;Priivacy-ai/spec-kitty#557&lt;/a&gt;
or the tracking issue for the release with the output of
&lt;code dir=&quot;auto&quot;&gt;spec-kitty doctor identity --json&lt;/code&gt; attached.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Do not&lt;/strong&gt; hand-edit &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; to remove &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt;. The file is watched
by the event log, and a missing &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; will
cause it to classify the mission as legacy and prompt for another
backfill — at which point the mission will receive a &lt;strong&gt;different&lt;/strong&gt; ULID, and
any event log entries keyed off the original ULID will become orphaned.&lt;/p&gt;
&lt;h2 id=&quot;related-documentation&quot;&gt;Related Documentation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/blob/main/CLAUDE.md#mission-identity-model-083&quot;&gt;Mission Identity Model in &lt;code dir=&quot;auto&quot;&gt;CLAUDE.md&lt;/code&gt;&lt;/a&gt; — developer-facing contract summary.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/api/event-envelope/&quot;&gt;Event Envelope Reference&lt;/a&gt; — how &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; flows into the machine contract.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/api/orchestrator-api/&quot;&gt;Orchestrator API Reference&lt;/a&gt; — &lt;code dir=&quot;auto&quot;&gt;--mission&lt;/code&gt; selector semantics.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/architecture/execution-lanes/&quot;&gt;Execution Lanes&lt;/a&gt; — lane branch and worktree naming.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/blob/main/docs/archive/architecture/feature-detection.md&quot;&gt;Feature Detection architecture note&lt;/a&gt; — historical context for the pre-083 selector.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/migrations/feature-flag-deprecation/&quot;&gt;Feature Flag Deprecation&lt;/a&gt; — the earlier &lt;code dir=&quot;auto&quot;&gt;--feature&lt;/code&gt; → &lt;code dir=&quot;auto&quot;&gt;--mission&lt;/code&gt; migration.&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
