{
 "about": {
  "generatedBy": "pipeline/plasmid-map/assembly-boundaries.py",
  "scriptSha256": "96b7566419e26c0f08ee15e4f85c3ecfd291922ecbc4462f2bd1e7a6bd762a09",
  "recordedOn": "2026-10-11",
  "oracle": "Biopython 1.88 Bio.Restriction cuts and Bio.Seq two-strand drawings; hand-specified seed overhangs and scarless products",
  "convention": "Retain signed bottom-minus-top cut separation from the enzyme offsets on the unwrapped drawing; wrapped position order and shortest circular distance cannot determine polarity.",
  "limits": "No repair, fill-in, phosphorylation or reaction-success inference. Existing methylation and off-linear refusal fixtures remain binding.",
  "contract": [
   "A construct record may carry `assembly`: { v: 1, method (restriction-cloning | golden-gate | gibson-style), methodVersion, release, host, topology, productSha256, inputs[] (name, role, sequence, circular, sha256), enzymes[], orientation, products, junctions[], conserved, qualifications[], designedAt, statement }.",
   "productSha256 is the SHA-256 (hex) of the record's residues as designed; a record whose residues no longer hash to it reads, but its design is dropped with the reason product-mismatch. A design whose topology differs from the record's alphabet is dropped with topology-mismatch.",
   "A malformed block (an unknown method, an input whose sha256 is not its sequence's, a missing field, a bound exceeded) refuses the record, as any other malformed field does.",
   "The block is optional: records without it read as before, so the schema version stays 1 (contracts §4.7 rule 1). A source of kind `assembly` names the method and the inputs' names.",
   "The statement travels verbatim in the block: 'A designed product is not evidence that the reaction occurred.'",
   "Gibson conserved uses fragmentBases - overlaps = product. Restriction and Golden Gate use coreBases + overhangs = product. Parent inputs may carry a ref; exact SHA-256 remains compulsory. Historical additive Gibson accounting is refused, never migrated silently."
  ]
 },
 "cases": [
  {
   "id": "record-restriction-valid",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "GAATTCCCCATGCCCAAGCTTTTTTTTTTTT",
    "alphabet": "dna-circular",
    "name": "vector + insert (designed)",
    "source": {
     "kind": "assembly",
     "method": "restriction-cloning",
     "from": [
      "vector",
      "insert"
     ]
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    },
    "assembly": {
     "v": 1,
     "method": "restriction-cloning",
     "methodVersion": "1.0.0",
     "release": "f1.e1.p1",
     "host": "dam-dcm",
     "topology": "circular",
     "productSha256": "362bc5695412e7cac9774bcaca765ce1296701cd900cba0f1d5c831824e436d9",
     "inputs": [
      {
       "name": "vector",
       "role": "vector",
       "sequence": "GAATTCGGGAAGCTTTTTTTTTTTT",
       "circular": true,
       "sha256": "6d97aebff6eb9531ac1a530a6ad79be087377035135007907f579b5e699bbb56",
       "ref": "mine:construct/parent-1"
      },
      {
       "name": "insert",
       "role": "insert",
       "sequence": "AGAATTCCCCATGCCCAAGCTTA",
       "circular": false,
       "sha256": "8774cb77ae23ae71fbabd095f8a0c7c80ddbdee10e596e7eddf61331064e3afa",
       "ref": "mine:construct/parent-2"
      }
     ],
     "enzymes": [
      "EcoRI",
      "HindIII"
     ],
     "orientation": 0,
     "products": 1,
     "junctions": [
      {
       "upstream": "5' AATT",
       "downstream": "5' AATT",
       "overhang": "AATT"
      },
      {
       "upstream": "5' AGCT",
       "downstream": "5' AGCT",
       "overhang": "AGCT"
      }
     ],
     "conserved": {
      "coreBases": 23,
      "overhangs": 8,
      "product": 31
     },
     "qualifications": [],
     "designedAt": "2026-10-11T12:00:00.000Z",
     "statement": "A designed product is not evidence that the reaction occurred."
    }
   },
   "expected": {
    "readable": true,
    "circular": true,
    "residues": "GAATTCCCCATGCCCAAGCTTTTTTTTTTTT",
    "assembly": "kept",
    "dropped": null,
    "sourceKind": "assembly"
   },
   "notes": "The product of the certified case ecori-hindiii-directional kept with its design: the block's product hash is the residues' hash, so the design is read back whole."
  },
  {
   "id": "record-residues-edited-after-design",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "GAATTCCCCATGCCCAAGCTTTTTTTTTTTA",
    "alphabet": "dna-circular",
    "name": "vector + insert (designed)",
    "source": {
     "kind": "assembly",
     "method": "restriction-cloning",
     "from": [
      "vector",
      "insert"
     ]
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    },
    "assembly": {
     "v": 1,
     "method": "restriction-cloning",
     "methodVersion": "1.0.0",
     "release": "f1.e1.p1",
     "host": "dam-dcm",
     "topology": "circular",
     "productSha256": "362bc5695412e7cac9774bcaca765ce1296701cd900cba0f1d5c831824e436d9",
     "inputs": [
      {
       "name": "vector",
       "role": "vector",
       "sequence": "GAATTCGGGAAGCTTTTTTTTTTTT",
       "circular": true,
       "sha256": "6d97aebff6eb9531ac1a530a6ad79be087377035135007907f579b5e699bbb56",
       "ref": "mine:construct/parent-1"
      },
      {
       "name": "insert",
       "role": "insert",
       "sequence": "AGAATTCCCCATGCCCAAGCTTA",
       "circular": false,
       "sha256": "8774cb77ae23ae71fbabd095f8a0c7c80ddbdee10e596e7eddf61331064e3afa",
       "ref": "mine:construct/parent-2"
      }
     ],
     "enzymes": [
      "EcoRI",
      "HindIII"
     ],
     "orientation": 0,
     "products": 1,
     "junctions": [
      {
       "upstream": "5' AATT",
       "downstream": "5' AATT",
       "overhang": "AATT"
      },
      {
       "upstream": "5' AGCT",
       "downstream": "5' AGCT",
       "overhang": "AGCT"
      }
     ],
     "conserved": {
      "coreBases": 23,
      "overhangs": 8,
      "product": 31
     },
     "qualifications": [],
     "designedAt": "2026-10-11T12:00:00.000Z",
     "statement": "A designed product is not evidence that the reaction occurred."
    }
   },
   "expected": {
    "readable": true,
    "circular": true,
    "assembly": "dropped",
    "dropped": "product-mismatch",
    "sourceKind": "assembly"
   },
   "notes": "One base changed after the design: the plasmid reads, the design is dropped with its reason, never shown as the product of the recorded reaction."
  },
  {
   "id": "record-topology-mismatch",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "GAATTCCCCATGCCCAAGCTTTTTTTTTTTT",
    "alphabet": "dna",
    "name": "vector + insert (designed)",
    "source": {
     "kind": "assembly",
     "method": "restriction-cloning",
     "from": [
      "vector",
      "insert"
     ]
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    },
    "assembly": {
     "v": 1,
     "method": "restriction-cloning",
     "methodVersion": "1.0.0",
     "release": "f1.e1.p1",
     "host": "dam-dcm",
     "topology": "circular",
     "productSha256": "362bc5695412e7cac9774bcaca765ce1296701cd900cba0f1d5c831824e436d9",
     "inputs": [
      {
       "name": "vector",
       "role": "vector",
       "sequence": "GAATTCGGGAAGCTTTTTTTTTTTT",
       "circular": true,
       "sha256": "6d97aebff6eb9531ac1a530a6ad79be087377035135007907f579b5e699bbb56",
       "ref": "mine:construct/parent-1"
      },
      {
       "name": "insert",
       "role": "insert",
       "sequence": "AGAATTCCCCATGCCCAAGCTTA",
       "circular": false,
       "sha256": "8774cb77ae23ae71fbabd095f8a0c7c80ddbdee10e596e7eddf61331064e3afa",
       "ref": "mine:construct/parent-2"
      }
     ],
     "enzymes": [
      "EcoRI",
      "HindIII"
     ],
     "orientation": 0,
     "products": 1,
     "junctions": [
      {
       "upstream": "5' AATT",
       "downstream": "5' AATT",
       "overhang": "AATT"
      },
      {
       "upstream": "5' AGCT",
       "downstream": "5' AGCT",
       "overhang": "AGCT"
      }
     ],
     "conserved": {
      "coreBases": 23,
      "overhangs": 8,
      "product": 31
     },
     "qualifications": [],
     "designedAt": "2026-10-11T12:00:00.000Z",
     "statement": "A designed product is not evidence that the reaction occurred."
    }
   },
   "expected": {
    "readable": true,
    "circular": false,
    "assembly": "dropped",
    "dropped": "topology-mismatch",
    "sourceKind": "assembly"
   },
   "notes": "The record says linear and the design says circular: the record's topology wins and the design is dropped with its reason."
  },
  {
   "id": "record-gibson-linear-valid",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "GTAACTAGTAATAAAAATTGTAATACTGTGCCAACGACACGCCTTCAGGCCGCCCGATATCGTTACCTCTGCTCATTTTT",
    "alphabet": "dna",
    "name": "left + right (designed)",
    "source": {
     "kind": "assembly",
     "method": "gibson-style",
     "from": [
      "left",
      "right"
     ]
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    },
    "assembly": {
     "v": 1,
     "method": "gibson-style",
     "methodVersion": "1.0.0",
     "release": "f1.e1.p1",
     "host": "dam-dcm",
     "topology": "linear",
     "productSha256": "87c5e3d5f1f3816940f8d47f96cfeb41c34cf425d94e1d24c2e047f000ff82a2",
     "inputs": [
      {
       "name": "left",
       "role": "fragment",
       "sequence": "GTAACTAGTAATAAAAATTGTAATACTGTGCCAACGACACGCCTTCAGGCCGCCC",
       "circular": false,
       "sha256": "02a2ac6fba5e74b9fa87a6e6aec12b2af58ed2decad1a0d9f937dd3e43909974",
       "ref": "mine:construct/parent-1"
      },
      {
       "name": "right",
       "role": "fragment",
       "sequence": "GCCTTCAGGCCGCCCGATATCGTTACCTCTGCTCATTTTT",
       "circular": false,
       "sha256": "5ce23b282f22960f41f8a928dd690c53fd82495e24f2bf8d92c34da6235d9ba2",
       "ref": "mine:construct/parent-2"
      }
     ],
     "enzymes": [],
     "orientation": 0,
     "products": 1,
     "junctions": [
      {
       "upstream": "left",
       "downstream": "right",
       "overhang": "GCCTTCAGGCCGCCC"
      }
     ],
     "conserved": {
      "fragmentBases": 95,
      "overlaps": 15,
      "product": 80
     },
     "qualifications": [],
     "designedAt": "2026-10-11T12:00:00.000Z",
     "statement": "A designed product is not evidence that the reaction occurred."
    }
   },
   "expected": {
    "readable": true,
    "circular": false,
    "residues": "GTAACTAGTAATAAAAATTGTAATACTGTGCCAACGACACGCCTTCAGGCCGCCCGATATCGTTACCTCTGCTCATTTTT",
    "assembly": "kept",
    "dropped": null,
    "sourceKind": "assembly"
   },
   "notes": "The linear product of the certified Gibson case two-fragment-linear-at-floor kept with its design."
  },
  {
   "id": "record-unknown-method",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "GAATTCCCCATGCCCAAGCTTTTTTTTTTTT",
    "alphabet": "dna-circular",
    "name": "vector + insert (designed)",
    "source": {
     "kind": "assembly",
     "method": "restriction-cloning",
     "from": [
      "vector",
      "insert"
     ]
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    },
    "assembly": {
     "v": 1,
     "method": "sanger-review",
     "methodVersion": "1.0.0",
     "release": "f1.e1.p1",
     "host": "dam-dcm",
     "topology": "circular",
     "productSha256": "362bc5695412e7cac9774bcaca765ce1296701cd900cba0f1d5c831824e436d9",
     "inputs": [
      {
       "name": "vector",
       "role": "vector",
       "sequence": "GAATTCGGGAAGCTTTTTTTTTTTT",
       "circular": true,
       "sha256": "6d97aebff6eb9531ac1a530a6ad79be087377035135007907f579b5e699bbb56",
       "ref": "mine:construct/parent-1"
      },
      {
       "name": "insert",
       "role": "insert",
       "sequence": "AGAATTCCCCATGCCCAAGCTTA",
       "circular": false,
       "sha256": "8774cb77ae23ae71fbabd095f8a0c7c80ddbdee10e596e7eddf61331064e3afa",
       "ref": "mine:construct/parent-2"
      }
     ],
     "enzymes": [
      "EcoRI",
      "HindIII"
     ],
     "orientation": 0,
     "products": 1,
     "junctions": [
      {
       "upstream": "5' AATT",
       "downstream": "5' AATT",
       "overhang": "AATT"
      },
      {
       "upstream": "5' AGCT",
       "downstream": "5' AGCT",
       "overhang": "AGCT"
      }
     ],
     "conserved": {
      "coreBases": 23,
      "overhangs": 8,
      "product": 31
     },
     "qualifications": [],
     "designedAt": "2026-10-11T12:00:00.000Z",
     "statement": "A designed product is not evidence that the reaction occurred."
    }
   },
   "expected": {
    "readable": false
   },
   "notes": "An assembly block naming a method the app has not is malformed: the record is refused, as every other malformed field refuses it."
  },
  {
   "id": "record-input-hash-wrong",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "GAATTCCCCATGCCCAAGCTTTTTTTTTTTT",
    "alphabet": "dna-circular",
    "name": "vector + insert (designed)",
    "source": {
     "kind": "assembly",
     "method": "restriction-cloning",
     "from": [
      "vector",
      "insert"
     ]
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    },
    "assembly": {
     "v": 1,
     "method": "restriction-cloning",
     "methodVersion": "1.0.0",
     "release": "f1.e1.p1",
     "host": "dam-dcm",
     "topology": "circular",
     "productSha256": "362bc5695412e7cac9774bcaca765ce1296701cd900cba0f1d5c831824e436d9",
     "inputs": [
      {
       "name": "vector",
       "role": "vector",
       "sequence": "GAATTCGGGAAGCTTTTTTTTTTTT",
       "circular": true,
       "sha256": "0000000000000000000000000000000000000000000000000000000000000000",
       "ref": "mine:construct/parent-1"
      },
      {
       "name": "insert",
       "role": "insert",
       "sequence": "AGAATTCCCCATGCCCAAGCTTA",
       "circular": false,
       "sha256": "8774cb77ae23ae71fbabd095f8a0c7c80ddbdee10e596e7eddf61331064e3afa",
       "ref": "mine:construct/parent-2"
      }
     ],
     "enzymes": [
      "EcoRI",
      "HindIII"
     ],
     "orientation": 0,
     "products": 1,
     "junctions": [
      {
       "upstream": "5' AATT",
       "downstream": "5' AATT",
       "overhang": "AATT"
      },
      {
       "upstream": "5' AGCT",
       "downstream": "5' AGCT",
       "overhang": "AGCT"
      }
     ],
     "conserved": {
      "coreBases": 23,
      "overhangs": 8,
      "product": 31
     },
     "qualifications": [],
     "designedAt": "2026-10-11T12:00:00.000Z",
     "statement": "A designed product is not evidence that the reaction occurred."
    }
   },
   "expected": {
    "readable": false
   },
   "notes": "An input whose recorded hash is not the hash of its sequence is malformed: refused."
  },
  {
   "id": "record-without-assembly",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "GAATTCCCCATGCCCAAGCTTTTTTTTTTTT",
    "alphabet": "dna-circular",
    "name": "plain",
    "source": {
     "kind": "paste"
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    }
   },
   "expected": {
    "readable": true,
    "circular": true,
    "assembly": null,
    "dropped": null,
    "sourceKind": "paste"
   },
   "notes": "A record without the block reads as before: the block is optional (contracts §4.7 rule 1, no schema bump)."
  },
  {
   "id": "record-designed-source-without-block",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "GAATTCCCCATGCCCAAGCTTTTTTTTTTTT",
    "alphabet": "dna-circular",
    "name": "designed without block",
    "source": {
     "kind": "assembly",
     "method": "restriction-cloning",
     "from": [
      "vector",
      "insert"
     ]
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    }
   },
   "expected": {
    "readable": true,
    "circular": true,
    "assembly": null,
    "dropped": null,
    "sourceKind": "assembly"
   },
   "notes": "A designed source without its block reads; the header can say designed, nothing more."
  },
  {
   "id": "record-gibson-historical-malformed-accounting",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "GTAACTAGTAATAAAAATTGTAATACTGTGCCAACGACACGCCTTCAGGCCGCCCGATATCGTTACCTCTGCTCATTTTT",
    "alphabet": "dna",
    "name": "left + right (designed)",
    "source": {
     "kind": "assembly",
     "method": "gibson-style",
     "from": [
      "left",
      "right"
     ]
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    },
    "assembly": {
     "v": 1,
     "method": "gibson-style",
     "methodVersion": "1.0.0",
     "release": "f1.e1.p1",
     "host": "dam-dcm",
     "topology": "linear",
     "productSha256": "87c5e3d5f1f3816940f8d47f96cfeb41c34cf425d94e1d24c2e047f000ff82a2",
     "inputs": [
      {
       "name": "left",
       "role": "fragment",
       "sequence": "GTAACTAGTAATAAAAATTGTAATACTGTGCCAACGACACGCCTTCAGGCCGCCC",
       "circular": false,
       "sha256": "02a2ac6fba5e74b9fa87a6e6aec12b2af58ed2decad1a0d9f937dd3e43909974"
      },
      {
       "name": "right",
       "role": "fragment",
       "sequence": "GCCTTCAGGCCGCCCGATATCGTTACCTCTGCTCATTTTT",
       "circular": false,
       "sha256": "5ce23b282f22960f41f8a928dd690c53fd82495e24f2bf8d92c34da6235d9ba2"
      }
     ],
     "enzymes": [],
     "orientation": 0,
     "products": 1,
     "junctions": [
      {
       "upstream": "left",
       "downstream": "right",
       "overhang": "GCCTTCAGGCCGCCC"
      }
     ],
     "conserved": {
      "coreBases": 80,
      "overhangs": 15,
      "product": 80
     },
     "qualifications": [],
     "designedAt": "2026-10-11T12:00:00.000Z",
     "statement": "A designed product is not evidence that the reaction occurred."
    }
   },
   "expected": {
    "readable": false
   },
   "notes": "Historical 0.8.0 Gibson block uses a false additive identity; refuse malformed provenance rather than silently rewriting history."
  },
  {
   "id": "record-golden-gate-valid",
   "input": {
    "v": 1,
    "app": "plasmid-map",
    "residues": "CCCCCCGGGGAGGAATATGCGCATTCCA",
    "alphabet": "dna-circular",
    "name": "Golden Gate designed product",
    "source": {
     "kind": "assembly",
     "method": "golden-gate",
     "from": [
      "destination",
      "insert"
     ]
    },
    "recordFeatures": [],
    "edits": [],
    "meth": "dam-dcm",
    "enz": [],
    "dig": [],
    "insert": null,
    "data": {
     "features": "1",
     "enzymes": "1",
     "primers": "1"
    },
    "assembly": {
     "v": 1,
     "method": "golden-gate",
     "methodVersion": "1.0.0",
     "release": "f1.e1.p1",
     "host": "dam-dcm",
     "topology": "circular",
     "productSha256": "97efce5501dd2dc7cc7049f3decd94fc3281483cb14ca2760e26aeb631ee44b6",
     "inputs": [
      {
       "name": "destination",
       "role": "destination",
       "sequence": "CCCCCCGGGGAGGAAGAGACGAAAAAACGTCTCTTCCA",
       "circular": true,
       "sha256": "3875614c1bb2874726b7f93f3f7e307da3277dcecc7584e3cada1e4a6a073f7d",
       "ref": "mine:construct/golden-parent-0"
      },
      {
       "name": "insert",
       "role": "part",
       "sequence": "AACGTCTCTAGGAATATGCGCATTCCAAGAGACGAA",
       "circular": false,
       "sha256": "fcf75bec685c96b96ef23c740edf7c76ebcc384294af94535f632088721ba0a8",
       "ref": "mine:construct/golden-parent-1"
      }
     ],
     "enzymes": [
      "BsmBI"
     ],
     "orientation": 0,
     "products": 1,
     "junctions": [
      {
       "upstream": "5' TCCT",
       "downstream": "5' AGGA",
       "overhang": "TCCT"
      },
      {
       "upstream": "5' TGGA",
       "downstream": "5' TCCA",
       "overhang": "TGGA"
      }
     ],
     "conserved": {
      "coreBases": 20,
      "overhangs": 8,
      "product": 28
     },
     "qualifications": [],
     "designedAt": "2026-10-11T12:00:00.000Z",
     "statement": "A designed product is not evidence that the reaction occurred."
    }
   },
   "expected": {
    "readable": true,
    "circular": true,
    "residues": "CCCCCCGGGGAGGAATATGCGCATTCCA",
    "assembly": "kept",
    "dropped": null,
    "sourceKind": "assembly"
   },
   "notes": "Hand-authored BsmBI product and its two non-palindromic overhangs, with exact parent hashes and references."
  }
 ]
}
