206-a-stopped-merge-regenerates-its-derived-tree

A stopped merge regenerates its derived tree, and refuses anything else that conflicts

Lifecycle approvedImplementation completeVerification unknownQualification unknown

A rebase or merge that stops on a conflict in the committed derived tree is resolved by hand today: take either side, run `compile` and `index`, stage the tree, and hope nothing else was conflicted or lying untracked in the working tree when the indexer read it. Every adopter that restacks pull requests has scripted that sequence, and spec 094's merge driver, which covers it inside git, documents that it can emit clean but stale shards because it runs before the merged tree is complete. This spec adds `spec-spine resolve-derived`, run after git has stopped, generalizing statecraft-cli's `scripts/resolve-shard-conflicts.sh`. It refuses when any path outside the derived root is still unmerged, or when the working tree holds anything the compile would read that is not staged; otherwise it regenerates both shard trees from the staged merge, stages exactly the derived root, and then checks what the merge did to authored text: no conflict marker staged, and the carried change's added and removed lines unchanged by the merge. It confirms freshness the way `check` does and reports in the family envelope. It never continues, commits or aborts the operation, and it writes nothing outside the derived root.

Read the full pinned specification ↗

Relationships

Claimed units

  • establishes
    {
      "kind": "file",
      "path": "crates/spec-spine-cli/src/cmd_resolve_derived.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/spec-spine-cli/tests/resolve_derived.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/spec-spine-core/src/resolve_derived.rs"
    }
  • extends
    {
      "nature": "additive",
      "spec": "001-compile-registry",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-cli/src/main.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "162-capability-catalog",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-core/src/capability.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "162-capability-catalog",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-cli/tests/capability_catalog.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "170-a-consumer-is-served-answers-not-access",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-cli/src/cmd_capabilities.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "001-compile-registry",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-core/src/lib.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "022-index-sharding",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-core/src/shard.rs"
      }
    }

Source headings

  1. 206: A stopped merge regenerates its derived tree, and refuses anything else that conflicts
  2. 1. Purpose
  3. 2. Territory
  4. 3. Behavior
  5. 3.1 The verb
  6. 3.2 What it reads
  7. 3.3 When there is nothing to resolve
  8. 3.4 When it refuses
  9. 3.5 Regeneration
  10. 3.6 What the merge did to authored text
  11. 3.7 The verdict
  12. 4. Relation to spec 094's merge driver
  13. 5. Acceptance criteria
  14. 6. Out of scope
  15. 7. Resolved decisions
  16. Verification

Frozen anchors

No frozen anchors declared.