<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xml:base="https://docs.spec-kitty.ai/adr/4.x/2026-11-06-5-gates-over-worktree-less-coordination/">
  <id>https://docs.spec-kitty.ai/adr/4.x/2026-11-06-5-gates-over-worktree-less-coordination/</id>
  <title>ADR: consolidation gates hold over a coordination branch with no worktree</title>
  <updated>2026-11-06T00:00:00.000Z</updated>
  <author><name>Spec Kitty</name></author>
  <link rel="alternate" type="text/html" href="https://docs.spec-kitty.ai/adr/4.x/2026-11-06-5-gates-over-worktree-less-coordination/"/>
  <summary>Proposed: ref-reading gates are unchanged, the late window reads a pinned ref, the write fence is the compare-and-swap, and resume and rollback lose the coordination checkout role.</summary>
  <content type="html">&lt;h2 id=&quot;consolidation-gates-hold-over-a-coordination-branch-with-no-worktree&quot;&gt;Consolidation gates hold over a coordination branch with no worktree&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Status:&lt;/strong&gt; Proposed (2026-11-06). The operator accepts it by merging the pull request that carries it, together with the other records of the set.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Date:&lt;/strong&gt; 2026-11-06&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Deciders:&lt;/strong&gt; Stijn Dejongh (operator). Ruling 4 of epic #7276 is DM &lt;code dir=&quot;auto&quot;&gt;01M6QY371KRY5XXQMDQ4WZR1YE&lt;/code&gt; in Mission &lt;code dir=&quot;auto&quot;&gt;lane-worktree-model-hardening-01M6QY1M&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Technical Story:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/issues/7284&quot;&gt;#7284&lt;/a&gt; (S9), epic &lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/issues/7276&quot;&gt;#7276&lt;/a&gt;. ADRs only; the implementation follows migration step 4 (&lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/issues/6117&quot;&gt;#6117&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discharges&lt;/strong&gt; the D-6 bullets of &lt;a href=&quot;/adr/4.x/2026-10-22-1-the-java-write-service-is-the-canonical-event-writer/&quot;&gt;ADR 2026-10-22-1&lt;/a&gt; on merge semantics and on the consolidation gates (mapping in that record’s Amendment 2026-11-06).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cites, does not re-decide:&lt;/strong&gt; the S10 late-window pass, &lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/issues/7265&quot;&gt;#7265&lt;/a&gt;, recorded as Amendment 2026-11-06 of &lt;a href=&quot;/adr/3.x/2026-09-19-1-terminus-safety-invariant/&quot;&gt;ADR 2026-09-19-1&lt;/a&gt; on PR &lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/pull/7274&quot;&gt;#7274&lt;/a&gt; (branch &lt;code dir=&quot;auto&quot;&gt;issue-7198-late-window-one-pass&lt;/code&gt;). Mission constraint C-005.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related records of the same set:&lt;/strong&gt; &lt;strong&gt;C-1&lt;/strong&gt; &lt;a href=&quot;/adr/4.x/2026-11-06-4-coordination-branch-written-by-commit/&quot;&gt;ADR 2026-11-06-4&lt;/a&gt; (the coordination branch is written by commit), &lt;strong&gt;C-3&lt;/strong&gt; &lt;a href=&quot;/adr/4.x/2026-11-06-6-committed-ledger-is-the-coordination-blob/&quot;&gt;ADR 2026-11-06-6&lt;/a&gt; (the committed ledger is the coordination blob), &lt;strong&gt;events ADR-0007&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;docs/adr/0007-write-service-commits-coordination-status-by-ref.md&lt;/code&gt; and &lt;strong&gt;events ADR-0008&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;docs/adr/0008-read-service-reads-coordination-ledger-from-git-objects.md&lt;/code&gt; in &lt;a href=&quot;https://github.com/spec-kitty/spec-kitty-events&quot;&gt;&lt;code dir=&quot;auto&quot;&gt;spec-kitty/spec-kitty-events&lt;/code&gt;&lt;/a&gt;, branch &lt;code dir=&quot;auto&quot;&gt;main&lt;/code&gt; (merged from &lt;code dir=&quot;auto&quot;&gt;issue-7284-coordination-ref-write-adrs&lt;/code&gt;), PR &lt;a href=&quot;https://github.com/spec-kitty/spec-kitty-events/pull/215&quot;&gt;spec-kitty/spec-kitty-events#215&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Builds on &lt;a href=&quot;/adr/4.x/2026-10-04-5-approval-stamp-bounds-the-approved-claim/&quot;&gt;ADR 2026-10-04-5&lt;/a&gt; (approval stamp bounds the claim) and &lt;a href=&quot;/adr/2.x/2026-02-09-3-event-log-merge-semantics/&quot;&gt;ADR 2026-02-09-3&lt;/a&gt; (event log merge semantics), both unchanged.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Reader:&lt;/strong&gt; a maintainer changing consolidation (claim, gate, late window, teardown, rollback, resume) for coordination Missions once the coordination worktree is retired (C-1 step 4a).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;context-and-problem-statement&quot;&gt;Context and Problem Statement&lt;/h2&gt;
&lt;p&gt;C-1 retires the coordination worktree: from step 4a the write service commits coordination status straight onto &lt;code dir=&quot;auto&quot;&gt;refs/heads/&amp;#x3C;coord&gt;&lt;/code&gt;. Consolidation reads and moves that branch today, and some of its steps use the worktree:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Gates that read refs&lt;/strong&gt; (the approval bound &lt;code dir=&quot;auto&quot;&gt;consolidation/approved_bound.py::check_lane&lt;/code&gt;, the claim build &lt;code dir=&quot;auto&quot;&gt;reconciliation.build_approved_wp_set&lt;/code&gt;, the attribution axes &lt;code dir=&quot;auto&quot;&gt;wp_attribution&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;line_attribution&lt;/code&gt; and the blob axis, owned-file evidence &lt;code dir=&quot;auto&quot;&gt;wp_evidence&lt;/code&gt;, and the &lt;code dir=&quot;auto&quot;&gt;lane_head&lt;/code&gt; stamps of &lt;code dir=&quot;auto&quot;&gt;status/lane_head.py&lt;/code&gt;) never needed a checkout.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The late projection window&lt;/strong&gt; folds the coordination worktree’s working-tree log into the status union; S10’s pass names that as its one exception to “read &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt;, never the live branch”.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rollback and resume&lt;/strong&gt; resync the coordination checkout (&lt;code dir=&quot;auto&quot;&gt;git/ref_advance.py::resync_checkouts_to_tip&lt;/code&gt;, called by &lt;code dir=&quot;auto&quot;&gt;consolidation/rollback.py&lt;/code&gt;) and recover it in place with &lt;code dir=&quot;auto&quot;&gt;reset --hard&lt;/code&gt; (one of the four checkout roles of &lt;code dir=&quot;auto&quot;&gt;consolidation/resume_recovery.py&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Teardown&lt;/strong&gt; destroys the coordination triple (branch, worktree, marker) behind &lt;code dir=&quot;auto&quot;&gt;coordination/teardown.py::ProjectionTeardownGate&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Two writers then move the coordination branch: the Java service (status units) and consolidation (its teardown delete). Something must keep them from losing each other’s updates.&lt;/p&gt;
&lt;h2 id=&quot;decision-drivers&quot;&gt;Decision Drivers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;No gate weakens (Mission constraint; ADR 2026-10-04-5 and ADR 2026-09-19-1 unchanged in what they prove).&lt;/li&gt;
&lt;li&gt;S10’s pass is consumed, not redesigned (C-005).&lt;/li&gt;
&lt;li&gt;A lost update on the coordination branch must be impossible, not unlikely.&lt;/li&gt;
&lt;li&gt;The fewest new cross-language couplings between the Java service and consolidation’s Python state.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;considered-options&quot;&gt;Considered Options&lt;/h2&gt;
&lt;p&gt;For the write fence (D-4), the open choice of this record:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The compare-and-swap alone&lt;/strong&gt; (recommended).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The service refuses coordination writes while a consolidation record holds the Mission.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consolidation writes its coordination bookkeeping through the service.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;decision-outcome&quot;&gt;Decision Outcome&lt;/h2&gt;
&lt;p&gt;Each decision is marked &lt;em&gt;(ruled)&lt;/em&gt;, &lt;em&gt;(derived)&lt;/em&gt; or &lt;em&gt;(open)&lt;/em&gt;; open choices carry a recommendation (Mission assumption A-12).&lt;/p&gt;
&lt;h3 id=&quot;d-1-ref-reading-gates-are-unchanged-derived&quot;&gt;D-1: ref-reading gates are unchanged &lt;em&gt;(derived)&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;The approval bound, the claim build, the attribution axes, owned-file evidence and the &lt;code dir=&quot;auto&quot;&gt;for_review&lt;/code&gt; gate on the lane branch (S2, Mission WP08) read refs and &lt;code dir=&quot;auto&quot;&gt;lane_head&lt;/code&gt; stamps. They read the status log through the one read door (&lt;a href=&quot;/adr/4.x/2026-11-06-2-one-status-read-contract/&quot;&gt;ADR 2026-11-06-2&lt;/a&gt;), which for a coordination Mission reads &lt;code dir=&quot;auto&quot;&gt;refs/heads/&amp;#x3C;coord&gt;&lt;/code&gt; (C-1 D-5). They never needed a checkout and change in nothing: not in their inputs, verdicts, codes or exits.&lt;/p&gt;
&lt;h3 id=&quot;d-2-the-lane_head-stamp-keeps-its-meaning-derived&quot;&gt;D-2: the &lt;code dir=&quot;auto&quot;&gt;lane_head&lt;/code&gt; stamp keeps its meaning &lt;em&gt;(derived)&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;At step 4 the service stamps &lt;code dir=&quot;auto&quot;&gt;policy_metadata.lane_head&lt;/code&gt; from &lt;code dir=&quot;auto&quot;&gt;refs/heads/&amp;#x3C;lane&gt;&lt;/code&gt; in the command form (&lt;a href=&quot;/adr/4.x/2026-10-27-1-the-write-service-protocol-is-loopback-http-with-a-bearer-token/&quot;&gt;ADR 2026-10-27-1&lt;/a&gt; D-3; events ADR-0007 D-4). The stamp still means “the lane branch head when the transition was recorded”. ADR 2026-10-04-5’s bound and the S8 approval windows read it unchanged.&lt;/p&gt;
&lt;h3 id=&quot;d-3-the-late-window-reads-a-pinned-ref-derived-cites-s10&quot;&gt;D-3: the late window reads a pinned ref &lt;em&gt;(derived; cites S10)&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;S10’s pass (&lt;a href=&quot;/adr/3.x/2026-09-19-1-terminus-safety-invariant/&quot;&gt;ADR 2026-09-19-1&lt;/a&gt; Amendment 2026-11-06, PR #7274) decides what the late window proves and on which tip: the tip &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; is read once; the base is &lt;code dir=&quot;auto&quot;&gt;coord_tip_after_projection&lt;/code&gt; on a first run and &lt;code dir=&quot;auto&quot;&gt;pre_mutation_coord_sha&lt;/code&gt; on a resume; the proof runs over the tree delta &lt;code dir=&quot;auto&quot;&gt;B -&gt; T&lt;/code&gt; against the target ref’s committed blobs; only a fully proven &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; is approved, by compare-and-swap. This record changes none of that.&lt;/p&gt;
&lt;p&gt;It changes one input. S10 names one exception to “read &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt;”: the status union folds the coordination worktree’s working-tree log. From step 4a there is no such log. &lt;strong&gt;The union reads the event log blob at &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt;&lt;/strong&gt;, like every other path of the window. Events committed after &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; are therefore outside the window, exactly as S10 already treats every other path. The exception closes by construction, not by a patch.&lt;/p&gt;
&lt;p&gt;The merge rules of ADR 2026-02-09-3 (concatenate, deduplicate by event id, refuse one id with two payloads, the wall-clock reduce with the #4990 and #4941 rules) are unchanged; only where their inputs are read changes. ADR 2026-02-09-3 needs no amendment; at most a factual note when step 4a ships.&lt;/p&gt;
&lt;h3 id=&quot;d-4-the-write-fence-is-the-compare-and-swap-open-recommendation-option-1&quot;&gt;D-4: the write fence is the compare-and-swap &lt;em&gt;(open; recommendation: option 1)&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Option 1, the compare-and-swap alone (recommended).&lt;/strong&gt; Both writers move the coordination ref only by compare-and-swap, and each treats a lost swap as a refusal, never a retry.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Service side&lt;/strong&gt; (events ADR-0007 D-1, D-3): &lt;code dir=&quot;auto&quot;&gt;update-ref &amp;#x3C;coord&gt; &amp;#x3C;new&gt; &amp;#x3C;T&gt;&lt;/code&gt;, with every git call run under an emptied &lt;code dir=&quot;auto&quot;&gt;core.hooksPath&lt;/code&gt;. After a failed swap the service re-reads the ref: still at &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; (a held ref lock) is &lt;code dir=&quot;auto&quot;&gt;SERVICE_BUSY&lt;/code&gt;; missing is &lt;code dir=&quot;auto&quot;&gt;COORDINATION_BRANCH_DELETED&lt;/code&gt;; any other value is &lt;code dir=&quot;auto&quot;&gt;COORDINATION_REF_MOVED&lt;/code&gt;. Nothing is written.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consolidation side&lt;/strong&gt; (unchanged): the late window approves &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; only while the live ref equals &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; (S10); the teardown gate and the compare-and-swap branch delete anchor on that approved tip (&lt;code dir=&quot;auto&quot;&gt;ProjectionTeardownGate&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;git/ref_advance.py&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The races, and what each yields:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;a service write between the late window’s read of &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; and the teardown delete: the delete’s swap fails, teardown keeps the branch and marker and raises &lt;code dir=&quot;auto&quot;&gt;CoordMovedAfterLanding&lt;/code&gt; (&lt;code dir=&quot;auto&quot;&gt;COORD_MOVED_AFTER_LANDING&lt;/code&gt;, exit 75); the next &lt;code dir=&quot;auto&quot;&gt;consolidate --resume&lt;/code&gt; proves the new events (S10);&lt;/li&gt;
&lt;li&gt;a consolidation move of the ref between the service’s read of &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; and its swap: the service refuses with &lt;code dir=&quot;auto&quot;&gt;COORDINATION_REF_MOVED&lt;/code&gt;; the caller re-reads and decides;&lt;/li&gt;
&lt;li&gt;the branch deleted by teardown before a service write: &lt;code dir=&quot;auto&quot;&gt;COORDINATION_BRANCH_DELETED&lt;/code&gt;; the Mission has landed, and the read door reads the target (&lt;a href=&quot;/adr/4.x/2026-11-06-2-one-status-read-contract/&quot;&gt;ADR 2026-11-06-2&lt;/a&gt; &lt;code dir=&quot;auto&quot;&gt;CONSOLIDATED_TARGET&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;No update is lost on either side. The cost is a refusal on the slower side of a race, which is rare: a status write during the consolidation of the same Mission.&lt;/li&gt;
&lt;li&gt;It needs nothing new: no code, no shared state between the service and consolidation’s record, and it covers &lt;code dir=&quot;auto&quot;&gt;orchestrator-api consolidate-mission&lt;/code&gt; (which has no rollback door) and &lt;code dir=&quot;auto&quot;&gt;consolidate --dry-run&lt;/code&gt; without a fence of their own.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Option 2, refuse writes while a consolidation record holds the Mission&lt;/strong&gt; (a new code, for example &lt;code dir=&quot;auto&quot;&gt;CONSOLIDATION_IN_PROGRESS&lt;/code&gt;). Considered: it turns the exit-75 race into an up-front refusal. Not recommended: the Java service would read consolidation’s Python state file (&lt;code dir=&quot;auto&quot;&gt;.kittify/runtime/merge/&amp;#x3C;mission_id&gt;/state.json&lt;/code&gt;), a new cross-language coupling to an internal format; a record left by a crash blocks every status write until &lt;code dir=&quot;auto&quot;&gt;consolidate --abort&lt;/code&gt;; and the compare-and-swap is still needed for the user and the strangler-period CLI.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Option 3, consolidation writes its coordination bookkeeping through the service.&lt;/strong&gt; Considered: one writer of the ref in every case. Not recommended now: it is migration step 5 of ADR 2026-10-22-1 (“then the consolidation bookkeeping writes”) and needs the service to speak consolidation’s projection writes. It remains compatible with option 1 and can follow at step 5.&lt;/p&gt;
&lt;h3 id=&quot;d-5-resume-and-rollback-lose-the-coordination-checkout-role-derived&quot;&gt;D-5: resume and rollback lose the coordination checkout role &lt;em&gt;(derived)&lt;/em&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;resync_checkouts_to_tip&lt;/code&gt;&lt;/strong&gt; (&lt;code dir=&quot;auto&quot;&gt;git/ref_advance.py&lt;/code&gt;): rollback no longer brings a coordination checkout back to the coordination branch’s tip (#5638); there is none. Rollback restores the coordination ref by compare-and-swap only, through the single rollback authority (&lt;code dir=&quot;auto&quot;&gt;consolidation/rollback.py::rollback_to_snapshot&lt;/code&gt;, unchanged). The resync stays for the target and Mission-branch checkouts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;pre_mutation_coord_sha&lt;/code&gt;&lt;/strong&gt; (and &lt;code dir=&quot;auto&quot;&gt;pre_mutation_coord_ref&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;pre_interrupt_lane_tips&lt;/code&gt;) stay &lt;strong&gt;ref anchors&lt;/strong&gt;: S10’s resume base, and the #6770 re-baseline that keeps them on a coordination topology, are unchanged.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resume recovery&lt;/strong&gt; (&lt;code dir=&quot;auto&quot;&gt;consolidation/resume_recovery.py&lt;/code&gt;): the in-place &lt;code dir=&quot;auto&quot;&gt;reset --hard HEAD&lt;/code&gt; recovery covers three checkout roles instead of four (repository root checkout, Mission worktree, lane worktree); the coordination worktree role and its &lt;code dir=&quot;auto&quot;&gt;pre_mutation_refs&lt;/code&gt; entry go away.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The status-surface guard&lt;/strong&gt;, which rollback’s resync made a backstop, retires with C-1 D-8.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Teardown&lt;/strong&gt;: the coordination triple becomes a pair (branch, marker). The gate and the compare-and-swap branch delete are unchanged; the worktree leg is removed. Lane cleanup still runs last, after it (ruling 6; Mission S5).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;d-6-what-stays-open-open&quot;&gt;D-6: what stays open &lt;em&gt;(open)&lt;/em&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Whether &lt;code dir=&quot;auto&quot;&gt;consolidate --dry-run&lt;/code&gt; reads the same once-read tip as a real run (default: yes; its forecast reads &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; once).&lt;/li&gt;
&lt;li&gt;The fence choice of D-4.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;consequences&quot;&gt;Consequences&lt;/h3&gt;
&lt;h4 id=&quot;positive&quot;&gt;Positive&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;The #7198 class (the late window reading a working-tree log that moved) closes by construction.&lt;/li&gt;
&lt;li&gt;Every gate reads committed git state only; none depends on a checkout existing.&lt;/li&gt;
&lt;li&gt;No new error code and no new shared state between the Java service and consolidation (under option 1).&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;negative&quot;&gt;Negative&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Under option 1, a status write that races the consolidation of the same Mission ends one side with a refusal (&lt;code dir=&quot;auto&quot;&gt;COORD_MOVED_AFTER_LANDING&lt;/code&gt;, exit 75, or &lt;code dir=&quot;auto&quot;&gt;COORDINATION_REF_MOVED&lt;/code&gt;); the operator re-runs.&lt;/li&gt;
&lt;li&gt;The resume and rollback code loses a role; tests that pin four roles change at step 4a.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;neutral&quot;&gt;Neutral&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;The approval bound, claim, attribution, evidence and &lt;code dir=&quot;auto&quot;&gt;for_review&lt;/code&gt; gates are untouched.&lt;/li&gt;
&lt;li&gt;ADR 2026-02-09-3’s merge semantics are untouched.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;confirmation&quot;&gt;Confirmation&lt;/h3&gt;
&lt;p&gt;Existing tests that must stay green, unchanged, at step 4a (D-1, D-2):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_approved_bound.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_approved_bound_residuals.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_wp_attribution.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_wp_evidence.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_claim_integrity_refusal.py&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;tests/specify_cli/lanes/test_for_review_gate_parity.py&lt;/code&gt; (S2, Mission WP08);&lt;/li&gt;
&lt;li&gt;S10’s &lt;code dir=&quot;auto&quot;&gt;tests/coordination/test_projection_teardown.py&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_late_teardown_projection.py&lt;/code&gt; (PR #7274), with the working-tree-log fixtures replaced by a ref-only coordination branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Named here, &lt;strong&gt;to be written by the step-4 Mission&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_late_window_reads_pinned_ref.py&lt;/code&gt;: with no coordination worktree, the union reads the log blob at &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt;; an event committed after &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; is not unioned and is proven on the next resume.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_coordination_write_fence.py&lt;/code&gt;: a service write between &lt;code dir=&quot;auto&quot;&gt;T&lt;/code&gt; and the teardown delete yields &lt;code dir=&quot;auto&quot;&gt;COORD_MOVED_AFTER_LANDING&lt;/code&gt; (exit 75) with the branch and marker kept; a consolidation move before the service’s swap yields &lt;code dir=&quot;auto&quot;&gt;COORDINATION_REF_MOVED&lt;/code&gt;; no event is lost in either case.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_rollback_without_coordination_checkout.py&lt;/code&gt;: rollback restores the coordination ref by compare-and-swap and calls no resync for it.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;tests/consolidation/test_resume_recovery_roles.py&lt;/code&gt;: resume recovery covers exactly three checkout roles.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;pros-and-cons-of-the-options&quot;&gt;Pros and Cons of the Options&lt;/h2&gt;
&lt;h3 id=&quot;1-the-compare-and-swap-alone-recommended&quot;&gt;1. The compare-and-swap alone (recommended)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Good: no new code or coupling; covers every caller, &lt;code dir=&quot;auto&quot;&gt;orchestrator-api&lt;/code&gt; included; no lost update.&lt;/li&gt;
&lt;li&gt;Bad: a race ends in a refusal on one side.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2-refuse-writes-while-a-consolidation-record-holds-the-mission&quot;&gt;2. Refuse writes while a consolidation record holds the Mission&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Good: the race becomes an up-front refusal with a clear reason.&lt;/li&gt;
&lt;li&gt;Bad: the Java service reads a Python-internal state file; a stale record blocks writes; the swap is still needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;3-consolidation-writes-through-the-service&quot;&gt;3. Consolidation writes through the service&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Good: one writer of the ref, always.&lt;/li&gt;
&lt;li&gt;Bad: a large contract growth, already scheduled as migration step 5.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;more-information&quot;&gt;More Information&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Mission discovery map: &lt;code dir=&quot;auto&quot;&gt;kitty-specs/lane-worktree-model-hardening-01M6QY1M/upstream/doctrine-and-write-service-adr-map.md&lt;/code&gt; (Part 2, C-2; risk 8).&lt;/li&gt;
&lt;li&gt;S10 design issue &lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/issues/7265&quot;&gt;#7265&lt;/a&gt; and its residuals (#7271, #7121, #5460), unchanged by this record.&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
