{
  "generated": "2026-09-21T02:43:50.039Z",
  "covmapCommit": "90797e9366807c1e314989bfa65e862d4d0ef0be",
  "scope": "Synthetic tiny Coq/Lean-like fixtures. These tests exercise mapping behavior, not theorem checking or semantic equivalence.",
  "passed": 4,
  "total": 4,
  "cases": [
    {
      "id": "named-rewrite",
      "title": "A changed body keeps its named link — and its label",
      "passed": true,
      "observation": "The edit was detected as drift. After recut, the link and reviewed-demo label survived, although the body changed. A review receipt tied to the previous hash is stale.",
      "before": {
        "hash": "e61416a5e1acacc8",
        "file": "target.lean",
        "start": 1,
        "end": 2,
        "label": "reviewed-demo",
        "name": "lean.opposite"
      },
      "after": {
        "hash": "c36ac555a04aac01",
        "file": "target.lean",
        "start": 1,
        "end": 2,
        "label": "reviewed-demo",
        "name": "lean.opposite"
      },
      "sourceBefore": "def opposite (b : Bool) (x : Int) : Int :=\n  if b then -x else x\n",
      "sourceAfter": "def opposite (b : Bool) (x : Int) : Int :=\n  if b then x else x\n",
      "sha256Before": "e61416a5e1acacc8511b2530753f75a9134b997fe38b6b228618c4becedec38d",
      "sha256After": "c36ac555a04aac011954d7f66b9c83e5441bc6da573dab37f264b63151f8045c",
      "reviewReceiptStale": true,
      "receipts": [
        {
          "command": "covmap init",
          "exit": 0,
          "output": "Initialized covmap in /private/var/folders/gn/1hqqc7pn3nz5s_p0dxnn9h300000gp/T/flocq-covmap-test-WLplL8/.covmap\n  HEAD -> main (run `covmap cover` to populate)\n  Project artifacts: selection policy, .covmap/coverings, .covmap/connections, and covmap metadata\n  Local state:       .covmap/objects, .covmap/iterators, .covmap/local\n  Next:              git add .covmap\n"
        },
        {
          "command": "covmap cover coq",
          "exit": 0,
          "output": "Covering 'coq': 1 segments, 2 lines (1 added)\n"
        },
        {
          "command": "covmap name coq:source.v:1 coq.opposite",
          "exit": 0,
          "output": "named dbb6d99a88720900 -> @coq.opposite\n"
        },
        {
          "command": "covmap cover lean",
          "exit": 0,
          "output": "Covering 'lean': 1 segments, 2 lines (1 added)\n"
        },
        {
          "command": "covmap name lean:target.lean:1 lean.opposite",
          "exit": 0,
          "output": "named e61416a5e1acacc8 -> @lean.opposite\n"
        },
        {
          "command": "covmap connect coq lean pair",
          "exit": 0,
          "output": "created connection 'pair': coq -> lean (self-map)\n"
        },
        {
          "command": "covmap link pair @coq.opposite @lean.opposite",
          "exit": 0,
          "output": "linked @coq.opposite -> @lean.opposite\n"
        },
        {
          "command": "covmap label lean:@lean.opposite reviewed-demo",
          "exit": 0,
          "output": "e61416a5e1acacc8 -> e61416a5e1acacc8  (label 'reviewed-demo' in covering 'lean')\n"
        },
        {
          "command": "covmap fsck",
          "exit": 0,
          "output": "fsck: ok\n"
        },
        {
          "command": "covmap ls-segments -l lean",
          "exit": 0,
          "output": "e61416a5e1acacc8\ttarget.lean\t1\t2\treviewed-demo\tlean.opposite\t\n"
        },
        {
          "command": "covmap status",
          "exit": 0,
          "output": "repo: /private/var/folders/gn/1hqqc7pn3nz5s_p0dxnn9h300000gp/T/flocq-covmap-test-WLplL8\ncovering coq: segments=1 lines=2\n  drift: clean\ncovering lean: segments=1 lines=2\n  drift: 1 file(s) edited, 0 file(s) missing/binary\n    edited: target.lean\n  details: run `covmap fsck --offline`\nconnections:\n  pair: coq -> lean (self-map) : 1 links, 0 broken · coverage source 1/1, target 1/1\n"
        },
        {
          "command": "covmap fsck",
          "exit": 1,
          "output": "fsck: covering lean target.lean:1..2: source drift: recorded hash e61416a5e1acacc8, current hash c36ac555a04aac01\nfsck: 1 issue(s)\n"
        },
        {
          "command": "covmap recut lean:@lean.opposite",
          "exit": 0,
          "output": "e61416a5e1acacc8 -> c36ac555a04aac01\n"
        },
        {
          "command": "covmap ls-segments -l lean",
          "exit": 0,
          "output": "c36ac555a04aac01\ttarget.lean\t1\t2\treviewed-demo\tlean.opposite\t\n"
        },
        {
          "command": "covmap status",
          "exit": 0,
          "output": "repo: /private/var/folders/gn/1hqqc7pn3nz5s_p0dxnn9h300000gp/T/flocq-covmap-test-WLplL8\ncovering coq: segments=1 lines=2\n  drift: clean\ncovering lean: segments=1 lines=2\n  drift: clean\nconnections:\n  pair: coq -> lean (self-map) : 1 links, 0 broken · coverage source 1/1, target 1/1\n"
        },
        {
          "command": "covmap fsck",
          "exit": 0,
          "output": "fsck: ok\n"
        }
      ]
    },
    {
      "id": "hash-rewrite",
      "title": "A hash-addressed link breaks on changed content",
      "passed": true,
      "observation": "The original content hash no longer identifies a live target segment. covmap reports a broken link instead of silently retargeting it.",
      "before": {
        "hash": "e61416a5e1acacc8",
        "file": "target.lean",
        "start": 1,
        "end": 2,
        "label": "unknown"
      },
      "after": {
        "hash": "c36ac555a04aac01",
        "file": "target.lean",
        "start": 1,
        "end": 2,
        "label": "unknown"
      },
      "receipts": [
        {
          "command": "covmap init",
          "exit": 0,
          "output": "Initialized covmap in /private/var/folders/gn/1hqqc7pn3nz5s_p0dxnn9h300000gp/T/flocq-covmap-test-Oi8VLv/.covmap\n  HEAD -> main (run `covmap cover` to populate)\n  Project artifacts: selection policy, .covmap/coverings, .covmap/connections, and covmap metadata\n  Local state:       .covmap/objects, .covmap/iterators, .covmap/local\n  Next:              git add .covmap\n"
        },
        {
          "command": "covmap cover coq",
          "exit": 0,
          "output": "Covering 'coq': 1 segments, 2 lines (1 added)\n"
        },
        {
          "command": "covmap cover lean",
          "exit": 0,
          "output": "Covering 'lean': 1 segments, 2 lines (1 added)\n"
        },
        {
          "command": "covmap connect coq lean pair",
          "exit": 0,
          "output": "created connection 'pair': coq -> lean (self-map)\n"
        },
        {
          "command": "covmap ls-segments -l coq",
          "exit": 0,
          "output": "dbb6d99a88720900\tsource.v\t1\t2\tunknown\t\t\n"
        },
        {
          "command": "covmap ls-segments -l lean",
          "exit": 0,
          "output": "e61416a5e1acacc8\ttarget.lean\t1\t2\tunknown\t\t\n"
        },
        {
          "command": "covmap link pair dbb6d99a88720900 e61416a5e1acacc8",
          "exit": 0,
          "output": "linked dbb6d99a88720900 -> e61416a5e1acacc8\n"
        },
        {
          "command": "covmap ls-segments -l lean",
          "exit": 0,
          "output": "e61416a5e1acacc8\ttarget.lean\t1\t2\tunknown\t\t\n"
        },
        {
          "command": "covmap recut lean:target.lean:1",
          "exit": 0,
          "output": "e61416a5e1acacc8 -> c36ac555a04aac01\n"
        },
        {
          "command": "covmap status",
          "exit": 0,
          "output": "repo: /private/var/folders/gn/1hqqc7pn3nz5s_p0dxnn9h300000gp/T/flocq-covmap-test-Oi8VLv\ncovering coq: segments=1 lines=2\n  drift: clean\ncovering lean: segments=1 lines=2\n  drift: clean\nconnections:\n  pair: coq -> lean (self-map) : 1 links, 1 broken · coverage source 1/1, target 0/1\n"
        },
        {
          "command": "covmap fsck",
          "exit": 1,
          "output": "pair\tdbb6d99a88720900\te61416a5e1acacc8\nfsck: 1 issue(s)\n"
        },
        {
          "command": "covmap ls-segments -l lean",
          "exit": 0,
          "output": "c36ac555a04aac01\ttarget.lean\t1\t2\tunknown\t\t\n"
        }
      ]
    },
    {
      "id": "metadata-only",
      "title": "Annotations leave code and its hash unchanged",
      "passed": true,
      "observation": "Labels and notes live in covmap metadata. This edit did not modify the Lean file or its content hash.",
      "before": {
        "hash": "e61416a5e1acacc8",
        "file": "target.lean",
        "start": 1,
        "end": 2,
        "label": "unknown",
        "name": "lean.opposite"
      },
      "after": {
        "hash": "e61416a5e1acacc8",
        "file": "target.lean",
        "start": 1,
        "end": 2,
        "label": "needs-review",
        "name": "lean.opposite"
      },
      "receipts": [
        {
          "command": "covmap init",
          "exit": 0,
          "output": "Initialized covmap in /private/var/folders/gn/1hqqc7pn3nz5s_p0dxnn9h300000gp/T/flocq-covmap-test-SRxzW4/.covmap\n  HEAD -> main (run `covmap cover` to populate)\n  Project artifacts: selection policy, .covmap/coverings, .covmap/connections, and covmap metadata\n  Local state:       .covmap/objects, .covmap/iterators, .covmap/local\n  Next:              git add .covmap\n"
        },
        {
          "command": "covmap cover coq",
          "exit": 0,
          "output": "Covering 'coq': 1 segments, 2 lines (1 added)\n"
        },
        {
          "command": "covmap name coq:source.v:1 coq.opposite",
          "exit": 0,
          "output": "named dbb6d99a88720900 -> @coq.opposite\n"
        },
        {
          "command": "covmap cover lean",
          "exit": 0,
          "output": "Covering 'lean': 1 segments, 2 lines (1 added)\n"
        },
        {
          "command": "covmap name lean:target.lean:1 lean.opposite",
          "exit": 0,
          "output": "named e61416a5e1acacc8 -> @lean.opposite\n"
        },
        {
          "command": "covmap connect coq lean pair",
          "exit": 0,
          "output": "created connection 'pair': coq -> lean (self-map)\n"
        },
        {
          "command": "covmap link pair @coq.opposite @lean.opposite",
          "exit": 0,
          "output": "linked @coq.opposite -> @lean.opposite\n"
        },
        {
          "command": "covmap ls-segments -l lean",
          "exit": 0,
          "output": "e61416a5e1acacc8\ttarget.lean\t1\t2\tunknown\tlean.opposite\t\n"
        },
        {
          "command": "covmap annotate lean:@lean.opposite -m An external note, not a source edit.",
          "exit": 0,
          "output": "annotated e61416a5e1acacc8\n"
        },
        {
          "command": "covmap label lean:@lean.opposite needs-review",
          "exit": 0,
          "output": "e61416a5e1acacc8 -> e61416a5e1acacc8  (label 'needs-review' in covering 'lean')\n"
        },
        {
          "command": "covmap ls-segments -l lean",
          "exit": 0,
          "output": "e61416a5e1acacc8\ttarget.lean\t1\t2\tneeds-review\tlean.opposite\tAn external note, not a source edit.\n"
        },
        {
          "command": "covmap fsck",
          "exit": 0,
          "output": "fsck: ok\n"
        }
      ]
    },
    {
      "id": "line-remap",
      "title": "Surviving code follows an inserted line",
      "passed": true,
      "observation": "An unchanged named declaration moved down one line after recut --remap; its content hash stayed the same. This is a tested simple insertion, not a guarantee for arbitrary rewrites.",
      "before": {
        "hash": "a22d9edfe6cd9b3c",
        "start": 3
      },
      "after": {
        "hash": "a22d9edfe6cd9b3c",
        "start": 4
      },
      "receipts": [
        {
          "command": "covmap init",
          "exit": 0,
          "output": "Initialized covmap in /private/var/folders/gn/1hqqc7pn3nz5s_p0dxnn9h300000gp/T/flocq-covmap-test-CxM0iW/.covmap\n  HEAD -> main (run `covmap cover` to populate)\n  Project artifacts: selection policy, .covmap/coverings, .covmap/connections, and covmap metadata\n  Local state:       .covmap/objects, .covmap/iterators, .covmap/local\n  Next:              git add .covmap\n"
        },
        {
          "command": "covmap cover coq",
          "exit": 0,
          "output": "Covering 'coq': 1 segments, 2 lines (1 added)\n"
        },
        {
          "command": "covmap name coq:source.v:1 coq.opposite",
          "exit": 0,
          "output": "named dbb6d99a88720900 -> @coq.opposite\n"
        },
        {
          "command": "covmap cover lean",
          "exit": 0,
          "output": "Covering 'lean': 1 segments, 2 lines (1 added)\n"
        },
        {
          "command": "covmap name lean:target.lean:1 lean.opposite",
          "exit": 0,
          "output": "named e61416a5e1acacc8 -> @lean.opposite\n"
        },
        {
          "command": "covmap connect coq lean pair",
          "exit": 0,
          "output": "created connection 'pair': coq -> lean (self-map)\n"
        },
        {
          "command": "covmap link pair @coq.opposite @lean.opposite",
          "exit": 0,
          "output": "linked @coq.opposite -> @lean.opposite\n"
        },
        {
          "command": "covmap recut --remap lean",
          "exit": 0,
          "output": "target.lean: remapped 1 segment(s) (1 refreshed, 0 unchanged)\n    @lean.opposite: 1..2 -> 1..4\nremap: 1 file(s) healed, 1 segment(s) refreshed, 0 unresolved\n"
        },
        {
          "command": "covmap split lean:target.lean 3",
          "exit": 0,
          "output": "warning: connection 'pair': target name endpoint '@lean.opposite' will narrow from 1..4 to 1..2\nnote: inbound connections stored in another repository cannot be discovered here\nsplit d47e30150239236a target.lean:1..4 ->\n  e61416a5e1acacc8  unknown  target.lean:1..2  inherited @lean.opposite\n  a22d9edfe6cd9b3c  unknown  target.lean:3..4\n"
        },
        {
          "command": "covmap name lean:target.lean:3 lean.identity",
          "exit": 0,
          "output": "named a22d9edfe6cd9b3c -> @lean.identity\n"
        },
        {
          "command": "covmap ls-segments -l lean",
          "exit": 0,
          "output": "e61416a5e1acacc8\ttarget.lean\t1\t2\tunknown\tlean.opposite\t\na22d9edfe6cd9b3c\ttarget.lean\t3\t4\tunknown\tlean.identity\t\n"
        },
        {
          "command": "covmap recut --remap lean",
          "exit": 0,
          "output": "target.lean: remapped 2 segment(s) (1 refreshed, 1 unchanged)\n    @lean.opposite: 1..2 -> 1..3\n    @lean.identity: 3..4 -> 4..5\nremap: 1 file(s) healed, 1 segment(s) refreshed, 0 unresolved\n"
        },
        {
          "command": "covmap ls-segments -l lean",
          "exit": 0,
          "output": "1604bec3b5fffc8b\ttarget.lean\t1\t3\tunknown\tlean.opposite\t\na22d9edfe6cd9b3c\ttarget.lean\t4\t5\tunknown\tlean.identity\t\n"
        },
        {
          "command": "covmap fsck",
          "exit": 0,
          "output": "fsck: ok\n"
        }
      ]
    }
  ]
}