{
  "schema": "vm101-complete-replacement-blueprints-v1",
  "canonical_id": "20260712-085142_vm101_m07_canonical_v1a_editmap",
  "source_canonical_id": "20260712-084610_vm101_m07_canonical_v1",
  "status": "EDIT_MAP_LOCKED_REPLACEMENTS_NOT_YET_WRITTEN",
  "generation_policy": {
    "source_hash_must_match": true,
    "source_line_count_must_match": true,
    "all_anchor_regions_must_match": true,
    "whole_file_output_required": true,
    "regex_patch_of_live_file": false,
    "candidate_syntax_check_required": true,
    "unified_diff_required": true,
    "fixture_tests_required": true,
    "vm101_install_allowed": false
  },
  "targets": [
    {
      "label": "refresh_pool_safe",
      "source_path": "/root/hmn/hmn-refresh-pool-safe.sh",
      "source_sha256": "bb047e820196c4c5cb263499ed890c782190293257a2033568015c6b19230682",
      "source_line_count": 308,
      "required_transformations": [
        "calculate required backup bytes before mutation",
        "refuse operation when temporary storage is insufficient",
        "create surgical backup manifest",
        "validate every rollback artifact before download",
        "refuse rollback from incomplete backup"
      ],
      "anchor_region_hashes": [
        {
          "region_id": "refresh_pool_safe-r1",
          "start_line": 1,
          "end_line": 34,
          "exact_sha256": "7e75958ec6298619df5e62b425ab56d25ed3cca2e2bafe211a874515d7d908da"
        },
        {
          "region_id": "refresh_pool_safe-r2",
          "start_line": 50,
          "end_line": 68,
          "exact_sha256": "2de96652395a9807c7422746babefeb1ada5eaedd9414ac8f2b4d46790d0b4f0"
        },
        {
          "region_id": "refresh_pool_safe-r3",
          "start_line": 88,
          "end_line": 125,
          "exact_sha256": "dcad8b5e9d50f609f60a17d416a8b7400adbe97a5eca5e21bb0dcd85d4dbce7f"
        },
        {
          "region_id": "refresh_pool_safe-r4",
          "start_line": 137,
          "end_line": 160,
          "exact_sha256": "de1e15a1740e62ac0fed278721d17bd80c667bb52f99a48e68ac8fa05ec3d183"
        },
        {
          "region_id": "refresh_pool_safe-r5",
          "start_line": 258,
          "end_line": 276,
          "exact_sha256": "e7aa96557f438533f092ee4a71f3b902fc11bce9174e42f798be1fbe2e2810a0"
        }
      ],
      "output_contract": {
        "complete_file": true,
        "destination": "/root/hmn/hmn-refresh-pool-safe.sh",
        "installation_in_this_step": false
      }
    },
    {
      "label": "code_test",
      "source_path": "/root/hmn/hmn-code-test.sh",
      "source_sha256": "3515205270211206a9f3a34bc5c62d94a9f14a54ad712d6fa7e9c7d50db1370a",
      "source_line_count": 66,
      "required_transformations": [
        "source canonical runtime library",
        "select first strict healthy vpn1-vpn5",
        "treat table 200 only as optional preferred candidate"
      ],
      "anchor_region_hashes": [
        {
          "region_id": "code_test-r1",
          "start_line": 13,
          "end_line": 39,
          "exact_sha256": "637eeaee0dd437ccd2eeaaffd6a136d40b39c7381eab50bb82e944d8af922b6a"
        }
      ],
      "output_contract": {
        "complete_file": true,
        "destination": "/root/hmn/hmn-code-test.sh",
        "installation_in_this_step": false
      }
    },
    {
      "label": "download_all_awg",
      "source_path": "/root/hmn/hmn-download-all-awg.sh",
      "source_sha256": "c20d8ff7feead493f2524c6da3c921bbf62cbdfb503a11a8ea75e4d15144e18f",
      "source_line_count": 308,
      "required_transformations": [
        "source canonical runtime library",
        "select first strict healthy vpn1-vpn5",
        "retain failure when no healthy slot exists"
      ],
      "anchor_region_hashes": [
        {
          "region_id": "download_all_awg-r1",
          "start_line": 24,
          "end_line": 50,
          "exact_sha256": "9d66c8b1efef40ca538868ad3016e0a0d9cdd93a2ba113e654fb12ebfc5365d6"
        }
      ],
      "output_contract": {
        "complete_file": true,
        "destination": "/root/hmn/hmn-download-all-awg.sh",
        "installation_in_this_step": false
      }
    },
    {
      "label": "refresh_awg",
      "source_path": "/root/hmn/hmn-refresh-awg.sh",
      "source_sha256": "f725224e1b766f85f1ccf4a934e44f3c240865081348ff6bed8f63d366678e17",
      "source_line_count": 213,
      "required_transformations": [
        "source canonical runtime library",
        "use vm101_healthy_bootstrap_iface",
        "keep table 200 informational only"
      ],
      "anchor_region_hashes": [
        {
          "region_id": "refresh_awg-r1",
          "start_line": 56,
          "end_line": 75,
          "exact_sha256": "16d7462937119a237b90b7b9477549f07163a76a328934e27ba573fe7435c860"
        },
        {
          "region_id": "refresh_awg-r2",
          "start_line": 93,
          "end_line": 157,
          "exact_sha256": "9be803ea741164541e8a3cbabb979ecf7c6cebfa0bec2e72e7eb8498bbc8a19e"
        },
        {
          "region_id": "refresh_awg-r3",
          "start_line": 175,
          "end_line": 204,
          "exact_sha256": "6ecbd45c4b33cc8b8f4ed95575ade6354b72a66d2afb9875d785dae391a606e2"
        }
      ],
      "output_contract": {
        "complete_file": true,
        "destination": "/root/hmn/hmn-refresh-awg.sh",
        "installation_in_this_step": false
      }
    },
    {
      "label": "validate_current_pool",
      "source_path": "/root/hmn/hmn-validate-current-pool.sh",
      "source_sha256": "7cf24b674fff3a5077308f07f1202b70dd34979e50b835758f92e9bda92507ee",
      "source_line_count": 266,
      "required_transformations": [
        "source canonical runtime library",
        "select a strict healthy bootstrap slot",
        "use runtime endpoint before UCI fallback"
      ],
      "anchor_region_hashes": [
        {
          "region_id": "validate_current_pool-r1",
          "start_line": 82,
          "end_line": 102,
          "exact_sha256": "fd6b59e44fc116df4beb86cf137f39ac757a12954600e3b5c7f2a3a4271358ea"
        },
        {
          "region_id": "validate_current_pool-r2",
          "start_line": 210,
          "end_line": 260,
          "exact_sha256": "75766dcc17724a6f657a5c75e1fbc46a2460b41d59cd826cbc1ff287010ab6c6"
        }
      ],
      "output_contract": {
        "complete_file": true,
        "destination": "/root/hmn/hmn-validate-current-pool.sh",
        "installation_in_this_step": false
      }
    },
    {
      "label": "planner",
      "source_path": "/usr/local/sbin/router-egress-hmn-plan-top5.sh",
      "source_sha256": "6ec99e157235d811d6f0f3ab92de7f3371dc813f2478a654358982cda7ce34ce",
      "source_line_count": 192,
      "required_transformations": [
        "source canonical runtime library",
        "read current endpoint from amneziawg runtime",
        "use UCI hmn_endpoint only as explicit fallback"
      ],
      "anchor_region_hashes": [
        {
          "region_id": "planner-r1",
          "start_line": 77,
          "end_line": 95,
          "exact_sha256": "13f1de7a31628ff1189f4c190193eec1c6bbf134b348f382b24c7f18456394df"
        },
        {
          "region_id": "planner-r2",
          "start_line": 117,
          "end_line": 135,
          "exact_sha256": "ef1d00a7007182b6cab15393d281a6e012b56eb66cda9d5884035f59fcb53e0c"
        }
      ],
      "output_contract": {
        "complete_file": true,
        "destination": "/usr/local/sbin/router-egress-hmn-plan-top5.sh",
        "installation_in_this_step": false
      }
    },
    {
      "label": "rebalance_apply",
      "source_path": "/usr/local/sbin/router-egress-hmn-rebalance-top5-apply.sh",
      "source_sha256": "2fa6b725c5e123b7fdc3dd14747058a02415d025231054c7537d72b8edc2346f",
      "source_line_count": 213,
      "required_transformations": [
        "source canonical runtime library",
        "read current endpoint from runtime",
        "retry strict health after ifup",
        "return nonzero for commit_failed",
        "return nonzero for commit refusal",
        "keep JSON decision consistent with shell status"
      ],
      "anchor_region_hashes": [
        {
          "region_id": "rebalance_apply-r1",
          "start_line": 19,
          "end_line": 37,
          "exact_sha256": "80d4e3afd21fb51f3c77dc68278beae09b7fb46515b3bf99607d2388972bc1e2"
        },
        {
          "region_id": "rebalance_apply-r2",
          "start_line": 77,
          "end_line": 95,
          "exact_sha256": "a8bea701c3163783a488ddb03c0534229a5916cbc08fdbecea9441fbc100b41b"
        },
        {
          "region_id": "rebalance_apply-r3",
          "start_line": 119,
          "end_line": 137,
          "exact_sha256": "f5f8a31d4868958b26fe36ab0c0c354e3a8409da8491ca508ebeea549b62cdac"
        },
        {
          "region_id": "rebalance_apply-r4",
          "start_line": 145,
          "end_line": 183,
          "exact_sha256": "2365b81d00203ba70f2a1d98aa52d033ce0b664a12391e83c88c104bde6c93ad"
        },
        {
          "region_id": "rebalance_apply-r5",
          "start_line": 191,
          "end_line": 209,
          "exact_sha256": "8fa53e8c61d287d82c7643c03181f891b2966750da57d4359e04b1081ba38a2a"
        }
      ],
      "output_contract": {
        "complete_file": true,
        "destination": "/usr/local/sbin/router-egress-hmn-rebalance-top5-apply.sh",
        "installation_in_this_step": false
      }
    },
    {
      "label": "emergency_runner",
      "source_path": "/usr/local/sbin/router-egress-emergency-refresh.sh",
      "source_sha256": "bea82c260ba6006b524ef01c614848097bd231fa6d49a725baded99046fe5d11",
      "source_line_count": 304,
      "required_transformations": [
        "capture complete rebalance output",
        "require shell rc zero",
        "require JSON decision commit_ok or noop",
        "require JSON apply_ok true",
        "convert false-success JSON to nonzero result"
      ],
      "anchor_region_hashes": [
        {
          "region_id": "emergency_runner-r1",
          "start_line": 139,
          "end_line": 157,
          "exact_sha256": "29bd6699c8f476d26c3e17daf2dabd79134d7fb577afb7132e49c521061fa3da"
        },
        {
          "region_id": "emergency_runner-r2",
          "start_line": 266,
          "end_line": 290,
          "exact_sha256": "49a306037f11ad6c20614c5c306df319266b1e12bc87c262c097eba19838daef"
        }
      ],
      "output_contract": {
        "complete_file": true,
        "destination": "/usr/local/sbin/router-egress-emergency-refresh.sh",
        "installation_in_this_step": false
      }
    },
    {
      "label": "slots_apply",
      "source_path": "/usr/local/sbin/router-egress-slots-apply.sh",
      "source_sha256": "6e5bfbcc2b216a234f5501d72f2319a74f5ae9f49ec931d10157e322eeb66bfc",
      "source_line_count": 83,
      "required_transformations": [
        "remove legacy table-200 hard gate",
        "retain authoritative validation for tables 201-205"
      ],
      "anchor_region_hashes": [
        {
          "region_id": "slots_apply-r1",
          "start_line": 36,
          "end_line": 54,
          "exact_sha256": "306e578e8c2682062f38e66443cc1fea9c3cdf44daaab22db29fac78eb117651"
        }
      ],
      "output_contract": {
        "complete_file": true,
        "destination": "/usr/local/sbin/router-egress-slots-apply.sh",
        "installation_in_this_step": false
      }
    }
  ]
}
