{
  "kind": "hwanse-selected-root-live-writer-frontier-review",
  "source": "tools/build_selected_root_live_writer_frontier_review.py",
  "status": "selected-root-writer-primitives-grounded-route-producer-pending",
  "summary": {
    "directRefCount": 10,
    "selectorByteWriterRefCount": 2,
    "selectedRootWriterRefCount": 3,
    "selectedRootExecutorFound": true,
    "saveLoadRestoreRefCount": 3,
    "reviewRequiredCount": 0,
    "selectorByteWriterGrounded": true,
    "selectedRootWriterGrounded": true,
    "routeProducerPromoted": false,
    "decision": "selector bytes and selectedRoot writer/executor VM primitives are grounded. This proves how a decoded stream can choose and execute a selected root, but it still does not prove which live field/scene route produces that stream in normal gameplay."
  },
  "watchedGlobals": [
    {
      "name": "selectorA",
      "vaHex": "0x004576da"
    },
    {
      "name": "selectorB",
      "vaHex": "0x004576db"
    },
    {
      "name": "selectedRoot",
      "vaHex": "0x0059de30"
    }
  ],
  "handlerRows": [
    {
      "label": "selector byte setter",
      "handlerVaHex": "0x00406dbb",
      "dispatch": {
        "entryVaHex": "0x00440674",
        "handlerVaHex": "0x00406dbb",
        "generalDispatchIndex": 79,
        "generalDispatchIndexHex": "0x4f",
        "saveSelectorSliceIndex": null,
        "saveSelectorSliceIndexHex": null
      },
      "semantics": [
        "case 0: push continuation stream+4; jump to dword[0x004dc518]",
        "case 1: selectorA=stream[+2], selectorB=stream[+3]; push continuation stream+4; jump to dword[0x004dc514]",
        "case 2/3: call save/load restore 0x00423319 with mode 0/1"
      ]
    },
    {
      "label": "selectedRoot indexed writer",
      "handlerVaHex": "0x0040ad9b",
      "dispatch": {
        "entryVaHex": "0x0044073c",
        "handlerVaHex": "0x0040ad9b",
        "generalDispatchIndex": 129,
        "generalDispatchIndexHex": "0x81",
        "saveSelectorSliceIndex": 7,
        "saveSelectorSliceIndexHex": "0x07"
      },
      "semantics": [
        "selectedRoot = streamTable[index]; advance +8"
      ]
    },
    {
      "label": "selectedRoot executor",
      "handlerVaHex": "0x0040adc9",
      "dispatch": {
        "entryVaHex": "0x00440740",
        "handlerVaHex": "0x0040adc9",
        "generalDispatchIndex": 130,
        "generalDispatchIndexHex": "0x82",
        "saveSelectorSliceIndex": 8,
        "saveSelectorSliceIndexHex": "0x08"
      },
      "semantics": [
        "if selectedRoot != 0, push continuation and set current stream to selectedRoot"
      ]
    },
    {
      "label": "selectedRoot direct writer",
      "handlerVaHex": "0x0040ae0e",
      "dispatch": {
        "entryVaHex": "0x00440744",
        "handlerVaHex": "0x0040ae0e",
        "generalDispatchIndex": 131,
        "generalDispatchIndexHex": "0x83",
        "saveSelectorSliceIndex": 9,
        "saveSelectorSliceIndexHex": "0x09"
      },
      "semantics": [
        "mode 0: selectedRoot = inline stream+4",
        "mode 1: selectedRoot = stream dword at +4"
      ]
    }
  ],
  "directReferenceRows": [
    {
      "name": "selectorA",
      "refVaHex": "0x00406e0f",
      "functionVaHex": "0x00406dbb",
      "functionEndVaHex": "0x00406eae",
      "role": "selector-byte-writer",
      "promotion": "grounded-vm-writer-primitive",
      "evidence": "opcode handler copies stream operands +2/+3 into selector bytes, then switches to a fixed root pointer."
    },
    {
      "name": "selectorA",
      "refVaHex": "0x004234a4",
      "functionVaHex": "0x00423319",
      "functionEndVaHex": "0x004235df",
      "role": "save-load-restore",
      "promotion": "excluded-save-load",
      "evidence": "restore path reads selector bytes and writes selectedRoot after loading persistent state blocks."
    },
    {
      "name": "selectorB",
      "refVaHex": "0x00406e1d",
      "functionVaHex": "0x00406dbb",
      "functionEndVaHex": "0x00406eae",
      "role": "selector-byte-writer",
      "promotion": "grounded-vm-writer-primitive",
      "evidence": "opcode handler copies stream operands +2/+3 into selector bytes, then switches to a fixed root pointer."
    },
    {
      "name": "selectorB",
      "refVaHex": "0x004234b3",
      "functionVaHex": "0x00423319",
      "functionEndVaHex": "0x004235df",
      "role": "save-load-restore",
      "promotion": "excluded-save-load",
      "evidence": "restore path reads selector bytes and writes selectedRoot after loading persistent state blocks."
    },
    {
      "name": "selectedRoot",
      "refVaHex": "0x0040adb9",
      "functionVaHex": "0x0040ad9b",
      "functionEndVaHex": "0x0040adc9",
      "role": "selected-root-indexed-writer",
      "promotion": "grounded-vm-writer-primitive",
      "evidence": "selectedRoot = dword table[index] where table comes from stream +4 and index from stream +1."
    },
    {
      "name": "selectedRoot",
      "refVaHex": "0x0040add8",
      "functionVaHex": "0x0040adc9",
      "functionEndVaHex": "0x0040ae0e",
      "role": "selected-root-executor",
      "promotion": "grounded-consumer-not-producer",
      "evidence": "if selectedRoot is nonzero, push continuation and set current stream to selectedRoot."
    },
    {
      "name": "selectedRoot",
      "refVaHex": "0x0040adff",
      "functionVaHex": "0x0040adc9",
      "functionEndVaHex": "0x0040ae0e",
      "role": "selected-root-executor",
      "promotion": "grounded-consumer-not-producer",
      "evidence": "if selectedRoot is nonzero, push continuation and set current stream to selectedRoot."
    },
    {
      "name": "selectedRoot",
      "refVaHex": "0x0040ae38",
      "functionVaHex": "0x0040ae0e",
      "functionEndVaHex": "0x0040ae7e",
      "role": "selected-root-direct-or-inline-writer",
      "promotion": "grounded-vm-writer-primitive",
      "evidence": "mode 0 sets selectedRoot to inline stream+4; mode 1 sets selectedRoot to stream dword at +4."
    },
    {
      "name": "selectedRoot",
      "refVaHex": "0x0040ae4b",
      "functionVaHex": "0x0040ae0e",
      "functionEndVaHex": "0x0040ae7e",
      "role": "selected-root-direct-or-inline-writer",
      "promotion": "grounded-vm-writer-primitive",
      "evidence": "mode 0 sets selectedRoot to inline stream+4; mode 1 sets selectedRoot to stream dword at +4."
    },
    {
      "name": "selectedRoot",
      "refVaHex": "0x004234bb",
      "functionVaHex": "0x00423319",
      "functionEndVaHex": "0x004235df",
      "role": "save-load-restore",
      "promotion": "excluded-save-load",
      "evidence": "restore path reads selector bytes and writes selectedRoot after loading persistent state blocks."
    }
  ],
  "selectorRootTable": {
    "tableVaHex": "0x00442d35",
    "first32": [
      {
        "index": 0,
        "rootVaHex": "0x00500c3c"
      },
      {
        "index": 1,
        "rootVaHex": "0x00476ab4"
      },
      {
        "index": 2,
        "rootVaHex": "0x0053f328"
      },
      {
        "index": 3,
        "rootVaHex": "0x004c8ffc"
      },
      {
        "index": 4,
        "rootVaHex": "0x004494d4"
      },
      {
        "index": 5,
        "rootVaHex": "0x005322e0"
      },
      {
        "index": 6,
        "rootVaHex": "0x004f4f70"
      },
      {
        "index": 7,
        "rootVaHex": "0x004e40b8"
      },
      {
        "index": 8,
        "rootVaHex": "0x004938b8"
      },
      {
        "index": 9,
        "rootVaHex": "0x0045ccfc"
      },
      {
        "index": 10,
        "rootVaHex": "0x0053b284"
      },
      {
        "index": 11,
        "rootVaHex": "0x004c2e04"
      },
      {
        "index": 12,
        "rootVaHex": "0x004843d0"
      },
      {
        "index": 13,
        "rootVaHex": "0x00443770"
      },
      {
        "index": 14,
        "rootVaHex": "0x004e5a08"
      },
      {
        "index": 15,
        "rootVaHex": "0x004a4924"
      },
      {
        "index": 16,
        "rootVaHex": "0x0046780c"
      },
      {
        "index": 17,
        "rootVaHex": "0x004f1540"
      },
      {
        "index": 18,
        "rootVaHex": "0x004aae54"
      },
      {
        "index": 19,
        "rootVaHex": "0x00473674"
      },
      {
        "index": 20,
        "rootVaHex": "0x00557660"
      },
      {
        "index": 21,
        "rootVaHex": "0x004e1d94"
      },
      {
        "index": 22,
        "rootVaHex": "0x00458f0c"
      },
      {
        "index": 23,
        "rootVaHex": "0x00000000"
      },
      {
        "index": 24,
        "rootVaHex": "0x004f867c"
      },
      {
        "index": 25,
        "rootVaHex": "0x004e75a0"
      },
      {
        "index": 26,
        "rootVaHex": "0x00546004"
      },
      {
        "index": 27,
        "rootVaHex": "0x004b218c"
      },
      {
        "index": 28,
        "rootVaHex": "0x004d5868"
      },
      {
        "index": 29,
        "rootVaHex": "0x004da88c"
      },
      {
        "index": 30,
        "rootVaHex": "0x00524060"
      },
      {
        "index": 31,
        "rootVaHex": "0x004d21c0"
      }
    ]
  },
  "newEvidence": [
    "0x00406dbb is a real VM handler table entry and writes selectorA/B from stream operands in subcase 1.",
    "0x0040ad9b and 0x0040ae0e are selectedRoot writer primitives.",
    "0x0040adc9 is the selectedRoot executor/consumer.",
    "0x00423319 remains a save/load restore bridge and is not a live route producer."
  ],
  "remainingProofs": [
    "Find the live scene/field root that reaches the selector byte setter with a normal gameplay stream.",
    "Prove a current stream/root in actual play is dispatched through the selectedRoot writer/executor path.",
    "Connect this selected-root layer upward to map transition, dialogue branch, or encounter setup producer evidence."
  ]
}
