<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xml:base="https://docs.spec-kitty.ai/adr/3.x/2026-05-14-1-stale-lane-auto-rebase-classifier-policy/">
  <id>https://docs.spec-kitty.ai/adr/3.x/2026-05-14-1-stale-lane-auto-rebase-classifier-policy/</id>
  <title>ADR: Stale-Lane Auto-Rebase Classifier Policy</title>
  <updated>2026-05-14T00:00:00.000Z</updated>
  <author><name>Spec Kitty</name></author>
  <link rel="alternate" type="text/html" href="https://docs.spec-kitty.ai/adr/3.x/2026-05-14-1-stale-lane-auto-rebase-classifier-policy/"/>
  <summary>Auto-rebase may resolve a stale lane only through a closed list of file-and-conflict-shape rules; anything unmatched falls back to manual handling and halts.</summary>
  <content type="html">&lt;h2 id=&quot;context&quot;&gt;Context&lt;/h2&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;spec-kitty merge&lt;/code&gt; currently fail-stops on stale lanes — i.e. when a lane
branch has not incorporated changes from the mission branch that conflict
with files the lane also touched. Pre-mission analysis
(&lt;code dir=&quot;auto&quot;&gt;work/findings/771-auto-rebase-stale-lanes.md&lt;/code&gt;) documented a 30-minute
rote-merge cost per 10-WP mission, all of which is on additive-only
conflict shapes that a machine can resolve safely.&lt;/p&gt;
&lt;p&gt;The user-facing risk of attempting to auto-merge is that a wrongly-classified
semantic conflict silently combines incompatible code. The classifier MUST
default to &lt;strong&gt;fail-safe&lt;/strong&gt;: when no rule matches, halt and surface the conflict
to the operator.&lt;/p&gt;
&lt;h2 id=&quot;decision&quot;&gt;Decision&lt;/h2&gt;
&lt;p&gt;Adopt a &lt;strong&gt;closed-list rule classifier&lt;/strong&gt; plus a fail-safe default. Each rule
is keyed on:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;File pattern&lt;/strong&gt; (glob or specific path).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Conflict shape&lt;/strong&gt; (what the conflict markers contain).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resolution&lt;/strong&gt; (the merged output the auto-rebase orchestrator writes back,
plus an audit-log rule ID).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Any file or conflict shape not matching an explicit rule resolves to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt;
and halts.&lt;/p&gt;
&lt;h2 id=&quot;rules-initial-set&quot;&gt;Rules (initial set)&lt;/h2&gt;
&lt;h3 id=&quot;r-pyproject-deps-union&quot;&gt;R-PYPROJECT-DEPS-UNION&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;File pattern&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;pyproject.toml&lt;/code&gt; (top of repo).
&lt;strong&gt;Conflict scope&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;[project.dependencies]&lt;/code&gt; array entries,
&lt;code dir=&quot;auto&quot;&gt;[project.optional-dependencies.*]&lt;/code&gt; arrays, &lt;code dir=&quot;auto&quot;&gt;[dependency-groups.*]&lt;/code&gt; arrays.
&lt;strong&gt;Conflict shape&lt;/strong&gt;: Both sides added distinct entries (by package name) to
the same array; no shared entry was modified.
&lt;strong&gt;Resolution&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;Auto&lt;/code&gt; — union of entries, deduplicated by package name
(case-insensitive). The union preserves the surrounding file’s sort
convention: if the unmodified prefix of the conflicted region is
alphabetically sorted, the union is sorted; otherwise insertion order
(side A first, then side B’s new entries) is preserved.
&lt;strong&gt;Counter-example&lt;/strong&gt;: If both sides modified the version specifier on the
same package (e.g. one side &lt;code dir=&quot;auto&quot;&gt;httpx &gt;=0.27&lt;/code&gt;, the other &lt;code dir=&quot;auto&quot;&gt;httpx &gt;=0.28&lt;/code&gt;),
resolve to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt; — version conflicts are semantic.&lt;/p&gt;
&lt;h3 id=&quot;r-init-imports-union&quot;&gt;R-INIT-IMPORTS-UNION&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;File pattern&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;**/__init__.py&lt;/code&gt; (any package init).
&lt;strong&gt;Conflict scope&lt;/strong&gt;: The block of &lt;code dir=&quot;auto&quot;&gt;from X import Y&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;import X&lt;/code&gt; statements
at the top of the file.
&lt;strong&gt;Conflict shape&lt;/strong&gt;: Both sides added distinct import lines (different &lt;code dir=&quot;auto&quot;&gt;X&lt;/code&gt;
or different &lt;code dir=&quot;auto&quot;&gt;Y&lt;/code&gt;); no shared import was modified.
&lt;strong&gt;Resolution&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;Auto&lt;/code&gt; — union of import lines, sorted by &lt;code dir=&quot;auto&quot;&gt;ruff&lt;/code&gt; after the
union. The auto-rebase orchestrator runs &lt;code dir=&quot;auto&quot;&gt;ruff --fix --select I001 &amp;#x3C;file&gt;&lt;/code&gt;
after writing the merged content, treating any non-zero exit from ruff as
a fallback to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt;.
&lt;strong&gt;Counter-example&lt;/strong&gt;: If one side renamed an existing import target (e.g.
&lt;code dir=&quot;auto&quot;&gt;from .auth import AuthFlow&lt;/code&gt; → &lt;code dir=&quot;auto&quot;&gt;from .auth import OAuthFlow&lt;/code&gt;), the rule
does not match (it’s a modify, not an add) — resolve to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;r-urls-list-union&quot;&gt;R-URLS-LIST-UNION&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;File pattern&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;**/urls.py&lt;/code&gt; (Django-style) or any file whose conflicting
region is bounded by a recognizable list constant (&lt;code dir=&quot;auto&quot;&gt;_URLS = [&lt;/code&gt;,
&lt;code dir=&quot;auto&quot;&gt;URL_PATTERNS = [&lt;/code&gt;, etc.).
&lt;strong&gt;Conflict scope&lt;/strong&gt;: Entries inside the list constant.
&lt;strong&gt;Conflict shape&lt;/strong&gt;: Both sides added distinct entries; no shared entry was
modified.
&lt;strong&gt;Resolution&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;Auto&lt;/code&gt; — union of entries, preserving the file’s original
ordering convention (alphabetical if the unmodified prefix of the list is
sorted, insertion order otherwise).
&lt;strong&gt;Counter-example&lt;/strong&gt;: If both sides modified the same entry’s pattern or
handler, resolve to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;r-uvlock-regenerate&quot;&gt;R-UVLOCK-REGENERATE&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;File pattern&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;uv.lock&lt;/code&gt; (exact path at repo top).
&lt;strong&gt;Conflict scope&lt;/strong&gt;: Any.
&lt;strong&gt;Resolution mode&lt;/strong&gt;: &lt;strong&gt;special&lt;/strong&gt; — &lt;code dir=&quot;auto&quot;&gt;uv.lock&lt;/code&gt; is not classified as
&lt;code dir=&quot;auto&quot;&gt;Auto&lt;/code&gt;/&lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt; for textual merge. Instead, the auto-rebase orchestrator:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Holds a global file lock via &lt;code dir=&quot;auto&quot;&gt;specify_cli.core.file_lock.MachineFileLock&lt;/code&gt;
to prevent concurrent regenerations across lanes.&lt;/li&gt;
&lt;li&gt;Discards both sides of the conflict (the file is fully regenerated).&lt;/li&gt;
&lt;li&gt;Runs &lt;code dir=&quot;auto&quot;&gt;uv lock --no-upgrade&lt;/code&gt; from the repo root.&lt;/li&gt;
&lt;li&gt;Stages the regenerated &lt;code dir=&quot;auto&quot;&gt;uv.lock&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If &lt;code dir=&quot;auto&quot;&gt;uv lock&lt;/code&gt; exits non-zero, the orchestrator halts with the stderr surfaced
to the operator.&lt;/p&gt;
&lt;h3 id=&quot;r-default-manual&quot;&gt;R-DEFAULT-MANUAL&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;File pattern&lt;/strong&gt;: any file not matched by the rules above.
&lt;strong&gt;Conflict scope&lt;/strong&gt;: any.
&lt;strong&gt;Resolution&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt; with &lt;code dir=&quot;auto&quot;&gt;reason=&quot;no classifier rule matched &amp;#x3C;file_path&gt;&quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This rule is &lt;strong&gt;always last&lt;/strong&gt; in the rule list. It is the fail-safe default
mandated by NFR-005.&lt;/p&gt;
&lt;h2 id=&quot;rule-list-ordering&quot;&gt;Rule list ordering&lt;/h2&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;python&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;RULES&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;: tuple[ClassifierRule, &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;--0:#C792EA;--1:#8844AE&quot;&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:#82AAFF;--1:#3B61B0&quot;&gt;R_PYPROJECT_DEPS_UNION&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:#82AAFF;--1:#3B61B0&quot;&gt;R_INIT_IMPORTS_UNION&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:#82AAFF;--1:#3B61B0&quot;&gt;R_URLS_LIST_UNION&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:#82AAFF;--1:#3B61B0&quot;&gt;R_UVLOCK_REGENERATE&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt;,      &lt;/span&gt;&lt;span style=&quot;--0:#919F9F;--1:#5F636F&quot;&gt;# special-cased in the orchestrator&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:#82AAFF;--1:#3B61B0&quot;&gt;R_DEFAULT_MANUAL&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;First match wins. &lt;code dir=&quot;auto&quot;&gt;R_DEFAULT_MANUAL&lt;/code&gt; is always reachable because no preceding
rule has an unbounded pattern.&lt;/p&gt;
&lt;h2 id=&quot;fail-safe-invariants-nfr-005&quot;&gt;Fail-safe invariants (NFR-005)&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Any input not exactly matching one of the named rules MUST resolve to
&lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A rule MUST resolve to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt; if its conflict shape predicate raises
ANY exception during evaluation. The classifier wraps each rule’s shape
predicate in a &lt;code dir=&quot;auto&quot;&gt;try/except&lt;/code&gt; that defaults to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt; on raise.&lt;/li&gt;
&lt;li&gt;The orchestrator MUST verify, after applying an &lt;code dir=&quot;auto&quot;&gt;Auto&lt;/code&gt; resolution, that
the resulting file is syntactically valid for its type. For
&lt;code dir=&quot;auto&quot;&gt;pyproject.toml&lt;/code&gt;: &lt;code dir=&quot;auto&quot;&gt;tomllib.loads&lt;/code&gt; succeeds. For Python files: &lt;code dir=&quot;auto&quot;&gt;ast.parse&lt;/code&gt;
succeeds. If validation fails, the orchestrator reverts the file to its
pre-merge state and reports &lt;code dir=&quot;auto&quot;&gt;Manual(reason=&quot;post-merge validation failed: ...&quot;)&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;operator-visible-behavior&quot;&gt;Operator-visible behavior&lt;/h2&gt;
&lt;h3 id=&quot;when-all-conflicts-in-a-lane-resolve-to-auto&quot;&gt;When all conflicts in a lane resolve to &lt;code dir=&quot;auto&quot;&gt;Auto&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The orchestrator:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Applies each &lt;code dir=&quot;auto&quot;&gt;Auto&lt;/code&gt; resolution by writing the merged text and staging
the file.&lt;/li&gt;
&lt;li&gt;Runs the orchestrator’s post-merge step (&lt;code dir=&quot;auto&quot;&gt;uv lock&lt;/code&gt; if &lt;code dir=&quot;auto&quot;&gt;uv.lock&lt;/code&gt; was
conflicted; &lt;code dir=&quot;auto&quot;&gt;ruff --fix --select I001&lt;/code&gt; if any &lt;code dir=&quot;auto&quot;&gt;__init__.py&lt;/code&gt; was
conflicted).&lt;/li&gt;
&lt;li&gt;Creates a merge commit on the lane branch with message
&lt;code dir=&quot;auto&quot;&gt;&quot;auto-rebase(lane=&amp;#x3C;id&gt;): &amp;#x3C;N&gt; conflicts resolved by classifier rules [R-PYPROJECT-DEPS-UNION, ...]&quot;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Continues the outer merge pipeline as if the lane had been merged
cleanly.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;when-any-conflict-in-a-lane-resolves-to-manual&quot;&gt;When any conflict in a lane resolves to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The orchestrator:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reverts any partial auto-resolutions in the lane worktree (&lt;code dir=&quot;auto&quot;&gt;git merge --abort&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Halts the outer merge pipeline.&lt;/li&gt;
&lt;li&gt;Emits the same actionable error message that &lt;code dir=&quot;auto&quot;&gt;spec-kitty merge&lt;/code&gt; emits
today: instructs the operator to run &lt;code dir=&quot;auto&quot;&gt;git merge &amp;#x3C;mission-branch&gt;&lt;/code&gt; in
the lane worktree and resolve manually.&lt;/li&gt;
&lt;li&gt;Reports per-lane status in &lt;code dir=&quot;auto&quot;&gt;AutoRebaseReport.classifications&lt;/code&gt; for any
future audit.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;when-uvlock-regeneration-fails&quot;&gt;When &lt;code dir=&quot;auto&quot;&gt;uv.lock&lt;/code&gt; regeneration fails&lt;/h3&gt;
&lt;p&gt;The orchestrator:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Aborts the lane merge.&lt;/li&gt;
&lt;li&gt;Surfaces the &lt;code dir=&quot;auto&quot;&gt;uv lock&lt;/code&gt; stderr to the operator.&lt;/li&gt;
&lt;li&gt;Records the failure in &lt;code dir=&quot;auto&quot;&gt;AutoRebaseReport.halt_reason&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Does NOT retry — operator intervention required (likely a &lt;code dir=&quot;auto&quot;&gt;pyproject.toml&lt;/code&gt;
issue that survived &lt;code dir=&quot;auto&quot;&gt;R-PYPROJECT-DEPS-UNION&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;resolved-questions&quot;&gt;Resolved questions&lt;/h2&gt;
&lt;p&gt;The contracts-draft predecessor surfaced three open questions for the operator.
The operator has accepted Pedro’s recommendations as written:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Auto-rebase commit message format&lt;/strong&gt;: include &lt;code dir=&quot;auto&quot;&gt;lane=&amp;#x3C;id&gt;&lt;/code&gt;. Message
format: &lt;code dir=&quot;auto&quot;&gt;auto-rebase(lane=&amp;#x3C;id&gt;): &amp;#x3C;N&gt; conflicts resolved by classifier rules [&amp;#x3C;rule_ids&gt;]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;ruff --fix --select I001&lt;/code&gt; scope&lt;/strong&gt;: keep minimal. Do not broaden to
&lt;code dir=&quot;auto&quot;&gt;--select E,F&lt;/code&gt; or similar without operator-requested evidence that the
import-only fix is insufficient.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;R-URLS-LIST-UNION&lt;/code&gt; sort-convention detection&lt;/strong&gt;: sample the unmodified
prefix of the list; if alphabetically sorted, sort the union; otherwise
preserve insertion order.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These three resolutions are inlined into the rule definitions above. The
predecessor contracts draft is preserved for historical traceability.&lt;/p&gt;
&lt;h2 id=&quot;examples&quot;&gt;Examples&lt;/h2&gt;
&lt;h3 id=&quot;example-1-r-pyproject-deps-union-auto-resolve&quot;&gt;Example 1: R-PYPROJECT-DEPS-UNION (auto-resolve)&lt;/h3&gt;
&lt;p&gt;Lane A’s &lt;code dir=&quot;auto&quot;&gt;pyproject.toml&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;toml&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;[project]&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:#C5E478;--1:#3B61B0&quot;&gt;dependencies&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;httpx&gt;=0.27&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;ruamel-yaml&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 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;Lane B’s &lt;code dir=&quot;auto&quot;&gt;pyproject.toml&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;toml&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;[project]&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:#C5E478;--1:#3B61B0&quot;&gt;dependencies&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;httpx&gt;=0.27&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;freezegun&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;ruamel-yaml&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 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;Mission branch’s &lt;code dir=&quot;auto&quot;&gt;pyproject.toml&lt;/code&gt; (after Lane A merged):&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;toml&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;[project]&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:#C5E478;--1:#3B61B0&quot;&gt;dependencies&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;httpx&gt;=0.27&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;ruamel-yaml&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;requests-mock&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 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;Lane B is stale; conflict on the &lt;code dir=&quot;auto&quot;&gt;dependencies&lt;/code&gt; array. R-PYPROJECT-DEPS-UNION
matches.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Auto-resolved result&lt;/strong&gt; (sorted because the unmodified prefix of the
conflicting region was sorted):&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;toml&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;[project]&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:#C5E478;--1:#3B61B0&quot;&gt;dependencies&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;freezegun&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;httpx&gt;=0.27&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;requests-mock&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:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;ruamel-yaml&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 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;h3 id=&quot;example-2-counter-example--version-specifier-conflict-manual&quot;&gt;Example 2: Counter-example — version specifier conflict (Manual)&lt;/h3&gt;
&lt;p&gt;Lane A adds &lt;code dir=&quot;auto&quot;&gt;httpx&gt;=0.27&lt;/code&gt;; Lane B adds &lt;code dir=&quot;auto&quot;&gt;httpx&gt;=0.28&lt;/code&gt;.
R-PYPROJECT-DEPS-UNION does NOT match (the rule’s shape predicate excludes
same-package version drift). Resolves to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt;. The orchestrator halts
and the operator decides.&lt;/p&gt;
&lt;h3 id=&quot;example-3-r-init-imports-union-auto-resolve&quot;&gt;Example 3: R-INIT-IMPORTS-UNION (auto-resolve)&lt;/h3&gt;
&lt;p&gt;Lane A’s &lt;code dir=&quot;auto&quot;&gt;apps/collaboration/__init__.py&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;python&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:#C792EA;--1:#8844AE&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; .auth &lt;/span&gt;&lt;span style=&quot;--0:#C792EA;--1:#8844AE&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; AuthFlow&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:#C792EA;--1:#8844AE&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; .flags &lt;/span&gt;&lt;span style=&quot;--0:#C792EA;--1:#8844AE&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; FeatureFlags&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Lane B’s &lt;code dir=&quot;auto&quot;&gt;apps/collaboration/__init__.py&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;python&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:#C792EA;--1:#8844AE&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; .flags &lt;/span&gt;&lt;span style=&quot;--0:#C792EA;--1:#8844AE&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; FeatureFlags&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:#C792EA;--1:#8844AE&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; .sync &lt;/span&gt;&lt;span style=&quot;--0:#C792EA;--1:#8844AE&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; SyncClient&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;R-INIT-IMPORTS-UNION matches.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Auto-resolved result&lt;/strong&gt; (after &lt;code dir=&quot;auto&quot;&gt;ruff --fix --select I001&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;python&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:#C792EA;--1:#8844AE&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; .auth &lt;/span&gt;&lt;span style=&quot;--0:#C792EA;--1:#8844AE&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; AuthFlow&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:#C792EA;--1:#8844AE&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; .flags &lt;/span&gt;&lt;span style=&quot;--0:#C792EA;--1:#8844AE&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; FeatureFlags&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:#C792EA;--1:#8844AE&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; .sync &lt;/span&gt;&lt;span style=&quot;--0:#C792EA;--1:#8844AE&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; SyncClient&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;example-4-counter-example--modification-of-an-existing-import-manual&quot;&gt;Example 4: Counter-example — modification of an existing import (Manual)&lt;/h3&gt;
&lt;p&gt;Lane A changes &lt;code dir=&quot;auto&quot;&gt;from .auth import AuthFlow&lt;/code&gt; to &lt;code dir=&quot;auto&quot;&gt;from .auth import OAuthFlow&lt;/code&gt;.
Lane B adds &lt;code dir=&quot;auto&quot;&gt;from .sync import SyncClient&lt;/code&gt;. R-INIT-IMPORTS-UNION does NOT
match because Lane A modified an existing import (not added a new one).
Resolves to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;consequences&quot;&gt;Consequences&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The lane→mission merge pipeline now attempts machine-driven recovery on
the additive-only conflict shapes that constitute the bulk of observed
stale-lane friction.&lt;/li&gt;
&lt;li&gt;The fail-safe default is preserved: any unrecognized conflict still halts
and surfaces the existing actionable error message.&lt;/li&gt;
&lt;li&gt;Operators retain full audit trail via &lt;code dir=&quot;auto&quot;&gt;AutoRebaseReport.classifications&lt;/code&gt;
and the commit-message rule-ID list.&lt;/li&gt;
&lt;li&gt;Future rule additions are localized to &lt;code dir=&quot;auto&quot;&gt;conflict_classifier.py&lt;/code&gt; and
documented as ADR amendments.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;testing-contract&quot;&gt;Testing contract&lt;/h2&gt;
&lt;p&gt;Per &lt;code dir=&quot;auto&quot;&gt;function-over-form-testing&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Per-rule unit tests&lt;/strong&gt; (&lt;code dir=&quot;auto&quot;&gt;tests/integration/merge/test_conflict_classifier.py&lt;/code&gt;):
parametrized &lt;code dir=&quot;auto&quot;&gt;(file_path, hunk_text, expected_resolution)&lt;/code&gt; triples for each
rule. Cover both happy auto-resolve and the rule’s counter-example.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Orchestrator integration tests&lt;/strong&gt;
(&lt;code dir=&quot;auto&quot;&gt;tests/integration/lanes/test_auto_rebase_additive.py&lt;/code&gt;): two-lane scenario
with &lt;code dir=&quot;auto&quot;&gt;pyproject.toml&lt;/code&gt; adds; assert the resulting &lt;code dir=&quot;auto&quot;&gt;pyproject.toml&lt;/code&gt; parses
as TOML and contains the union of dependencies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Negative integration tests&lt;/strong&gt;: two-lane scenario with a semantic conflict;
assert the orchestrator halts with the current actionable error message;
assert no partial auto-resolution leaks to the lane worktree.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fail-safe smoke&lt;/strong&gt;: feed the classifier a file pattern not covered by any
rule; assert &lt;code dir=&quot;auto&quot;&gt;R-DEFAULT-MANUAL&lt;/code&gt; fires with the documented reason.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Predecessor draft: &lt;code dir=&quot;auto&quot;&gt;kitty-specs/quality-devex-hardening-3-2-01KRJGKH/contracts/stale-lane-auto-rebase-classifier-policy.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Data model: &lt;code dir=&quot;auto&quot;&gt;kitty-specs/quality-devex-hardening-3-2-01KRJGKH/data-model.md&lt;/code&gt; §3&lt;/li&gt;
&lt;li&gt;WP08: &lt;code dir=&quot;auto&quot;&gt;kitty-specs/quality-devex-hardening-3-2-01KRJGKH/tasks/WP08-auto-rebase-classifier.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Issue: &lt;a href=&quot;https://github.com/Priivacy-ai/spec-kitty/issues/771&quot;&gt;Priivacy-ai/spec-kitty#771&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;amendment-2026-10-04-5457&quot;&gt;Amendment 2026-10-04 (#5457)&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;A managed-artifact rule for target-owned bookkeeping.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;R-TARGET-OWNED-BOOKKEEPING&lt;/code&gt; (&lt;code dir=&quot;auto&quot;&gt;RULE_ID_TARGET_OWNED&lt;/code&gt; in &lt;code dir=&quot;auto&quot;&gt;src/specify_cli/lanes/auto_rebase.py&lt;/code&gt;) resolves a conflict on a target-owned path to the incoming side.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Distinction from &lt;code dir=&quot;auto&quot;&gt;RULES&lt;/code&gt;.&lt;/strong&gt; It is a &lt;strong&gt;managed-artifact (whole-file) rule&lt;/strong&gt;. It is not a per-hunk entry in the &lt;code dir=&quot;auto&quot;&gt;RULES&lt;/code&gt; tuple above and it has no conflict-shape predicate. &lt;code dir=&quot;auto&quot;&gt;_resolve_managed_artifact_conflicts&lt;/code&gt; takes the whole file from the incoming side before the generic text rules run, in the same stage as the coordination-artifact and status rules.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;File pattern.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;is_target_owned_path&lt;/code&gt; from the state contract (&lt;code dir=&quot;auto&quot;&gt;src/specify_cli/state/contract.py&lt;/code&gt;): an exact path declared &lt;code dir=&quot;auto&quot;&gt;StateSurface.target_owned&lt;/code&gt;. Today that is &lt;code dir=&quot;auto&quot;&gt;.kittify/metadata.yaml&lt;/code&gt;. The set is declared in one place; this ADR does not list paths.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resolution.&lt;/strong&gt; Stage 3, the incoming coordination or mission side, which is closer to the merge target branch. The file is generated and never authored by a work package.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fail-safe.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;R-DEFAULT-MANUAL&lt;/code&gt; is unchanged and remains the fail-safe default for every path the rules above and this managed-artifact stage do not match (NFR-005). Operator-editable project files such as &lt;code dir=&quot;auto&quot;&gt;.gitattributes&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;.gitignore&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;.kittify/config.yaml&lt;/code&gt; still resolve to &lt;code dir=&quot;auto&quot;&gt;Manual&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The decision and its merge-site table are recorded in &lt;a href=&quot;/adr/4.x/2026-10-04-4-upgrade-writes-project-global-state-once/&quot;&gt;ADR 2026-10-04-4&lt;/a&gt;. The original decision text above is unchanged.&lt;/p&gt;</content>
</entry>
