{
 "about": {
  "method": "exact-transform-global-edit-v1 (src/lib/seq/sequence-correspondence.ts)",
  "oracle": "Coordinate maps worked out by hand; the edit distance from an independent unit-cost dynamic program written in this script (not the engine's matrix); reverse complements by Biopython 1.88; SHA-256 of each sequence computed here.",
  "recordedOn": "2026-10-10",
  "generatedBy": "pipeline/sequence-toolkit/revision-transforms.py",
  "convention": "The engine compares two immutable revisions and records both SHA-256 sequence hashes, the method id and the correspondence kind as data. An exact origin rotation or reverse complement transforms coordinates without inventing mutations; a non-exact circular change is withheld (kind unresolved, mapping null) rather than resolved at an arbitrary origin; residue edits and annotation-only changes are separate findings; a note-only change makes no residue edit; an edit overlapping a CDS is qualified, never transferred. For edit cases the test checks the engine's edit list length equals this edit distance and, applied to the source, reconstructs the target.",
  "ruling": "CSO, 10 October 2026 (docs/board/memos/2026-10-10-cso-wave2-cloning.md §2.1 M3)."
 },
 "cases": [
  {
   "id": "substitution-joined-cds",
   "note": "A single substitution at base 5 overlapping the second segment of a joined CDS: exact mapping, the CDS flagged, no annotation transferred across it.",
   "source": {
    "sequence": "ACGTTGCA",
    "topology": "linear",
    "features": [
     {
      "key": "CDS",
      "location": "",
      "strand": "+",
      "parts": [
       {
        "start": 2,
        "end": 3
       },
       {
        "start": 5,
        "end": 6
       }
      ],
      "qualifiers": {
       "label": [
        "joined CDS"
       ]
      }
     }
    ]
   },
   "target": {
    "sequence": "ACGTCGCA",
    "topology": "linear",
    "features": [
     {
      "key": "CDS",
      "location": "",
      "strand": "+",
      "parts": [
       {
        "start": 2,
        "end": 3
       },
       {
        "start": 5,
        "end": 6
       }
      ],
      "qualifiers": {
       "label": [
        "joined CDS"
       ]
      }
     }
    ]
   },
   "expect": {
    "kind": "edits",
    "mapping": [
     1,
     2,
     3,
     4,
     5,
     6,
     7,
     8
    ],
    "ambiguous": false,
    "annotationsChanged": false,
    "topologyChanged": false,
    "withheld": false,
    "cdsQualified": true,
    "editDistance": 1
   },
   "sourceHash": "4fe1c78572f65ea0377c698fafd34a0fd3d93e25f7b8313828729eedbe103e37",
   "targetHash": "b7d6e490c9c9665b83aac54de21b0c858c7c5359dd90a8ad3a696442b28ea435"
  },
  {
   "id": "insertion",
   "note": "One base inserted: the source maps around the inserted base.",
   "source": {
    "sequence": "ACGT",
    "topology": "linear",
    "features": []
   },
   "target": {
    "sequence": "ACTGT",
    "topology": "linear",
    "features": []
   },
   "expect": {
    "kind": "edits",
    "mapping": [
     1,
     2,
     4,
     5
    ],
    "ambiguous": true,
    "annotationsChanged": false,
    "topologyChanged": false,
    "withheld": false,
    "cdsQualified": false,
    "editDistance": 1
   },
   "sourceHash": "1dff3e84fe7877e0673b69bbddcf40124e396e3f9943dd890c91b6a09adb9af0",
   "targetHash": "aedf8f5f78dfb517eb2987208ab01f64d73f3bb52279f2aaf64c1453c570366f"
  },
  {
   "id": "deletion",
   "note": "One base deleted: the deleted base maps to null.",
   "source": {
    "sequence": "ACTGT",
    "topology": "linear",
    "features": []
   },
   "target": {
    "sequence": "ACGT",
    "topology": "linear",
    "features": []
   },
   "expect": {
    "kind": "edits",
    "mapping": [
     1,
     2,
     null,
     3,
     4
    ],
    "ambiguous": true,
    "annotationsChanged": false,
    "topologyChanged": false,
    "withheld": false,
    "cdsQualified": false,
    "editDistance": 1
   },
   "sourceHash": "aedf8f5f78dfb517eb2987208ab01f64d73f3bb52279f2aaf64c1453c570366f",
   "targetHash": "1dff3e84fe7877e0673b69bbddcf40124e396e3f9943dd890c91b6a09adb9af0"
  },
  {
   "id": "origin-rotation",
   "note": "A circular origin rotation: coordinates change, no biological mutation is invented.",
   "source": {
    "sequence": "ACGTTGCA",
    "topology": "circular",
    "features": []
   },
   "target": {
    "sequence": "TTGCAACG",
    "topology": "circular",
    "features": []
   },
   "expect": {
    "kind": "rotation",
    "rotation": 3,
    "mapping": [
     6,
     7,
     8,
     1,
     2,
     3,
     4,
     5
    ],
    "ambiguous": false,
    "annotationsChanged": false,
    "topologyChanged": false,
    "withheld": false,
    "cdsQualified": false
   },
   "sourceHash": "4fe1c78572f65ea0377c698fafd34a0fd3d93e25f7b8313828729eedbe103e37",
   "targetHash": "6da62b72e1f7bf221204ee434037ae2c8af2f2944a82b927cd20cb6e1d8acc2a"
  },
  {
   "id": "reverse-complement",
   "note": "The reverse complement: an exact reversed coordinate transform.",
   "source": {
    "sequence": "AACGT",
    "topology": "linear",
    "features": []
   },
   "target": {
    "sequence": "ACGTT",
    "topology": "linear",
    "features": []
   },
   "expect": {
    "kind": "reverse-complement",
    "reversed": true,
    "mapping": [
     5,
     4,
     3,
     2,
     1
    ],
    "ambiguous": false,
    "annotationsChanged": false,
    "topologyChanged": false,
    "withheld": false,
    "cdsQualified": false
   },
   "sourceHash": "821dddb0a2cc309caee447586d514e0dcd812d9a6b5386cb965ed98dfd95d669",
   "targetHash": "7f5d6eb930d2ff1a3521dbcf62b748f63e0d5dcd278294cb1b454f08cf49c523"
  },
  {
   "id": "repeat-rotation-ambiguous",
   "note": "A repeated circular sequence permits more than one exact origin correspondence: qualified, no edits.",
   "source": {
    "sequence": "ATATAT",
    "topology": "circular",
    "features": []
   },
   "target": {
    "sequence": "TATATA",
    "topology": "circular",
    "features": []
   },
   "expect": {
    "kind": "rotation",
    "ambiguous": true,
    "mapping": null,
    "annotationsChanged": false,
    "topologyChanged": false,
    "withheld": false,
    "cdsQualified": false
   },
   "sourceHash": "fc40fa4a9b598f2d21c6706ee3d08da8c410f5fd3ecfd2318258b9fd4289657c",
   "targetHash": "5dbcb00e62c8082d837cd4f12f870c560fd97c705cc9b8619a8fda1faa287bbb"
  },
  {
   "id": "note-only",
   "note": "A note added to an annotation, the sequence unchanged: identical, no residue edit, the annotations marked changed.",
   "source": {
    "sequence": "ACGTTGCA",
    "topology": "linear",
    "features": [
     {
      "key": "CDS",
      "location": "",
      "strand": "+",
      "parts": [
       {
        "start": 2,
        "end": 3
       },
       {
        "start": 5,
        "end": 6
       }
      ],
      "qualifiers": {
       "label": [
        "joined CDS"
       ]
      }
     }
    ]
   },
   "target": {
    "sequence": "ACGTTGCA",
    "topology": "linear",
    "features": [
     {
      "key": "CDS",
      "location": "",
      "strand": "+",
      "parts": [
       {
        "start": 2,
        "end": 3
       },
       {
        "start": 5,
        "end": 6
       }
      ],
      "qualifiers": {
       "label": [
        "joined CDS"
       ],
       "note": [
        "Rechecked"
       ]
      }
     }
    ]
   },
   "expect": {
    "kind": "identical",
    "mapping": [
     1,
     2,
     3,
     4,
     5,
     6,
     7,
     8
    ],
    "ambiguous": false,
    "annotationsChanged": true,
    "topologyChanged": false,
    "withheld": false,
    "cdsQualified": false
   },
   "sourceHash": "4fe1c78572f65ea0377c698fafd34a0fd3d93e25f7b8313828729eedbe103e37",
   "targetHash": "4fe1c78572f65ea0377c698fafd34a0fd3d93e25f7b8313828729eedbe103e37"
  },
  {
   "id": "non-exact-circular-withheld",
   "note": "A non-exact change on a circle: withheld rather than fabricated at an arbitrary origin; the record shows the withheld state as data.",
   "source": {
    "sequence": "ACGTTGCA",
    "topology": "circular",
    "features": []
   },
   "target": {
    "sequence": "TTGCAACC",
    "topology": "circular",
    "features": []
   },
   "expect": {
    "kind": "unresolved",
    "mapping": null,
    "ambiguous": true,
    "annotationsChanged": null,
    "topologyChanged": false,
    "withheld": true,
    "cdsQualified": false
   },
   "sourceHash": "4fe1c78572f65ea0377c698fafd34a0fd3d93e25f7b8313828729eedbe103e37",
   "targetHash": "ad00549d6c4e6d42da08b23fd2a3e7b1e55c1bf4460a4a84c06766a3d620f22a"
  },
  {
   "id": "topology-change",
   "note": "The same sequence declared circular in the target: the topology change is recorded as data; the residues are identical.",
   "source": {
    "sequence": "ACGTTGCA",
    "topology": "linear",
    "features": []
   },
   "target": {
    "sequence": "ACGTTGCA",
    "topology": "circular",
    "features": []
   },
   "expect": {
    "kind": "identical",
    "mapping": [
     1,
     2,
     3,
     4,
     5,
     6,
     7,
     8
    ],
    "ambiguous": false,
    "annotationsChanged": false,
    "topologyChanged": true,
    "withheld": false,
    "cdsQualified": false
   },
   "sourceHash": "4fe1c78572f65ea0377c698fafd34a0fd3d93e25f7b8313828729eedbe103e37",
   "targetHash": "4fe1c78572f65ea0377c698fafd34a0fd3d93e25f7b8313828729eedbe103e37"
  },
  {
   "id": "repeat-indel-ambiguous",
   "note": "A base deleted inside a homopolymer run: the placement is ambiguous and qualified; the edit distance is one.",
   "source": {
    "sequence": "GGAAAAAACC",
    "topology": "linear",
    "features": []
   },
   "target": {
    "sequence": "GGAAAAACC",
    "topology": "linear",
    "features": []
   },
   "expect": {
    "kind": "edits",
    "mapping": null,
    "ambiguous": true,
    "annotationsChanged": false,
    "topologyChanged": false,
    "withheld": false,
    "cdsQualified": false,
    "editDistance": 1
   },
   "sourceHash": "63dd7da737144b4e63d3a88723211f34f0b6e786228925fd446fbe9ab5360480",
   "targetHash": "a8a57dbaebce63a690a300502e04ffe8eef08a52e4ea1c9ff46d77700ec2514f"
  }
 ]
}
