005-coupling-gate

The coupling gate: join the two views and refuse drift

Lifecycle approvedImplementation completeVerification unknownQualification unknown

The PR-time coupling gate (spec-spine.md guardrail 2): cross-reference every changed code path against the authority graph and refuse the merge when code drifts from the spec that owns it. A pure function of (config, registry, index, diff, waiver); the CLI parses `git diff --no-color -U0 --no-renames base...head` (quotepath off, end-of-options) into a typed DiffInput so git stays out of core. Matches a diff hunk to its owning unit at file, section, and symbol granularity; is amends-aware with the FR-005 strict-expansion guard; transfers authority across supersedes; honors PR-body waivers and an additive bypass list. Establishes the couple engine and the `spec-spine couple` subcommand.

Read the full pinned specification ↗

Relationships

depended on by

Claimed units

  • establishes
    {
      "kind": "file",
      "path": "crates/spec-spine-core/src/couple.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/spec-spine-core/src/dep_only.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/spec-spine-cli/src/cmd_couple.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/spec-spine-core/tests/couple.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/spec-spine-cli/tests/couple.rs"
    }
  • extends
    {
      "nature": "additive",
      "spec": "001-compile-registry",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-core/src/lib.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "001-compile-registry",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-cli/src/main.rs"
      }
    }

Source headings

  1. 005: The coupling gate
  2. 1. Purpose
  3. 2. Territory
  4. 3. Behavior
  5. 3.1 The boundary: git stays out of core
  6. 3.2 Owner derivation: three granularities
  7. 3.3 Amends-awareness and the strict-expansion guard (FR-005)
  8. 3.4 Supersedes: authority transfer
  9. 3.5 Clearance, waivers, and bypass
  10. 3.6 Granularity reconciliation (the crate-spec vs file-establishes question)
  11. 3.7 Exit codes
  12. 3.8 Determinism
  13. 4. Out of scope

Frozen anchors

No frozen anchors declared.