069-the-committed-index-is-compared-not-trusted

The committed index is compared, not trusted

Lifecycle approvedImplementation completeVerification unknownQualification unknown

`index check` does not compare the committed index with what the corpus indexes to. It reads each committed shard's own mapping, derives from that mapping which span files to hash, and compares the resulting hash with the shard's `shardHash` field. The mapping body itself (which units resolved where, which paths implement which spec, the ownership flags) is never compared with a fresh resolution, and for a `file`, `directory` or `crate` unit, which carries no span, nothing in the hash constrains it. Measured on a scratch repository: rewriting a committed shard so its spec owns nothing, with `shardHash` left alone, leaves `index check` and `check` reporting fresh, and `couple` then derives ownership from the edited body and passes a change to code the spec owned, without its `spec.md`. `.derived/` is in the bypass floor, so the edit itself trips nothing. AGENTS.md tells every session that a fresh `check` means the committed shards are exactly what the corpus compiles to; for the index that is not what is checked. Spec 028 3.1 recorded the weaker comparison as a cost trade; a full re-index of this repository takes 0.04 s against 0.03 s for the check. This spec makes `index check` compare bytes and set membership exactly as `compile --check` does, so every reader of the committed index (the coupling gate, `index owner`, coverage, the projections) reads a body equal to the recompute. It amends 024 5, whose bounded trade let a sibling-caused resolution flip go unreported.

Read the full pinned specification ↗

Relationships

Claimed units

  • establishes
    {
      "kind": "file",
      "path": "crates/spec-spine-core/tests/index_body.rs"
    }
  • extends
    {
      "nature": "additive",
      "spec": "004-codebase-index",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-core/src/index.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "004-codebase-index",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-cli/src/cmd_index.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "062-one-name-one-freshness-verb",
      "unit": {
        "kind": "file",
        "path": "crates/spec-spine-cli/src/cmd_check.rs"
      }
    }

Source headings

  1. 069: The committed index is compared, not trusted
  2. 1. Purpose
  3. 2. Territory
  4. 3. Behavior
  5. 3.1 `index check` compares bytes and sets
  6. 3.2 Every reader inherits it
  7. 3.3 What the gate's ownership now means
  8. 3.4 Cost
  9. 3.5 What must keep working
  10. 3.6 The trade in 024 5 changes
  11. 4. Out of scope
  12. 5. Resolved decisions
  13. Verification

Frozen anchors

No frozen anchors declared.