[
 {
  "id": "packaging.ort-runtime-preflight",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "    [ -f \"${ort_file}\" ] || { printf",
  "replace": "    [ -n \"${ort_file}\" ] || { printf",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a missing provider must fail before existing output is overwritten"
 },
 {
  "id": "packaging.ort-runtime-provider-choice",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "    amd) ort_files+=(\"$(ort_amdgpu_ep_dir)/${ORT_AMDGPU_EP_MODULE}\") ;;\n",
  "replace": "    amd) ort_files+=(\"${ort_dir}/libonnxruntime_providers_shared.so\" \"${ort_dir}/libonnxruntime_providers_cuda.so\") ;;\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "AMD packages must carry the plugin MIGraphX EP from the image's prefix, not CUDA"
 },
 {
  "id": "packaging.external-library-loader",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "external_suffix=\"\\${external_library_path}\"",
  "replace": "external_suffix=\"\"",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "the bundled loader must search the external runtime directories"
 },
 {
  "id": "packaging.cmake-closure-no-default-system",
  "target": "cmake/CPackCommon.cmake",
  "find": "list(APPEND _args --no-default-system)",
  "replace": "list(APPEND _args --system \"libGL.so.1\")",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "CMake must pass the caller's requested system exclusion policy to the ELF walker"
 },
 {
  "id": "consumer-inventory.shared-library-class",
  "target": ".github/consumers.json",
  "find": "\"glob\": \"linux/scripts/lib/*.sh\"",
  "replace": "\"glob\": \"linux/scripts/lib/none/*.sh\"",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "shared shell libraries must remain in the consumer inventory"
 },
 {
  "id": "consumer-inventory.shared-requirements-class",
  "target": ".github/consumers.json",
  "find": "\"glob\": \"linux/scripts/lib/*.requirements.txt\"",
  "replace": "\"glob\": \"linux/scripts/lib/none/*.requirements.txt\"",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "shared sibling requirements must remain in the consumer inventory"
 },
 {
  "id": "consumer-inventory.root-requirements-class",
  "target": ".github/consumers.json",
  "find": "\"glob\": \"linux/scripts/*.requirements.txt\"",
  "replace": "\"glob\": \"linux/scripts/none/*.requirements.txt\"",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "shared root requirements must remain in the consumer inventory"
 },
 {
  "id": "consumer-inventory.shared-filename-alias",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "    alias_value = path.name if alias == \"filename\" else path.stem",
  "replace": "    alias_value = path.stem",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "a dynamically constructed shared filename must not vanish from the inventory"
 },
 {
  "id": "consumer-inventory.shared-ambiguous-basename",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "        return entry[\"conservative_alias\"] or entry[\"alias_name\"] not in ctx[\"basenames\"]",
  "replace": "        return entry[\"alias_name\"] not in ctx[\"basenames\"]",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "a same-named local file cannot prove that an ambiguous basename is not the hub file"
 },
 {
  "id": "consumer-inventory.shared-alias-evidence",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "            if entry[\"conservative_alias\"] and matched != needle and not ctx[\"is_self\"]:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "an ambiguous basename is a mention, not evidence of an actual hub call"
 },
 {
  "id": "version-snapshot.consumer-pins-uv-exclusions",
  "target": "docs/scripts/consumer_pins.py",
  "find": "    if path == (\"tool\", \"uv\", \"exclude-dependencies\"):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-consumer-pins-toml.sh",
  "why": "uv exclusion names must not be misreported as unpinned declared dependencies"
 },
 {
  "id": "version-snapshot.consumer-pins-invalid-toml",
  "target": "docs/scripts/consumer_pins.py",
  "find": "            except tomllib.TOMLDecodeError as exc:",
  "replace": "            except TypeError as exc:",
  "test": "bash linux/scripts/tests/test-consumer-pins-toml.sh",
  "why": "a malformed manifest must fail with the TOML error rather than an uncaught exception"
 },
 {
  "id": "lib.uv-image-cleanup-forward",
  "target": "linux/scripts/01-core/uv-image-overlay.sh",
  "find": "  uv_image_overlay_cleanup \"${status}\" \"${path}\" || status=$?",
  "replace": "  uv_image_overlay_cleanup \"${status}\" \"${path}\" || true",
  "test": "bash linux/scripts/tests/test-uv-image-overlay.sh",
  "why": "the EXIT handler must forward cleanup errors as its final status"
 },
 {
  "id": "lib.uv-image-cleanup-status",
  "target": "linux/scripts/01-core/uv-image-overlay.sh",
  "find": "    [ \"${status}\" -ne 0 ] || status=1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-uv-image-overlay.sh",
  "why": "failed overlay removal must fail a previously successful build"
 },
 {
  "id": "lib.uv-image-cleanup-receipt",
  "target": "linux/scripts/01-core/uv-image-overlay.sh",
  "find": "  if ! rm -rf -- \"${path}\" || [ -e \"${path}\" ] || [ -L \"${path}\" ]; then",
  "replace": "  if ! rm -rf -- \"${path}\"; then",
  "test": "bash linux/scripts/tests/test-uv-image-overlay.sh",
  "why": "a successful removal command must not hide a temporary path that remains"
 },
 {
  "id": "lib.uv-image-unlocked-install",
  "target": "linux/scripts/01-core/verify-uv-image-plan.py",
  "find": "        if version not in allowed.get(key(name), set()):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-uv-image-overlay.sh",
  "why": "a pip plan must not install a package or version absent from the uv lock"
 },
 {
  "id": "lib.uv-image-image-version",
  "target": "linux/scripts/01-core/verify-uv-image-plan.py",
  "find": "        if name in image and Version(image[name]) != Version(specs[0].version):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-uv-image-overlay.sh",
  "why": "an omitted image distribution must match the active uv lock version exactly"
 },
 {
  "id": "lib.uv-image-module-provenance",
  "target": "linux/scripts/01-core/verify-uv-image-modules.py",
  "find": "        if not path.is_relative_to(root):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-uv-image-overlay.sh",
  "why": "an overlay must not shadow the image's required runtime modules"
 },
 {
  "id": "lib.uv-image-target-venv",
  "target": "linux/scripts/01-core/uv-image-overlay.sh",
  "find": "sys.exit(sys.prefix == sys.base_prefix)",
  "replace": "sys.exit(0)",
  "test": "bash linux/scripts/tests/test-uv-image-overlay.sh",
  "why": "a system interpreter must fail before any package operation even under Python optimization"
 },
 {
  "id": "lib.cmake-policy-single-argument",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "    \"-DCMAKE_POLICY_VERSION_MINIMUM=${CMAKE_POLICY_VERSION_MINIMUM:-3.5}\"",
  "replace": "    -DCMAKE_POLICY_VERSION_MINIMUM=${CMAKE_POLICY_VERSION_MINIMUM:-3.5}",
  "test": "bash linux/scripts/tests/test-cross-cmake-argv.sh",
  "why": "an operator-provided policy value must remain one CMake option without splitting or globbing"
 },
 {
  "id": "lib.cmake-build-empty-positional",
  "target": "linux/scripts/lib/cli-value-options.sh",
  "find": "_cpo_remaining+=(\"$@\")",
  "replace": "_cpo_remaining+=(\"${@:2}\")",
  "test": "bash linux/scripts/tests/test-lib-smoke.sh",
  "why": "an empty positional preset must retain its array entry and caller default instead of aborting on an empty associative-array key"
 },
 {
  "id": "docs-site.chrome-close-failed-initialization",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "    try { await close(); }",
  "replace": "    try { /* missing initialization cleanup */ }",
  "test": "bash linux/scripts/tests/test-chrome-close.sh",
  "why": "a failed initial DevTools call rejects before the browser reaches its caller, so launch must terminate its own process group, remove its profile and unregister signal handlers"
 },
 {
  "id": "harvest.failure-is-fatal",
  "target": "linux/scripts/01-core/parallel-loop.sh",
  "find": "    parallel_loop_harvest \"${flagdir}\" || failed=1",
  "replace": "    parallel_loop_harvest \"${flagdir}\" || true",
  "test": "bash linux/scripts/tests/test-parallel-loop.sh",
  "why": "successful workers cannot hide a failed parent result harvest"
 },
 {
  "id": "harvest.failed-pin-read-is-fatal",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "      pin_value=\"$(cat \"${flagdir}/pin.${name}\")\" || {\n        warn \"Cannot read parallel worker pin: ${flagdir}/pin.${name}\"\n        return 1\n      }",
  "replace": "      pin_value=\"$(cat \"${flagdir}/pin.${name}\")\" || true",
  "test": "bash linux/scripts/tests/test-parallel-loop.sh",
  "why": "a pin read that emits partial bytes and fails must not publish that pin or the built flag, including under an errexit-disabled caller"
 },
 {
  "id": "harvest.empty-pin-is-fatal",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "      [ -n \"${pin_value}\" ] || { warn \"Empty parallel worker pin: ${flagdir}/pin.${name}\"; return 1; }",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-parallel-loop.sh",
  "why": "an empty worker pin must not clear a valid parent pin or advertise a completed build"
 },
 {
  "id": "docs-site.chrome-close-uses-group-callback",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "    kill();",
  "replace": "    proc.kill('SIGKILL');",
  "test": "bash linux/scripts/tests/test-chrome-close.sh",
  "why": "real Chrome launches supply process-group termination while standalone child fixtures retain the direct-kill default; bypassing the callback leaves renderer descendants alive"
 },
 {
  "id": "docs-site.chrome-close-reaps-before-profile",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "await Promise.race([exited, new Promise",
  "replace": "await Promise.race([Promise.resolve(), new Promise",
  "test": "bash linux/scripts/tests/test-chrome-close.sh",
  "why": "kill returns before the child exits; removing a profile while its writer is still alive reproduced ENOTEMPTY in the real sidebar gate"
 },
 {
  "id": "docs-site.chrome-close-bounded-retries",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "maxRetries: 10, retryDelay: 100",
  "replace": "maxRetries: 0, retryDelay: 100",
  "test": "bash linux/scripts/tests/test-chrome-close.sh",
  "why": "remaining Chrome profile writers need bounded filesystem retry after the main process exits, rather than treating force as an ENOTEMPTY retry"
 },
 {
  "id": "docs-site.chrome-close-failure-is-fatal",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "  fs.rmSync(profile, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });",
  "replace": "  try { fs.rmSync(profile, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 }); } catch {}",
  "test": "bash linux/scripts/tests/test-chrome-close.sh",
  "why": "exhausted cleanup retries or unrelated filesystem errors must reject the caller rather than hiding a failed cleanup behind a green page report"
 },
 {
  "id": "docs-site.chrome-close-awaits-every-peer",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "const outcomes = await Promise.allSettled(",
  "replace": "const outcomes = await Promise.all(",
  "test": "bash linux/scripts/tests/test-chrome-close.sh",
  "why": "one browser's cleanup failure must not report before the other launched browsers finish their own cleanup"
 },
 {
  "id": "python.app-bundle.exclude-provider-before-resolver",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "export_args+=(--no-emit-package \"${provider}\")",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-app-packages.sh",
  "why": "a PyPI ORT provider in the exported requirements fails resolution on an ABI without a published wheel before the chain provider can replace it"
 },
 {
  "id": "python.app-bundle.chain-provider-in-first-resolver",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "    --requirement \"${work}/requirements.lock.txt\" \"${ort}\" || return 1",
  "replace": "    --requirement \"${work}/requirements.lock.txt\" || return 1",
  "test": "bash linux/scripts/tests/test-python-app-packages.sh",
  "why": "the first dependency transaction must resolve against the explicit chain wheel while retaining the other locked dependencies"
 },
 {
  "id": "mutations.baseline-diagnostic-head",
  "target": "docs/scripts/verify_mutations.py",
  "find": "lines[:3] + [\"...\"] + lines[-3:]",
  "replace": "lines[-6:]",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k gitbash",
  "why": "a long assertion report must retain the first failure instead of hiding it behind the final lines of a multiline comparison"
 },
 {
  "id": "mutations.baseline-diagnostic-bounded",
  "target": "docs/scripts/verify_mutations.py",
  "find": "line[:500] for line in excerpt",
  "replace": "line for line in excerpt",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k gitbash",
  "why": "a single very long baseline line must not turn every failed entry sharing that baseline into an unbounded repeated CI log"
 },
 {
  "id": "runtime-smoke.gates-only-exit",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  _manifest_exit_after_gates_if_requested\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-manifest-gates-only.sh",
  "why": "gates-only must exit through the actual helper before any build or publication even with push flags"
 },
 {
  "id": "runtime-smoke.gates-only-not-default",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  [ \"${GATES_ONLY}\" -eq 1 ] || return 0\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-manifest-gates-only.sh",
  "why": "the extracted early-exit helper must leave ordinary build and publication runs reachable"
 },
 {
  "id": "lib.dartdoc-tool-default",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "    doc_cmd=(_dartdoc_build_default_doc)",
  "replace": "    doc_cmd=(dart doc)",
  "test": "bash linux/scripts/tests/test-dartdoc-tool.sh",
  "why": "the default must use the fixed pinned generator rather than the SDK's crashing bundled dartdoc"
 },
 {
  "id": "lib.dartdoc-tool-cache-isolated",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  cache=\"${DARTDOC_BUILD_TOOL_CACHE:-$(_dartdoc_build_root)/.dart_tool/dartdoc-tool}/${DARTDOC_VERSION}\"",
  "replace": "  cache=\"${PUB_CACHE}\"",
  "test": "bash linux/scripts/tests/test-dartdoc-tool.sh",
  "why": "resolving a documentation generator must not alter the app's or caller's global pub tool cache"
 },
 {
  "id": "lib.dartdoc-tool-caller-command",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  if [[ ${#doc_cmd[@]} -eq 0 ]]; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-dartdoc-tool.sh",
  "why": "a deliberate caller command must retain its arguments and bypass the default generator resolver"
 },
 {
  "id": "lib.dartdoc-tool-exact-pin",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "      dart pub global activate dartdoc \"${DARTDOC_VERSION}\" --no-executables || return 1",
  "replace": "      dart pub global activate dartdoc 0.0.0 --no-executables || return 1",
  "test": "bash linux/scripts/tests/test-dartdoc-tool.sh",
  "why": "the official package resolution must request the exact centrally declared version"
 },
 {
  "id": "lib.dartdoc-tool-activation-verified",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  if ! PUB_CACHE=\"${cache}\" dart pub global list | grep -qxF \"dartdoc ${DARTDOC_VERSION}\"; then\n    err \"The docs tool cache does not contain dartdoc ${DARTDOC_VERSION} after activation.\"\n  fi",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-dartdoc-tool.sh",
  "why": "a resolver claiming success with another version must not run a stale generator"
 },
 {
  "id": "lib.dartdoc-tool-generation-failure",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  PUB_HOSTED_URL=https://pub.dev PUB_CACHE=\"${cache}\" dart pub global run dartdoc:dartdoc",
  "replace": "  PUB_HOSTED_URL=https://pub.dev PUB_CACHE=\"${cache}\" dart pub global run dartdoc:dartdoc || true",
  "test": "bash linux/scripts/tests/test-dartdoc-tool.sh",
  "why": "documentation generation errors must propagate to the lane instead of producing a green incomplete site"
 },
 {
  "id": "lib.dartdoc-tool-clean-failure",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "    ) || return 1",
  "replace": "    )",
  "test": "bash linux/scripts/tests/test-dartdoc-tool.sh",
  "why": "a failed preparation must stop generation even when a gate calls the function with errexit disabled"
 },
 {
  "id": "sbom.documentation-tool-pin",
  "target": "docs/scripts/deps_table.py",
  "find": "        paths.append(tool_pins)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-curated-sbom.sh",
  "why": "the explicit documentation tool's inventory must track its tool-pins version rather than omit it"
 },
 {
  "id": "image-acceptance.flutter-prologue",
  "target": "shared/config/image-consumers.json",
  "find": "source \\\"${ANTFRASTRUCTURE_DIR}/linux/scripts/05-frameworks/flutter/lane-prologue.sh\\\"; flutter_lane_prepare_env;",
  "replace": "source \\\"${ANTFRASTRUCTURE_DIR}/linux/scripts/05-frameworks/flutter/lane-prologue.sh\\\";",
  "test": "bash linux/scripts/tests/test-image-consumer-bootstrap.sh",
  "why": "the mounted Flutter checkout must be registered before Git-based strict checks discover its packages"
 },
 {
  "id": "image-acceptance.flutter-plugin-package",
  "target": "shared/config/image-consumers.json",
  "find": "run_flutter_common_checks 1",
  "replace": "run_flutter_common_checks 0",
  "test": "bash linux/scripts/tests/test-image-consumer-bootstrap.sh",
  "why": "the native inference package must resolve its own dependencies before its VM checks"
 },
 {
  "id": "image-acceptance.unprivileged-cpp-lane",
  "target": "shared/config/image-consumers.json",
  "find": "\"scripts/linux/ci-build-and-test.sh\", \"--compiler\", \"gcc\"",
  "replace": "\"scripts/linux/ci-build-and-test.sh\"",
  "test": "bash linux/scripts/tests/test-image-consumer-bootstrap.sh",
  "why": "acceptance must explicitly select GCC instead of invoking the Clang TSan lane that needs privileged CI"
 },
 {
  "id": "image-acceptance.cleanup-failure",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    if \"container_cleanup_error\" in row:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "a timed-out container removal must retain failed evidence even after host ownership is restored"
 },
 {
  "id": "image-acceptance.linux-user",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    if sys.platform.startswith(\"linux\"):\n        command +=",
  "replace": "    if False:\n        command +=",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "Linux acceptance must use a user that can write both the SDK and isolated checkout"
 },
 {
  "id": "image-acceptance.ownership-failure",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    if \"ownership_error\" in row:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "an inaccessible host workspace must not produce a passed receipt"
 },
 {
  "id": "image-acceptance.failed-receipt",
  "target": "linux/scripts/image-acceptance.py",
  "find": "receipt.get(\"status\") != \"passed\"",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "a failed receipt must never reach registry publication"
 },
 {
  "id": "image-acceptance.missing-consumer",
  "target": "linux/scripts/image-acceptance.py",
  "find": "if len(rows) != len(plan[\"consumers\"]):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "a receipt must account for every declared consumer"
 },
 {
  "id": "image-acceptance.manifest-bypass",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    runtime_step_phase acceptance _manifest_accept_and_promote \"${manifest_ref}\"",
  "replace": "    : acceptance-bypassed",
  "test": "bash linux/scripts/tests/test-manifest-acceptance.sh",
  "why": "manifest publication must propagate acceptance failure"
 },
 {
  "id": "image-acceptance.target-errors",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        if error.code != 404:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "receipt replay and promotion must enforce target-errors"
 },
 {
  "id": "image-acceptance.duplicate-platform",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        if name in platforms:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "receipt replay and promotion must enforce duplicate-platform"
 },
 {
  "id": "image-acceptance.lost-platform",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        if missing:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "receipt replay and promotion must enforce lost-platform"
 },
 {
  "id": "image-acceptance.tested-platform",
  "target": "linux/scripts/image-acceptance.py",
  "find": "if receipt[\"platform\"] not in {\"/\".join(platform.split(\"/\")[:2]) for platform in platforms}:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "receipt replay and promotion must enforce tested-platform"
 },
 {
  "id": "image-acceptance.source-freeze",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    if changes:\n        row[\"source_changes\"]",
  "replace": "    if False:\n        row[\"source_changes\"]",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "receipt replay and promotion must enforce source-freeze"
 },
 {
  "id": "image-acceptance.crlf-lock",
  "target": "linux/scripts/image-acceptance.py",
  "find": "\"content\": data.decode(\"utf-8\")",
  "replace": "\"content\": data.decode(\"utf-8\").replace(\"\\r\\n\", \"\\n\")",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "receipt replay and promotion must enforce crlf-lock"
 },
 {
  "id": "code-size.new-offender",
  "target": "linux/scripts/quality_allow.py",
  "find": "        if was is None:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "an unfrozen oversized subject must fail"
 },
 {
  "id": "code-size.growth",
  "target": "linux/scripts/quality_allow.py",
  "find": "        elif count > was:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "growth past the frozen number must fail"
 },
 {
  "id": "code-size.unrecorded-shrink",
  "target": "linux/scripts/quality_allow.py",
  "find": "        elif count < was:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "an improvement must be recorded, not silent"
 },
 {
  "id": "code-size.stale-freeze",
  "target": "linux/scripts/quality_allow.py",
  "find": "        if key not in seen:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "a freeze must not outlive its subject"
 },
 {
  "id": "code-size.file-verdict-discarded",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    rc |= check_counts(\"files\"",
  "replace": "    rc |= 0 * check_counts(\"files\"",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "a file violation must fail, not just print"
 },
 {
  "id": "code-size.longest-not-last",
  "target": "linux/scripts/verify_code_size.py",
  "find": "longest[(f, n)] = max(c, longest.get((f, n), 0))",
  "replace": "longest[(f, n)] = c",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "a redefinition must not hide the offender"
 },
 {
  "id": "code-size.python-ast",
  "target": "linux/scripts/verify_code_size.py",
  "find": "        if rel.endswith(\".py\"):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "python functions are in scope"
 },
 {
  "id": "code-size.dockerfile-pass",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    for path, rel in _flat_scan(root, FLAT_SCAN, lambda fn: fn.startswith(\"Dockerfile\")):",
  "replace": "    for path, rel in _flat_scan(root, FLAT_SCAN, lambda fn: False):",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "Dockerfiles are size-checked"
 },
 {
  "id": "advert-keys.unprobed-row",
  "target": "linux/scripts/verify_advertised_keys.py",
  "find": "    if new_unprobed:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-advertised-keys.sh",
  "why": "a table row with no ADV probe can only SKIP"
 },
 {
  "id": "advert-keys.healed-baseline",
  "target": "linux/scripts/verify_advertised_keys.py",
  "find": "    if healed:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-advertised-keys.sh",
  "why": "a probed key must leave the frozen baseline"
 },
 {
  "id": "cross-build.pull-flag",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "printf '%s' \"--pull=true\"",
  "replace": "printf '%s' \"--pull=false\"",
  "test": "bash linux/scripts/tests/test-cross-stage-build-cmd.sh",
  "why": "a pushing build refreshes its base"
 },
 {
  "id": "cross-build.local-no-retry",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "[ \"${push_flag}\" -eq 1 ] && _max_attempts=\"${PUSH_MAX_ATTEMPTS:-4}\"",
  "replace": "_max_attempts=\"${PUSH_MAX_ATTEMPTS:-4}\"",
  "test": "bash linux/scripts/tests/test-cross-stage-build-cmd.sh",
  "why": "retry is a push concept"
 },
 {
  "id": "cross-build.salvage-loop",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "for _tgt in \"${_salvage_targets[@]}\"; do",
  "replace": "for _tgt in; do",
  "test": "bash linux/scripts/tests/test-cross-stage-build-cmd.sh",
  "why": "a failed build salvages its named stages"
 },
 {
  "id": "cross-build.salvage-disk-guard",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "&& _cross_salvage_disk_ok \"${_cache_dir}\"; then",
  "replace": "; then",
  "test": "bash linux/scripts/tests/test-cross-stage-build-cmd.sh",
  "why": "a short disk must not be filled further"
 },
 {
  "id": "stage-graph.loop-var-leak",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "  local stage=\"$1\" s\n",
  "replace": "  local stage=\"$1\"\n",
  "test": "bash linux/scripts/tests/test-stage-defs.sh",
  "why": "the disk guard's protected-slug list depends on it"
 },
 {
  "id": "guard-helpers.first-match",
  "target": "linux/scripts/01-core/guard-helpers.sh",
  "find": "-print -quit 2>/dev/null || true",
  "replace": "-print -quit 2>/dev/null",
  "test": "bash linux/scripts/tests/test-guard-helpers.sh",
  "why": "a missing dir must not abort a set -e caller"
 },
 {
  "id": "delete-guard.quote-aware-split",
  "target": ".claude/hooks/guard-destructive-deletes.py",
  "find": "    out, buf, quote = [], [], \"\"",
  "replace": "    return re.split(r\"[;&|\\n]+\", text)\n    out, buf, quote = [], [], \"\"",
  "test": "bash linux/scripts/tests/test-delete-guard.sh",
  "why": "splitting through a quote misreads prose as a delete"
 },
 {
  "id": "delete-guard.unexpected-json-errors-propagate",
  "target": ".claude/hooks/guard-destructive-deletes.py",
  "find": "    except json.JSONDecodeError:",
  "replace": "    except Exception:",
  "test": "bash linux/scripts/tests/test-delete-guard.sh",
  "why": "invalid hook JSON stays non-blocking while unexpected parser failures remain visible"
 },
 {
  "id": "mutations.survivor-must-fail",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if not applied:\n        report.err(\"FAIL: {} -- {} ({})\\n\".format(e[\"id\"], detail, e[\"target\"]))\n        return 1",
  "replace": "    if not applied:\n        report.err(\"FAIL: {} -- {} ({})\\n\".format(e[\"id\"], detail, e[\"target\"]))\n        return 0",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k twice",
  "why": "a stale mutation is silently testing nothing"
 },
 {
  "id": "mutations.restores-the-file",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        shutil.copyfile(backup.name, target)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k gitbash",
  "why": "a tool that edits in place must never leave the tree mutated"
 },
 {
  "id": "mutations.restore-is-byte-exact",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    with open(path, \"rb\") as fh:\n        return fh.read().decode(\"utf-8\")",
  "replace": "    with open(path, encoding=\"utf-8\") as fh:\n        return fh.read()",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k copies",
  "why": "a text-mode read turns CRLF into LF, so the restore and the mutant both change a target's line endings (CON134)"
 },
 {
  "id": "mutations.crlf-target-takes-lf-find",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if \"\\r\\n\" in original:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k copies",
  "why": "a CRLF checkout (core.autocrlf) of a target makes every multi-line LF find stale"
 },
 {
  "id": "mutations.vacuous-bite",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if not base_ok:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k gitbash",
  "why": "a mutation recorded as biting while its suite was ALREADY red proves nothing; each distinct test must pass unmutated first"
 },
 {
  "id": "mutations.host-skip-only-on-git-bash",
  "target": "docs/scripts/verify_mutations.py",
  "find": "HOST_MAY_SKIP = os.name == \"nt\" or sys.platform.startswith((\"cygwin\", \"msys\"))",
  "replace": "HOST_MAY_SKIP = True",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k gitbash",
  "why": "on Linux, where CI grades every mutation, an exit 77 or a waived case must stay a failure; a skip there would shrink CI without a red line"
 },
 {
  "id": "mutations.host-skip-reads-77",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if rc == 77 and HOST_MAY_SKIP:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k gitbash",
  "why": "on Git Bash a suite that cannot run says so with exit 77; reading that as a vacuous bite makes every Windows pre-push red for the host, not the code"
 },
 {
  "id": "mutations.host-skipped-survivor-is-a-skip",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if HOST_MAY_SKIP and now_skips:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k gitbash",
  "why": "a survivor in a suite that skipped or waived a case on this host proves nothing there (the case that would catch it never ran); calling it SURVIVED on Git Bash is a false alarm Linux would not raise"
 },
 {
  "id": "mutations.skip-verdict-is-honest",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if rc == 0 and report.skipped:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k gitbash",
  "why": "a run with skips must not close on 'every recorded mutation is caught' -- that line is what a reader trusts, and here it would be untrue"
 },
 {
  "id": "wheels.no-deps",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  uv pip install --no-deps --force-reinstall \"${_ow[@]}\"",
  "replace": "  uv pip install --force-reinstall \"${_ow[@]}\"",
  "test": "bash linux/scripts/tests/test-reconcile-local-wheels.sh",
  "why": "--no-deps is what stops uv floating the venv off the lock (moved into _install_wheel_groups 2026-09-03; the array is a nameref there)"
 },
 {
  "id": "wheels.ort-dangling-edges",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "uv pip install 'protobuf>=6,<7' flatbuffers",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-reconcile-local-wheels.sh",
  "why": "the ORT wheel's own requirements are skipped by --no-deps"
 },
 {
  "id": "probe.all-parts-concatenated",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  _probe_advertised\n  _probe_actual_versions\n  _probe_venv_inventory\n  _probe_elf_and_sonames\n",
  "replace": "  _probe_advertised\n  _probe_actual_versions\n  _probe_venv_inventory\n",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a dropped section leaves its printfs in the file, so no other gate notices"
 },
 {
  "id": "handoff.artifact-context-join",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "printf '%s' \"${ARTIFACT_CONTEXT_ROOT%/}-${arch}\"",
  "replace": "printf '%s' \"${ARTIFACT_CONTEXT_ROOT%/}/${arch}\"",
  "test": "bash linux/scripts/tests/test-cross-oci-handoff.sh",
  "why": "the --no-push package build must read the image android just exported"
 },
 {
  "id": "harvest.both-flag-kinds",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "  for f in \"${flagdir}\"/pin.*.* \"${flagdir}\"/built.*.*; do",
  "replace": "  for f in \"${flagdir}\"/pin.*.*; do",
  "test": "bash linux/scripts/tests/test-parallel-loop.sh",
  "why": "--no-push writes only built.<stage>.<arch>, and pin.* alone loses it"
 },
 {
  "id": "boot.discriminating-assertion",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  elif ! printf '%s' \"${out}\" | grep -q \"gstma=yes\"; then",
  "replace": "  elif ! printf '%s' \"${out}\" | grep -q \"gst=set\"; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the image ENV sets GST_PLUGIN_PATH, so gst=set answers yes without the entrypoint"
 },
 {
  "id": "boot.vulkan-arch-neutral",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  elif ! printf '%s' \"${out}\" | grep -q \"vkarch=neutral\"; then",
  "replace": "  elif ! printf '%s' \"${out}\" | grep -q \"vkarch=\"; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "setup-env.sh pins every Vulkan variable to /opt/vulkan/<ver>/<arch>, and the probe line exists either way (CON48)"
 },
 {
  "id": "boot.vulkan-sourced",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  elif ! printf '%s' \"${out}\" | grep -q \"vkadd=yes\"; then",
  "replace": "  elif ! printf '%s' \"${out}\" | grep -q \"vkadd=\"; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the image ENV sets VULKAN_SDK, so only VK_ADD_LAYER_PATH proves the entrypoint sourced setup-env.sh"
 },
 {
  "id": "vulkan.env-prefer-active-link",
  "target": "linux/scripts/01-core/vulkan-env.sh",
  "find": "  vulkan_env_prefer_active_link \"${root}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-vulkan-env-active-link.sh",
  "why": "without it vulkan_env_source and every explicit setup script keep setup-env.sh's arch dir, which a foreign-arch process under QEMU then reads (CON48)"
 },
 {
  "id": "vulkan.env-component-boundary",
  "target": "linux/scripts/01-core/vulkan-env.sh",
  "find": "        \"${resolved}\"/*) comp=\"${link}${comp#\"${resolved}\"}\" ;;",
  "replace": "        \"${resolved}\"*) comp=\"${link}${comp#\"${resolved}\"}\" ;;",
  "test": "bash linux/scripts/tests/test-vulkan-env-active-link.sh",
  "why": "x86_64-other is a sibling of x86_64, not inside it"
 },
 {
  "id": "vulkan.env-no-duplicate-entry",
  "target": "linux/scripts/01-core/vulkan-env.sh",
  "find": "      case \"${seen}\" in *\":${comp}:\"*) continue ;; esac\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-vulkan-env-active-link.sh",
  "why": "the image ENV already lists /opt/vulkan/active/bin, so the rewrite would add it twice"
 },
 {
  "id": "lib.cmake-build-vulkan-script-on-link",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "  project_env_source_vulkan\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-vulkan-env-active-link.sh",
  "why": "a consumer lane that names --vulkan-setup-script re-pins the arch dir the entrypoint left on the link (CON48)"
 },
 {
  "id": "lib.ctest-run-vulkan-script-on-link",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "  project_env_source_vulkan\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-vulkan-env-active-link.sh",
  "why": "a consumer lane that names --vulkan-setup-script re-pins the arch dir the entrypoint left on the link (CON48)"
 },
 {
  "id": "vulkan.env-script-root",
  "target": "linux/scripts/01-core/vulkan-env.sh",
  "find": "  [ -n \"${root}\" ] || root=\"$(dirname \"$(dirname \"${script}\")\")\"\n",
  "replace": "  [ -n \"${root}\" ] || root=\"$(dirname \"${script}\")\"\n",
  "test": "bash linux/scripts/tests/test-vulkan-env-active-link.sh",
  "why": "the link sits beside <version>/, two levels above setup-env.sh"
 },
 {
  "id": "vulkan.env-keeps-callers-arch",
  "target": "linux/scripts/01-core/vulkan-env.sh",
  "find": "  if [ -n \"${_vke_arch_set}\" ]; then ARCH=\"${_vke_arch}\"; else unset ARCH; fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-vulkan-env-active-link.sh",
  "why": "LunarG's setup-env.sh sets ARCH=$(uname -m), so a lane's ARCH=amd64 or a cross target's ARCH reads as the host's uname (CON133)"
 },
 {
  "id": "vulkan.entrypoint-keeps-callers-arch",
  "target": "linux/scripts/04-runtime/entrypoint.sh",
  "find": "if [ -n \"${_ep_arch_set}\" ]; then ARCH=\"${_ep_arch}\"; else unset ARCH; fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-vulkan-env-active-link.sh",
  "why": "every command through the image's entrypoint got ARCH=x86_64 for a lane's -e ARCH=amd64 (OxidANT 134e46e, CON133)"
 },
 {
  "id": "qairt.include-root-not-qnn-dir",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "    local inc=\"${LITERT_QNN_HOME}/include/QNN\"",
  "replace": "    local inc=\"${LITERT_QNN_HOME}/include\"",
  "test": "bash linux/scripts/tests/test-litert-qairt-headers.sh",
  "why": "upstream consumes a pre-set QAIRT_HEADERS_DIR verbatim, so the include root fails 7 min deep at qnn_common"
 },
 {
  "id": "qairt.missing-header-assert",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "    [ -f \"${inc}/QnnLog.h\" ] || err ",
  "replace": "    [ -f \"${inc}/QnnLog.h\" ] || true && err_disabled ",
  "test": "bash linux/scripts/tests/test-litert-qairt-headers.sh",
  "why": "a moved SDK layout must fail loudly at configure, not silently produce a bad -D"
 },
 {
  "id": "qairt.android-guard-unreachable",
  "target": "linux/scripts/03-media/build/litert/android/build-android.sh",
  "find": "_litert_disable_qairt_header_download \"${PWD}\"",
  "replace": ": # guard call removed",
  "test": "bash linux/scripts/tests/test-litert-qairt-guard.sh",
  "why": "the android lane clones its own tree, so the cross lane's patch cannot cover it -- YA"
 },
 {
  "id": "shellcheck.extensionless-arm",
  "target": "linux/scripts/lint-shell.sh",
  "find": "    *)\n      # No extension at all \u2014 admit it only on a shell shebang. LOAD-BEARING: the live hook has none.",
  "replace": "    *)\n      continue\n      # No extension at all \u2014 admit it only on a shell shebang. LOAD-BEARING: the live hook has none.",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "without the extension-less arm the live commit hook is linted by nothing, and the scan reports 'no shell scripts to check' -- a miss that looks like a pass"
 },
 {
  "id": "shellcheck.ansible-default-scope",
  "target": "linux/scripts/lint-shell.sh",
  "find": "\"${REPO_ROOT}/linux/ansible\"",
  "replace": "\"${REPO_ROOT}/linux/scripts\"",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "the default scan and warning ratchet must not report green while tracked Ansible shell scripts are missing"
 },
 {
  "id": "chain-status.emitter-dispatch",
  "target": "linux/scripts/01-core/chain-lifecycle.sh",
  "find": "chain_status_kv_json() { _chain_status_walk_json \"${1:-}\" _chain_status_emit_kv; }",
  "replace": "chain_status_kv_json() { _chain_status_walk_json \"${1:-}\" _chain_status_emit_str; }",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "the shared walker dispatches on an emitter NAME; the suite never calls these functions directly, so pin that its end-to-end JSON check still catches a wrong emitter"
 },
 {
  "id": "wheels.ort-census-bytes",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "                if sha256(want) != sha256(have):",
  "replace": "                if False:",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "PyPI ships the chain's own version too; a same-version foreign build differs only in its bytes"
 },
 {
  "id": "wheels.ort-census-missing",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "                missing.append(rel)",
  "replace": "                pass",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "a chain file the venv lacks (PyPI's build has no DirectML.dll) must fail, not be skipped"
 },
 {
  "id": "wheels.ort-census-extra",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "    extra = listed(dist) - members",
  "replace": "    extra = set()",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "a file only the installed copy carries is foreign payload under the chain wheel's name"
 },
 {
  "id": "wheels.ort-census-owner-count",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "        if len(owners) > 1 or (pkg == \"onnxruntime\" and not owners):",
  "replace": "        if len(owners) > 2 or (pkg == \"onnxruntime\" and not owners):",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "two distributions in one import package is the version-shadow class; exactly one may own it"
 },
 {
  "id": "wheels.ort-census-owner-required",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "        if len(owners) > 1 or (pkg == \"onnxruntime\" and not owners):",
  "replace": "        if len(owners) > 1:",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "a venv with no onnxruntime at all is not chain-only; an empty census must fail"
 },
 {
  "id": "wheels.ort-census-name-pattern",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "        if (ORT_DIST.match(name) or owns) and key not in found:",
  "replace": "        if owns and key not in found:",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "an onnxruntime-* dist with its own import package (the PyPI onnxruntime-ep-webgpu) is caught by its name alone"
 },
 {
  "id": "wheels.ort-census-owner-candidacy",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "        if (ORT_DIST.match(name) or owns) and key not in found:",
  "replace": "        if ORT_DIST.match(name) and key not in found:",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "ORT under an unrelated dist name (ort-nightly) is caught by the import package it writes into"
 },
 {
  "id": "wheels.ort-census-stray",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "    if stray:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "a DLL dropped into onnxruntime/capi by no distribution loads with the package all the same"
 },
 {
  "id": "wheels.ort-census-import-origin",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "    if spec.origin and real(spec.origin) not in owned:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "what `import onnxruntime` actually loads must be the owner's file, not a dist-less copy earlier on sys.path"
 },
 {
  "id": "wheels.ort-census-store-has-ort",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "    if not any(ORT_RUNTIME.match(name) for name, _ in index):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "a store without the chain ORT wheel is the silent-PyPI-fallback precondition; name it"
 },
 {
  "id": "wheels.ort-census-crash-fails",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "        findings, chain = (\n            [f\"the census could not complete: {type(exc).__name__}: {exc!s}\"],\n            [],\n        )",
  "replace": "        findings, chain = (\n            [],\n            [],\n        )",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "a census that could not look must never print PASS"
 },
 {
  "id": "wheels.ort-census-unexpected-error-fatal",
  "target": "linux/scripts/03-media/runtime/ort-venv-census.py",
  "find": "    except CENSUS_FAILURES as exc:",
  "replace": "    except Exception as exc:",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "only known filesystem and wheel-format failures get a census sentinel; implementation bugs must keep their traceback and fail without a verdict"
 },
 {
  "id": "wheels.ort-chain-wheel-fatal",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "refusing to fall back to the app lock's PyPI build\" >&2\n  return 1",
  "replace": "refusing to fall back to the app lock's PyPI build\" >&2\n  return 0",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "without the chain ORT wheel the lock's PyPI onnxruntime 1.27.0 used to ship silently (the cross wheel is conditional)"
 },
 {
  "id": "wheels.ort-family-pattern",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "    onnxruntime-*.whl|onnxruntime_*.whl)",
  "replace": "    onnxruntime-*.whl|onnxruntime_dnnl-*.whl)",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "a flavour list misses the next flavour (onnxruntime_qnn), and the staged check then reads a chain wheel as none"
 },
 {
  "id": "wheels.ort-family-not-runtime",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "    onnxruntime_genai*.whl|onnxruntime_extensions*.whl|onnxruntime_ep_*.whl) printf 'other' ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "a plugin EP or extensions wheel staged alone is not a chain ORT runtime"
 },
 {
  "id": "wheels.ort-chain-wheel-check-called",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  prune_conflicting_onnx_wheels\n  assert_chain_ort_wheel_staged\n",
  "replace": "  prune_conflicting_onnx_wheels\n",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "a staged-wheel check nothing calls is no check"
 },
 {
  "id": "wheels.ort-census-pass-line",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  if [ \"${_rc}\" -ne 0 ] || [[ $'\\n'\"${_out}\" != *$'\\n'\"ORT-CENSUS PASS\"* ]]; then",
  "replace": "  if [ \"${_rc}\" -ne 0 ]; then",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "exit 0 with no PASS line (an interpreter that ran nothing) must not pass the stage"
 },
 {
  "id": "wheels.ort-census-last-step",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  ensure_project_package_installed\n  assert_ort_chain_only\n}",
  "replace": "  ensure_project_package_installed\n}",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "the census must see the finished venv: every uv call before it can pull an ORT from PyPI"
 },
 {
  "id": "wheels.ort-census-isolated",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  \"${VENV}/bin/python\" -I \"${_census}\"",
  "replace": "  \"${VENV}/bin/python\" \"${_census}\"",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "without -I a PYTHONPATH entry is part of the census's sys.path and of its verdict"
 },
 {
  "id": "wheels.ort-purge-name-filter",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "sed -n 's/^ORT-CENSUS PURGE \\([a-z0-9][a-z0-9-]*\\)$/\\1/p'",
  "replace": "sed -n 's/^ORT-CENSUS PURGE //p'",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "only a normalised dist name may reach the uv command line"
 },
 {
  "id": "wheels.ort-purge-from-census",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "      uv pip uninstall \"${_ort_dists[@]}\" ||",
  "replace": "      uv pip uninstall onnxruntime onnxruntime-gpu ||",
  "test": "bash linux/scripts/tests/test-reconcile-local-wheels.sh",
  "why": "a fixed name list missed every variant it did not carry; the census names what is installed"
 },
 {
  "id": "wheels.ort-purge-failure-stops",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "_names=\"$(_ort_purge_names)\" || { echo \"ERROR: the ORT census could not list the venv's ONNX Runtime distributions\" >&2; return 1; }",
  "replace": "_names=\"$(_ort_purge_names)\" || true",
  "test": "bash linux/scripts/tests/test-reconcile-local-wheels.sh",
  "why": "a census that cannot list the venv must stop the reconcile, not purge nothing"
 },
 {
  "id": "wheels.ort-genai-sync-skip-flavour",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  _genai_wheel=\"$(ls /opt/wheels/onnxruntime_genai*.whl 2>/dev/null | head -1 || true)\"",
  "replace": "  _genai_wheel=\"$(ls /opt/wheels/onnxruntime_genai-*.whl 2>/dev/null | head -1 || true)\"",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "nvidia's chain GenAI is onnxruntime_genai_cuda / _trt_rtx; a plain-name glob let uv sync download and install the lock's PyPI onnxruntime-genai at build time"
 },
 {
  "id": "probe.genai-flavour-count",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    onnxruntime-genai) grep -cE '^onnxruntime-genai(-[a-z0-9-]+)?$' <<<\"${names}\" || true ;;",
  "replace": "    onnxruntime-genai) grep -cxF -- \"${want}\" <<<\"${names}\" || true ;;",
  "test": "bash linux/scripts/tests/test-smoke-genai-flavour.sh",
  "why": "the census purges the lock's PyPI onnxruntime-genai, so an nvidia image carries only the flavoured chain GenAI; an exact name fails ARCH-PARITY and VENV-SET there"
 },
 {
  "id": "probe.genai-flavour-anchored",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    onnxruntime-genai) grep -cE '^onnxruntime-genai(-[a-z0-9-]+)?$' <<<\"${names}\" || true ;;",
  "replace": "    onnxruntime-genai) grep -cE '^onnxruntime-genai' <<<\"${names}\" || true ;;",
  "test": "bash linux/scripts/tests/test-smoke-genai-flavour.sh",
  "why": "a lookalike name (onnxruntime-genaix) is not a GenAI flavour and must not satisfy the gate"
 },
 {
  "id": "probe.pkg-count-exact-elsewhere",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    *)                 grep -cxF -- \"${want}\" <<<\"${names}\" || true ;;",
  "replace": "    *)                 grep -cF -- \"${want}\" <<<\"${names}\" || true ;;",
  "test": "bash linux/scripts/tests/test-smoke-genai-flavour.sh",
  "why": "only GenAI has flavours: torch_tensorrt is not torch and pandas-stubs is not pandas"
 },
 {
  "id": "probe.parity-uses-pkg-count",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "        *)             present=\"$(_pkg_count \"${want}\" \"${wheels}\")\" ;;",
  "replace": "        *)             present=\"$(printf '%s\n' \"${wheels}\"   | grep -cxF -- \"${want}\" || true)\" ;;",
  "test": "bash linux/scripts/tests/test-smoke-genai-flavour.sh",
  "why": "ARCH-PARITY must use the flavour-aware match, or every nvidia image reports onnxruntime_genai missing"
 },
 {
  "id": "probe.venvset-uses-pkg-count",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      if [ \"$(_pkg_count \"${r}\" \"${pkgs}\")\" -gt 0 ]; then",
  "replace": "      if printf '%s\n' \"${pkgs}\" | grep -qxF -- \"${r}\"; then",
  "test": "bash linux/scripts/tests/test-smoke-genai-flavour.sh",
  "why": "VENV-SET must use the flavour-aware match, or every nvidia image reports MISS ml-ai onnxruntime-genai"
 },
 {
  "id": "probe.venv-metadata-error-fatal",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  status=\"$(printf '%s\\n' \"${_SHIPPED_TRUTH_PROBE}\" | sed -n 's/^VENV ERROR /ERROR /p' | head -1)\"",
  "replace": "  status=\"\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a failed or malformed metadata probe must fail VENV-SET instead of passing with discarded requirement edges"
 },
 {
  "id": "probe.genai-bind-flavour",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "        if re.fullmatch(r\"onnxruntime-genai(-[a-z0-9-]+)?\", name):",
  "replace": "        if name == \"onnxruntime-genai\":",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "on nvidia the GenAI dist is onnxruntime-genai-cuda / -trt-rtx; asking only for the plain name turns a broken binding into a SKIP"
 },
 {
  "id": "probe.genai-tier1-flavour",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    version = genai_dist_version()",
  "replace": "    version = None",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "tier 1's metadata fallback must read a flavoured GenAI's version too"
 },
 {
  "id": "probe.genai-unexpected-config-exception",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    except (OSError, RuntimeError, ValueError) as exc:",
  "replace": "    except Exception as exc:",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "an unexpected Config exception must fail loudly instead of counting as proof that native code rejected the model path"
 },
 {
  "id": "wheels.partition-arg-order",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  _partition_wheels_by_install_group iree_wheels tvm_wheels other_wheels \"${local_wheels[@]}\"",
  "replace": "  _partition_wheels_by_install_group tvm_wheels iree_wheels other_wheels \"${local_wheels[@]}\"",
  "test": "bash linux/scripts/tests/test-reconcile-local-wheels.sh",
  "why": "the three groups are told apart only by nameref ARGUMENT ORDER now; swapping two must not pass"
 },
 {
  "id": "wheels.torch-backfill-guard",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  if [ \"${have_torch_family}\" = \"true\" ]; then\n    _backfill_torch_runtime_deps\n  fi",
  "replace": "  : # backfill call removed",
  "test": "bash linux/scripts/tests/test-reconcile-local-wheels.sh",
  "why": "extracting the backfill must not make it unreachable -- the notice is a printf and would still print"
 },
 {
  "id": "wheels.reconcile-return-status",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  if [ \"${have_torch_family}\" = \"true\" ]; then\n    _backfill_torch_runtime_deps\n  fi",
  "replace": "  [ \"${have_torch_family}\" = \"true\" ] && _backfill_torch_runtime_deps",
  "test": "bash linux/scripts/tests/test-reconcile-local-wheels.sh",
  "why": "the exact 014e97b5 shape: a trailing && list makes the function return 1 on every arch without a local torch wheel and set -e kills setup-torch-venv.sh silently (2026-09-03 amd64 build)"
 },
 {
  "id": "wheels.chain-no-pre-sync-install",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "    printf 'Chain GenAI wheel replaces the locked onnxruntime-genai: %s\\n' \"${_genai_wheel##*/}\"\n",
  "replace": "    printf 'Chain GenAI wheel replaces the locked onnxruntime-genai: %s\\n' \"${_genai_wheel##*/}\"\n    uv pip install --no-deps --force-reinstall \"${_genai_wheel}\"\n",
  "test": "bash linux/scripts/tests/test-ort-venv-census.sh",
  "why": "an install before the exact uv sync is removed by it and installed again by reconcile_local_wheels: the CON52 detour"
 },
 {
  "id": "wheels.chain-gate-called",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  enforce_torch_version_pins\n  assert_chain_wheels_installed\n",
  "replace": "  enforce_torch_version_pins\n",
  "test": "bash linux/scripts/tests/test-chain-wheels-installed.sh",
  "why": "without the gate a lock's PyPI build in place of a chain wheel ships green"
 },
 {
  "id": "wheels.chain-url-exact",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "    if url == want:",
  "replace": "    if url.startswith(f\"file://{store}/\"):",
  "test": "bash linux/scripts/tests/test-chain-wheels-installed.sh",
  "why": "another file in the same store (an older chain's wheel) is not the staged one"
 },
 {
  "id": "wheels.chain-fatal",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "sys.exit(1 if bad else 0)",
  "replace": "sys.exit(0)",
  "test": "bash linux/scripts/tests/test-chain-wheels-installed.sh",
  "why": "a FAIL line that does not stop the build is the old silent shadowing"
 },
 {
  "id": "wheels.chain-iree-exempt-riscv64-only",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "      iree|iree-compiler|iree-runtime) [ \"$(uname -m)\" = \"riscv64\" ] && continue ;;",
  "replace": "      iree|iree-compiler|iree-runtime) continue ;;",
  "test": "bash linux/scripts/tests/test-chain-wheels-installed.sh",
  "why": "IREE's install is fatal off riscv64, so the lock's PyPI IREE there must fail the gate"
 },
 {
  "id": "wheels.chain-sync-installs-nothing",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  uv sync \"${_sync_args[@]}\" || echo \"WARNING: uv sync after lock regeneration had issues; reconcile_local_wheels installs the chain wheels next\"\n",
  "replace": "  uv sync \"${_sync_args[@]}\" || echo \"WARNING: uv sync after lock regeneration had issues; reconcile_local_wheels installs the chain wheels next\"\n  uv pip install --no-deps --force-reinstall /opt/wheels/*.whl || true\n",
  "test": "bash linux/scripts/tests/test-chain-wheels-installed.sh",
  "why": "reconcile_local_wheels is the one install point; a second one in the fallback is the detour again"
 },
 {
  "id": "rust.native-toolchain-triple",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "compgen -G \"${RUSTUP_HOME}/toolchains/*-${triple}\" >/dev/null",
  "replace": "compgen -G \"${RUSTUP_HOME}/toolchains/*\" >/dev/null",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "accepting ANY toolchain dir is the 2026-09-01 ship: the builder's x86_64 rustup passes as native on arm64/riscv64 (2 GB of exit-127 binaries at the front of PATH)"
 },
 {
  "id": "rust.smoke-host-triple",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "elif ! printf '%s\\n' \"${out}\" | grep -qF -- \"-${triple}\"; then",
  "replace": "elif false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "without the host-triple read the smoke is the ADV/HAVE table again: a rustc that happens to run (QEMU host binaries, a future amd64 loader in the image) passes as native"
 },
 {
  "id": "flutter.bootstrap-hard-fail",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "        echo \"ERROR: flutter --version failed while bootstrapping the ${arch} Dart SDK; the shipped Flutter would be unusable\" >&2\n        return 1",
  "replace": "        echo \"ERROR: flutter --version failed while bootstrapping the ${arch} Dart SDK; the shipped Flutter would be unusable\" >&2\n        return 0",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "the sdk stage's best-effort `flutter --version` WARNING is how both shipped images carried a 716 MB SDK with an empty bin/cache for months; a bootstrap that cannot fail the stage is that WARNING again"
 },
 {
  "id": "flutter.bootstrap-cache-handover",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    hand_root_created_paths_to_runtime_user /opt/flutter",
  "replace": "    chown -R \"${RUNTIME_UID:?}:${RUNTIME_UID}\" /opt/flutter/bin/cache",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "root leaves more behind than bin/cache -- the git fetch and the flutter_tools pub get run as root too; handing over only the cache IS the 2026-09-04 image, whose root-owned .dart_tool broke flutter pub get for every consumer, unfixably from inside a read-only overlay layer"
 },
 {
  "id": "flutter.smoke-offline",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "out=\"$(_rt_run_optional --network none bash -lc 'flutter --suppress-analytics --version",
  "replace": "out=\"$(_rt_run_optional bash -lc 'flutter --suppress-analytics --version",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "online, a bare SDK bootstraps itself during the smoke and passes; the shipped property is that it works without a network"
 },
 {
  "id": "flutter.smoke-dart-arch",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "elif ! printf '%s\\n' \"${out}\" | grep -qF \"${machine}\"; then",
  "replace": "elif false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "an x86-64 Dart SDK in the arm64 image executes natively on this host, so running flutter proves nothing about the arch; only the ELF machine does"
 },
 {
  "id": "sccache.retry-once",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "  sccache \"$@\" 2>\"${_err}\" 9>&-\n  _rc2=$?",
  "replace": "  _rc2=1  # retry removed",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "Transient cache failures must be retried once while the server cannot hold the compile slot."
 },
 {
  "id": "artifact-parity.completeness-check",
  "target": "linux/scripts/verify-artifact-copy-parity.sh",
  "find": "  check_completeness \"${pairs}\"",
  "replace": "  : # completeness check disabled",
  "test": "bash linux/scripts/tests/test-artifact-copy-completeness.sh",
  "why": "without the completeness check a built-but-not-copied artifact (Flutter 2026-09-03) ships as missing and nothing notices"
 },
 {
  "id": "doc-links.code-pointers",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "    n_pointers = check_code_pointers(docs, findings)\n",
  "replace": "    n_pointers = 0  # code pointers unchecked\n",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "286 docs/ pointers live in CODE; without this pass a moved page or renamed heading leaves them dangling and nothing notices (6 were on 2026-09-03)"
 },
 {
  "id": "doc-links.consumer-gitlink-skip",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "                and (REPO_ROOT / rel).is_file()]  # a nested submodule is a gitlink: a directory\n",
  "replace": "                ]\n",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "a submodule below a consumer's top level is a gitlink in git ls-files; reading it as a file crashed the gate on DocumANTation (2026-10-19)"
 },
 {
  "id": "doc-links.local-section-ref-unchecked",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "            if m.group(\"sec\") in have:\n                continue",
  "replace": "            if True:\n                continue",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "a bare (\u00a7 1a) pointing at no section must be caught, not merely counted"
 },
 {
  "id": "doc-links.git-free-floor",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "        return _static_ignores(paths)\n    asked = {line.strip() for line in proc.stdout.splitlines() if line.strip()}",
  "replace": "        return set()\n    asked = {line.strip() for line in proc.stdout.splitlines() if line.strip()}",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "without git the gate must skip the same paths, or it lints model output and kills its own mutation entries"
 },
 {
  "id": "doc-links.tracked-output-floor",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "    return asked | _static_ignores(paths)",
  "replace": "    return asked",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "git check-ignore never reports a TRACKED file and .gitignore re-admits dated run dirs, so trusting git alone puts 66 model-output files back in the scan -- which is how 28280c43 turned the gate red"
 },
 {
  "id": "gate-registry.new-unproven",
  "target": "linux/scripts/quality_allow.py",
  "find": "    if new:\n        rc = 1",
  "replace": "    if new:\n        rc = 0",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a NEW unproven slug must fail, not just be listed (two-way rule, NEW half)"
 },
 {
  "id": "gate-registry.stale-frozen",
  "target": "linux/scripts/quality_allow.py",
  "find": "    if stale:\n        rc = 1",
  "replace": "    if stale:\n        rc = 0",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a frozen slug that gained a proof must fail as STALE so the list only ratchets down"
 },
 {
  "id": "gate-registry.registry-stale",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    if current != text:\n        rc = 1",
  "replace": "    if current != text:\n        rc = 0",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a stale docs/code-quality-gates.md must fail the gate, not just print"
 },
 {
  "id": "gate-registry.basename-is-the-contract",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "        suite_names = [t for t, txt in tests.items() if mentions(needle, txt)]",
  "replace": "        suite_names = []",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a suite naming the script basename (or the inline function) is the test-proof; without the scan every slug is unproven"
 },
 {
  "id": "gate-registry.basename-boundary",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "NEEDLE = r\"(?<![\\w.-])%s\\b\"",
  "replace": "NEEDLE = r\"%s\"",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "the needle is a bounded word, not a substring: a suite naming not-delta.sh must not prove delta.sh"
 },
 {
  "id": "gate-registry.inline-needle",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "        return rel, (start, count), word",
  "replace": "        return rel, (start, count), os.path.basename(rel)",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "an inline gate is keyed by its function name; keying it by the host file lets any suite that says preflight.sh prove it"
 },
 {
  "id": "gate-registry.script-tie-break",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "        pick = [s for s in sites if s[0] == preflight_rel] or \\\n               [s for s in sites if s[0] in cmd] or sorted(sites)",
  "replace": "        pick = sorted(sites)",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a shell function defined in several files resolves to preflight.sh, else to the file the run_check command names -- not to whichever sorts first"
 },
 {
  "id": "gate-registry.imported-module-mutations",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    return [rel] + imported_modules(rel, text)",
  "replace": "    return [rel]",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a mutation on an imported sibling module can prove the importer, so the import scan must feed the attribution"
 },
 {
  "id": "gate-registry.fallback-dropped",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "if \"MISSING\" not in e[3]]",
  "replace": "if \"MISSING\" in e[3]]",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "the [ -f ] MISSING fallback line must never be taken for the real gate"
 },
 {
  "id": "gate-registry.inline-extent",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    if extent is None:\n        return text",
  "replace": "    if True:\n        return text",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "an inline gate's allow/import scan is confined to its function body, not the whole preflight.sh"
 },
 {
  "id": "gate-registry.hook-tier",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    if slug in fast:\n        return \"hook+CI\"",
  "replace": "    if False:\n        return \"hook+CI\"",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "the hook tier column is read from the pre-commit _FAST_SLUGS string, continuation lines included"
 },
 {
  "id": "gate-registry.by-construction",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    if row[\"slug\"] in BY_CONSTRUCTION:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "script-tests and mutations ARE the proof machinery; they must read 'by construction', never UNPROVEN"
 },
 {
  "id": "crlf-guard.pattern-neutered",
  "target": "linux/scripts/verify-shell-eol.sh",
  "find": "if (c[n] == p \"crlf\" || c[n] == p \"mixed\" || c[n] == p \"-text\")",
  "replace": "if (c[n] == \"never-matches\")",
  "test": "bash linux/scripts/tests/test-crlf-guard.sh",
  "why": "the CRLF guard must actually select CR-bearing rows: neutering the awk condition makes every dirty working tree look clean"
 },
 {
  "id": "code-complexity.new-offender",
  "target": "linux/scripts/quality_allow.py",
  "find": "        if was is None:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "an unfrozen knot must fail"
 },
 {
  "id": "code-complexity.growth",
  "target": "linux/scripts/quality_allow.py",
  "find": "        elif count > was:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "complexity growth past the frozen number must fail"
 },
 {
  "id": "code-complexity.unrecorded-shrink",
  "target": "linux/scripts/quality_allow.py",
  "find": "        elif count < was:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "an untangled function must be recorded"
 },
 {
  "id": "code-complexity.stale-freeze",
  "target": "linux/scripts/quality_allow.py",
  "find": "        if key not in seen:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a freeze must not outlive its knot"
 },
 {
  "id": "code-complexity.heredoc-skip",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    elif c == \"<\" and \"arith\" not in stack:",
  "replace": "    elif False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "Python inside a heredoc must not count"
 },
 {
  "id": "code-complexity.here-string",
  "target": "linux/scripts/verify_code_size.py",
  "find": "(?<!<)<<-?",
  "replace": "<<-?",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "<<< is a here-string, not a heredoc that swallows the function"
 },
 {
  "id": "code-complexity.quotes-blanked",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if c in QUOTE:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "'a || b' is text, not a path"
 },
 {
  "id": "code-complexity.quote-state-per-line",
  "target": "linux/scripts/verify_code_size.py",
  "find": "        code, docs = strip_line(line, stack, comments)",
  "replace": "        code, docs = strip_line(line, [], comments)",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a multi-line awk program is one string, not shell"
 },
 {
  "id": "code-complexity.subst-in-quotes",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    elif top == \"dq\" and line.startswith(\"$(\", i):",
  "replace": "    elif False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "the && inside \"$(a && b)\" is real code"
 },
 {
  "id": "code-complexity.comments-dropped",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if c == \"#\" and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "# a || b is a comment"
 },
 {
  "id": "code-complexity.case-arms",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "        self.cc += tok in BRANCH or arm",
  "replace": "        self.cc += tok in BRANCH",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "every case arm is a path"
 },
 {
  "id": "code-complexity.subst-not-arm",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "            f[1] = \"body\"",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "the ')' of $(...) in an arm body is not another arm"
 },
 {
  "id": "code-complexity.nesting-open",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "        self.depth += (tok in OPEN) - (tok in CLOSE)",
  "replace": "        self.depth += 0",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "blocks must deepen the nesting count"
 },
 {
  "id": "code-complexity.python-ast",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "    for path, rel in scan(\".py\"):",
  "replace": "    for path, rel in scan(\".pyx\"):",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "python functions are in scope"
 },
 {
  "id": "code-complexity.elif-depth",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "            chained = isinstance(child, ast.If) and getattr(n, \"orelse\", None) == [child]",
  "replace": "            chained = False",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "an elif chain is not nesting"
 },
 {
  "id": "code-complexity.metric-split",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "if k[2] == metric}",
  "replace": "if True}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a cc row must not read as a stale nesting row"
 },
 {
  "id": "code-complexity.verdict-kept",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "        rc |= check_counts(metric",
  "replace": "        rc = check_counts(metric",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "the cc verdict must survive the nesting pass"
 },
 {
  "id": "code-complexity.command-position",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "        if tok in KEYWORDS and not self.cmd:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "an unquoted keyword in an argument ('... for cross build') is not a branch"
 },
 {
  "id": "code-complexity.command-position-reset",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "        self.cmd = tok in CMD_OPS or arm or (cmd and tok in CMD_KW)",
  "replace": "        self.cmd = False",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "command position must be re-entered after ;, |, && and a newline"
 },
 {
  "id": "code-complexity.newline-token",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "TOKEN = re.compile(r\"\\n|\\$\\(",
  "replace": "TOKEN = re.compile(r\"\\$\\(",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a line start is a command position, so the tokenizer must see newlines"
 },
 {
  "id": "code-complexity.escaped-dq",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if top == \"dq\" and c == \"\\\\\":",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a \\\" inside \"...\" does not close the string"
 },
 {
  "id": "code-complexity.escaped-code",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if c == \"\\\\\":",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a backslash-escaped quote in code does not open a string"
 },
 {
  "id": "code-complexity.arith-dollar",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if line.startswith(\"$((\", i):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "$(( a << b )) is a shift, not a heredoc that swallows the rest"
 },
 {
  "id": "code-complexity.arith-command",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "(( a << b )) is a shift, not a heredoc that swallows the rest"
 },
 {
  "id": "code-complexity.brace-delimited",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "        if tok == \"}\" and not delimited:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "the '}' of ${x:-$(cmd)} is not a block end"
 },
 {
  "id": "code-complexity.allow-row-metric",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "        if key[2] not in METRICS:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "an allow row naming no known metric must fail, not be ignored"
 },
 {
  "id": "dead-functions.new-dead",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "if not seen[name]]",
  "replace": "if False]",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k root",
  "why": "an unfrozen function nothing names must fail"
 },
 {
  "id": "dead-functions.comment-is-not-a-use",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "return HEAD.sub(\"\", COMMENT.sub(\"\", text))",
  "replace": "return HEAD.sub(\"\", text)",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "a name mentioned only in a comment is still dead"
 },
 {
  "id": "dead-functions.definition-is-not-a-use",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "return HEAD.sub(\"\", COMMENT.sub(\"\", text))",
  "replace": "return COMMENT.sub(\"\", text)",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k defs",
  "why": "its own head, or a second definition, must not count as a call"
 },
 {
  "id": "dead-functions.comment-multiline",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "r\"(?:^|(?<=\\s))#.*$\", re.MULTILINE)",
  "replace": "r\"(?:^|(?<=\\s))#.*$\")",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "without MULTILINE only a comment on the first line is stripped"
 },
 {
  "id": "dead-functions.tab-indented-comment",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "r\"(?:^|(?<=\\s))#.*$\"",
  "replace": "r\"(?:^|(?<= ))#.*$\"",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "a tab-indented comment is a comment; a space-only lookbehind counts it as a use"
 },
 {
  "id": "dead-functions.head-multiline",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "HEAD = re.compile(r\"^\\s*\" + DEF_HEAD, re.MULTILINE)",
  "replace": "HEAD = re.compile(r\"^\\s*\" + DEF_HEAD)",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k defs",
  "why": "without MULTILINE only a definition head at byte 0 is stripped"
 },
 {
  "id": "dead-functions.allow-file-is-not-a-use",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "SKIP_SUFFIXES = (\".md\", \".patch\", \".diff\", \".allow\")",
  "replace": "SKIP_SUFFIXES = (\".md\", \".patch\", \".diff\")",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k defs",
  "why": "a freeze row must not count as a use, or every freeze goes STALE"
 },
 {
  "id": "dead-functions.patch-and-diff-skipped",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "SKIP_SUFFIXES = (\".md\", \".patch\", \".diff\", \".allow\")",
  "replace": "SKIP_SUFFIXES = (\".md\", \".allow\")",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "a patch or diff quotes code, it never runs it"
 },
 {
  "id": "dead-functions.patches-dir-skipped",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "\"__pycache__\", \"patches\",",
  "replace": "\"__pycache__\",",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "vendored upstream source under patches/ is not a caller"
 },
 {
  "id": "dead-functions.pytest-cache-skipped",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "\".pytest_cache\", \".dart_tool\"}",
  "replace": "\".dart_tool\"}",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "a pytest cache records test node ids and would name functions nothing calls"
 },
 {
  "id": "dead-functions.dart-tool-skipped",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "\".pytest_cache\", \".dart_tool\"}",
  "replace": "\".pytest_cache\"}",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "the Flutter tool cache is generated, not source"
 },
 {
  "id": "dead-functions.mutations-manifest-skipped",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "\"docs/scripts/mutations.json\"}",
  "replace": "\"docs/scripts/mutations.json.none\"}",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "a mutation's find/replace text is prose about code, like an .allow row"
 },
 {
  "id": "dead-functions.dist-is-not-corpus",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "\"linux/webserver/dist\"",
  "replace": "\"linux/webserver/dist/none\"",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "a minified web bundle can name anything; letting it count would mask dead functions"
 },
 {
  "id": "dead-functions.dist-skip-is-narrow",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "\"node_modules\",",
  "replace": "\"node_modules\", \"dist\",",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "skipping every dist/ by name would silently drop a future linux/scripts/dist"
 },
 {
  "id": "dead-functions.dockerfile-in-corpus",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "if not fn.endswith(SKIP_SUFFIXES) and _kept(path):",
  "replace": "if not fn.endswith(SKIP_SUFFIXES) and _kept(path) and not fn.startswith(\"Dockerfile\"):",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k defs",
  "why": "a Dockerfile RUN is how stages call helpers; dropping it would flag live code"
 },
 {
  "id": "dead-functions.census-lists-the-masked",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "    return ([key for key in considered if _isolated(key[0], corpus_texts)],",
  "replace": "    return ([],",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "--census is the only pass that sees a function another file's same name masks"
 },
 {
  "id": "dead-functions.census-skips-sourcing-files",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "    if SOURCED.search(corpus_texts.get(rel, \"\")):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "a file that sources a library can be called back into by it"
 },
 {
  "id": "dead-functions.census-skips-named-files",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "    return not any(base in text for other, text in corpus_texts.items() if other != rel)",
  "replace": "    return True",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "a file another file names by basename can be sourced or run from there"
 },
 {
  "id": "dead-functions.host-config-is-a-subject",
  "target": "linux/scripts/verify_code_size.py",
  "find": "SCAN = (\"linux/scripts\", \"linux/host-config\", \"docs/scripts\", \"linux/llm-stack\")",
  "replace": "SCAN = (\"linux/scripts\", \"docs/scripts\", \"linux/llm-stack\")",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k basics",
  "why": "operator tools under linux/host-config are scanned for definitions, not only for calls"
 },
 {
  "id": "code-size.llm-stack-is-a-subject",
  "target": "linux/scripts/verify_code_size.py",
  "find": "SCAN = (\"linux/scripts\", \"linux/host-config\", \"docs/scripts\", \"linux/llm-stack\")",
  "replace": "SCAN = (\"linux/scripts\", \"linux/host-config\", \"docs/scripts\")",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "EX1: linux/llm-stack was outside the scan set until 2026-09-07 -- 43 files and 19,874 lines invisible to every extent gate; dropping it again silently un-freezes 47 reviewed rows"
 },
 {
  "id": "cross-build.429-must-be-anchored",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "|(status|code):? ?429([^0-9]|$)",
  "replace": "|[^0-9]429[^0-9]",
  "test": "bash linux/scripts/tests/test-cross-stage-build-cmd.sh",
  "why": "a bare 429 matches BuildKit's own elapsed-time prefix (#15 429.0), so any step running 429.x seconds makes the NEXT deterministic failure look rate-limited and buys three full stage rebuilds"
 },
 {
  "id": "cross-build.dns-is-transient",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "|could not resolve host|temporary failure in name resolution",
  "replace": "|__never_matches_dns__|temporary failure in name resolution",
  "test": "bash linux/scripts/tests/test-cross-stage-build-cmd.sh",
  "why": "a DNS blip cloning from github killed a whole 3-arch chain at sdk-riscv64 -- the STAGE BARRIER takes every arch down, so one failed lookup costs the run"
 },
 {
  "id": "cross-build.smoke-failure-is-hard",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "  [ -n \"${log_file}\" ] && [ -r \"${log_file}\" ] || return 0\n  tail -n 300",
  "replace": "  [ -n \"${log_file}\" ] && [ -r \"${log_file}\" ] || return 0\n  return 0\n  tail -n 300",
  "test": "bash linux/scripts/tests/test-cross-stage-build-cmd.sh",
  "why": "classifying every failure as transient retries a dead build to the cap; the log tail has to be read, not assumed"
 },
 {
  "id": "dead-functions.stale-freeze",
  "target": "linux/scripts/quality_allow.py",
  "find": "    stale = sorted(frozen - set(keys))",
  "replace": "    stale = []",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k root",
  "why": "a freeze must not outlive its subject"
 },
 {
  "id": "dead-functions.one-liner-is-a-definition",
  "target": "linux/scripts/verify_code_size.py",
  "find": "            if depth == 0:\n",
  "replace": "            if depth == 0 and n > 1:\n",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k defs",
  "why": "a one-line function on a file's last line was never yielded and could not be dead"
 },
 {
  "id": "dead-functions.function-keyword",
  "target": "linux/scripts/verify_code_size.py",
  "find": "DEF = re.compile(\"^\" + DEF_HEAD)",
  "replace": "DEF = re.compile(r\"^()([A-Za-z_][A-Za-z0-9_]*)\\(\\)\\s*\\{\")",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k defs",
  "why": "function name { is a definition too"
 },
 {
  "id": "shellcheck-warnings.verdict-exit",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "        print(\"OK: shellcheck warnings match the baseline exactly\")\n    return rc",
  "replace": "        print(\"OK: shellcheck warnings match the baseline exactly\")\n    return 0",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "a failing four-way verdict must reach the exit code, not just the log"
 },
 {
  "id": "shellcheck-warnings.windows-argument-batches",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "    for batch in shellcheck_batches(shellcheck, files, limit):",
  "replace": "    for batch in (files,):",
  "test": "bash linux/scripts/tests/test-shellcheck-batching.sh",
  "why": "Windows must split long ShellCheck argv while preserving every file and warning result."
 },
 {
  "id": "shellcheck-warnings.level-filter",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "        if c.get(\"level\") != \"warning\" or (only is not None and c[\"file\"] not in only):",
  "replace": "        if (only is not None and c[\"file\"] not in only):",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "only warning-level findings are this gate's business; error-level ones are lint-shell.sh's"
 },
 {
  "id": "shellcheck-warnings.x-follow-sources",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "SHELLCHECK_ARGUMENTS = (\"-x\", \"-f\", \"json1\", \"-S\", \"warning\")",
  "replace": "SHELLCHECK_ARGUMENTS = (\"-f\", \"json1\", \"-S\", \"warning\")",
  "test": "bash linux/scripts/tests/test-shellcheck-batching.sh",
  "why": "every bounded invocation must keep -x so source directives retain the same analysis"
 },
 {
  "id": "shellcheck-warnings.files-count-filter",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "or (only is not None and c[\"file\"] not in only)",
  "replace": "or False",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "--files must report the listed files only, whatever path the tool attributes a finding to"
 },
 {
  "id": "shellcheck-warnings.files-restriction",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "        files = [f for f in in_scope if f in wanted]",
  "replace": "        files = list(in_scope)",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "--files must check only the listed files, or the hook reports other people's files"
 },
 {
  "id": "shellcheck-warnings.files-frozen-scope",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "        frozen = {k: n for k, n in frozen.items() if k[0] in only}",
  "replace": "        frozen = dict(frozen)",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "--files must compare against the listed files' rows only, or every other row reads STALE"
 },
 {
  "id": "shellcheck-warnings.scope-skip-note",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "        skipped = wanted - set(in_scope)",
  "replace": "        skipped = set()",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "a file outside the lint-shell.sh scope must be skipped visibly, not silently"
 },
 {
  "id": "shellcheck-warnings.abs-path-rel",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "    if os.path.isabs(path):\n        return os.path.relpath(path, ROOT)",
  "replace": "    if os.path.isabs(path):\n        return path",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "an absolute --files path must resolve INTO the scope; unresolved it is merely skipped, which reads as a pass"
 },
 {
  "id": "shellcheck-warnings.keep-reason",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "old.get(key, (0, f\"baseline {today}, not yet reviewed\"))[1]",
  "replace": "(0, f\"baseline {today}, not yet reviewed\")[1]",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "--write-baseline must keep a reviewed reason, or every rewrite erases the review"
 },
 {
  "id": "shellcheck-warnings.stamp-date",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "    today = datetime.date.today().isoformat()",
  "replace": "    today = \"2000-01-01\"",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "a frozen row carries the day it was written; the midnight tolerance must not accept any date"
 },
 {
  "id": "shellcheck-warnings.partial-rewrite",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "    keep = {k: v for k, v in old.items() if partial and k[0] not in checked}",
  "replace": "    keep = {}",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "--write-baseline --files must leave unchecked files' rows alone"
 },
 {
  "id": "shellcheck-warnings.list-files-exit2",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "    if proc.returncode != 0:",
  "replace": "    if False:",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "a failing --list-files must be exit 2; an empty scope silently checks nothing and passes"
 },
 {
  "id": "shellcheck-warnings.json-exit2",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "        raise SystemExit(2)\n    for c in comments:",
  "replace": "        return counts\n    for c in comments:",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "shellcheck output that is not json1 must be exit 2, not zero findings"
 },
 {
  "id": "shellcheck-warnings.tool-missing-exit",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "    if proc.returncode != 0 or not out:",
  "replace": "    if False:",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "no usable shellcheck must be exit 2 with a message, not a traceback or a pass"
 },
 {
  "id": "shellcheck-warnings.env-bin-override",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "    override = os.environ.get(\"SHELLCHECK_BIN\")",
  "replace": "    override = None",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "SHELLCHECK_BIN must stay the first-choice override, so a caller can pin the binary the counts were frozen with"
 },
 {
  "id": "shellcheck.list-files-first",
  "target": "linux/scripts/lint-shell.sh",
  "find": "if [ \"${LIST_FILES}\" -eq 1 ]; then",
  "replace": "if [ \"${LIST_FILES}\" -eq 1 ] && [ \"${#CHECK[@]}\" -gt 0 ]; then",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "--list-files output is a file list; falling through to the 'no shell scripts' banner makes an ANSI line a scope entry"
 },
 {
  "id": "code-dupes.shrunk-budget",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "            if n < budget[0]:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "a budget above the measurement must fail and name the new budget"
 },
 {
  "id": "code-dupes.stale-row",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    stale = [k for k in allow if k not in per_file]",
  "replace": "    stale = []",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "a row whose pair is no longer over the threshold must fail as stale"
 },
 {
  "id": "code-dupes.stale-wording",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "} is no longer over the threshold \"",
  "replace": "} no longer overlaps \"",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "a pair still overlapping at or under the threshold must not be reported as no overlap"
 },
 {
  "id": "code-dupes.stale-count",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "{measured.get(k, (0,))[0]} shared",
  "replace": "{0} shared",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "the stale line must print the count measured BEFORE the threshold cut, not zero"
 },
 {
  "id": "code-dupes.bookkeeping-exit",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    return 1 if shrunk or stale else 0",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "printing a shrunk or stale row is not enough; the gate must exit 1"
 },
 {
  "id": "code-dupes.bookkeeping-before-findings",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    bookkeeping = _print_bookkeeping(shrunk, stale, measured, args.threshold)\n\n    verdict = _finding_verdict(args, findings, bookkeeping, runs, texts, ranked)\n    if verdict is None:",
  "replace": "    verdict = _finding_verdict(args, findings, 0, runs, texts, ranked)\n    if verdict is None:\n        bookkeeping = _print_bookkeeping(shrunk, stale, measured, args.threshold)\n        verdict = (0 if args.report_only else 1) if bookkeeping else None\n    if verdict is None:",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "one run must show every bookkeeping error, not hide them behind the first new finding"
 },
 {
  "id": "code-dupes.duplicate-row",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "        if key in allow:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "two rows for one unordered pair must exit 2 naming both, never silently last-wins"
 },
 {
  "id": "code-dupes.kind-scopes-allow",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "             if all(file_kind(Path(f).name) in kinds for f in k)}",
  "replace": "             if True}",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "--kind must not call every other kind's row stale"
 },
 {
  "id": "code-dupes.baseline-keeps-reason",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "{allow.get(key, (0, fresh))[1]}",
  "replace": "{fresh}",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "--baseline must carry an existing row's reason over verbatim"
 },
 {
  "id": "env-knobs.stale-detected",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "LC_ALL=C comm -13 \"${_tmp}/consumed\" \"${_tmp}/own_allow\" > \"${_tmp}/stale\"",
  "replace": ": > \"${_tmp}/stale\"",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "an allow row whose knob is consumed nowhere must be found"
 },
 {
  "id": "env-knobs.stale-fails",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  rc=1\n",
  "replace": "  rc=0\n",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a stale row must fail the gate, not just print"
 },
 {
  "id": "env-knobs.stale-regardless-of-gate",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  fi\n  exit \"${rc}\"\nfi",
  "replace": "  fi\n  exit 0\nfi",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "stale is a bookkeeping error: it fails even when every knob is owned and KNOB_GATE is off"
 },
 {
  "id": "env-knobs.ok-line-withheld",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  if [ \"${rc}\" -eq 0 ]; then\n    echo \"  OK: every consumed knob has an owner",
  "replace": "  if [ \"${rc}\" -ge 0 ]; then\n    echo \"  OK: every consumed knob has an owner",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a run that FAILED on a stale row must not also print the all-clear line"
 },
 {
  "id": "env-knobs.comment-line-not-consumer",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "(out == \"\" || substr(out, length(out), 1) ~ /[ \\t]/)",
  "replace": "(substr(out, length(out), 1) ~ /[ \\t]/)",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "prose naming a knob on a full-line comment is not a reader, so it must not keep a dead row alive"
 },
 {
  "id": "env-knobs.trailing-comment-not-consumer",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  | awk -v MODE=prefix \"${_KNOB_AWK}\" \\\n",
  "replace": "  | cat \\\n",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a knob named only in a trailing comment is not a reader either"
 },
 {
  "id": "mutations.isolated-copy",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        args.root = workspace",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k heavy",
  "why": "the throwaway copy must be the tree that gets mutated; pointing the run back at --root writes into a directory buildkit may be reading as a build context"
 },
 {
  "id": "mutations.in-place-is-opt-in",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    elif args.in_place:",
  "replace": "    elif False:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k gitbash",
  "why": "--in-place is the documented opt-out the gate's own fixtures need; silently ignoring it turns every absolute-path fixture into a false SURVIVED"
 },
 {
  "id": "mutations.workspace-cleanup",
  "target": "docs/scripts/mutation_workspace.py",
  "find": "            for root in roots:\n                shutil.rmtree(root, ignore_errors=True)",
  "replace": "            for root in roots:\n                pass",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k copies",
  "why": "one leaked ~130MB copy per invocation, and the gate runs from a pre-commit hook"
 },
 {
  "id": "crlf-guard.mixed-blind",
  "target": "linux/scripts/verify-shell-eol.sh",
  "find": "c[n] == p \"crlf\" || c[n] == p \"mixed\" || c[n] == p \"-text\"",
  "replace": "c[n] == p \"crlf\" || c[n] == p \"-text\"",
  "test": "bash linux/scripts/tests/test-crlf-guard.sh",
  "why": "git says w/crlf only when EVERY line ends CRLF; a file an editor or merge half-rewrote is w/mixed, the realistic accident that produces \"$'\\r': command not found\" in the containers"
 },
 {
  "id": "crlf-guard.lone-cr-blind",
  "target": "linux/scripts/verify-shell-eol.sh",
  "find": "|| c[n] == p \"-text\"",
  "replace": "|| c[n] == \"never-emitted\"",
  "test": "bash linux/scripts/tests/test-crlf-guard.sh",
  "why": "a bare CR (no LF after it) makes git report w/-text, not w/crlf; it breaks bash the same way and no tracked *.sh is legitimately binary"
 },
 {
  "id": "crlf-guard.index-column",
  "target": "linux/scripts/verify-shell-eol.sh",
  "find": "root=\".\" column=\"w\" field=2 staged=0",
  "replace": "root=\".\" column=\"i\" field=1 staged=0",
  "test": "bash linux/scripts/tests/test-crlf-guard.sh",
  "why": "buildkit snapshots the WORKING TREE, so only git's w/ column decides; reading i/ turns a CRLF-in-index/LF-on-disk file into a false positive and misses the real one"
 },
 {
  "id": "comment-size.verdict-discarded",
  "target": "linux/scripts/verify_comment_size.py",
  "find": "    return rc",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-prevention-gates.sh",
  "why": "an oversized block that is only PRINTED is not a gate; the verdict must reach preflight"
 },
 {
  "id": "comment-size.limit-not-enforced",
  "target": "linux/scripts/verify_comment_size.py",
  "find": "        if n > LIMIT:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-prevention-gates.sh",
  "why": "a block that ends at a code line is the common shape; stop collecting it and the gate sees nothing"
 },
 {
  "id": "comment-size.every-language-is-a-subject",
  "target": "linux/scripts/verify_comment_size.py",
  "find": "PATTERNS = [\"*\" + e for e in sorted(HASH | SLASH)] + [\"*\" + n + \"*\" for n in HASH_NAMES]",
  "replace": "PATTERNS = [\"*.sh\"]",
  "test": "bash linux/scripts/tests/test-prevention-gates.sh",
  "why": "the rule covers every language; a scan narrowed back to shell leaves PowerShell, Python and C-family comments ungated in silence"
 },
 {
  "id": "comment-size.heredoc-is-data",
  "target": "linux/scripts/verify_comment_size.py",
  "find": "            end = _heredoc_word(line)",
  "replace": "            end = None",
  "test": "bash linux/scripts/tests/test-prevention-gates.sh",
  "why": "a heredoc body is data another program reads; counting its # lines would demand edits to generated files"
 },
 {
  "id": "masked-decls.verdict-discarded",
  "target": "linux/scripts/verify_masked_assignments.py",
  "find": "    return rc",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-prevention-gates.sh",
  "why": "a masked declaration that is only PRINTED is not a gate; the verdict must reach preflight"
 },
 {
  "id": "masked-decls.substitution-required",
  "target": "linux/scripts/verify_masked_assignments.py",
  "find": "            if m and SUBST.search(code):",
  "replace": "            if m:",
  "test": "bash linux/scripts/tests/test-prevention-gates.sh",
  "why": "`local x` with no command substitution masks nothing; flagging it would make the split fix itself an offence"
 },
 {
  "id": "python-lint.gate-tier-neutered",
  "target": "linux/scripts/lint-python.sh",
  "find": "if ! _ruff_check --quiet --select \"${selector}\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "the shared gate tier must still reject an undefined name on every invocation"
 },
 {
  "id": "python-lint.ruff-last-batch-dropped",
  "target": "linux/scripts/lint-python.sh",
  "find": "for ((i = 0; i < ${#PY_FILES[@]}; i += 64)); do",
  "replace": "for ((i = 0; i + 64 < ${#PY_FILES[@]}; i += 64)); do",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "the files past the last full batch must still reach Ruff"
 },
 {
  "id": "python-lint.ruff-batch-verdict-overwritten",
  "target": "linux/scripts/lint-python.sh",
  "find": "\"${RUFF[@]}\" check \"$@\" \"${PY_FILES[@]:i:64}\" >> \"${_RUFF_OUT}\" 2>&1 || rc=1",
  "replace": "\"${RUFF[@]}\" check \"$@\" \"${PY_FILES[@]:i:64}\" >> \"${_RUFF_OUT}\" 2>&1 && rc=0 || rc=1",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "a clean later batch must not clear an earlier batch's finding"
 },
 {
  "id": "python-lint.ruff-unbatched",
  "target": "linux/scripts/lint-python.sh",
  "find": "\"${PY_FILES[@]:i:64}\"",
  "replace": "\"${PY_FILES[@]:i}\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "one Ruff call with every tracked file exceeds Git Bash's argument limit on Windows"
 },
 {
  "id": "python-lint.tier-boundary",
  "target": "linux/scripts/lint-python.sh",
  "find": "GATE_SELECT=\"E9,F63,F7,F82,B012,B023\"",
  "replace": "GATE_SELECT=\"E9,F63,F7,F82,B012,B023,F401\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "the adoption ramp must stay advisory: promoting a style code into the gate tier turns a passing tree red"
 },
 {
  "id": "python-lint.exception-return-required",
  "target": "linux/scripts/lint-python.sh",
  "find": "GATE_SELECT=\"E9,F63,F7,F82,B012,B023\"",
  "replace": "GATE_SELECT=\"E9,F63,F7,F82,B023\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "the lint tier must reject a return in finally that hides an exception"
 },
 {
  "id": "python-lint.loop-closure-required",
  "target": "linux/scripts/lint-python.sh",
  "find": "GATE_SELECT=\"E9,F63,F7,F82,B012,B023\"",
  "replace": "GATE_SELECT=\"E9,F63,F7,F82,B012\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "the lint tier must reject late-bound closures in plain and embedded Python"
 },
 {
  "id": "env-knobs.owner-trailing-comment",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "out == \"\" || substr(out, length(out), 1) ~ /[ \\t]/",
  "replace": "out == \"\"",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "the trailing '#' strip must cut, not merely trim whitespace, or a ' # ${NAME:-}' still counts as a reader"
 },
 {
  "id": "env-knobs.private-prefix-not-a-knob",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "'\\$\\{[A-Z][A-Z0-9_]{2,}:-'",
  "replace": "'\\$\\{[A-Z_][A-Z0-9_]{2,}:-'",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "the extraction regex is what bars _-prefixed privates from the census; the loose selector does not"
 },
 {
  "id": "env-knobs.escaped-literal-not-reader",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  | sed -E 's/\\\\\\$/\\\\/g' \\\n",
  "replace": "  | cat \\\n",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a backslash-escaped \\${NAME:-} is literal output text; counting it as a reader keeps a dead allow row alive"
 },
 {
  "id": "gate-registry.mutation-id-prefix",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    return [e[\"id\"] for e in entries if id_slug(e) == slug\n            and (e[\"target\"] in files or calls_the_gate(e, script, files, tests))]",
  "replace": "    return [e[\"id\"] for e in entries\n            if (e[\"target\"] in files or calls_the_gate(e, script, files, tests))]",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "Without the id-prefix key every gate sharing a file (an imported sibling module above all) inherits its neighbours' mutations, the circular credit that gave code-size 7 foreign proofs."
 },
 {
  "id": "gate-registry.mutation-target-scope",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "id_slug(e) == slug\n            and (e[\"target\"] in files or calls_the_gate(e, script, files, tests))]",
  "replace": "id_slug(e) == slug]",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "The id prefix alone is a claim; the target is the evidence. Without it a typo'd prefix would prove a gate whose code the mutation never touches."
 },
 {
  "id": "gate-registry.off-convention-loud",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    if target in files:\n        return f\"prefix names no preflight slug, and {target} is {holds}\"",
  "replace": "    if False:\n        return \"prefix names no preflight slug, and %s is %s\" % (target, holds)",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "an id pinning a gate's own file under a non-slug prefix must be renamed to that gate, not filed away as a descriptive family where the gate loses the proof"
 },
 {
  "id": "gate-registry.hook-scoped-tier",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "                        (\"scoped\", \"hook (scoped)+CI\")):",
  "replace": "                        ):",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "_FAST_SLUGS is not the whole hook: four gates run through their own blocks and read CI-only without this, understating what a commit already checks."
 },
 {
  "id": "preflight-slugs.doc-count-stale",
  "target": "linux/scripts/tests/test-preflight-slugs.sh",
  "find": "t_assert_eq \"$(printf '%s\\n' \"${_known}\" | grep -c .)\" \"${_doc_count}\" \"doc slug count vs KNOWN_SLUGS\"",
  "replace": "t_assert_eq \"$(printf '%s\\n' \"${_known}\" | grep -c . | awk '{print $1 + 1}')\" \"${_doc_count}\" \"doc slug count vs KNOWN_SLUGS\"",
  "test": "bash linux/scripts/tests/test-preflight-slugs.sh",
  "why": "the doc's self-declared slug count is COMPARED against KNOWN_SLUGS, not merely parsed out of the page"
 },
 {
  "id": "preflight-slugs.doc-lines-stale",
  "target": "linux/scripts/tests/test-preflight-slugs.sh",
  "find": "_arr_last=\"$(awk -v s=\"${_arr_first}\" 'NR>=s && /\\)$/ {print NR; exit}' \"${PREFLIGHT}\")\"",
  "replace": "_arr_last=\"${_arr_first}\"",
  "test": "bash linux/scripts/tests/test-preflight-slugs.sh",
  "why": "a quoted line span rots on the next edit of preflight.sh unless the doc is checked against where the array really is"
 },
 {
  "id": "preflight-slugs.doc-row-missing",
  "target": "docs/cross-build-verification.md",
  "find": "| `gate-registry` | `verify_gate_registry.py`",
  "replace": "| `gate-registryX` | `verify_gate_registry.py`",
  "test": "bash linux/scripts/tests/test-preflight-slugs.sh",
  "why": "a slug with no row in the doc table, or a row naming no slug, must fail"
 },
 {
  "id": "pre-commit.bare-shellcheck",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "\"${_sc_bin}\" -S error ${_staged_sh} || {",
  "replace": "shellcheck -S error ${_staged_sh} || {",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "the hook must use lint-shell.sh's pinned binary, not whatever PATH has"
 },
 {
  "id": "code-complexity.cmd-op-newline",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a newline must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-semicolon",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a ; must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-arm-end",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a ;; must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-arm-fallthrough",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";;\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a ;& must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-arm-retry",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a ;;& must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-andand",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "an && must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-oror",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "an || must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-pipe",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"&\", \"(\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a | must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-background",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"(\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "an & must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-subshell",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"$(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a ( must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-substitution",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"{\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a $( must put the next word in command position"
 },
 {
  "id": "code-complexity.cmd-op-brace-group",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\", \"{\"}",
  "replace": "CMD_OPS = {\"\\n\", \";\", \";;\", \";&\", \";;&\", \"&&\", \"||\", \"|\", \"&\", \"(\", \"$(\"}",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a { must put the next word in command position"
 },
 {
  "id": "code-complexity.arith-after-space",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \"\\t;(|&\"):",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "`((` after a space is arithmetic, so its << is not a heredoc"
 },
 {
  "id": "code-complexity.arith-after-tab",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" ;(|&\"):",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "`((` after a tab is arithmetic, so its << is not a heredoc"
 },
 {
  "id": "code-complexity.arith-after-semicolon",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t(|&\"):",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "`((` after a ; is arithmetic, so its << is not a heredoc"
 },
 {
  "id": "code-complexity.arith-after-paren",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;|&\"):",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "`((` after a ( is arithmetic, so its << is not a heredoc"
 },
 {
  "id": "code-complexity.arith-after-pipe",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(&\"):",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "`((` after a | is arithmetic, so its << is not a heredoc"
 },
 {
  "id": "code-complexity.arith-after-amp",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(|\"):",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "`((` after an & is arithmetic, so its << is not a heredoc"
 },
 {
  "id": "env-knobs.owner-quoted-text",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "    if (c == \"\\\"\") { top++; S[top] = \"dq\"; continue }",
  "replace": "    if (c == \"\\\"\") { continue }",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "text inside a double-quoted string is not code: an echo that spells NAME=value owns nothing"
 },
 {
  "id": "env-knobs.owner-command-position",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "function cmdpos(pre,   w) {\n  sub(/[ \\t]+$/, \"\", pre)",
  "replace": "function cmdpos(pre,   w) {\n  return 1\n  sub(/[ \\t]+$/, \"\", pre)",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "an assignment-shaped ARGUMENT is not an assignment: only command position owns"
 },
 {
  "id": "env-knobs.owner-comment-text",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "    if (c == \"#\" && (out == \"\" || substr(out, length(out), 1) ~ /[ \\t]/)) break",
  "replace": "    if (0) break",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a comment is not code: prose spelling `export NAME=1` must not own NAME"
 },
 {
  "id": "env-knobs.owner-heredoc-body",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  if (nhd > 0) { t = $0; if (hdtab[1]) sub(/^\\t+/, \"\", t); if (t == hdend[1]) hdpop(); next }",
  "replace": "  if (nhd > 0) { nhd = 0 }",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a NAME=value line in a heredoc body is emitted data, not this script's own assignment"
 },
 {
  "id": "env-knobs.owner-substitution-in-quotes",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "      else if (c == \"$\" && substr($0, i + 1, 1) == \"(\") { top++; S[top] = \"code\"; P[top] = 0; out = out \"$(\"; i++ }",
  "replace": "      else if (c == \"$\" && substr($0, i + 1, 1) == \"(\") { i++ }",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "$( ) inside a double-quoted word is code again, so an assignment there still owns"
 },
 {
  "id": "env-knobs.owner-keyword-prefix",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  if (w ~ /^(then|else|elif|do|if|while|until|export|local|declare|readonly|typeset|env|time|!)$/) return 1",
  "replace": "  if (w ~ /^(then|else|elif|do|if|while|until|env|time|!)$/) return 1",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "export/local/readonly/declare open command position, so the assignment after them owns"
 },
 {
  "id": "env-knobs.owner-env-prefix-chain",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "    pos = q + l",
  "replace": "    out = substr(out, q + l); pos = 1",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "cmdpos must see the whole line prefix, or only the FIRST name of an env-prefix chain owns"
 },
 {
  "id": "env-knobs.owner-case-arm",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  if (pre ~ /[;&|(){]$/) return 1",
  "replace": "  if (pre ~ /[;&|({]$/) return 1",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a case arm's ) opens command position, so an assignment in the arm owns"
 },
 {
  "id": "env-knobs.owner-expansion-guard",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "    if (prev !~ /[A-Za-z0-9_{]/ && cmdpos(substr(out, 1, q - 1))) print substr(out, q, l - 1)",
  "replace": "    if (prev !~ /[A-Za-z0-9_]/ && cmdpos(substr(out, 1, q - 1))) print substr(out, q, l - 1)",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a parameter expansion's own = is not an assignment: ${VAR=x} must not own"
 },
 {
  "id": "env-knobs.heredoc-quoted-delimiter",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  if (qc == SQ || qc == \"\\\"\") { j++; while (j <= length($0) && substr($0, j, 1) != qc) { d = d substr($0, j, 1); j++ }; j++ }",
  "replace": "  if (0) { j++ }",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a heredoc must be recognised BEFORE quote state eats its delimiter, or the usage text inside <<'EOT' owns knobs again"
 },
 {
  "id": "env-knobs.heredoc-tab-terminator",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "if (hdtab[1]) sub(/^\\t+/, \"\", t);",
  "replace": "if (0) sub(/^\\t+/, \"\", t);",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "<<- indents its terminator; without the tab strip the heredoc never ends and eats the rest of the file"
 },
 {
  "id": "env-knobs.heredoc-queue",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "function hdpop(   k) { for (k = 1; k < nhd; k++) { hdend[k] = hdend[k + 1]; hdtab[k] = hdtab[k + 1] } nhd-- }",
  "replace": "function hdpop(   k) { nhd = 0 }",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "two heredocs opened on one line end one at a time; popping both makes the second body code"
 },
 {
  "id": "env-knobs.heredoc-not-herestring",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  if (d == \"\") { nhd--; out = out \"<<\"; return i + 1 }",
  "replace": "  if (d == \"\") { nhd--; out = out \"<\"; return i }",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a <<< here-string must not re-enter as a heredoc opened at its second <, which would swallow the rest of the file"
 },
 {
  "id": "env-knobs.owner-chain-walks-back",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  if (w !~ /^[A-Za-z_][A-Za-z0-9_]*=/) return 0\n  return cmdpos(substr(pre, 1, length(pre) - length(w)))",
  "replace": "  return (w ~ /^[A-Za-z_][A-Za-z0-9_]*=/)",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "the prefix is walked back over preceding assignments: a word after a command name stays an argument even when it is assignment-shaped"
 },
 {
  "id": "env-knobs.owner-single-quoted-text",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "    if (c == SQ) { top++; S[top] = \"sq\"; continue }",
  "replace": "    if (c == SQ) { continue }",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "text inside single quotes is not code: a continued usage line spelling NAME=value owns nothing"
 },
 {
  "id": "crlf-guard.scope-sh-suffix-only",
  "target": "linux/scripts/verify-shell-eol.sh",
  "find": "  \"${list[@]}\" 2>/dev/null \\\n    | xargs -0r bash \"${_EOL_DIR}/lint-shell.sh\" --list-files 2>/dev/null \\\n    | tr '\\n' '\\0' \\\n    | xargs -0r git ls-files --eol -- 2>/dev/null \\\n",
  "replace": "  git ls-files --eol -- '*.sh' 2>/dev/null \\\n",
  "test": "bash linux/scripts/tests/test-crlf-guard.sh",
  "why": "a *.sh pathspec cannot see an extension-less script on a shell shebang, so the commit hook that runs this very gate was outside it while the neighbouring shellcheck gate covered it"
 },
 {
  "id": "crlf-guard.scope-not-classified",
  "target": "linux/scripts/verify-shell-eol.sh",
  "find": "xargs -0r bash \"${_EOL_DIR}/lint-shell.sh\" --list-files 2>/dev/null",
  "replace": "xargs -0r printf '%s\\n' 2>/dev/null",
  "test": "bash linux/scripts/tests/test-crlf-guard.sh",
  "why": "the scope must be lint-shell.sh's answer to 'what is a shell script'; taking every tracked path instead turns CR in prose, patches and fixtures into gate failures"
 },
 {
  "id": "crlf-guard.pipefail-pin",
  "target": "linux/scripts/verify-shell-eol.sh",
  "find": "set -uo pipefail",
  "replace": "set -u",
  "test": "bash linux/scripts/tests/test-crlf-guard.sh",
  "why": "__git-ls-files-FAILED__ is reachable only because a failing stage fails the pipeline; without pipefail awk's zero is the verdict and a broken git or a missing lint-shell.sh reads as a clean tree"
 },
 {
  "id": "crlf-guard.staged-reads-index",
  "target": "linux/scripts/verify-shell-eol.sh",
  "find": "    --staged) staged=1 column=\"i\" field=1 ;;",
  "replace": "    --staged) staged=1 ;;",
  "test": "bash linux/scripts/tests/test-crlf-guard.sh",
  "why": "the commit carries the index's bytes; a staged CR with LF on disk must stop the commit, which the w/ column never sees"
 },
 {
  "id": "python-lint.embedded-extraction-off",
  "target": "linux/scripts/lint-python.sh",
  "find": "  ${_LINT_PY} linux/scripts/extract_embedded_python.py \"${_EMB_DIR}\" \"$@\" >> \"${_EMB_MAP}\"",
  "replace": "  true",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "the extraction call is the only thing putting heredoc Python in front of ruff; switching it off drops ~775 lines out of the gate while every suite stays green"
 },
 {
  "id": "python-lint.embedded-file-discovery",
  "target": "linux/scripts/lint-python.sh",
  "find": "find linux/scripts -name '*.sh' -type f;",
  "replace": "find linux/scripts/01-core -name '*.sh' -type f;",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "the extractor is only as wide as the file list it is handed; narrowing the discovery scope silently un-lints whole directories of embedded Python and nothing said so"
 },
 {
  "id": "python-lint.heredoc-python-decision",
  "target": "linux/scripts/extract_embedded_python.py",
  "find": "        except SyntaxError:\n            continue",
  "replace": "        except SyntaxError:\n            pass",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "the parse check is what keeps non-Python out: without it a cat'ed TPL_PY_* config template is emitted as Python and reddens the gate on a file that was never Python"
 },
 {
  "id": "python-lint.hook-half-of-discovery",
  "target": "linux/scripts/lint-python.sh",
  "find": "; find linux/host-config/git-hooks -type f)",
  "replace": ")",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "a git hook carries no .sh suffix, so it is reachable only through the second half of the extractor's file list; dropping it takes the pre-commit hook's embedded Python out of the gate and every suite stays green"
 },
 {
  "id": "lib.lint-scope-python-root",
  "target": "linux/scripts/01-core/lint-root.sh",
  "find": "_lsb_root=\"${LINT_ROOT_PATH}\"",
  "replace": "_lsb_root=\"$1\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "the root is the only thing that puts a consumer's Python in front of ruff at all; ignoring it grades ANTfrastructure -- which is clean -- and reports OK for 65 files nobody linted"
 },
 {
  "id": "python-lint.consumer-heredoc-extraction",
  "target": "linux/scripts/lint-python.sh",
  "find": "      < <(lint_root_tracked \"${SCAN_ROOT}\" '*.sh')",
  "replace": "      < <(true)",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "heredoc Python is no more visible to ruff in a consumer than it is here; handing the extractor an empty file list under a root is the quiet half-gate, and every suite stays green"
 },
 {
  "id": "python-lint.empty-root-scope-is-an-error",
  "target": "linux/scripts/lint-python.sh",
  "find": "[ \"${#PY_FILES[@]}\" -gt 0 ] || [ \"${#_EMB_SH[@]}\" -gt 0 ] || err \"No Python files found to lint under ${SCAN_ROOT}.\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "ruff with no file arguments lints the CWD, so an empty target set under a root turns into a green verdict about this repo instead of an error about the consumer"
 },
 {
  "id": "lint-gates.consumer-embedded-python-scope",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "_lint_gates_scope embedded-python '*.sh' allow-empty",
  "replace": "_lint_gates_scope embedded-python '*.none' allow-empty",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "a consumer's shell heredocs would never reach Ruff if the aggregator handed it only .py files"
 },
 {
  "id": "python-lint.extractor-failure-fatal",
  "target": "linux/scripts/lint-python.sh",
  "find": "  done\n  _lint_python_extract_batch \"${_EMB_BATCH[@]}\" || err \"Embedded Python extraction failed; refusing a partial lint result\"",
  "replace": "  done\n  _lint_python_extract_batch \"${_EMB_BATCH[@]}\" || true",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "a missing or failing extractor must make the lint verdict fail rather than quietly dropping every embedded block"
 },
 {
  "id": "python-lint.bounded-extractor-batches",
  "target": "linux/scripts/lint-python.sh",
  "find": "    if [ \"${#_EMB_BATCH[@]}\" -ge 32 ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "Git Bash cannot pass a whole tracked shell tree to a Windows Python child in one command line"
 },
 {
  "id": "python-lint.full-extractor-batch-fatal",
  "target": "linux/scripts/lint-python.sh",
  "find": "      _lint_python_extract_batch \"${_EMB_BATCH[@]}\" || err \"Embedded Python extraction failed; refusing a partial lint result\"",
  "replace": "      _lint_python_extract_batch \"${_EMB_BATCH[@]}\" || true",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "a failed full extractor batch must stop before later batches run and return a partial verdict"
 },
 {
  "id": "python-lint.empty-extraction-succeeds",
  "target": "linux/scripts/extract_embedded_python.py",
  "find": "    return 1 if failed else 0",
  "replace": "    return 1",
  "test": "bash linux/scripts/tests/test-embedded-python-extract.sh",
  "why": "a shell tree without Python heredocs is a successful empty extraction, so lint can distinguish it from an unreadable file"
 },
 {
  "id": "python-lint.unreadable-extraction-source-fails",
  "target": "linux/scripts/extract_embedded_python.py",
  "find": "            failed = True",
  "replace": "            failed = False",
  "test": "bash linux/scripts/tests/test-embedded-python-extract.sh",
  "why": "skipping a vanished source silently produces a partial lint result when files change between selection and extraction"
 },
 {
  "id": "mutations.preflight-callsite-isolated",
  "target": "linux/scripts/preflight.sh",
  "find": "docs/scripts/verify_mutations.py",
  "replace": "docs/scripts/verify_mutations.py --in-place",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "preflight points the gate at the repo buildkit reads as a build context; one flag turns every mutation into an in-place edit of that tree"
 },
 {
  "id": "mutations.preflight-runs-the-gate",
  "target": "linux/scripts/preflight.sh",
  "find": "run_check mutations \"mutation gate (can the tests fail?)\" ${PREFLIGHT_PYTHON} docs/scripts/verify_mutations.py",
  "replace": "run_check mutations \"mutation gate (can the tests fail?)\" true",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "the mutations slug must actually invoke the gate, not a stand-in that always passes"
 },
 {
  "id": "mutations.hook-callsite-isolated",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "    ${_PY} docs/scripts/verify_mutations.py \"${_only[@]}\" 2>&1 | tee \"${_mlog}\"",
  "replace": "    ${_PY} docs/scripts/verify_mutations.py --in-place \"${_only[@]}\" 2>&1 | tee \"${_mlog}\"",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "the hook runs on the live working tree; --in-place there mutates files a concurrent build is snapshotting"
 },
 {
  "id": "mutations.hook-runs-the-gate",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "    ${_PY} docs/scripts/verify_mutations.py \"${_only[@]}\" 2>&1 | tee \"${_mlog}\"",
  "replace": "    true 2>&1 | tee \"${_mlog}\"",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "the commit decision must depend on the staged-file run of the gate, not on a stand-in"
 },
 {
  "id": "mutations.find-must-match-once",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if hits > 1:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k twice",
  "why": "a find string matching several places would neuter only the first, leaving the guarantee half-standing and the verdict a false SURVIVED"
 },
 {
  "id": "mutations.copy-preserves-mode",
  "target": "docs/scripts/verify_mutations.py",
  "find": "            shutil.copy2(",
  "replace": "            shutil.copyfile(",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k twice",
  "why": "a copy that drops the executable bit makes every shell test fail for the wrong reason -- a vacuous-bite storm, not a verdict"
 },
 {
  "id": "mutations.copy-does-not-follow-symlinks",
  "target": "docs/scripts/verify_mutations.py",
  "find": "follow_symlinks=False)",
  "replace": "follow_symlinks=True)",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k symlinks",
  "why": "dereferencing pulls whatever a link points at -- a host binary, a device node -- into a copy the pre-commit hook makes once per commit, and turns a path the tests see as a link into a regular file"
 },
 {
  "id": "mutations.symlink-target-refused",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if os.path.islink(target):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k symlinks",
  "why": "the copy holds symlinks, not their contents: writing to one lands on the outside path it points at, which is the one thing the throwaway copy exists to prevent"
 },
 {
  "id": "pre-commit.mutation-cap",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "run = matched[:cap] if cap > 0 else matched",
  "replace": "run = matched",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "without the cap the hook runs every matched entry -- the 5m22s mutation step"
 },
 {
  "id": "pre-commit.sample-is-newest-first",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "matched.reverse()",
  "replace": "matched = list(matched)",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a cut that keeps the OLDEST entries never runs the one just written"
 },
 {
  "id": "pre-commit.sample-says-so",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "  if [ \"$1\" -lt \"$2\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a sampled run printing the full-coverage line is a green for work it did not do"
 },
 {
  "id": "pre-commit.notice-is-printed",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "_mutation_notice \"${_run:-0}\" \"${_matched:-0}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "the SAMPLED notice is the only thing between a green hook and a false claim of full coverage; with the call gone a capped run prints nothing about its own scope"
 },
 {
  "id": "pre-commit.notice-count-is-the-run",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "_mutation_notice \"${_run:-0}\" \"${_matched:-0}\"",
  "replace": "_mutation_notice \"$(( ${_run:-0} + 2 ))\" \"${_matched:-0}\"",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a notice stating a larger sample than the ids actually passed to the gate is worse than no notice -- it reports coverage nobody paid for"
 },
 {
  "id": "pre-commit.uncapped-claims-no-sample",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "_mutation_notice \"${_run:-0}\" \"${_matched:-0}\"",
  "replace": "_mutation_notice \"${_run:-0}\" \"$(( ${_matched:-0} + 1 ))\"",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "an uncapped run that prints SAMPLED sends people to 'make preflight' for coverage the hook already gave them"
 },
 {
  "id": "pre-commit.mutation-failure-aborts",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "      echo \"pre-commit: a recorded mutation SURVIVED -- a test here cannot fail\" >&2\n      exit 1",
  "replace": "      echo \"pre-commit: a recorded mutation SURVIVED -- a test here cannot fail\" >&2\n      exit 0",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a surviving mutation must ABORT the commit, not merely print about it on the way to a green hook"
 },
 {
  "id": "code-complexity.arith-line-start",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if line.startswith(\"((\", i) and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if line.startswith(\"((\", i) and (line[i - 1] in \" \\t;(|&\"):",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "a line that starts with `((` has no delimiter before it, so its << would read as a heredoc"
 },
 {
  "id": "code-complexity.delim-semicolon",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "DELIM = \" \\t\\n;\"",
  "replace": "DELIM = \" \\t\\n\"",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "the `}` of `{ : ;}` is delimited by the ;, so it closes its block instead of reading as ${x}-tail text"
 },
 {
  "id": "gate-registry.wrong-prefix-loud",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "        return f\"{slug} does not own {target} -- {holds}\"",
  "replace": "        return None",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a prefix naming a real slug is a claim of ownership; unchecked, a typo'd or copied prefix silently stops proving anything"
 },
 {
  "id": "gate-registry.hook-whole-tree-tier",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "                        (\"relevant\", \"hook (whole tree, when relevant)+CI\"),",
  "replace": "                        (\"relevant\", \"hook (scoped)+CI\"),",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a conditionally-run WHOLE-TREE gate must not read as scoped to the staged files"
 },
 {
  "id": "gate-registry.hook-block-staged-list",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "            return \"scoped\" if CHANGED in body or mentions(var, body) else \"relevant\"",
  "replace": "            return \"scoped\" if CHANGED in body else \"relevant\"",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a block that expands its guard variable into the gate command IS scoped to the staged files"
 },
 {
  "id": "gate-registry.hook-block-changed",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "            return \"scoped\" if CHANGED in body or mentions(var, body) else \"relevant\"",
  "replace": "            return \"scoped\" if mentions(var, body) else \"relevant\"",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "--changed is the staged list under another name, so the block that passes it is scoped"
 },
 {
  "id": "gate-registry.id-rule-not-gate-scoped",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "        if target in owners[slug] or e[\"id\"] in credited.get(slug, ()):\n            return None",
  "replace": "        if target in owners[slug] or e[\"id\"] in credited.get(slug, ()) or target not in files:\n            return None",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "the rule must judge the id, not the target: scoping it to registered gate files is exactly how a slug prefix over an ordinary build script passed silently"
 },
 {
  "id": "gate-registry.family-must-be-declared",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    rc = check_keys(families, frozen_families,",
  "replace": "    rc = check_keys({k: v for k, v in families.items() if k in frozen_families}, frozen_families,",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "an undeclared prefix is how an invented or misspelled namespace enters; declaring it is what makes the descriptive half of the convention checkable at all"
 },
 {
  "id": "gate-registry.family-not-a-slug-freeze",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    rc = check_keys(unproven, frozen - frozen_ids - frozen_families,",
  "replace": "    rc = check_keys(unproven, frozen - frozen_ids,",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "family declarations share a file with the unproven-slug ratchet; mixed in, every declaration reads as a STALE slug freeze and the census miscounts the debt"
 },
 {
  "id": "shellcheck.crlf-shebang",
  "target": "linux/scripts/lint-shell.sh",
  "find": "| head -n 1 | tr -d '\\r')\" in",
  "replace": "| head -n 1)\" in",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "a wholly-CRLF extension-less script leaves the CR on the shebang, matches no arm, and is invisible to this gate and to crlf-guard, which reads its scope from here"
 },
 {
  "id": "doc-numbers.manifest-total-stale",
  "target": "linux/scripts/tests/test-doc-numbers.sh",
  "find": "return {\"total\": len(entries), \"distinct\": len({e[\"test\"] for e in entries}),",
  "replace": "return {\"total\": len(entries) + 1, \"distinct\": len({e[\"test\"] for e in entries}),",
  "test": "bash linux/scripts/tests/test-doc-numbers.sh",
  "why": "the page's entry total is COMPARED against the manifest, not merely present: a derivation off by one must fail the suite"
 },
 {
  "id": "doc-numbers.distinct-commands-stale",
  "target": "linux/scripts/tests/test-doc-numbers.sh",
  "find": "\"distinct\": len({e[\"test\"] for e in entries}),",
  "replace": "\"distinct\": len({e[\"test\"] for e in entries}) - 1,",
  "test": "bash linux/scripts/tests/test-doc-numbers.sh",
  "why": "the distinct-command count is compared too, so a wrong derivation must fail rather than pass unnoticed"
 },
 {
  "id": "doc-numbers.family-count-stale",
  "target": "linux/scripts/tests/test-doc-numbers.sh",
  "find": "        fam[key] = fam.get(key, 0) + 1",
  "replace": "        fam[key] = fam.get(key, 0) + 2",
  "test": "bash linux/scripts/tests/test-doc-numbers.sh",
  "why": "every per-family count in the page is compared against the ids carrying that prefix"
 },
 {
  "id": "doc-numbers.total-re-quoted",
  "target": "docs/cross-build-verification.md",
  "find": "CI still run every entry.",
  "replace": "CI still run all 180 entries.",
  "test": "bash linux/scripts/tests/test-doc-numbers.sh",
  "why": "the manifest total has one owner; a second page re-quoting it is exactly how the last three waves went stale"
 },
 {
  "id": "doc-numbers.fast-slug-count-stale",
  "target": "linux/scripts/tests/test-doc-numbers.sh",
  "find": "    return len([s for s in body.split(\",\") if s]), first, last",
  "replace": "    return len([s for s in body.split(\",\") if s]) + 1, first, last",
  "test": "bash linux/scripts/tests/test-doc-numbers.sh",
  "why": "the hook's fast-slug count is derived from _FAST_SLUGS and compared, so a wrong derivation must fail"
 },
 {
  "id": "doc-numbers.fast-slug-span-stale",
  "target": "linux/scripts/tests/test-doc-numbers.sh",
  "find": "    while lines[last - 1].rstrip().endswith(\"\\\\\"):",
  "replace": "    while False:",
  "test": "bash linux/scripts/tests/test-doc-numbers.sh",
  "why": "the quoted _FAST_SLUGS span must follow the list's real continuation lines, not stop at its first"
 },
 {
  "id": "env-knobs.heredoc-delimiter-shape",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "if (d !~ /^[A-Za-z_]/) d = \"\"",
  "replace": "if (0) d = \"\"",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a heredoc delimiter is a word, not a number: without the shape rule `$(( 1 << 2 ))` opens a heredoc on '2' and eats the rest of the file"
 },
 {
  "id": "env-knobs.heredoc-per-file-reset",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "FNR == 1 { nhd = 0 }",
  "replace": "FNR == 1 { }",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "one awk reads every script, so an unterminated heredoc in one file would swallow the next file's assignments"
 },
 {
  "id": "doc-numbers.family-binds-nearest",
  "target": "linux/scripts/tests/test-doc-numbers.sh",
  "find": "([^()\\n\\d]{0,60}?)",
  "replace": "([^()\\n]{0,60}?)",
  "test": "bash linux/scripts/tests/test-doc-numbers.sh",
  "why": "the count must be the LAST number before the marker, or --update overwrites a correct unrelated number on the same line"
 },
 {
  "id": "version-forwarding.per-arch-override",
  "target": "linux/scripts/01-core/version-forwarding.sh",
  "find": "      if [ -n \"${!override:-}\" ] && ! _vf_is_tracked \"${override}\"; then value=\"${!override}\"; fi",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-version-forwarding.sh",
  "why": "riscv64 has no upstream cmake/node artifact, so without the per-arch override the image advertises a version it does not contain"
 },
 {
  "id": "version-forwarding.override-not-a-key",
  "target": "linux/scripts/01-core/version-forwarding.sh",
  "find": "  local _vfit\n  for _vfit in \"${_VERSION_BUILD_ARG_VARS[@]}\"; do\n    [ \"${_vfit}\" = \"$1\" ] && return 0\n  done\n  return 1",
  "replace": "  return 1",
  "test": "bash linux/scripts/tests/test-version-forwarding.sh",
  "why": "a forwarded key that merely ends in _<ARCH> (GENAI_ALLOW_RISCV64) is a key, not another key's override"
 },
 {
  "id": "pre-commit.fast-tier-aborts",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "PREFLIGHT_ONLY=\"${_FAST_SLUGS}\" bash linux/scripts/preflight.sh || {\n  echo \"pre-commit: FAILED \u2014 fix the gate above, or 'git commit --no-verify' if you know why\" >&2\n  exit 1\n}",
  "replace": "PREFLIGHT_ONLY=\"${_FAST_SLUGS}\" bash linux/scripts/preflight.sh || true",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a failing fast gate must REFUSE the commit, not print and continue"
 },
 {
  "id": "pre-commit.shellcheck-aborts",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "  \"${_sc_bin}\" -S error ${_staged_sh} || {\n    echo \"pre-commit: shellcheck FAILED on staged files\" >&2\n    exit 1\n  }",
  "replace": "  \"${_sc_bin}\" -S error ${_staged_sh} || true",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a shellcheck error on a staged file must refuse the commit"
 },
 {
  "id": "pre-commit.ratchet-aborts",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "  ${_PY} linux/scripts/verify_shellcheck_warnings.py --files ${_staged_sh} || {\n    echo \"pre-commit: shellcheck warning ratchet FAILED on staged files\" >&2\n    exit 1\n  }",
  "replace": "  ${_PY} linux/scripts/verify_shellcheck_warnings.py --files ${_staged_sh} || true",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a warning-ratchet regression must refuse the commit, not land as a frozen row later"
 },
 {
  "id": "pre-commit.doc-dupes-aborts",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "  ${_PY} docs/scripts/verify_doc_dupes.py >/dev/null || { echo \"pre-commit: doc duplication FAILED\" >&2; exit 1; }",
  "replace": "  ${_PY} docs/scripts/verify_doc_dupes.py >/dev/null || true",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a doc-duplication failure must refuse the commit"
 },
 {
  "id": "pre-commit.doc-numbers-aborts",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "  bash linux/scripts/tests/test-doc-numbers.sh >/dev/null 2>&1 || {",
  "replace": "  bash linux/scripts/tests/test-doc-numbers.sh >/dev/null 2>&1 || true || {",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "stale derived doc numbers must refuse the commit; printed and let through, the digit reaches CI and reds the preflight and every mutation shard (36022089345)"
 },
 {
  "id": "pre-commit.doc-numbers-trigger-names-the-manifest",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "  | grep -E '^(docs/scripts/mutations\\.json|linux/host-config",
  "replace": "  | grep -E '^(docs/scripts/mutations-renamed\\.json|linux/host-config",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "the manifest is the input most commits move; a trigger that stops naming it never runs the suite on exactly the commit that made the total stale"
 },
 {
  "id": "pre-commit.doc-numbers-only-when-an-input-moves",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "if [ -n \"${_staged_dn}\" ]; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "the suite costs seconds and reads a whole-tree census; a commit that moves none of its inputs must not pay for it, or the hook drifts back toward the budget that taught --no-verify"
 },
 {
  "id": "mutations.symlink-checked-before-exists",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if os.path.islink(target):\n        return None, None, \"target is a symlink -- a write through it escapes the copy\"\n    if not within(os.path.realpath(root), target):\n        return None, None, \"target resolves outside the mutation root\"\n    if not os.path.exists(target):\n        return None, None, \"target missing\"",
  "replace": "    if not os.path.exists(target):\n        return None, None, \"target missing\"\n    if os.path.islink(target):\n        return None, None, \"target is a symlink -- a write through it escapes the copy\"\n    if not within(os.path.realpath(root), target):\n        return None, None, \"target resolves outside the mutation root\"",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k symlinks",
  "why": "os.path.exists follows the link, so checking it first reports a dangling symlink as a stale manifest entry and hides the escape"
 },
 {
  "id": "doc-dupes.over-threshold-fails",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "if 1 < len(holders) <= MAX_OWNERS:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "a passage shared by two pages must be counted, or the gate reports every tree clean"
 },
 {
  "id": "dead-code.cpython-wrapper-returns",
  "target": "linux/scripts/01-core/cpython-dev-packages.sh",
  "find": "cpython_ext_dev_packages_required() { _cpython_dev_pkgs_by_class required; }",
  "replace": "cpython_ext_dev_packages_required() { _cpython_dev_pkgs_by_class required; }\ncpython_ext_dev_packages_optional() { _cpython_dev_pkgs_by_class optional; }",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k history",
  "why": "a wrapper deleted as dead must not reappear"
 },
 {
  "id": "dead-code.ffmpeg-cleanup-returns",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "main() {\n    local _ff_stamp=",
  "replace": "cleanup() {\n    rm -rf \"${FFMPEG_SRC}\" || true\n}\n\nmain() {\n    local _ff_stamp=",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k history",
  "why": "same-name masking blinds the gate to ffmpeg's cleanup(); only the suite pin sees it come back"
 },
 {
  "id": "disk-guard.lane-images-first",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  _disk_guard_image_store_fallback \"${bc_dir}\" \"${need}\" \"$(_disk_guard_stage_tags '' 1)\" 0\n  _disk_guard_trim_cache_export \"${bc_dir}\" \"${need}\" \"${protected}\" \"\" \"${CROSS_TRIM_KEEP_SLUGS:-3}\"\n",
  "replace": "  _disk_guard_trim_cache_export \"${bc_dir}\" \"${need}\" \"${protected}\" \"\" \"${CROSS_TRIM_KEEP_SLUGS:-3}\"\n  _disk_guard_image_store_fallback \"${bc_dir}\" \"${need}\" \"$(_disk_guard_stage_tags '' 1)\" 0\n",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "the lane-entry gate spends the free image lever before the levers that cost rebuild time"
 },
 {
  "id": "disk-guard.stage-images-first",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "      _disk_guard_image_store_fallback \"${bc_dir}\" \"${threshold}\" \"$(_disk_guard_stage_tags \"${completed_stage}\" 1)\" 0\n      free_gb=\"$(_disk_guard_free_gb \"${bc_dir}\")\"\n      [ -n \"${free_gb}\" ] || return 0\n      if [ \"${free_gb}\" -lt \"${threshold}\" ]; then\n        _chain_evict_slugs \"${bc_dir}\" protected _chain_bc_free_gb _chain_num_below \"${threshold}\" free_gb\n        [ -n \"${free_gb}\" ] || return 0\n      fi\n",
  "replace": "      _chain_evict_slugs \"${bc_dir}\" protected _chain_bc_free_gb _chain_num_below \"${threshold}\" free_gb\n      [ -n \"${free_gb}\" ] || return 0\n      _disk_guard_image_store_fallback \"${bc_dir}\" \"${threshold}\" \"$(_disk_guard_stage_tags \"${completed_stage}\" 1)\" 0\n      free_gb=\"$(_disk_guard_free_gb \"${bc_dir}\")\"\n      [ -n \"${free_gb}\" ] || return 0\n",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "the between-stage guard spends the free image lever before the export eviction"
 },
 {
  "id": "disk-guard.buildkit-fallback-unwired",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  _disk_guard_buildkit_fallback \"${bc_dir}\" \"${threshold}\"\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "the in-stage guard must reach the buildkit store before declaring defeat"
 },
 {
  "id": "disk-guard.watch-dies-with-owner",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "    kill -0 \"${owner}\" 2>/dev/null || return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a sampler outliving a chain killed without its traps keeps trimming the cache forever"
 },
 {
  "id": "disk-guard.buildkit-trim-first",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  before=\"$(_disk_guard_lever_needed \"${path}\" \"${target_gb}\")\" || return 0\n  _disk_guard_buildkit_ready",
  "replace": "  before=\"$(_disk_guard_free_gb \"${path}\")\"\n  _disk_guard_buildkit_ready",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "the cheap trim runs first; the store is pruned only when it came up short"
 },
 {
  "id": "disk-guard.buildkit-keep-storage",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "prune --filter type==regular --keep-storage \"$(_disk_guard_regular_keep_mb \"${keep}\")\"",
  "replace": "prune --filter type==regular",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a mid-run prune must keep layer cache, not empty the store"
 },
 {
  "id": "disk-guard.buildkit-keep-floor",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if [ \"${keep}\" -gt 0 ] && [ \"${keep}\" -lt 100 ]; then keep=100; fi",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "under 100G of retained layers the remaining stages recompile"
 },
 {
  "id": "disk-guard.buildkit-prune-once",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if [ \"${prunes:-0}\" -gt 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "one prune per caller: a repeat walks the whole store and frees nothing (2026-09-07: this arm moved into _disk_guard_lever_ready, the owner BOTH levers share, so neutering it now costs the image store too.)"
 },
 {
  "id": "disk-guard.buildkit-missing-tool",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if ! command -v \"${tool}\" >/dev/null 2>&1; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a host without buildctl must get the named SKIP, not a mystery (2026-09-07: this arm moved into _disk_guard_lever_ready, the owner BOTH levers share, so neutering it now costs the image store too.)"
 },
 {
  "id": "disk-guard.buildkit-unreachable-store",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if ! _disk_guard_buildctl du >/dev/null 2>&1; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a store that will not answer du must not be pruned blind"
 },
 {
  "id": "disk-guard.buildkit-freed-measured",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "    _DISK_GUARD_BUILDKIT_FREED_GB=$(( after - before ))",
  "replace": "    _DISK_GUARD_BUILDKIT_FREED_GB=0",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "the log must say HOW MUCH was reclaimed"
 },
 {
  "id": "disk-guard.buildkit-freed-credited",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if [ \"${_DISK_GUARD_BUILDKIT_FREED_GB:-0}\" -gt 0 ] 2>/dev/null; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "223G reclaimed must not still be reported as NOTHING was reclaimable"
 },
 {
  "id": "disk-guard.buildkit-cachemount-survival",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if [ \"${2:-0}\" -lt \"${1:-0}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a filter that stopped holding must be shouted about, not assumed"
 },
 {
  "id": "disk-guard.buildkit-never-nerdctl",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  _disk_guard_buildkit_prune \"${keep}\" || true",
  "replace": "  nerdctl builder prune -f >/dev/null 2>&1 || true",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "the unfiltered prune eats the cachemounts: 1.5-2h of cold LLVM on 2026-08-17"
 },
 {
  "id": "trailing-conditional.explicit-or-tail",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "    if fallback >= 0:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "`... && x || true` is how a deliberate no-op path is spelled; without the escape hatch the gate reports every one of them and the allow file becomes cover"
 },
 {
  "id": "trailing-conditional.double-bracket-is-not-a-pipeline",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "        if two == \"[[\":\n            bracket += 1",
  "replace": "        if two == \"[[\":\n            bracket += 0",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "an || INSIDE [[ ... ]] is an operator of the test, not a fallback arm -- read as top level it silences every double-bracket finding"
 },
 {
  "id": "trailing-conditional.last-semicolon-statement",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "    for cut in reversed([i for i, op in top_ops(stmt) if op == \";\"]):",
  "replace": "    for cut in reversed([]):",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "a `;` ends a statement, so `y=1; [ -n \"$x\" ]` returns the test -- judging the whole line instead reads the assignment as the return and misses it"
 },
 {
  "id": "trailing-conditional.continuation-joined-first",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "CONT_END = (\"\\\\\", \"&&\", \"||\", \"|\", \"(\", \"then\", \"do\", \"else\")",
  "replace": "CONT_END = (\"&&\", \"||\", \"|\", \"(\", \"then\", \"do\", \"else\")",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "a backslash-continued line read on its own loses the `a ||` that precedes it and the gate reports a finding the author already handled"
 },
 {
  "id": "trailing-return.derive-cxx-empty-path",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  [ -x \"${cxx}\" ] || return 0\n  printf '%s' \"${cxx}\"",
  "replace": "  [ -x \"${cxx}\" ] && printf '%s' \"${cxx}\"",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "the documented contract is empty output; returning 1 kills resolve_cross_cc_cxx_for_arch's caller under set -e instead of letting it report the missing compiler"
 },
 {
  "id": "trailing-return.resolve-tools-refuses-empty-cxx",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "      [ -x \"${_ert_out[cxx]}\" ] || return 1",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "derive_cxx_from_cc now answers with an empty string instead of rc 1, so the caller must test the value or it sails on with CXX unset"
 },
 {
  "id": "trailing-return.chain-exit-trap-returns-zero",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  if declare -F cross_cleanup_local_context_workdir >/dev/null 2>&1; then\n    cross_cleanup_local_context_workdir\n  fi",
  "replace": "  declare -F cross_cleanup_local_context_workdir >/dev/null 2>&1 \\\n    && cross_cleanup_local_context_workdir",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "an EXIT trap whose last command is a false && list returns 1 under set -e, turning a chain that finished green into a failed run"
 },
 {
  "id": "trailing-return.gst-patch-last-guard",
  "target": "linux/scripts/03-media/build/gstreamer/common/patch-gstreamer-sources.sh",
  "find": "  if [ -f \"${repo_root}/subprojects/gst-devtools/validate/plugins/ssim/gstvalidatessim.c\" ]; then\n    bash \"${_apply_patch}\" \"${_patch_dir}/007-validate-ssim-register-outside-validate.patch\" \"${repo_root}\" \\\n      \"gst-devtools ssim plugin registers outside gst-validate\"\n  fi",
  "replace": "  [ -f \"${repo_root}/subprojects/gst-devtools/validate/plugins/ssim/gstvalidatessim.c\" ] && \\\n    bash \"${_apply_patch}\" \"${_patch_dir}/007-validate-ssim-register-outside-validate.patch\" \"${repo_root}\" \\\n      \"gst-devtools ssim plugin registers outside gst-validate\"",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "the last guarded patch decides the function's status, and both call sites invoke it bare under set -euo pipefail, so a tree without gst-devtools would abort the GStreamer build"
 },
 {
  "id": "code-size.extent-code-lines",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    code = code_lines(lines)",
  "replace": "    code = lines",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "a function's extent is counted over stripped code, never over raw lines"
 },
 {
  "id": "code-size.extent-comment-brace",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if c == \"#\" and (i == 0 or line[i - 1] in \" \\t;(|&\"):",
  "replace": "    if c == \"#\" and (i == 0 or line[i - 1] in \"\\t;(|&\"):",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "an indented comment is still a comment: its } must not end the function -- generate_pkgconfig_file measured 5 lines instead of 37"
 },
 {
  "id": "code-size.extent-single-quote",
  "target": "linux/scripts/verify_code_size.py",
  "find": "QUOTE = {\"'\": \"sq\", '\"': \"dq\"}",
  "replace": "QUOTE = {'\"': \"dq\"}",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "a } inside '...' is text, not a block end"
 },
 {
  "id": "code-size.extent-double-quote",
  "target": "linux/scripts/verify_code_size.py",
  "find": "QUOTE = {\"'\": \"sq\", '\"': \"dq\"}",
  "replace": "QUOTE = {\"'\": \"sq\"}",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "a } inside \"...\" is text, not a block end"
 },
 {
  "id": "code-size.extent-heredoc-body",
  "target": "linux/scripts/verify_code_size.py",
  "find": "        if pending:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "a heredoc body is data: its braces and its definition heads are not code"
 },
 {
  "id": "code-size.extent-def-in-heredoc",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    for i, line in enumerate(code):",
  "replace": "    for i, line in enumerate(lines):",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "a definition head must be found on the stripped line, or heredoc fixture text reads as 29 phantom functions"
 },
 {
  "id": "probe.advert-unset-fatal",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "printf 'UNSET %s\\n' \"${key}\"",
  "replace": "printf 'SKIP %s\\n' \"${key}\"",
  "test": "bash linux/scripts/tests/test-advertised-keys.sh",
  "why": "a key the image never advertises must be fatal, not a row that can only ever SKIP -- the hole that hid eleven ARG-only keys"
 },
 {
  "id": "probe.advert-unread-fatal",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "printf 'UNREAD %s %s\\n' \"${key}\" \"${adv}\"",
  "replace": "printf 'SKIP %s %s\\n' \"${key}\" \"${adv}\"",
  "test": "bash linux/scripts/tests/test-advertised-keys.sh",
  "why": "the rust defect's exact shape: rustc --version failed on arm64 for months and this arm reported SKIP"
 },
 {
  "id": "probe.advert-unknown-verb",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    *)      _smoke_unknown_verdict bad advertised-version \"${verb}\" \"${key}\" \"${target_arch}\" \\\n              \" -- a verb no arm handles is a silently dropped row\" ;;",
  "replace": "      *)      : ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a verb no arm handles is a silently dropped row -- the same class as the SKIP arms themselves"
 },
 {
  "id": "probe.tree-arch-mismatch",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      BAD)     _tree_arch_bad_verdict ;;",
  "replace": "      BAD)     : ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a builder-arch tree in a foreign image is the whole point of the gate; without this arm it reports OK on the 2 GB x86_64 rustup"
 },
 {
  "id": "probe.tree-arch-machine-word",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "        machine_id = int.from_bytes(head[18:20], order)",
  "replace": "        machine_id = int.from_bytes(head[16:18], order)",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "reading e_type instead of e_machine makes every tree read the same, so the fixture proves it is the machine word that is read"
 },
 {
  "id": "probe.tree-arch-scan-sentinel",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  _smoke_probe_required marker \"${out}\" TREESCAN_DONE _tree_arch_probe_failure \\\n    \"${target_arch}\" \"${out}\" || return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "exit status is not evidence: a scanner that never ran prints nothing, and without the sentinel the gate passes on empty output"
 },
 {
  "id": "probe.tree-arch-arg-default",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      [ -n \"${val}\" ] || val=\"$(sed -n \"s/^ARG ${var}=\\(.*\\)$/\\1/p\" \"${dockerfile}\" | head -1)\"",
  "replace": "      val=\"\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "ONNXRUNTIME_OUTPUT_DIR/OPENCV_OUTPUT_DIR are ARG-only, so without the Dockerfile default those trees resolve to nothing and the gate would scan and say nothing"
 },
 {
  "id": "probe.tree-arch-relocation",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    /opt/llvm-target) printf '%s' /usr/local/llvm-target ;;",
  "replace": "    /opt/llvm-target) printf '%s' /opt/llvm-target ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the manifest carries the COPY SOURCE path, which does not exist in the image; the suite reads ALLOWED_RELOCATIONS so the two owners of that fact cannot drift"
 },
 {
  "id": "shellcheck-warnings.allow-row-shape",
  "target": "linux/scripts/quality_allow.py",
  "find": "            if at < 1 or len(parts) < at + 2 or not parts[at].isdigit():",
  "replace": "            if False:",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "a malformed allow row must be a gate message naming the file and line at exit 2, never the ValueError traceback it was until 2026-09-04"
 },
 {
  "id": "shellcheck-warnings.allow-keys-from-left",
  "target": "linux/scripts/quality_allow.py",
  "find": "            at = len(parts) - 2 if keys is None else keys",
  "replace": "            at = len(parts) - 2",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "a declared key arity is what lets a reason carry |; counting from the right instead makes the reason shift into the count column"
 },
 {
  "id": "shellcheck-warnings.allow-inline-hash-kept",
  "target": "linux/scripts/quality_allow.py",
  "find": "            line = raw.strip()",
  "replace": "            line = raw.split(\"#\", 1)[0].strip()",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "stripping an inline # truncates a reason silently -- file-size.allow already carries a docs anchor in one"
 },
 {
  "id": "vulkan.trace-tmpdir-hardcoded",
  "target": "linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "find": "_TMP_RE=\"$(printf '%s' \"${TMPDIR:-/tmp}\"",
  "replace": "_TMP_RE=\"$(printf '%s' \"/tmp\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "mktemp honours TMPDIR; a hardcoded /tmp in the argv normaliser failed 5 of 35 assertions under any override"
 },
 {
  "id": "vulkan.host-pkgconfig-half-excludes-the-target",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "    export VULKAN_HOST_PKG_CONFIG_LIBDIR=\"${host_pkgconfig}\"",
  "replace": "    export VULKAN_HOST_PKG_CONFIG_LIBDIR=\"/usr/lib/${target_triplet}/pkgconfig:${host_pkgconfig}\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the host SDK build searches this path; one target-triplet entry in it hands a host tool the foreign xcb module, whose LIBRARY_DIRS becomes an absolute find_library result that ld cannot skip -- the x86_64 vulkaninfo link then fails and takes the sdk stage with it"
 },
 {
  "id": "vulkan.host-build-swaps-the-pkgconfig-path",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  export PKG_CONFIG_LIBDIR=\"${VULKAN_HOST_PKG_CONFIG_LIBDIR}\"",
  "replace": "  export PKG_CONFIG_LIBDIR=\"${PKG_CONFIG_LIBDIR}\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "without the swap the host build keeps the cross search path it is sudo --preserve-env'd with, which is exactly the configuration that failed; the compilers were already saved and restored here and pkg-config was the one that was not"
 },
 {
  "id": "version-forwarding.versions-env-quiet-source",
  "target": "linux/scripts/01-core/versions.env",
  "find": "CUDA_ARCHITECTURES=\"75;86;87;89;120\"",
  "replace": "CUDA_ARCHITECTURES=75;86;87;89;120",
  "test": "bash linux/scripts/tests/test-version-forwarding.sh",
  "why": "an unquoted ;-bearing value runs its own tail as commands on every plain `source versions.env` (lint-python.sh does exactly that)"
 },
 {
  "id": "version-forwarding.loader-strips-quotes",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "        \\\"*\\\") _ve_val=\"${_ve_val#\\\"}\"; _ve_val=\"${_ve_val%\\\"}\" ;;",
  "replace": "        \\\"*\\\") : ;;",
  "test": "bash linux/scripts/tests/test-version-forwarding.sh",
  "why": "the quotes are syntax, not data: if the loader stopped stripping them the --build-arg would carry them into CMake and defeat the 90 -> 90a transform"
 },
 {
  "id": "code-dupes.baseline-refuses-kind",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    scope = ap.add_mutually_exclusive_group()",
  "replace": "    scope = ap",
  "test": "bash linux/scripts/tests/test-code-dupes.sh",
  "why": "a scoped --baseline must refuse, not rewrite the whole allow file from one kind's pairs"
 },
 {
  "id": "dead-functions.census-masked-tier",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "[key for key in considered if definers[key[1]] > 1]",
  "replace": "[]",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "the census must list the (file, name) pairs whose verdict comes from another file's same-named definition"
 },
 {
  "id": "dead-functions.census-masked-keyed-on-file",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "            [key for key in considered if definers[key[1]] > 1],",
  "replace": "            [k for k in considered if definers[k[1]] > 1 and _isolated(k[0], corpus_texts)],",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "the masked tier is keyed on (file, name); re-adding the file-reachability filter makes it inert again"
 },
 {
  "id": "env-knobs.quoted-hash-strip",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "  | awk -v MODE=prefix \"${_KNOB_AWK}\" \\",
  "replace": "  | sed -E 's/[[:space:]]+#.*$//' \\",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a flat cut at ` #` loses every reader to the right of a hash inside a quoted string"
 },
 {
  "id": "env-knob-default.reader-owns-its-default",
  "target": "linux/scripts/01-core/build-helpers.sh",
  "find": ": \"${MEDIA_STRIP:=1}\"",
  "replace": ": \"${MEDIA_STRIP_UNSET:=1}\"",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "the thirteen build-window knobs must default where they are read, not in the registry"
 },
 {
  "id": "env-knob-default.registry-row-deleted",
  "target": "linux/scripts/lint-env-knobs.allow",
  "find": "\nSTV_ASSERT_ONLY\n",
  "replace": "\nSTV_ASSERT_ONLY\nMEDIA_STRIP\n",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "a knob that defaults at its reader must not also carry a registry row"
 },
 {
  "id": "shellcheck.default-sweep-includes-hooks",
  "target": "linux/scripts/lint-shell.sh",
  "find": "-o -path \"${REPO_ROOT}/linux/host-config/git-hooks/*\"",
  "replace": "-o -path \"${REPO_ROOT}/linux/host-config/no-such-dir/*\"",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "the hook must be in the DEFAULT scope, which is the set the shellcheck-warnings ratchet asks for"
 },
 {
  "id": "lib.lint-scope-shell-root",
  "target": "linux/scripts/01-core/lint-root.sh",
  "find": "_lsb_root=\"${LINT_ROOT_PATH}\"",
  "replace": "_lsb_root=\"$1\"",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "a submodule checkout puts this script inside the consumer; ignoring the root grades ANTfrastructure and reports OK for a tree nobody looked at"
 },
 {
  "id": "shellcheck.non-git-root-refused",
  "target": "linux/scripts/01-core/lint-root.sh",
  "find": "  git -C \"${LINT_ROOT_PATH}\" rev-parse --git-dir >/dev/null 2>&1 \\\n    || _lint_root_die \"--root ${LINT_ROOT_PATH} is not a git checkout; a consumer's scope is read from git ls-files.\" \\\n    || return 1",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "a consumer's scope is read from git ls-files, which answers NOTHING outside a checkout; accepting one silently turns every root-taking gate into a green verdict over an empty file list"
 },
 {
  "id": "shellcheck.missing-root-refused",
  "target": "linux/scripts/01-core/lint-root.sh",
  "find": "  LINT_ROOT_PATH=\"$(cd \"${LINT_ROOT_RAW}\" 2>/dev/null && pwd)\" \\\n    || _lint_root_die \"lint root not found: ${LINT_ROOT_RAW}\" || return 1",
  "replace": "  LINT_ROOT_PATH=\"$(cd \"${LINT_ROOT_RAW}\" 2>/dev/null && pwd)\" || LINT_ROOT_PATH=\"$1\"",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "a mistyped root that falls back to ANTfrastructure grades a clean tree and reports OK for the checkout the caller actually named -- the wrong-tree bug this whole contract exists to stop"
 },
 {
  "id": "shellcheck.consumer-scope-is-tracked-files",
  "target": "linux/scripts/lint-shell.sh",
  "find": "< <(lint_root_tracked \"${SCAN_ROOT}\" '*.sh')",
  "replace": "< <(cd \"${SCAN_ROOT}\" && find . -name '*.sh' -type f -print0)",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "git ls-files is what makes a vendored submodule a gitlink instead of a subtree; a find sweep grades the hub's own scripts AS the consumer's, which is the wrong-tree bug from the other direction"
 },
 {
  "id": "shellcheck.empty-root-scope-is-an-error",
  "target": "linux/scripts/lint-shell.sh",
  "find": "  [ \"${LINT_ROOT_GIVEN}\" -eq 0 ] \\\n    || err \"no shell script to check under ${SCAN_ROOT}; a root was given explicitly, so reporting green over an empty file list would be a verdict about nothing.\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "this gate skips paths that do not exist, so a scope built from a wrong prefix arrives here empty; the 'no shell scripts to check' pass then reports green over a tree nobody read"
 },
 {
  "id": "pre-commit.doc-span-fast-slugs",
  "target": "docs/cross-build-verification.md",
  "find": "`_FAST_SLUGS` (`:107-110`)",
  "replace": "`_FAST_SLUGS` (`:107-111`)",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "the _FAST_SLUGS offset quoted in prose is re-derived from the hook, not trusted"
 },
 {
  "id": "pre-commit.doc-span-staged-shell",
  "target": "docs/cross-build-verification.md",
  "find": "(`:121-138`, the binary resolved",
  "replace": "(`:121-137`, the binary resolved",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "the staged-shell block offset quoted in prose is re-derived from the hook, not trusted"
 },
 {
  "id": "stdout-returns.unconsumed-not-a-finding",
  "target": "linux/scripts/verify_stdout_returns.py",
  "find": "        if name not in consumed or STDOUT_LOGGERS.match(name + \" \"):",
  "replace": "        if STDOUT_LOGGERS.match(name + \" \"):",
  "test": "bash linux/scripts/tests/test-stdout-returns.sh",
  "why": "only a function whose stdout is someone's return value can leak a log line into it"
 },
 {
  "id": "stdout-returns.redirect-is-the-fix",
  "target": "linux/scripts/verify_stdout_returns.py",
  "find": "if STDOUT_LOGGERS.match(line) and \">&2\" not in line:",
  "replace": "if STDOUT_LOGGERS.match(line):",
  "test": "bash linux/scripts/tests/test-stdout-returns.sh",
  "why": "a logger already redirected to fd 2 must not be reported"
 },
 {
  "id": "stdout-returns.command-position",
  "target": "linux/scripts/verify_stdout_returns.py",
  "find": "STDOUT_LOGGERS = re.compile(r\"^\\s*(log|info)\\s\")",
  "replace": "STDOUT_LOGGERS = re.compile(r\"(log|info)\\s\")",
  "test": "bash linux/scripts/tests/test-stdout-returns.sh",
  "why": "the logger must OPEN the line; matching mid-line flags every message that mentions a log"
 },
 {
  "id": "stdout-returns.verdict-not-discarded",
  "target": "linux/scripts/verify_stdout_returns.py",
  "find": "    return 1\n",
  "replace": "    return 0\n",
  "test": "bash linux/scripts/tests/test-stdout-returns.sh",
  "why": "printing the findings is not enough; the gate must exit non-zero"
 },
 {
  "id": "mutations.copy-drops-escaping-symlinks",
  "target": "docs/scripts/verify_mutations.py",
  "find": "            if os.path.islink(path) and not within(home, path):",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k symlinks",
  "why": "a link kept as a link is still a door out of the copy: a test running inside it reads and writes through docs/.venv/bin/python straight to /usr/bin/python3"
 },
 {
  "id": "mutations.shards-cover-every-entry",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    for e in entries:\n        todo.put(e)",
  "replace": "    for e in entries[::2]:\n        todo.put(e)",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "parallelism must not thin the run -- entries dealt to a shard that is never submitted are reported as neither biting nor surviving"
 },
 {
  "id": "mutations.shard-failure-fails-the-run",
  "target": "docs/scripts/verify_mutations.py",
  "find": "            return max(f.result() for f in done)",
  "replace": "            return min(f.result() for f in done)",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "a survivor in ONE shard must fail the whole gate; taking the best shard's verdict is the false green this tool exists to find"
 },
 {
  "id": "mutations.report-is-printed",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    report.summary(entries)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "verdicts stream in the order the shards finish them; without the closing summary a long log names its failures nowhere in manifest order"
 },
 {
  "id": "pre-commit.pinned-shellcheck-or-refuse",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "  _sc_bin=\"$(bash linux/scripts/lint-shell.sh --print-bin)\" || {\n    echo \"pre-commit: no pinned shellcheck \u2014 see lint-shell.sh --print-bin\" >&2\n    exit 1\n  }",
  "replace": "  _sc_bin=\"$(bash linux/scripts/lint-shell.sh --print-bin)\" || _sc_bin=shellcheck",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "with no pinned binary the hook must REFUSE; falling back to whatever shellcheck PATH offers lints the commit against an unknown version and calls it green"
 },
 {
  "id": "python-lint.heredoc-finding-names-its-source",
  "target": "linux/scripts/lint-python.sh",
  "find": "    _name_sources \"${_RUFF_OUT}\"\n    echo \"\"\n    err \"${failed} (${selector})\"",
  "replace": "    cat \"${_RUFF_OUT}\"\n    echo \"\"\n    err \"${failed} (${selector})\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "a finding named probe__2.py:1: makes the reader add an opener line to a body line by hand; the extractor's map already knows the answer"
 },
 {
  "id": "python-lint.versions-env-is-data",
  "target": "linux/scripts/lint-python.sh",
  "find": ". \"${_core}/load-versions-env.sh\" && load_versions_env \"${_core}/tool-pins.env\"",
  "replace": ". \"${_core}/tool-pins.env\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "versions.env is inert data with shell metacharacters in it: sourcing runs CUDA_ARCHITECTURES' arch numbers as commands, three errors on stderr every hook run"
 },
 {
  "id": "gate-registry.shell-out-ownership",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    return [rel] + imported_modules(rel, text) + shelled_out(rel, text)",
  "replace": "    return [rel] + imported_modules(rel, text)",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a .sh gate imports nothing, so without the shell-out its helper -- extract_embedded_python.py under python-lint -- belongs to no row and its mutation is credited to nobody"
 },
 {
  "id": "gate-registry.call-site-credit",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "            and (e[\"target\"] in files or calls_the_gate(e, script, files, tests))]",
  "replace": "            and e[\"target\"] in files]",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a mutation that pins the gate's CALL SITE in a shared orchestrator or a git hook proves that gate; crediting only by target froze four such ids as off-convention"
 },
 {
  "id": "gate-registry.call-site-needs-the-name",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    return os.path.isfile(path) and mentions(script, _read(path))",
  "replace": "    return os.path.isfile(path)",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "without the name check any file at all counts as a call site, and a gate collects proofs from mutations that never touch it"
 },
 {
  "id": "tree-arch.candidates-first",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "            (first if executable or \".so\" in name else rest).append(path)",
  "replace": "            rest.append(path)",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "rust-src spends the cap before toolchains/*/bin/rustc: the objects an image EXECUTES must be read first"
 },
 {
  "id": "tree-arch.capped-is-not-a-pass",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      CAPPED)  bad=$((bad + 1))\n               fail \"tree-arch: the walk of ${tree} hit the ${machine}-file cap, so everything past it was never read -- a partial scan is not a pass. Raise RT_TREE_CAP or narrow the tree\" ;;",
  "replace": "      CAPPED)  : ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a walk that ran out of budget read only part of the tree; reporting that as OK is the silent false green"
 },
 {
  "id": "disk-guard.keep-value-validated",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  case \"${keep}\" in ''|*[!0-9]*) keep=120 ;; esac",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "an operator typo in CROSS_BUILDKIT_KEEP_GB must not reach an arithmetic context or --keep-storage"
 },
 {
  "id": "disk-guard.prune-credit-per-caller",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if [ \"${prunes:-0}\" -gt 0 ]; then\n    _disk_guard_log \"[${tag}] ${latch_why}\"",
  "replace": "  if [ \"${prunes:-0}\" -gt -1 ]; then\n    _disk_guard_log \"[${tag}] ${latch_why}\"",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "the once-per-caller rule must still let the NEXT stage reclaim, or only the first stage of a chain ever frees space (2026-09-07: this arm moved into _disk_guard_lever_ready, the owner BOTH levers share, so neutering it now costs the image store too.)"
 },
 {
  "id": "probe.advert-empty-table-is-vacuous",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  if [ \"${ok}\" -eq 0 ] && [ \"${bad}\" -eq 0 ] && [ -n \"${empty_failure}\" ]; then fail \"${empty_failure}\"; fi",
  "replace": "  if false; then fail \"${empty_failure}\"; fi",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a gate whose key list came back empty asserted nothing; printing PASS for it is the hole the gate exists to close"
 },
 {
  "id": "lib.app-runner-cd-guarded",
  "target": "linux/scripts/lib/app-runner.sh",
  "find": "  cd \"${WORK_DIR}\" || err \"Cannot enter working directory: ${WORK_DIR}\"",
  "replace": "  cd \"${WORK_DIR}\"",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "app-runner sets no -e, so an unguarded cd that fails leaves the very next line exec'ing the app from the caller's directory instead of PROJECT_ROOT -- a silent wrong-cwd launch, not a failure"
 },
 {
  "id": "lib.ctest-run-cd-guarded",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "    cd \"${BUILD_DIR}\" || err \"Cannot enter build directory: ${BUILD_DIR}\"",
  "replace": "    cd \"${BUILD_DIR}\"",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "the [[ -d ]] check above it does not cover a cd that fails for permissions, and this library sets no -e either: the whole ctest suite would then run in the wrong tree and report on it"
 },
 {
  "id": "lib.cmake-build-vulkan-default-must-exist",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "        && -f \"${CMAKE_BUILD_DEFAULT_VULKAN_SETUP_SCRIPT}\" ]]; then",
  "replace": "        ]]; then",
  "test": "bash linux/scripts/tests/test-lib-smoke.sh",
  "why": "cmake_build_prepare_env sources VULKAN_SETUP_SCRIPT unconditionally once it is set, so adopting a caller default that is not on disk turns a missing SDK into a sourcing error much later; the -f test is what stops it"
 },
 {
  "id": "lib.cmake-build-vulkan-flag-beats-env",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "  if [[ -n \"${version_arg}\" ]]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-lib-smoke.sh",
  "why": "an explicit --vulkan-version must override the VULKAN_VERSION the image exported, or the flag silently does nothing on every image that presets one"
 },
 {
  "id": "lib.cmake-build-skip-configure-optional-value",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "      if [[ $# -ge 2 && \"${2}\" != -* ]]; then",
  "replace": "      if [[ $# -ge 2 ]]; then",
  "test": "bash linux/scripts/tests/test-lib-smoke.sh",
  "why": "--skip-configure takes an OPTIONAL value; without the -* guard it swallows the following flag as its value, so `--skip-configure --parallel 5` sets SKIP_CONFIGURE=--parallel and drops the job count"
 },
 {
  "id": "lib.log-bootstrap-source-removed",
  "target": "linux/scripts/lib/rust-toolchain.sh",
  "find": "# shellcheck source=./log-bootstrap.sh\nsource \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)/log-bootstrap.sh\"",
  "replace": "# shellcheck source=./log-bootstrap.sh",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "a lib that stops sourcing the shared bootstrap ends up with no info/warn/err at all -- the exact drift that left app-runner.sh and rust-toolchain.sh defective before the one-owner extraction"
 },
 {
  "id": "lib.log-bootstrap-private-fallback-returns",
  "target": "linux/scripts/lib/coverage.sh",
  "find": "source \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)/log-bootstrap.sh\"",
  "replace": "source \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)/log-bootstrap.sh\"\ninfo() { printf '\\033[1;34m[INFO]\\033[0m %s\\n' \"$*\"; }",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "one owner only holds if a re-pasted private copy of the fallbacks fails; nine such copies drifted twice into real defects and no duplication gate could see them at 9 owners, over the 6-owner idiom threshold"
 },
 {
  "id": "lib.log-bootstrap-loses-01core",
  "target": "linux/scripts/lib/log-bootstrap.sh",
  "find": "&& pwd)/../01-core\"",
  "replace": "&& pwd)/../01-core-gone\"",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "the owner must still reach the REAL 01-core/logging.sh rather than settle for its own minimal fallbacks -- the silent degrade app-runner.sh shipped for months, where consumers got no log/die and divergent formatting and nothing failed"
 },
 {
  "id": "pkg-names.unguarded-is-a-verdict",
  "target": "linux/scripts/verify_package_names.py",
  "find": "        return False, \"\"",
  "replace": "        return True, \"\"",
  "test": "bash linux/scripts/tests/test-package-names.sh",
  "why": "if every call site reads guarded the gate can never FAIL at all; UNGUARDED IS the verdict -- it is the four-hours-in stage kill this gate exists to catch"
 },
 {
  "id": "pkg-names.guard-precedence",
  "target": "linux/scripts/verify_package_names.py",
  "find": "    if block_guard:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-package-names.sh",
  "why": "an install under an enclosing apt probe is guarded BY that probe, not by a condition of its own; lose the arm and the WARN names the wrong reason, pointing a reader at the wrong fix"
 },
 {
  "id": "pkg-names.array-must-be-handed-over",
  "target": "linux/scripts/verify_package_names.py",
  "find": "    return {m.group(1) for m in ARRAY_REF_RE.finditer(text)}",
  "replace": "    return set()",
  "test": "bash linux/scripts/tests/test-package-names.sh",
  "why": "an array counts as a request only when its file hands it to an installer; with no references every array-declared package silently leaves the scan and the gate reads green over names it never checked"
 },
 {
  "id": "pkg-names.array-body-spans-lines",
  "target": "linux/scripts/verify_package_names.py",
  "find": "            if cut >= 0:",
  "replace": "            if True:",
  "test": "bash linux/scripts/tests/test-package-names.sh",
  "why": "a NAME=( ... ) body spanning lines is the common shape in install-deps.sh; ending it on the first line reads one package and drops the rest of the list"
 },
 {
  "id": "pkg-names.append-helper-destination",
  "target": "linux/scripts/verify_package_names.py",
  "find": "        args = args.strip().split(\" \", 1)[1] if \" \" in args.strip() else \"\"",
  "replace": "        args = args",
  "test": "bash linux/scripts/tests/test-package-names.sh",
  "why": "append_unique_packages' first argument is the DESTINATION array, not a package; keep it and the gate demands a distro package by that name and fails on a name that was never requested"
 },
 {
  "id": "pkg-names.cpython-dev-table",
  "target": "linux/scripts/verify_package_names.py",
  "find": "             if rel.endswith(\"01-core/cpython-dev-packages.sh\") else [])",
  "replace": "             if False else [])",
  "test": "bash linux/scripts/tests/test-package-names.sh",
  "why": "the CPython dev-package table is a request shape no installer call site names; skip it and every package that decides which CPython extension modules build is never checked at all"
 },
 {
  "id": "pkg-names.quoted-name-is-not-a-call",
  "target": "linux/scripts/verify_package_names.py",
  "find": "            if in_quotes(spans, m.start()):",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-package-names.sh",
  "why": "an installer name inside a string is prose, not a call site; counting it invents requests out of echo text -- the exact MUST_NOT_FIND decoy shape the extractor self-check was built around"
 },
 {
  "id": "doc-links.flutter-checks-anchor",
  "target": "docs/code-quality-tooling.md",
  "find": "#### Dart file enumeration",
  "replace": "#### Finding the Dart files",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "05-frameworks/flutter/flutter_checks.sh now points at this section by anchor; renaming the heading must fail, which is the whole point of the anchor -- the bare page reference it used to carry always resolved and the gate could not see it"
 },
 {
  "id": "gate-fixture.plants-the-subject",
  "target": "linux/scripts/tests/gate-tree.sh",
  "find": "  printf '%s\\n' \"${subject}\" > \"${dir}/linux/scripts/subject.sh\"",
  "replace": "  : > \"${dir}/linux/scripts/subject.sh\"",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k defs",
  "why": "one helper now plants the subject for two gate suites; a fixture that writes an EMPTY subject.sh makes every case in both pass against nothing -- exactly the vacuous-fixture failure this manifest exists to catch"
 },
 {
  "id": "gate-fixture.plants-the-allow",
  "target": "linux/scripts/tests/gate-tree.sh",
  "find": "  [ -z \"${allow}\" ] || printf '%s\\n' \"${allow}\" > \"${dir}/linux/scripts/${allow_name}\"",
  "replace": "  [ -n \"${allow}\" ] || printf '%s\\n' \"${allow}\" > \"${dir}/linux/scripts/${allow_name}\"",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "the shared fixture's allow arm inverted: every freeze case would then run with no allow file present and every allow-file assertion would prove nothing. Split across the other suite on purpose so both consumers of the shared helper carry a live mutation"
 },
 {
  "id": "sccache.runtime-ccache-dir-in-workspace",
  "target": "linux/Dockerfile.package",
  "find": "CCACHE_DIR=/var/cache/ccache",
  "replace": "CCACHE_DIR=/workspace/.ccache",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "the shipped image must not write ccache into the consumer's bind-mounted checkout, where it pollutes the working tree and makes flatpak-builder abort on a non-ext4 mount"
 },
 {
  "id": "sccache.runtime-sccache-dir-in-workspace",
  "target": "linux/Dockerfile.package",
  "find": "SCCACHE_DIR=/var/cache/sccache",
  "replace": "SCCACHE_DIR=/workspace/.sccache",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "sccache inherited the wrong prefix from the line above it once already; the pin must catch it on either variable"
 },
 {
  "id": "sccache.cache-dir-owner-drift",
  "target": "linux/scripts/01-core/compiler-cache.sh",
  "find": ": \"${CCACHE_DIR:=/var/cache/ccache}\"",
  "replace": ": \"${CCACHE_DIR:=/tmp/ccache}\"",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "the library owns the path and the Dockerfile ENV is pinned to it; a change on the owner's side must fail too, not silently diverge into two values that agree by hand"
 },
 {
  "id": "rust.copy-chown",
  "target": "linux/Dockerfile.package",
  "find": "COPY --link --chown=${RUNTIME_UID}:${RUNTIME_UID} --from=artifact-source /usr/local/rustup /usr/local/rustup",
  "replace": "COPY --link --from=artifact-source /usr/local/rustup /usr/local/rustup",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "the shipped 2026-09-04 shape: a root-owned /usr/local/rustup, where uid 1001's rustup dies on 'could not create temp file /usr/local/rustup/tmp/...: Permission denied' and Corrosion/cargokit/flutter_rust_bridge_codegen cannot run at all"
 },
 {
  "id": "rust.toolchain-handover",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    hand_root_created_paths_to_runtime_user \"${RUSTUP_HOME:?}\" \"${CARGO_HOME:?}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "the COPY --chown covers amd64 only; on arm64/riscv64 ensure_native_rust_toolchain rm -rf's both trees and re-installs them as root, so without the handover the foreign arches ship exactly the unwritable toolchain the consumer reported"
 },
 {
  "id": "rust.handover-only-root-owned",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    find \"$@\" ! -user \"${uid}\" -exec chown -h \"${uid}:${uid}\" {} +",
  "replace": "    chown -R \"${uid}:${uid}\" \"$@\"",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "a blanket chown -R rewrites metadata on every file of a tree that entered via COPY --chown, forcing a copy-up of rustup+cargo (2.2 GB) and /opt/flutter (716 MB) into this RUN's layer on every arch -- the exact cost docs/artifact-copy-completeness.md says the COPY-time chown exists to avoid"
 },
 {
  "id": "flutter.bootstrap-whole-tree-chown",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    hand_root_created_paths_to_runtime_user /opt/flutter",
  "replace": "    chown -R \"${RUNTIME_UID:?}:${RUNTIME_UID}\" /opt/flutter",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "the right ownership by the wrong means: chown -R rewrites the metadata of the COPY --chown'd ~700 MB framework checkout and copies it up into this RUN layer on every arch -- the size rule as an assertion"
 },
 {
  "id": "flutter.smoke-sdk-writable",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "for d in /opt/flutter/bin/cache /opt/flutter/packages/flutter_tools/.dart_tool; do [ -w \"$d\" ] || printf \"UNWRITABLE %s\\n\" \"$d\"; done; ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "without the writability question the gate is back to proving flutter RUNS -- which it did, green, all through the ship in which flutter pub get could not open flutter_tools/.dart_tool/package_config.json"
 },
 {
  "id": "flutter.smoke-root-owned",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "find /opt/flutter ! -user \"$(id -u)\" -printf \"FOREIGN %p\\n\" 2>/dev/null | head -3",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the 34 root-owned git internals write nothing today but are the same root-after-chown defect one command away from .dart_tool; only an ownership sweep of the whole SDK sees them"
 },
 {
  "id": "dockerfile-lint.step-labels-unlabelled-run-fails",
  "target": "linux/scripts/verify_dockerfile_step_labels.py",
  "find": "            if pending is None:\n",
  "replace": "            if False:\n",
  "test": "bash linux/scripts/tests/test-dockerfile-step-labels.sh",
  "why": "a RUN without a step label would pass, and its layer would read as its ENV list again"
 },
 {
  "id": "dockerfile-lint.step-labels-label-before-a-copy-fails",
  "target": "linux/scripts/verify_dockerfile_step_labels.py",
  "find": "        elif head in LAYERED:\n",
  "replace": "        elif False:\n",
  "test": "bash linux/scripts/tests/test-dockerfile-step-labels.sh",
  "why": "a label followed by a COPY would name the COPY layer, not the RUN it was written for"
 },
 {
  "id": "dockerfile-lint.step-labels-repeated-name-fails",
  "target": "linux/scripts/verify_dockerfile_step_labels.py",
  "find": "            elif name in seen:\n",
  "replace": "            elif False:\n",
  "test": "bash linux/scripts/tests/test-dockerfile-step-labels.sh",
  "why": "two layers could carry one name and layer-audit.py could not tell them apart"
 },
 {
  "id": "dockerfile-lint.step-labels-heredoc-body-is-skipped",
  "target": "linux/scripts/verify_dockerfile_env_order.py",
  "find": "                heredoc = match.group(2) if match else \"\"\n",
  "replace": "                heredoc = \"\"\n",
  "test": "bash linux/scripts/tests/test-dockerfile-step-labels.sh",
  "why": "a heredoc's body lines would be read as instructions of their own"
 },
 {
  "id": "dockerfile-lint.step-labels-lint-runs-the-gate",
  "target": "linux/scripts/lint-dockerfiles.sh",
  "find": "  python3 linux/scripts/verify_dockerfile_step_labels.py \"${CHAIN_DOCKERFILES[@]}\" || FAILED=1\n",
  "replace": "  true\n",
  "test": "bash linux/scripts/tests/test-dockerfile-step-labels.sh",
  "why": "the step-label gate would exist and never run"
 },
 {
  "id": "dockerfile-lint.env-order-same-instruction",
  "target": "linux/scripts/verify_dockerfile_env_order.py",
  "find": "            if ref in seen and ref != key and ref not in args:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "the whole finding: Dockerfile.android shipped an ENV whose ${ANDROID_HOME} expanded empty, and a gate that reports nothing is how it shipped"
 },
 {
  "id": "dockerfile-lint.env-order-arg-excuse",
  "target": "linux/scripts/verify_dockerfile_env_order.py",
  "find": "            if ref in seen and ref != key and ref not in args:",
  "replace": "            if ref in seen and ref != key:",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "GCC_PREFIX=/opt/gcc-${GCC_VERSION} beside ENV GCC_VERSION is correct because the ARG carries the value; without the excuse the gate reds every working Dockerfile"
 },
 {
  "id": "dockerfile-lint.env-order-self-reference",
  "target": "linux/scripts/verify_dockerfile_env_order.py",
  "find": "        seen.append(key)\n    return bad",
  "replace": "    return bad",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "PATH=\"/opt/bin:${PATH}\" reads the INHERITED PATH and is the documented idiom; a gate that flags it cannot be left on"
 },
 {
  "id": "dockerfile-lint.env-order-arg-scope-leak",
  "target": "linux/scripts/verify_dockerfile_env_order.py",
  "find": "        if head == \"FROM\":\n            args = set()",
  "replace": "        if head == \"FROM\":\n            pass",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "an ARG only excuses a reference in ITS OWN stage; leaking the scope across FROM excuses the next stage's real defect"
 },
 {
  "id": "dockerfile-lint.env-order-interior-comment",
  "target": "linux/scripts/verify_dockerfile_env_order.py",
  "find": "            if line.lstrip().startswith(\"#\"):\n                continue",
  "replace": "            if False:\n                continue",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "Dockerfile.package's ENV blocks carry comment lines mid-continuation; treating one as the end of the instruction hides every key set after it"
 },
 {
  "id": "dockerfile-lint.env-order-empty-target-list",
  "target": "linux/scripts/verify_dockerfile_env_order.py",
  "find": "        sys.stderr.write(\"usage: verify_dockerfile_env_order.py <Dockerfile>...\\n\")\n        return 2",
  "replace": "        return 0",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "a gate handed no files must not exit 0 -- that is the vacuous pass the whole registry exists to prevent"
 },
 {
  "id": "dockerfile-lint.env-order-missing-target",
  "target": "linux/scripts/verify_dockerfile_env_order.py",
  "find": "            sys.stderr.write(f\"FAIL: not a file: {rel}\\n\")\n            bad += 1",
  "replace": "            sys.stderr.write(f\"FAIL: not a file: {rel}\\n\")",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "a mistyped path that only prints scans nothing and still says ok -- the gate would silently cover fewer Dockerfiles every rename"
 },
 {
  "id": "dockerfile-lint.env-order-not-wired",
  "target": "linux/scripts/lint-dockerfiles.sh",
  "find": "python3 linux/scripts/verify_dockerfile_env_order.py \"${DOCKERFILES[@]}\" || FAILED=1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "copy-media-payloads.sh was written and never invoked for months; a gate nothing calls is that defect again"
 },
 {
  "id": "lib.lint-scope-dockerfile-root",
  "target": "linux/scripts/01-core/lint-root.sh",
  "find": "_lsb_root=\"${LINT_ROOT_PATH}\"",
  "replace": "_lsb_root=\"$1\"",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "a submodule checkout puts this script inside the consumer; ignoring the root grades this repo's own 24 Dockerfiles -- which are clean -- and reports their verdict as the consumer's"
 },
 {
  "id": "dockerfile-lint.empty-root-scope-is-an-error",
  "target": "linux/scripts/lint-dockerfiles.sh",
  "find": "[ \"${#DOCKERFILES[@]}\" -gt 0 ] || err \"No Dockerfiles found to lint under ${SCAN_ROOT}.\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "a consumer with no Dockerfile must be told so; falling through leaves the reader a verdict that names no tree and covered no file"
 },
 {
  "id": "dockerfile-lint.consumer-config-wins",
  "target": "linux/scripts/lint-dockerfiles.sh",
  "find": "[ -f \"${SCAN_ROOT}/.hadolint.yaml\" ] && HADOLINT_CONFIG=\"${SCAN_ROOT}/.hadolint.yaml\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "this repo's waivers say nothing about a Dockerfile it never wrote; grading a consumer by them silently drops every rule the hub ignores for its own build-layer reasons"
 },
 {
  "id": "android-env.home-unset",
  "target": "linux/Dockerfile.package",
  "find": "ENV ANDROID_HOME=${ANDROID_PAYLOAD_ON:+/opt/android-sdk} \\\n    ANDROID_SDK_ROOT=${ANDROID_PAYLOAD_ON:+/opt/android-sdk}",
  "replace": "ENV ANDROID_SDK_ROOT=${ANDROID_PAYLOAD_ON:+/opt/android-sdk}",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "the shipped defect exactly: the SDK is in the image and nothing advertises it, so flutter reports '[!] No Android SDK found' three steps from the visible error"
 },
 {
  "id": "android-env.path-fronted",
  "target": "linux/Dockerfile.package",
  "find": "ENV PATH=\"${PATH}${ANDROID_HOME:+:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools}\"",
  "replace": "ENV PATH=\"${ANDROID_HOME:+${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:}${PATH}\"",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "platform-tools ships its own mke2fs/make_f2fs/sqlite3; fronting PATH with it shadows /usr/sbin/mke2fs on all three arches with an x86-64 binary"
 },
 {
  "id": "android-env.build-tools-on-path",
  "target": "linux/Dockerfile.package",
  "find": "ENV PATH=\"${PATH}${ANDROID_HOME:+:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools}\"",
  "replace": "ENV PATH=\"${PATH}${ANDROID_HOME:+:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS}}\"",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "build-tools/36.0.0 carries a renderscript-era lld; on a compiler image that name must keep resolving to /usr/bin/lld"
 },
 {
  "id": "android-env.root-not-copied",
  "target": "linux/Dockerfile.package",
  "find": "COPY --link --from=artifact-source /opt/android-sdk /opt/android-sdk",
  "replace": "COPY --link --from=artifact-source /opt/android /opt/android-sdk-unused",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "ANDROID_HOME must name a tree this Dockerfile actually stages; an ENV pointing at a path no COPY creates is the lie class the repo keeps re-fixing"
 },
 {
  "id": "probe.contract-workspace-location",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    /workspace*) printf 'BAD %s points into the bind-mounted checkout: %s\\n' \"${row}\" \"${val}\" ;;",
  "replace": "    /nowhere*)   printf 'BAD %s points into the bind-mounted checkout: %s\\n' \"${row}\" \"${val}\" ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "location and writability are two separate assertions: on a consumer's host /workspace IS a writable bind mount, so without the location arm the shipped CCACHE_DIR=/workspace/.ccache passes"
 },
 {
  "id": "probe.contract-writable",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    *)           if [ \"${write}\" = yes ]; then",
  "replace": "    *)           if [ \"${write}\" != skip ]; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "moving a cache out of the checkout is only half the fix; without the writability arm the unwritable /usr/local/rustup/tmp and /usr/local/cargo of the shipped image pass"
 },
 {
  "id": "probe.contract-real-write",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  if [ -n \"$2\" ] && [ -d \"$2\" ] && : > \"${_t}\" 2>/dev/null; then",
  "replace": "  if [ -n \"$2\" ]; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a set variable is not a writable directory; the probe must actually create and remove a file, because access(2) answers yes for root and says nothing about a read-only overlay layer"
 },
 {
  "id": "probe.contract-image-user",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "      *\" ${want} \"*) ;;\n      *) printf \"the probe ran as",
  "replace": "      *) ;;\n      *) printf \"the probe ran as",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "as root every directory answers writable, so a probe that did not run as the image's own Config.User proves nothing and must stop the gate instead of printing seven green rows"
 },
 {
  "id": "probe.contract-done-marker",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  if ! printf '%s\\n' \"${probe}\" | grep -qxF -- 'CCPROBE_DONE'; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "exit status is not evidence: a probe that died on line 1 prints nothing, and without the sentinel the gate reads the empty output as a compliant image"
 },
 {
  "id": "probe.contract-empty-table",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  if [ \"${asserted:-0}\" = 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the gate reduces to its row table, so a table that came back empty asserted nothing; printing PASS for it is the hole the gate exists to close"
 },
 {
  "id": "probe.contract-nofact",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    *) printf 'NOFACT %s no WRITE line\\n' \"${row}\"; return 0 ;;",
  "replace": "    *) ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a row the probe never reported must fail, not be judged from the remaining half of its facts -- a silently dropped row is exactly how all four defects shipped green"
 },
 {
  "id": "probe.contract-exemption-rot",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "_consumer_exempt_verdict() {\n  case \"$3\" in",
  "replace": "_consumer_exempt_verdict() {\n  case \"no\" in",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "an exemption that cannot stop applying is a permanent blind spot; the riscv64 Flutter arms must fail the day upstream ships a riscv64 SDK, and must not be granted when the rot signal is missing"
 },
 {
  "id": "probe.contract-owner-count",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  elif [ \"${n}\" != 0 ]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the 37 root-owned paths under /opt/flutter are the one defect a consumer cannot repair at runtime; without this arm the gate reports the tree as owned by the runtime uid"
 },
 {
  "id": "probe.contract-android-platform-tools",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  elif [ \"${dir}\" != yes ]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "an exported ANDROID_HOME is not an SDK; the directory it names has to exist, or 'flutter build apk' still stops with '[!] No Android SDK found'"
 },
 {
  "id": "probe.contract-android-path",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  elif [ \"${onpath}\" != yes ]; then\n    printf 'BAD %s neither %s/platform-tools nor cmdline-tools/latest/bin is on PATH' \"${row}\" \"${val}\"",
  "replace": "  elif false; then\n    printf 'BAD %s neither %s/platform-tools nor cmdline-tools/latest/bin is on PATH' \"${row}\" \"${val}\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "flutter finds the SDK by variable but adb / sdkmanager / avdmanager are found by PATH; half a wiring is not the contract the consumer asked for"
 },
 {
  "id": "flutter.bootstrap-inline-chown-copy",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    hand_root_created_paths_to_runtime_user /opt/flutter",
  "replace": "    find /opt/flutter ! -user \"${RUNTIME_UID:?}\" -exec chown -h \"${RUNTIME_UID}:${RUNTIME_UID}\" {} +",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "functionally identical and still wrong: the flutter and rust sites landed the same find/chown idiom in the same file on the same day, and a second copy drifts from the one the size rule (a tree the COPY --chown already owns draws zero chown calls) is proven against"
 },
 {
  "id": "probe.contract-w-does-not-create",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  if [ -n \"$2\" ] && [ -d \"$2\" ] && : > \"${_t}\" 2>/dev/null; then",
  "replace": "  if [ -n \"$2\" ] && mkdir -p \"$2\" 2>/dev/null && : > \"${_t}\" 2>/dev/null; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a probe that mkdir's its own target answers writable for a directory the consumer's [ -w ] calls false -- green here, red there"
 },
 {
  "id": "probe.contract-gate-is-called",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    check_consumer_contract \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the gate can be perfect and never run: the call list is the other half of the guarantee"
 },
 {
  "id": "probe.jdk-row-asserted",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_CONSUMER_CONTRACT_ROWS=\"ccache-dir sccache-dir rustup-tmp cargo-home android-home jdk appimagetool dart-tool flutter-owner flatpak-runtimes appimage-runtime web-lane-tools ort-crate-env chrome android-emulator cargo-qa-tools free-threaded-python lint-tools uv-cache-seed gtk4-dev gnu-time\"",
  "replace": "_CONSUMER_CONTRACT_ROWS=\"ccache-dir sccache-dir rustup-tmp cargo-home android-home appimagetool dart-tool flutter-owner flatpak-runtimes appimage-runtime web-lane-tools ort-crate-env chrome android-emulator cargo-qa-tools free-threaded-python lint-tools uv-cache-seed gtk4-dev gnu-time\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "dropping the row ships an Android SDK with no JDK again: Gradle stops the whole lane and the gate says nothing"
 },
 {
  "id": "probe.jdk-needs-java-home",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "      elif [ -z \"${home}\" ]; then\n        printf 'BAD %s java runs but JAVA_HOME is unset, which is what Gradle reads' \"${row}\"",
  "replace": "      elif false; then\n        printf 'BAD %s java runs but JAVA_HOME is unset, which is what Gradle reads' \"${row}\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "Gradle reads JAVA_HOME, not PATH: java on PATH with the variable unset is exactly the shape the Android lane died on"
 },
 {
  "id": "packaging.jdk-installed",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    _sdp_out+=(\"${JDK_PACKAGE:?JDK_PACKAGE is required (01-core/versions.env)}\")",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "the SDK COPY leaves the source stage's JDK behind, so the runtime image must install its own or Gradle has nothing to run"
 },
 {
  "id": "packaging.java-home-anchored",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    ln -sfn \"${home}\" /usr/lib/jvm/default-java",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "JAVA_HOME points at the anchor; without the symlink the ENV names a path that does not exist and Gradle fails as if no JDK were installed"
 },
 {
  "id": "packaging.appimagetool-readable",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "    chmod 0755 \"$tmpfile\"",
  "replace": "    chmod +x \"$tmpfile\"",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "mktemp gives 0600, so +x yields 0711: the tool runs for root and dies for the image user with 'Cannot open /proc/self/exe'"
 },
 {
  "id": "probe.appimagetool-row-asserted",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_CONSUMER_CONTRACT_ROWS=\"ccache-dir sccache-dir rustup-tmp cargo-home android-home jdk appimagetool dart-tool flutter-owner flatpak-runtimes appimage-runtime web-lane-tools ort-crate-env chrome android-emulator cargo-qa-tools free-threaded-python lint-tools uv-cache-seed gtk4-dev gnu-time\"",
  "replace": "_CONSUMER_CONTRACT_ROWS=\"ccache-dir sccache-dir rustup-tmp cargo-home android-home jdk dart-tool flutter-owner flatpak-runtimes appimage-runtime web-lane-tools ort-crate-env chrome android-emulator cargo-qa-tools free-threaded-python lint-tools uv-cache-seed gtk4-dev gnu-time\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "dropping the row lets an unreadable appimagetool ship again and the gate says nothing"
 },
 {
  "id": "probe.flatpak-row-asserted",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_CONSUMER_CONTRACT_ROWS=\"ccache-dir sccache-dir rustup-tmp cargo-home android-home jdk appimagetool dart-tool flutter-owner flatpak-runtimes appimage-runtime web-lane-tools ort-crate-env chrome android-emulator cargo-qa-tools free-threaded-python lint-tools uv-cache-seed gtk4-dev gnu-time\"",
  "replace": "_CONSUMER_CONTRACT_ROWS=\"ccache-dir sccache-dir rustup-tmp cargo-home android-home jdk appimagetool dart-tool flutter-owner appimage-runtime web-lane-tools ort-crate-env chrome android-emulator cargo-qa-tools free-threaded-python lint-tools uv-cache-seed gtk4-dev gnu-time\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "dropping the row from the list is how a contract stops being asserted without anything looking broken: the gate still passes, and the seven missing runtimes cost every consumer run ~1.9 GB again"
 },
 {
  "id": "probe.appimagetool-readability",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  elif [ \"${readable}\" != yes ]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "executable is not usable: an AppImage must read its own file, so the gate must check readability and not mere presence"
 },
 {
  "id": "tree-arch.cross-payload-exempt",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "            if _cross_payload(path):\n                continue",
  "replace": "            if False:\n                continue",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a cross toolchain ships target runtimes by design; asserting them fails every correct cross image"
 },
 {
  "id": "tree-arch.exemption-is-narrow",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "CROSS_PAYLOAD = (\n    \"/lib/rustlib/\",              # rustup: per-target std, one dir per --target\n    \"/lib/clang/\",                # clang: multilib sanitizer/builtins runtimes\n    \"/lib/gcc/\",                  # gcc: per-target crt objects, one dir per triple\n)",
  "replace": "CROSS_PAYLOAD = (\"/\",)",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the exemption must cover the target payload and nothing else: widened to the whole tree it hides the builder-arch rustc HT1 exists for"
 },
 {
  "id": "llvm-target.fill-is-needed-driven",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "            for n in $(_elf_needed \"${e}\"); do",
  "replace": "            for n in $(cd \"${src}\" && ls); do",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "this IS the old rule: a glob over the builder's multiarch dir shipped libLLVM.so.20.1/21.1, libclang-21.so.21, libclang-23.so.23 and libclang-cpp.so.21.1 -- 392 MiB of x86-64 -- into both foreign runtime images"
 },
 {
  "id": "llvm-target.fill-keeps-existing",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "                [ ! -e \"${prefix}/lib/${n}\" ] || continue",
  "replace": "                :",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "without it the builder's x86-64 lib overwrites the arm64/riscv64 source-built soname of the same name, which is the wrong-arch defect with the file count unchanged"
 },
 {
  "id": "llvm-target.fill-replaces-dangling",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "                rm -f \"${prefix}/lib/${n}\"\n                cp -a \"${src}/${n}\" \"${prefix}/lib/${n}\"",
  "replace": "                cp -a \"${src}/${n}\" \"${prefix}/lib/${n}\"",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "an apt LLVM tree ships lib/<soname> as a link into the multiarch dir it was copied away from; cp refuses to write through a dangling symlink, so the prefix keeps a link to nothing"
 },
 {
  "id": "llvm-target.fill-reaches-fixpoint",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "    while [ \"${added}\" = 1 ] && [ \"${round}\" -lt 4 ]; do",
  "replace": "    while [ \"${round}\" -lt 1 ]; do",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "a filled lib brings its own NEEDED: one pass leaves libclang-cpp.so.23.1 in the prefix with libLLVM.so.23.1 unresolved, which is the franken-toolchain the walk exists to stop"
 },
 {
  "id": "llvm-target.needed-not-soname",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "    LC_ALL=C readelf -d \"$1\" 2>/dev/null | sed -n 's/.*(NEEDED).*\\[\\(.*\\)\\].*/\\1/p'",
  "replace": "    LC_ALL=C readelf -d \"$1\" 2>/dev/null | sed -n 's/.*\\[\\(.*\\)\\].*/\\1/p'",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "SONAME and RUNPATH carry brackets too; reading them as NEEDED makes every lib a consumer of itself and pulls its own name back out of the multiarch dir"
 },
 {
  "id": "llvm-target.ld-path-published",
  "target": "linux/scripts/06-packaging/llvm-loader-path.sh",
  "find": "  printf '%s\\n' \"${prefix}/lib\" > \"${config}\" || return $?\n  ldconfig",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "libtvm_compiler.so's DT_NEEDED libLLVM.so.<ver> resolves through this conf and nothing else, so dropping it makes `import tvm` die in the shipped image"
 },
 {
  "id": "llvm-target.no-package-stage-copy",
  "target": "linux/scripts/06-packaging/copy-media-payloads.sh",
  "find": "  publish_llvm_target_ld_path\n}",
  "replace": "  publish_llvm_target_ld_path\n  cp -a \"${_lib}\" \"/usr/local/llvm-target/lib/${_soname}\"\n}",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "the package stage held a second copy of the fill for months and its filename-only guard is what let the foreign arches take the builder's libs; one owner or the bug comes back"
 },
 {
  "id": "tree-arch.hexagon-skels-are-dsp-payload",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "-linux-[a-z0-9]+/|/hexagon-v[0-9]+/\")",
  "replace": "-linux-[a-z0-9]+/\")",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "without the hexagon-v*/ filter the 107 QDSP6 skels of the QNN HTP backend red every arm64 runtime-image smoke"
 },
 {
  "id": "tree-arch.hexagon-filter-is-narrow",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "-linux-[a-z0-9]+/|/hexagon-v[0-9]+/\")",
  "replace": "-linux-[a-z0-9]+/|/\")",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the DSP exemption must cover the skeleton dirs and nothing else: widened, it hides a builder-arch object anywhere in the tree"
 },
 {
  "id": "runtime-smoke.nvidia-gst-plugins-recorded",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_PARITY_GST_KNOWN_BROKEN=\"amd64:libgstnvunixfd.so amd64:libgstnvvideo4linux2.so amd64:libgstnvvideoconvert.so amd64:libgstnvvideosinks.so arm64:libgstnvvideoconvert.so\"",
  "replace": "_PARITY_GST_KNOWN_BROKEN=\"\"",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "unrecorded, the five NVIDIA gst plugins that need the driver's libcuda.so.1 warn as new drift on every nvidia runtime-image smoke"
 },
 {
  "id": "tree-arch.frozen-table-empty",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_RT_TREE_ARCH_FROZEN=\"\"",
  "replace": "_RT_TREE_ARCH_FROZEN=\"arm64:/usr/local/llvm-target:X86-64:5\"",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "the freeze list only ratchets down; a row that outlives its defect turns the gate's loudest arm into a note"
 },
 {
  "id": "tree-arch.frozen-key-is-per-arch",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    case \"${entry}\" in \"${key}:\"*) printf '%s' \"${entry##*:}\"; return 0 ;; esac",
  "replace": "    case \"${entry}\" in *) printf '%s' \"${entry##*:}\"; return 0 ;; esac",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "a freeze is <arch>:<tree>:<machine>:<count>; matched loosely, one arch's known finding silently waives the same tree on the other two"
 },
 {
  "id": "disk-guard.lane-gate-unwired",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  _disk_guard_buildkit_fallback \"${bc_dir}\" \"${need}\"\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "the gate that REFUSES the runtime lane must reach the store before it refuses; DISK1 shipped this reachable only from the sampler"
 },
 {
  "id": "disk-guard.stage-guard-unwired",
  "target": "linux/scripts/01-core/chain-storage.sh",
  "find": "        _disk_guard_buildkit_fallback \"${bc_dir}\" \"${threshold}\"\n        free_gb=\"$(_disk_guard_free_gb \"${bc_dir}\")\"\n",
  "replace": "        :\n",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "CROSS_NO_LOCAL_CACHE_EXPORT=1 costs every remaining stage its cache export; the store is the last thing to try before paying that"
 },
 {
  "id": "disk-guard.stage-guard-recheck",
  "target": "linux/scripts/01-core/chain-storage.sh",
  "find": "      if [ -z \"${free_gb}\" ] || [ \"${free_gb}\" -lt \"${threshold}\" ]; then\n        log \"[disk-guard] still",
  "replace": "      if [ \"${free_gb}\" -lt \"${threshold}\" ] || true; then\n        log \"[disk-guard] still",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "a store that DID rescue the stage must keep the cache exports on; re-reading free space and then ignoring it makes the reclaim pointless"
 },
 {
  "id": "disk-guard.lane-gate-episode",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  _disk_guard_reclaim_begin\n  # Images first: before",
  "replace": "  # Images first: before",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "the once-per-caller latch is per PROCESS: a prune the base stage made would still be latched when the lane refuses hours later"
 },
 {
  "id": "disk-guard.stage-guard-episode",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "      _disk_guard_reclaim_begin\n      # Images first: the arch loop",
  "replace": "      # Images first: the arch loop",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "same latch, other gate: after the first between-stage prune every later stage would log `already pruned once here` and reclaim nothing"
 },
 {
  "id": "disk-guard.episode-clears-latch",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "_disk_guard_reclaim_begin() {\n  _DISK_GUARD_BUILDKIT_PRUNES=0",
  "replace": "_disk_guard_reclaim_begin() {\n  :",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "the episode owner must actually restore the credit; an empty body makes both call sites decorative"
 },
 {
  "id": "tree-arch.android-exempt-is-handed-over",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_RT_TREE_ARCH_EXEMPT=\"/opt/android-sdk /opt/android\"",
  "replace": "_RT_TREE_ARCH_EXEMPT=\"/opt/android-sdk\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "/opt/android leaves tree-arch because an Android payload's arch is the ANDROID target's, never the image's -- arm64-v8a is legitimately AArch64 inside the amd64 image. Putting it back asks the wrong question and reds every lane; the tree is not unasserted, check_android_abi judges it against the ABI the image advertises, which is stricter than 'matches the image'"
 },
 {
  "id": "tree-arch.machine-label-one-word",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "EM = {3: \"Intel-80386\"",
  "replace": "EM = {3: \"Intel 80386\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the verdict is read with `read -r verb tree machine count sample`; a space in the label ate the count column in the 2026-09-04 run and would stop the frozen lookup matching"
 },
 {
  "id": "probe.contract-flutter-owner-asserted",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    riscv64:dart-tool) return 0 ;;",
  "replace": "    riscv64:dart-tool|riscv64:flutter-owner) return 0 ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the riscv64 image measures 0 foreign-owned paths, so the row PASSES; exempting it would let CC1 defect 4 ship green on that arch"
 },
 {
  "id": "probe.contract-exempt-fact-per-row",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    appimagetool) printf '%s' 'appimagetool-readable' ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "an exemption re-checked by ANOTHER row's fact cannot rot at all: a riscv64 appimagetool would read EXEMPT forever"
 },
 {
  "id": "probe.contract-exempt-fact-is-read",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "      fact=\"$(_consumer_exempt_fact \"${row}\")\"",
  "replace": "      fact=flutter-sdk",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the per-row table is only worth anything if the verdict loop actually consults it"
 },
 {
  "id": "mutations.stale-check-runs-no-test",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        rc = run_stale(entries, args.root)",
  "replace": "        rc = run_entries(args, entries, Report())",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k stale",
  "why": "the staleness pass is affordable in a hook only because it runs no suite; running them turns a 0.06s whole-manifest sweep into minutes"
 },
 {
  "id": "mutations.stale-check-verdict",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        if mutated is None:\n            rc = 1",
  "replace": "        if False:\n            rc = 1",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k stale",
  "why": "an entry that can no longer be applied must FAIL the pass; reporting nothing is how the rot stayed invisible until CI"
 },
 {
  "id": "mutations.push-stale-check-aborts",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "  exit 1\n}\n\nif [ \"${#_ranges[@]}\" -eq 0 ]; then",
  "replace": "  exit 0\n}\n\nif [ \"${#_ranges[@]}\" -eq 0 ]; then",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "a rotted manifest entry must STOP the push; printing and pushing anyway is the state this hook was written to end"
 },
 {
  "id": "mutations.push-stale-check-whole-manifest",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "${_PY} docs/scripts/verify_mutations.py --stale-check ||",
  "replace": "${_PY} docs/scripts/verify_mutations.py --stale-check --changed ||",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "scoping the staleness pass to the diff leaves every entry the push does not touch as invisible as it was before the hook existed"
 },
 {
  "id": "mutations.push-runs-the-gate",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "${_PY} docs/scripts/verify_mutations.py \"${_ranges[@]}\"",
  "replace": "true \"${_ranges[@]}\"",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "staleness alone never asks whether a test can fail; without this call the push hook proves only that the edits still apply"
 },
 {
  "id": "shellcheck-warnings.bash-from-path",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "    return shutil.which(\"bash\") or \"bash\"",
  "replace": "    return \"bash\"",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "on Windows a bare `bash` resolves to System32's WSL launcher before PATH; it mangles the C:\\ script path and the ratchet dies before grading anything"
 },
 {
  "id": "mutations.push-clears-git-env",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX",
  "replace": ": unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "with GIT_DIR inherited from git, a fixture's `git -C <tmp> init` re-inits the real repository as bare (2026-09-22, the hub's submodule gitdir)"
 },
 {
  "id": "gate-registry.hooks-are-all-of-them",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    paths = [os.path.join(HOOK_DIR, fn) for fn in sorted(os.listdir(HOOK_DIR))]",
  "replace": "    paths = [os.path.join(HOOK_DIR, \"pre-commit\")]",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "reading a single hook path reports every gate a second versioned hook runs as CI-only -- a false statement in a generated file"
 },
 {
  "id": "gate-registry.hook-top-level-tier",
  "target": "linux/scripts/verify_gate_registry.py",
  "find": "    for scope, tier in ((\"whole\", \"hook (whole tree)+CI\"),",
  "replace": "    for scope, tier in ((\"whole\", \"hook (scoped)+CI\"),",
  "test": "bash linux/scripts/tests/test-gate-registry.sh",
  "why": "a gate a hook runs unconditionally at top level is not scoped to anything; calling it scoped tells the reader the push only checked what it changed"
 },
 {
  "id": "android-parity.divergence-fails",
  "target": "linux/scripts/01-core/verify-android-stage-parity.sh",
  "find": "if [ \"${FAIL}\" -ne 0 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-android-stage-parity.sh",
  "why": "a drifted stage must FAIL the gate; printing a diff and exiting 0 is the shape this repo keeps finding"
 },
 {
  "id": "android-parity.missing-stage-fails",
  "target": "linux/scripts/01-core/verify-android-stage-parity.sh",
  "find": "    FAIL=1\n    continue\n  fi",
  "replace": "    continue\n  fi",
  "test": "bash linux/scripts/tests/test-android-stage-parity.sh",
  "why": "a stage the gate can no longer find is a check that silently stopped covering a fifth of Dockerfile.android"
 },
 {
  "id": "android-parity.block-ends-at-next-from",
  "target": "linux/scripts/01-core/verify-android-stage-parity.sh",
  "find": "    grab && /^FROM / { grab = 0 }",
  "replace": "    grab && /^NEVERFROM / { grab = 0 }",
  "test": "bash linux/scripts/tests/test-android-stage-parity.sh",
  "why": "without the boundary every block swallows the rest of the file and the comparison becomes a stage against itself"
 },
 {
  "id": "android-parity.lib-value-normalized",
  "target": "linux/scripts/01-core/verify-android-stage-parity.sh",
  "find": "      sub(/^ARG ANDROID_LIB=.*/, \"ARG ANDROID_LIB=<LIB>\")",
  "replace": "      sub(/^NEVER_ANDROID_LIB=.*/, \"x\")",
  "test": "bash linux/scripts/tests/test-android-stage-parity.sh",
  "why": "ANDROID_LIB is the ONE difference the five stages are allowed; unnormalized, the gate is red on a healthy tree"
 },
 {
  "id": "android-parity.comments-normalized",
  "target": "linux/scripts/01-core/verify-android-stage-parity.sh",
  "find": "      if ($0 ~ /^[[:space:]]*#/ || $0 ~ /^[[:space:]]*$/) next   # comments/blanks",
  "replace": "      if ($0 ~ /^[[:space:]]*$/) next",
  "test": "bash linux/scripts/tests/test-android-stage-parity.sh",
  "why": "a per-stage comment is the point of keeping them separate stages, and must not read as drift"
 },
 {
  "id": "android-parity.stage-list-complete",
  "target": "linux/scripts/01-core/verify-android-stage-parity.sh",
  "find": "STAGES=(android-gstreamer android-onnx android-litert android-opencv android-iree)",
  "replace": "STAGES=(android-gstreamer android-onnx)",
  "test": "bash linux/scripts/tests/test-android-stage-parity.sh",
  "why": "the gate's own list is the contract; a stage dropped from it drifts unwatched for as long as nobody rereads the script"
 },
 {
  "id": "patch-integrity.malformed-diff-fails",
  "target": "linux/scripts/verify-patch-integrity.sh",
  "find": "  if grep -qE '^--- ' \"${_p}\" && grep -qE '^\\+\\+\\+ ' \"${_p}\" && grep -qE '^@@ ' \"${_p}\"; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-patch-integrity.sh",
  "why": "a truncated patch only detonates hours into a cross build, which is the entire reason this static check exists"
 },
 {
  "id": "patch-integrity.orphan-fails",
  "target": "linux/scripts/verify-patch-integrity.sh",
  "find": "  if grep -rlF \"${_base}\" \"${SCRIPTS_DIR}\" --include='*.sh' | grep -q .; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-patch-integrity.sh",
  "why": "a patch no build script names has quietly stopped being applied, and its fix with it"
 },
 {
  "id": "patch-integrity.corpus-is-shell-scripts",
  "target": "linux/scripts/verify-patch-integrity.sh",
  "find": "  if grep -rlF \"${_base}\" \"${SCRIPTS_DIR}\" --include='*.sh' | grep -q .; then",
  "replace": "  if grep -rlF \"${_base}\" \"${SCRIPTS_DIR}\" | grep -q .; then",
  "test": "bash linux/scripts/tests/test-patch-integrity.sh",
  "why": "a patch named only in a doc or a changelog is still applied by nothing; the corpus is *.sh on purpose"
 },
 {
  "id": "patch-integrity.helper-routing-reported",
  "target": "linux/scripts/verify-patch-integrity.sh",
  "find": "    if grep -rlF \"${_base}\" \"${SCRIPTS_DIR}\" --include='*.sh' \\\n         | xargs grep -lE 'apply-patch\\.sh|android_apply_patch' 2>/dev/null | grep -q .; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-patch-integrity.sh",
  "why": "the advisory has to tell the two apply shapes apart, or every site reads as raw and the INFO line means nothing"
 },
 {
  "id": "patch-integrity.raw-apply-site-is-advisory",
  "target": "linux/scripts/verify-patch-integrity.sh",
  "find": "      pass \"referenced: ${_base}\"",
  "replace": "      fail \"referenced: ${_base}\"",
  "test": "bash linux/scripts/tests/test-patch-integrity.sh",
  "why": "some apply sites legitimately pre-date apply-patch.sh; making the advisory fatal breaks a green tree for no build reason"
 },
 {
  "id": "patch-integrity.failure-count-is-the-exit",
  "target": "linux/scripts/verify-patch-integrity.sh",
  "find": "[ \"${fail_n}\" -eq 0 ]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-patch-integrity.sh",
  "why": "a per-file loop that reports failures and exits 0 is the vacuous-gate shape; the count must reach the exit code"
 },
 {
  "id": "runtime-paths.missing-infra-fails",
  "target": "linux/scripts/04-runtime/verify-runtime-paths.sh",
  "find": "if [ \"${_infra_fail}\" -ne 0 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-runtime-paths.sh",
  "why": "LOG31: this gate once never failed at all. A missing tracked file is a broken tree, not a heuristic mismatch"
 },
 {
  "id": "runtime-paths.infra-loop-reports-all",
  "target": "linux/scripts/04-runtime/verify-runtime-paths.sh",
  "find": "  if [ ! -f \"${_req}\" ]; then\n    echo \"FAIL: required file missing: ${_req}\" >&2\n    _infra_fail=1\n  fi",
  "replace": "  if [ ! -f \"${_req}\" ]; then\n    echo \"FAIL: required file missing: ${_req}\" >&2\n    _infra_fail=1\n    break\n  fi",
  "test": "bash linux/scripts/tests/test-runtime-paths.sh",
  "why": "stopping at the first missing file sends the reader back for a second run to find the next one"
 },
 {
  "id": "runtime-paths.warn-is-advisory",
  "target": "linux/scripts/04-runtime/verify-runtime-paths.sh",
  "find": "echo \"Done: path-mismatch WARN lines above are advisory; infrastructure errors fail hard (LOG31).\"\nexit 0",
  "replace": "echo \"Done: path-mismatch WARN lines above are advisory; infrastructure errors fail hard (LOG31).\"\nexit 1",
  "test": "bash linux/scripts/tests/test-runtime-paths.sh",
  "why": "the path extraction is heuristic and WARNs on a healthy tree; promoting that to an exit code makes the gate unusable, not stronger"
 },
 {
  "id": "runtime-paths.warn-scope-is-narrow",
  "target": "linux/scripts/04-runtime/verify-runtime-paths.sh",
  "find": "        /opt/*|/usr/local/*)",
  "replace": "        /*)",
  "test": "bash linux/scripts/tests/test-runtime-paths.sh",
  "why": "the WARN case list is narrow on purpose; widening it floods a healthy tree until nobody reads the output"
 },
 {
  "id": "runtime-paths.canonical-paths-expanded",
  "target": "linux/scripts/04-runtime/verify-runtime-paths.sh",
  "find": "    | while IFS= read -r line; do _envsubst \"$line\"; done \\",
  "replace": "    | while IFS= read -r line; do printf '%s\\n' \"$line\"; done \\",
  "test": "bash linux/scripts/tests/test-runtime-paths.sh",
  "why": "a canonical path holding ${GCC_VERSION} would never match a Dockerfile that spells the version out"
 },
 {
  "id": "runtime-paths.needs-no-envsubst",
  "target": "linux/scripts/04-runtime/verify-runtime-paths.sh",
  "find": "    | while IFS= read -r line; do _envsubst \"$line\"; done \\",
  "replace": "    | while IFS= read -r line; do envsubst <<<\"$line\"; done \\",
  "test": "bash linux/scripts/tests/test-runtime-paths.sh",
  "why": "the image ships no envsubst; leaning on it again turns the canonical list empty there, and the gate passes having compared nothing"
 },
 {
  "id": "workflow-lint.findings-fail",
  "target": "linux/scripts/lint-workflows.sh",
  "find": "if [ \"${FAILED}\" -eq 0 ]; then\n  printf 'WORKFLOW LINT OK\\n'\nelse\n  printf 'WORKFLOW LINT FAILED\\n' >&2\n  exit 1\nfi",
  "replace": "printf 'WORKFLOW LINT OK\\n'",
  "test": "bash linux/scripts/tests/test-workflow-lint.sh",
  "why": "a lint gate that prints findings and exits 0 still reports green, which is the hazard its own header names"
 },
 {
  "id": "workflow-lint.shellcheck-half-resolved",
  "target": "linux/scripts/lint-workflows.sh",
  "find": "shellcheck_for_actionlint\nshellcheck_rule_selftest\n",
  "replace": "shellcheck_rule_selftest\n",
  "test": "bash linux/scripts/tests/test-workflow-lint.sh",
  "why": "actionlint reaches shellcheck by NAME and silently disables the rule when the name is absent; without this resolution every run: block is graded for YAML only and the gate still prints WORKFLOW LINT OK"
 },
 {
  "id": "workflow-lint.shellcheck-rule-selftest",
  "target": "linux/scripts/lint-workflows.sh",
  "find": "shellcheck_rule_selftest\n\nFAILED=0",
  "replace": "\nFAILED=0",
  "test": "bash linux/scripts/tests/test-workflow-lint.sh",
  "why": "a resolved binary is a precondition, not the guarantee: a path that exists while actionlint still cannot exec it leaves the rule off, and only the planted-SC1010 self-test can tell that apart from a working gate"
 },
 {
  "id": "workflow-lint.root-argument-is-the-tree",
  "target": "linux/scripts/lint-workflows.sh",
  "find": "LINT_ROOT=\"$(cd \"${1:-${SCRIPT_REPO_ROOT}}\" && pwd)\" || exit 1",
  "replace": "LINT_ROOT=\"${SCRIPT_REPO_ROOT}\"",
  "test": "bash linux/scripts/tests/test-workflow-lint.sh",
  "why": "a submodule checkout puts this script inside the consumer; ignoring the argument lints ANTfrastructure and reports OK for a tree nobody looked at"
 },
 {
  "id": "workflow-lint.cd-into-lint-root",
  "target": "linux/scripts/lint-workflows.sh",
  "find": "cd \"${LINT_ROOT}\" || exit 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-workflow-lint.sh",
  "why": "actionlint discovers workflows from its cwd, so resolving the root and then not entering it lints the wrong tree just as silently"
 },
 {
  "id": "secret-scan.leak-fails",
  "target": "linux/scripts/lint-secrets.sh",
  "find": "err \"gitleaks found potential secrets (values redacted, file:line shown above).",
  "replace": "echo \"gitleaks found potential secrets (values redacted, file:line shown above).",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "a scanner that reports findings and exits 0 gates nothing; the leak ships"
 },
 {
  "id": "secret-scan.scope-is-the-argument",
  "target": "linux/scripts/lint-secrets.sh",
  "find": "cd \"${_SCAN_DIR}\" && \"${GITLEAKS}\" detect",
  "replace": "cd \"${REPO_ROOT}\" && \"${GITLEAKS}\" detect",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "the path argument is what lets a consumer checkout be scanned; ignoring it grades the wrong tree, green or red for the wrong reason"
 },
 {
  "id": "secret-scan.values-are-redacted",
  "target": "linux/scripts/lint-secrets.sh",
  "find": "--no-banner --redact --verbose );",
  "replace": "--no-banner --verbose );",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "without --redact every CI log that ran the gate becomes a copy of the credential it found"
 },
 {
  "id": "secret-scan.findings-are-printed",
  "target": "linux/scripts/lint-secrets.sh",
  "find": "--no-banner --redact --verbose );",
  "replace": "--no-banner --redact );",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "this gate once failed on main saying 'leaks found: 2' and naming neither; a finding nobody can locate is not actionable"
 },
 {
  "id": "secret-scan.config-is-relative-in-tree",
  "target": "linux/scripts/lint-secrets.sh",
  "find": "[ \"${CONFIG}\" = \"${SCAN_CONFIG_DIR}/.gitleaks.toml\" ] && _CONFIG_ARG=\".gitleaks.toml\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "gitleaks skips its OWN config only when the config and source paths are spelled the same way; an absolute config against a relative source makes the gate scan .gitleaks.toml and report the rule regexes inside it as findings"
 },
 {
  "id": "secret-scan.relative-root-is-the-callers",
  "target": "linux/scripts/lint-secrets.sh",
  "find": "SCAN_ROOT=\"$(cd \"${1:-${REPO_ROOT}}\" 2>/dev/null && pwd)\" || err \"scan root not found: ${1:-.}\"",
  "replace": "SCAN_ROOT=\"${1:-.}\"",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "resolving the argument AFTER the cd into the hub checkout is the shipped bug: the consumer's own `... lint-secrets.sh .` then scanned the hub, which is clean, and the consumer's leak passed the gate meant to catch it"
 },
 {
  "id": "secret-scan.consumer-config-wins",
  "target": "linux/scripts/lint-secrets.sh",
  "find": "elif [ -f \"${SCAN_CONFIG_DIR}/.gitleaks.toml\" ]; then",
  "replace": "elif false; then",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "a consumer's allowlist entries are written about ITS false positives and the hub's say nothing about them; grading a consumer tree by the hub config is the same category of error as scanning the wrong tree"
 },
 {
  "id": "secret-scan.hub-config-is-the-fallback",
  "target": "linux/scripts/lint-secrets.sh",
  "find": "  CONFIG=\"${REPO_ROOT}/.gitleaks.toml\"",
  "replace": "  CONFIG=\"${SCAN_ROOT}/.gitleaks.toml\"",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "the hub config is what grades every consumer that ships none of its own; point the fallback at the scanned tree and those trees are handed a config that is not there"
 },
 {
  "id": "copy-coverage.missing-fails",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "    if total_missing:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "a referenced script nobody COPY'd is exit 127 deep inside a multi-hour build; reporting it and returning 0 ships that build"
 },
 {
  "id": "copy-coverage.transitive-refs",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "        collect_refs(ref, provided, seen, out)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "the media_load_arch_flags bug was transitive: the Dockerfile COPY'd what it ran, and what THAT sourced was missing"
 },
 {
  "id": "copy-coverage.dir-copy-expands",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "            for f in src_path.rglob(pattern):",
  "replace": "            for f in []:",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "a directory COPY provides every script beneath it; not expanding it makes the gate red on a healthy tree until someone deletes it"
 },
 {
  "id": "copy-coverage.bind-mount-provides",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "        for m in MOUNT_RE.findall(s):\n            kv = dict(KV_RE.findall(m))\n            if \"source\" in kv and \"target\" in kv:",
  "replace": "        for m in []:\n            kv = dict(KV_RE.findall(m))\n            if \"source\" in kv and \"target\" in kv:",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "a per-RUN bind mount is ephemeral but present while that RUN executes, and counting only COPY is a false red"
 },
 {
  "id": "copy-coverage.continuations-joined",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "        if line.rstrip().endswith(\"\\\\\"):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "a COPY wrapped over backslash-newlines provides nothing when the logical line is never rejoined"
 },
 {
  "id": "copy-coverage.known-base-is-per-dockerfile",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "    base_ok = KNOWN_BASE_PROVIDED.get(dockerfile.name, [])",
  "replace": "    base_ok = [p for v in KNOWN_BASE_PROVIDED.values() for p in v]",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "the inheritance table is keyed by Dockerfile on purpose; an entry that leaked to every image would silence the class the gate exists for"
 },
 {
  "id": "copy-coverage.no-dockerfiles-fails",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "        print(\"no Dockerfiles found\", file=sys.stderr)\n        return 1",
  "replace": "        return 0",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "zero subjects is a broken checkout, and a gate that grades nothing must not report a clean sweep"
 },
 {
  "id": "copy-coverage.report-is-read-only",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "    if \"--report-core-usage\" in sys.argv[1:]:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "the core-usage report is a lower bound by its own docstring; wiring a verdict to it would gate on a figure nobody should act on alone"
 },
 {
  "id": "context-paths.missing-fails",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "    if broken:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "a source that is not in the context is a build that dies at checksum, before instruction one; counting it and returning 0 ships that build"
 },
 {
  "id": "context-paths.copy-sources-checked",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "        for source in mount_sources(line) + copy_sources(line):",
  "replace": "        for source in mount_sources(line):",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "COPY is how most of this tree reaches an image; skipping it leaves the majority of every Dockerfile ungraded"
 },
 {
  "id": "context-paths.mount-sources-checked",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "        for source in mount_sources(line) + copy_sources(line):",
  "replace": "        for source in copy_sources(line):",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "both live breakages were bind mounts, not COPYs -- a COPY-only gate would have caught neither"
 },
 {
  "id": "context-paths.escape-directive-honoured",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "    joiner = escape_char(text)",
  "replace": "    joiner = chr(92)",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "every Windows Dockerfile continues its lines with a backtick; reading them with the backslash default folds nothing and hides every source after line one"
 },
 {
  "id": "context-paths.stage-copy-not-judged",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "    if any(t.lower().startswith(\"--from=\") for t in tokens):",
  "replace": "    if any(t.lower().startswith(\"--never=\") for t in tokens):",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "a COPY --from= names a path in another stage; grading it against the host tree is a guaranteed false red, and a gate that is red on a healthy tree gets switched off"
 },
 {
  "id": "context-paths.stage-mount-not-judged",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "        if \"from\" in fields:\n            continue",
  "replace": "        if \"never\" in fields:\n            continue",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "the same for a bind mount that reads from a stage rather than from the context"
 },
 {
  "id": "context-paths.vars-are-wildcards",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "VAR.sub(\"*\", source.replace(\"\\\\\", \"/\"))",
  "replace": "source.replace(\"\\\\\", \"/\")",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "which value a build arg takes is not a static fact; treating ${VAR} literally makes every templated path a false red"
 },
 {
  "id": "context-paths.context-is-per-dockerfile",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "    context = ROOT / CONTEXTS.get(rel, \".\")",
  "replace": "    context = ROOT / next(iter(CONTEXTS.values()), \".\")",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "the context table is keyed by Dockerfile because Build-Buildkit passes a different -Context to one of them; an entry that leaked would grade every image against the wrong root"
 },
 {
  "id": "context-paths.generated-is-per-dockerfile",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "    produced = GENERATED.get(rel, {})",
  "replace": "    produced = {k: v for m in GENERATED.values() for k, v in m.items()}",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "a name a documented step produces for ONE image must not excuse the same name in another; that is how an allow row stops covering anything"
 },
 {
  "id": "context-paths.untracked-not-graded",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "        if known is not None and rel not in known:\n            continue",
  "replace": "        if False:\n            continue",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "a local external/ checkout has its own build contract; grading it buries the repo's own findings under ones nobody here can act on"
 },
 {
  "id": "context-paths.no-dockerfiles-fails",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "        print(\"no Dockerfiles found\", file=sys.stderr)\n        return 1",
  "replace": "        return 0",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "zero subjects is a broken checkout, and a gate that grades nothing must not report a clean sweep"
 },
 {
  "id": "context-paths.external-floor-is-independent-of-git",
  "target": "linux/scripts/verify_dockerfile_context_paths.py",
  "find": "SKIP_DIRS = {\".git\", \"external\", \"out\", \"logs\", \"node_modules\", \"__pycache__\", \".venv\", \"third_party\"}",
  "replace": "SKIP_DIRS = {\".git\", \"out\", \"logs\", \"node_modules\", \"__pycache__\", \".venv\", \"third_party\"}",
  "test": "bash linux/scripts/tests/test-dockerfile-context-paths.sh",
  "why": "git reports nothing in a checkout it refuses -- a mirror with no .git, a bind-mounted tree, dubious ownership -- and without the named floor the gate then grades somebody's external/ clone and buries this repo's own findings"
 },
 {
  "id": "mirror-consistency.missing-arg-fails",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "      _mirror_consistency_error \"${df} is missing ARG ${arg}\"",
  "replace": "      echo \"ERROR: ${df} is missing ARG ${arg}\" >&2",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "a Dockerfile that cannot receive the mirror ARGs silently builds against the upstream archive; the count has to reach the exit code"
 },
 {
  "id": "mirror-consistency.base-needs-the-run",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "    if ! grep -q 'use-fast-ubuntu-mirror.sh' \"$df_path\"; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "downstream images inherit the mirror RUN from base; without it in base nothing rewrites the sources at all"
 },
 {
  "id": "mirror-consistency.restore-is-wired",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "if [ -z \"${restore_ln}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "a working-but-unwired restore is exactly how the CA-bootstrap http downgrade shipped with nothing undoing it"
 },
 {
  "id": "mirror-consistency.restore-runs-after-install",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "elif [ -z \"${install_ln}\" ] || [ \"${restore_ln}\" -le \"${install_ln}\" ]; then",
  "replace": "elif false; then",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "restoring https before the CA store exists puts apt back into the chicken-and-egg the downgrade was there to break"
 },
 {
  "id": "mirror-consistency.outcome-is-asserted",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "  if ! grep -q '^URIs: https://mirror.invalid/ubuntu/$' \"${fixture_root}/etc/apt/sources.list.d/ubuntu.sources\" \\\n     || grep -q 'http://mirror.invalid' \"${fixture_root}/etc/apt/sources.list.d/ubuntu.sources\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "APT-HTTP itself: the call site was present and the sources still ended on http. Referenced != restored, and only the outcome check can tell"
 },
 {
  "id": "mirror-consistency.downgrade-precondition",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "if ! grep -q '^URIs: http://mirror.invalid/ubuntu/$' \"${fixture_root}/etc/apt/sources.list.d/ubuntu.sources\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "if the downgrade stops landing there is nothing left to restore, and the outcome check would pass for the wrong reason"
 },
 {
  "id": "mirror-consistency.errors-reach-exit",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "if [ \"$errors\" -gt 0 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "every ERROR above is printed to stderr; a gate that prints them and exits 0 is the vacuous shape this repo keeps finding"
 },
 {
  "id": "sbom.check-fails-when-stale",
  "target": "docs/scripts/generate_sbom.py",
  "find": "    print(\"Curated SBOM is out of date.\", file=sys.stderr)\n    print(\"Run: python docs/scripts/generate_sbom.py --write\", file=sys.stderr)\n    return 1",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-curated-sbom.sh",
  "why": "the published corresponding-source record is only as good as the check that it matches the tree it claims to describe"
 },
 {
  "id": "sbom.check-is-byte-equality",
  "target": "docs/scripts/generate_sbom.py",
  "find": "    if OUT_FILE.exists() and OUT_FILE.read_text(encoding=\"utf-8\") == content:",
  "replace": "    if OUT_FILE.exists():",
  "test": "bash linux/scripts/tests/test-curated-sbom.sh",
  "why": "existence is not currency: a committed document edited by hand would pass a check that only asks whether the file is there"
 },
 {
  "id": "sbom.timestamp-is-frozen",
  "target": "docs/scripts/generate_sbom.py",
  "find": "            \"created\": \"1970-01-01T00:00:00Z\",",
  "replace": "            \"created\": __import__(\"datetime\").datetime.now().isoformat() + \"Z\",",
  "test": "bash linux/scripts/tests/test-curated-sbom.sh",
  "why": "a wall-clock stamp makes --check fail on every run, and a gate that is always red is a gate that gets switched off"
 },
 {
  "id": "sbom.stdout-writes-nothing",
  "target": "docs/scripts/generate_sbom.py",
  "find": "        sys.stdout.buffer.write(content.encode(\"utf-8\"))\n        return 0",
  "replace": "        sys.stdout.buffer.write(content.encode(\"utf-8\"))\n        OUT_DIR.mkdir(parents=True, exist_ok=True)\n        OUT_FILE.write_text(content, encoding=\"utf-8\", newline=\"\\n\")\n        return 0",
  "test": "bash linux/scripts/tests/test-curated-sbom.sh",
  "why": "--stdout is the read-only mode; writing from it would make the check pass by rewriting the thing it was about to compare"
 },
 {
  "id": "sbom.tracks-versions-env",
  "target": "docs/scripts/generate_sbom.py",
  "find": "    content = render(build_document(parse_versions_env()))",
  "replace": "    content = render(build_document({}))",
  "test": "bash linux/scripts/tests/test-curated-sbom.sh",
  "why": "the curated half exists to name the source-built versions; a document that ignores versions.env drifts silently from the image it describes"
 },
 {
  "id": "arg-consistency.arg-default-drift-fatal",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "_finish_fatal_check \"${VALUE_ERRORS}\"",
  "replace": "_finish_fatal_check 0",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "a Dockerfile ARG default that drifts from versions.env wins silently on any non-orchestrated docker build"
 },
 {
  "id": "arg-consistency.defaultless-arg-fatal",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "_finish_fatal_check \"${DEFAULTLESS_ERRORS}\"",
  "replace": "_finish_fatal_check 0",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "the LITERTJS_VERSION class: a default-less ARG builds with an EMPTY value and the image ships built against nothing"
 },
 {
  "id": "arg-consistency.derived-arg-skipped",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "      case \"$val_raw\" in '${'*) continue ;; esac",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "an ARG computed from another ARG has no literal to compare; reporting it is a permanent false red nobody can fix"
 },
 {
  "id": "arg-consistency.gcc-case-mapping-pinned",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "    echo \"  ERROR: gcc.sh case default for major ${_gcc_major} does not map to ${_gcc_full} (versions.env GCC_VERSION)\"\n    LITERAL_ERRORS=$((LITERAL_ERRORS + 1))",
  "replace": "    echo \"  ERROR: gcc.sh case default for major ${_gcc_major} does not map to ${_gcc_full} (versions.env GCC_VERSION)\"",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "the case arm OVERRIDES the real version and no ARG check can see it; printing without counting leaves the drift shipping"
 },
 {
  "id": "arg-consistency.llvm-mapping-pinned",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "    echo \"  ERROR: common.sh llvm_release_version mapping does not contain ${_llvm_full} (versions.env LLVM_RELEASE)\"\n    LITERAL_ERRORS=$((LITERAL_ERRORS + 1))",
  "replace": "    echo \"  ERROR: common.sh llvm_release_version mapping does not contain ${_llvm_full} (versions.env LLVM_RELEASE)\"",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "the second case-mapped literal drifts exactly as silently as the first, and misreports the LLVM the image carries"
 },
 {
  "id": "arg-consistency.gcc-literal-drift-fatal",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "      echo \"  ERROR: ${_loc#\"${REPO_ROOT}/\"}  ${_expr}  \u2260  expected ${_var} default ${_want}\"\n      GCC_LITERAL_ERRORS=$((GCC_LITERAL_ERRORS + 1))",
  "replace": "      echo \"  ERROR: ${_loc#\"${REPO_ROOT}/\"}  ${_expr}  \u2260  expected ${_var} default ${_want}\"",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "these ~25 sites all name the same /opt/gcc-<ver> toolchain, so unlike the generic scan there is no legitimate divergence to be advisory about"
 },
 {
  "id": "arg-consistency.scan-vacuity-floor",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "  if [ \"${_gcc_sites}\" -lt 10 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "a refactor that rewrites the literals into a shape the pattern cannot see makes the gate find nothing and print OK -- the stale-gate class twice over"
 },
 {
  "id": "arg-consistency.handforward-fatal",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "_finish_fatal_check \"${HANDFWD_ERRORS}\"",
  "replace": "_finish_fatal_check 0",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "XC7: a literal --build-arg beside the auto-forward is a second channel that survives refactors of the first and then diverges"
 },
 {
  "id": "arg-consistency.handforward-excludes-tests",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "done < <(grep -rnP --include='*.sh' --exclude-dir=tests \\",
  "replace": "done < <(grep -rnP --include='*.sh' \\",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "a suite quotes the pattern as assertion text; counting that makes the gate red for describing itself, which is how a gate gets deleted"
 },
 {
  "id": "arg-consistency.forwarding-check-advisory",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "  echo \"Remove the # noforward marker in versions.env or drop the Dockerfile ARG\"",
  "replace": "  echo \"Remove the # noforward marker in versions.env or drop the Dockerfile ARG\"; exit 1",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "the noforward marker is an orchestrator choice; gating a build on a comment turns a hint into a blocker"
 },
 {
  "id": "arg-consistency.script-drift-advisory",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "    echo \"  WARN drift: ${file}  ${match}  \u2260  versions.env ${var}=${env_val}\"\n    DRIFT_WARN=$((DRIFT_WARN + 1))",
  "replace": "    echo \"  WARN drift: ${file}  ${match}  \u2260  versions.env ${var}=${env_val}\"\n    DRIFT_WARN=$((DRIFT_WARN + 1)); exit 1",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "script defaults legitimately diverge -- a standalone run pins a branch, not the built ref -- so this scan must never be an exit code"
 },
 {
  "id": "shellcheck-warnings.allow-reader-yields-rows",
  "target": "linux/scripts/quality_allow.py",
  "find": "    return {key: (count, reason) for key, count, reason, _num in iter_rows(path, keys, fmt)}",
  "replace": "    return dict.fromkeys((k for k, _c, _r, _n in iter_rows(path, keys, fmt)), (0, \"\"))",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "load_rows is the dict VIEW of iter_rows; dropping the count and reason it carries makes every frozen budget 0"
 },
 {
  "id": "code-dupes.allow-keys-declared",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    for pair, budget, why, n in iter_rows(str(ALLOW_FILE), 2, ALLOW_FMT):",
  "replace": "    for pair, budget, why, n in iter_rows(str(ALLOW_FILE)):",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "the pair is two declared key columns, so a | in the reason cannot shift the budget; counting from the right keys the row on four columns and it matches no measured pair"
 },
 {
  "id": "code-dupes.allow-rows-not-folded",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    for pair, budget, why, n in iter_rows(str(ALLOW_FILE), 2, ALLOW_FMT):",
  "replace": "    for (pair, (budget, why)), n in zip(load_rows(str(ALLOW_FILE), 2, ALLOW_FMT).items(), range(1, 999)):",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "the shared reader must hand this gate every ROW: a dict view folds two identical rows into one before the duplicate check can see them"
 },
 {
  "id": "code-complexity.allow-keys-declared",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "    frozen = load_counts(allow, 3, ALLOW_FMT)",
  "replace": "    frozen = load_counts(allow, 3, None)",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "three declared key columns are what let a reason carry |; counting from the right mis-keys the row and reports it STALE"
 },
 {
  "id": "code-size.fn-allow-keys-declared",
  "target": "linux/scripts/verify_code_size.py",
  "find": "load_counts(fn_allow, 2, FN_FMT), LIMIT",
  "replace": "load_counts(fn_allow), LIMIT",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "function-size.allow has two key columns; without the declaration a | in the reason shifts the count"
 },
 {
  "id": "code-size.file-allow-keys-declared",
  "target": "linux/scripts/verify_code_size.py",
  "find": "load_counts(file_allow, 1, FILE_FMT), FILE_LIMIT",
  "replace": "load_counts(file_allow), FILE_LIMIT",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "file-size.allow has one key column; same rule, and its reasons already carry a docs anchor"
 },
 {
  "id": "dead-functions.self-mention-not-a-use",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "    seen.subtract(self_mentions())",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k defs",
  "why": "a function that names itself in a printf, or calls only itself, must stay dead: string literals are not stripped from the corpus"
 },
 {
  "id": "env-knobs.arch-flags-are-owners",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "ENV_OWNER_FILES=(\"${SCRIPTS}/01-core/versions.env\" \"${SCRIPTS}/01-core/tool-pins.env\" \"${SCRIPTS}\"/03-media/core/arch-flags-*.env)",
  "replace": "ENV_OWNER_FILES=(\"${SCRIPTS}/01-core/versions.env\" \"${SCRIPTS}/01-core/tool-pins.env\")",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "media_load_arch_flags sources arch-flags-<arch>.env, so its keys own their knobs; without them the MEDIA_SKIP_* knobs read as unowned again"
 },
 {
  "id": "env-knobs.runtime-paths-owns-nothing",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "ENV_OWNER_FILES=(\"${SCRIPTS}/01-core/versions.env\" \"${SCRIPTS}/01-core/tool-pins.env\" \"${SCRIPTS}\"/03-media/core/arch-flags-*.env)",
  "replace": "ENV_OWNER_FILES=(\"${SCRIPTS}/01-core/versions.env\" \"${SCRIPTS}/01-core/tool-pins.env\" \"${SCRIPTS}\"/03-media/core/arch-flags-*.env \"${SCRIPTS}\"/04-runtime/*.env)",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "runtime-paths.env is reference data for verify-runtime-paths.sh and no stage sources it; counting it would invent an owner for every path knob"
 },
 {
  "id": "doc-numbers.census-count-stale",
  "target": "linux/scripts/tests/test-doc-numbers.sh",
  "find": "    return dict(zip(CENSUS_KEYS, (int(g) for g in hit.groups())))",
  "replace": "    return dict(zip(CENSUS_KEYS, (int(g) + 1 for g in hit.groups())))",
  "test": "bash linux/scripts/tests/test-doc-numbers.sh",
  "why": "the census figures on the page are COMPARED against the gate's own --census, so a wrong derivation must fail rather than pass"
 },
 {
  "id": "doc-numbers.census-keys-in-order",
  "target": "linux/scripts/tests/test-doc-numbers.sh",
  "find": "CENSUS_KEYS = (\"considered\", \"isolated\", \"masked\", \"unlinked\")",
  "replace": "CENSUS_KEYS = (\"considered\", \"masked\", \"isolated\", \"unlinked\")",
  "test": "bash linux/scripts/tests/test-doc-numbers.sh",
  "why": "each quoted number binds to its own tier; swapping the isolated and masked counts must not read as correct"
 },
 {
  "id": "trailing-conditional.one-line-body",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "    brace = lines[-1].rfind(\"}\")",
  "replace": "    brace = -1",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "the closing-brace trim is what gives a one-line `f() { ...; }` a body at all; without it the last statement reads as `... ; }` and the `;` cut hands back the brace, so every one-line predicate goes silently missing"
 },
 {
  "id": "trailing-conditional.block-closer-verdict",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "        if stmt and not closes_a_block(stmt):",
  "replace": "        if stmt:",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "a loop returns its last iteration and an if returns the branch it took, so stopping at `done`/`fi`/`esac` is how reconcile_local_wheels' shape stayed invisible; judging the closer word itself reports nothing, ever"
 },
 {
  "id": "trailing-conditional.closer-not-in-a-pipeline",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "    return is_simple(stmt) and stmt.split()[0] in CLOSERS",
  "replace": "    return stmt.split()[0] in CLOSERS",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "`done | sort -u` returns the PIPELINE, not the loop body; opening the block there reports the loop's guarded action as the function's status and invents a finding the author already handled"
 },
 {
  "id": "trailing-conditional.separator-only-line-skipped",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "        if last < 0:\n            break",
  "replace": "        if not stmt:\n            break",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "a case arm's `;;` line strips to nothing once separators are trimmed; treating that empty result as end-of-body abandons the walk one line short and every `esac` finding disappears"
 },
 {
  "id": "trailing-conditional.or-last-arm-judged",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "        return is_finding(stmt[fallback + 2:].strip())",
  "replace": "        return False",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "an author who wrote a fallback arm is trusted only for WHAT THEY WROTE THERE: `do_thing || [ -n \"$x\" ]` still returns a condition, and `a || b && c` is SC2015's own shape"
 },
 {
  "id": "trailing-conditional.delegate-hop",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "        elif delegate(stmt):",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "a function ending on a bare call to a predicate returns that predicate; without the hop cross_build_is_active and its two aliases read clean while carrying the exact hazard the gate exists for"
 },
 {
  "id": "trailing-return.csv-each-skips-empty-element",
  "target": "linux/scripts/01-core/guard-helpers.sh",
  "find": "    if [ -n \"${_item}\" ]; then \"${_fn}\" \"${_item}\"; fi",
  "replace": "    [ -n \"${_item}\" ] && \"${_fn}\" \"${_item}\"",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "a CSV with a trailing comma makes the LAST iteration the empty one, so the loop -- and csv_each -- returns 1 and kills the caller under set -e, against the helper's own documented contract that empty elements are skipped"
 },
 {
  "id": "trailing-return.version-build-args-empty-value",
  "target": "linux/scripts/01-core/version-forwarding.sh",
  "find": "    if [ -n \"${value}\" ]; then\n      append_optional_build_arg \"${_avba_name}\" \"${var_name}\" \"${value}\"\n    fi",
  "replace": "    [ -n \"${value}\" ] && append_optional_build_arg \"${_avba_name}\" \"${var_name}\" \"${value}\"",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "an empty value in the LAST tracked versions.env key returns 1 from the loop, and append_common_build_args ends on a call to this function, so the orchestrator's whole build-arg assembly dies under set -e"
 },
 {
  "id": "trailing-return.gst-log-dump-err-trap",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-stage.sh",
  "find": "    if [ -f \"${_log}\" ]; then\n      echo \"--- ${_log} ---\" >&2\n      cat \"${_log}\" >&2\n    fi",
  "replace": "    [ -f \"${_log}\" ] && echo \"--- ${_log} ---\" >&2 && cat \"${_log}\" >&2",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "_dump_gst_build_logs is the stage's ERR trap; a trap whose own last statement is a guarded action returns 1 when the last diagnostic log is absent -- the 2026-09-02 logging.sh ERR-trap death seen from the trap side"
 },
 {
  "id": "trailing-return.wasm-opt-pin-already-exported",
  "target": "linux/scripts/lib/wasm-opt.sh",
  "find": "    if [[ -z \"${!name:-}\" ]]; then export \"${name}=${line#*=}\"; fi",
  "replace": "    [[ -z \"${!name:-}\" ]] && export \"${name}=${line#*=}\"",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "the while-read loop returns its last iteration, so wasm_opt_load_pin returns 1 exactly when the last BINARYEN_* key is already exported -- which the function's own header calls the normal case"
 },
 {
  "id": "trailing-return.agentic-retry-sleep-skipped",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "        if [[ \"${DRY_RUN:-false}\" != \"true\" ]]; then sleep \"$sleep_s\"; fi",
  "replace": "        [[ \"${DRY_RUN:-false}\" != \"true\" ]] && sleep \"$sleep_s\"",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "STATIC proof only: the `while true` above it never falls out of the loop, so this line is not what invoke_agent returns today. The gate is the test -- it reports the shape as a NEW finding -- and the line is normalised so a `break` added later cannot turn it into a real defect"
 },
 {
  "id": "cross-build.clang-wrapper-bakes-gcc-toolchain",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": " --gcc-toolchain=${gcc_prefix}",
  "replace": "",
  "test": "bash linux/scripts/tests/test-clang-cross-wrappers.sh",
  "why": "this flag in the wrapper's exec line is the entire reason export_clang_gcc_toolchain_env could be deleted (CL3); without it the wrappers fall back to clang's own GCC discovery and nothing points them at the source-built /opt/gcc-$GCC_VERSION"
 },
 {
  "id": "cross-build.clang-wrapper-fixes-the-triple",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "--target=${triplet} ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-clang-cross-wrappers.sh",
  "why": "a clang-<arch> wrapper without --target is the host compiler wearing a cross name; it compiles and links host objects into a foreign-arch image with no error until runtime"
 },
 {
  "id": "doc-links.header-scope",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "HEADER_LINES = 10",
  "replace": "HEADER_LINES = 0",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "the header rule is scoped to a leading comment block ON PURPOSE -- a zero window finds nothing, so the whole check goes inert while its allow file still reads as 45 reviewed rows, which is exactly the cover an allowlist must never become"
 },
 {
  "id": "doc-links.header-anchor-exempt",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "                if m.group(2):\n                    continue",
  "replace": "                if False:\n                    continue",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "an anchored pointer is the shape the house rule ASKS for; counting it as bare reports every compliant header and makes the gate's advice contradict itself"
 },
 {
  "id": "doc-links.header-section-ref-exempt",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "            if SECTION_SIGN in line:\n                continue",
  "replace": "            if False:\n                continue",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "`page.md \u00a7 Heading` already says which section it means and check_section_refs already validates it; reporting it as bare demands a second spelling of a reference the gate can already follow"
 },
 {
  "id": "doc-links.header-stale-row",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "    for key in sorted(frozen - set(found)):",
  "replace": "    for key in sorted(set()):",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "without the stale half the freeze is one-way: a row whose pointer gained an anchor, or whose file was deleted, sits there forever reading as a reviewed exception for something that no longer exists"
 },
 {
  "id": "doc-links.header-suffix-scope",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "        if f.suffix not in HEADER_SUFFIXES:\n            continue",
  "replace": "        if False:\n            continue",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "the house header convention is a .sh/.py comment-block rule; applying it to every scanned file (Makefile fragments, YAML, patches) reports first-10-line prose that was never promised an anchor"
 },
 {
  "id": "python.ext-modules-ifs",
  "target": "linux/scripts/01-core/cpython-dev-packages.sh",
  "find": "    IFS=' ' read -r -a mod_words <<< \"${mods}\"",
  "replace": "    read -r -a mod_words <<< \"${mods}\"",
  "test": "bash linux/scripts/tests/test-cpython-ext-table.sh",
  "why": "build_python.sh runs under IFS=$'\\n\\t', where an unpinned read leaves a two-module row as the single word '_ssl _hashlib' -- the exact trap the table header names"
 },
 {
  "id": "python.dynload-audit-derives-its-list",
  "target": "linux/scripts/02-toolchain/python/build_python.sh",
  "find": "  done < <(cpython_ext_modules)",
  "replace": "  done < <(printf '%s\\n' zlib _bz2)",
  "test": "bash linux/scripts/tests/test-cpython-ext-table.sh",
  "why": "the lib-dynload audit must read the table, never a second list of its own -- the desync CL2 exists for"
 },
 {
  "id": "python.uv-greedy-keeps-first",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "            case \"$keep\" in *\" $other \"*) conflicted=1 ;; esac",
  "replace": "            case \"$drop\" in *\" $other \"*) conflicted=1 ;; esac",
  "test": "bash linux/scripts/tests/test-uv-conflict-extras.sh",
  "why": "conflicting against the DROPPED set excludes nothing, so `uv sync --all-extras` fails again with the error the helper exists to avoid"
 },
 {
  "id": "stage-graph.validate-graph-verdict",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "  return \"${ok}\"",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-stage-defs.sh",
  "why": "a graph error must be the function's exit status; build-cross-chain.sh and preflight's stage-graph slug read nothing else"
 },
 {
  "id": "stage-graph.cycle-is-a-verdict",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "'[ERROR] Cycle detected in stage chain near \"%s\"\\n' \"${stage}\" >&2\n        ok=1",
  "replace": "'[ERROR] Cycle detected in stage chain near \"%s\"\\n' \"${stage}\" >&2\n        ok=0",
  "test": "bash linux/scripts/tests/test-stage-defs.sh",
  "why": "printing the cycle is not refusing it -- the depth cap has to set the verdict, which is what the deleted `chain` array never did"
 },
 {
  "id": "gst.env-multiarch-triplet-dir",
  "target": "linux/scripts/04-runtime/gstreamer-env.sh",
  "find": "  MULTIARCH_DIR=\"lib/${TRIPLET}\"",
  "replace": "  MULTIARCH_DIR=\"lib\"",
  "test": "bash linux/scripts/tests/test-gstreamer-env.sh",
  "why": "the multiarch dir is the whole point of the file: smoke-runtime-image.sh proves the entrypoint sourced it by looking for that GST_PLUGIN_PATH entry"
 },
 {
  "id": "gst.env-dead-system-lib",
  "target": "linux/scripts/04-runtime/gstreamer-env.sh",
  "find": "  MULTIARCH_DIR=\"lib/multiarch\"",
  "replace": "  MULTIARCH_DIR=\"lib/multiarch\"\n  SYSTEM_LIB=\"/usr/lib\"",
  "test": "bash linux/scripts/tests/test-gstreamer-env.sh",
  "why": "re-introducing the write-only SYSTEM_LIB must fail: the suite asserts set-ness, not emptiness, so an assignment of \"\" would not slip through either"
 },
 {
  "id": "gst.gi-scanner-wrapper-arch",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "  gi_scanner_wrapper=\"/usr/local/bin/g-ir-scanner-${gi_cross_wrapper_arch}-cross\"",
  "replace": "  gi_scanner_wrapper=\"/usr/local/bin/g-ir-scanner-cross\"",
  "test": "bash linux/scripts/tests/test-gi-cross-detect.sh",
  "why": "the wrapper paths are per-target-arch; an arch-less name makes arm64 and riscv64 share one scanner wrapper"
 },
 {
  "id": "gst.gi-dead-host-bindir",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "  gi_version=\"${gi_version%%-*}\"",
  "replace": "  gi_version=\"${gi_version%%-*}\"\n  gi_bindir=\"/usr/bin\"",
  "test": "bash linux/scripts/tests/test-gi-cross-detect.sh",
  "why": "the deleted host bindir/libdir must not come back -- the .pc metadata is written from target_gi_*, and the suite pins both the state and the header comment that lists it"
 },
 {
  "id": "handoff.manifest-missing-rid-refuses",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  [ \"${missing}\" -gt 0 ] && [ \"${BUILD_IMAGES}\" -eq 0 ] && refuse=1",
  "replace": "  [ \"${missing}\" -gt 0 ] && [ \"${BUILD_IMAGES}\" -eq 2 ] && refuse=1",
  "test": "bash linux/scripts/tests/test-manifest-wrapper-gate.sh",
  "why": "ancestry_run_ids_coherent drops empty ids, so on the --repair/--manifest-only path unverifiable provenance MUST refuse rather than be assumed coherent"
 },
 {
  "id": "doc-dupes.owner-cutoff",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "        if 1 < len(holders) <= MAX_OWNERS:",
  "replace": "        if 1 < len(holders):",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "a phrase held by more paragraphs than MAX_OWNERS is shared vocabulary; without the cutoff the gate reports every stock sentence as a copy"
 },
 {
  "id": "doc-dupes.cross-file-only",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "                if a[0] != b[0]:",
  "replace": "                if True:",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "a page restating itself is not docs duplication; pairing same-file paragraphs makes every long page a finding"
 },
 {
  "id": "doc-dupes.badge-block-not-prose",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "        if fence or block or line",
  "replace": "        if fence or line",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "the generated badge block is markup, never a copied passage"
 },
 {
  "id": "doc-dupes.word-floor",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "            if len(words) < MIN_WORDS:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "a paragraph too short to carry a shingle must never be indexed, or the scanned count stops meaning what it says"
 },
 {
  "id": "doc-dupes.stale-row-fails",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "    if not stale:\n        return 0",
  "replace": "    if True:\n        return 0",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "an allow row whose overlap is gone must fail; a silent stale row is cover for the next copy"
 },
 {
  "id": "doc-dupes.report-lists-allowed",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "    for n, a, b, why in allowed:\n        print(f\"  allowed {n:4d}",
  "replace": "    for n, a, b, why in []:\n        print(f\"  allowed {n:4d}",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "--report exists to show the allowed pairs and their reasons; a report that lists none is a blank page that still exits 0"
 },
 {
  "id": "lib.slang-invalid-emit-not-copied",
  "target": "linux/scripts/lib/slang-compile.sh",
  "find": "  if ! offenders=\"$(slang_compile_wgsl_varyings_are_located \"$tmp_out\")\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-slang-compile.sh",
  "why": "an emit whose varying struct members carry no @builtin/@location must never reach the destination file; skipping the validator is how a naga-rejected shader gets committed"
 },
 {
  "id": "lib.slang-invalid-emit-is-fatal",
  "target": "linux/scripts/lib/slang-compile.sh",
  "find": "      2) wgsl_invalid+=(\"$out_name\") ;;",
  "replace": "      2) : ;;",
  "test": "bash linux/scripts/tests/test-slang-compile.sh",
  "why": "outcome 2 is what makes slang_compile_main exit 1; dropping it turns a toolchain regression into a silent green run"
 },
 {
  "id": "lib.slang-emit-failure-reported",
  "target": "linux/scripts/lib/slang-compile.sh",
  "find": "      1) wgsl_failed+=(\"$src_file\") ;;",
  "replace": "      1) : ;;",
  "test": "bash linux/scripts/tests/test-slang-compile.sh",
  "why": "a slangc that failed must be named in the summary, or a shader silently stops being regenerated"
 },
 {
  "id": "lib.slang-outcome-survives-errexit",
  "target": "linux/scripts/lib/slang-compile.sh",
  "find": "    _slang_emit_one_wgsl \"$slangc\" \"$src_file\" \"$out_name\" \"$dst_rel\" \"$slangc_version\" || rc=$?",
  "replace": "    _slang_emit_one_wgsl \"$slangc\" \"$src_file\" \"$out_name\" \"$dst_rel\" \"$slangc_version\"",
  "test": "bash linux/scripts/tests/test-slang-compile.sh",
  "why": "the helper reports its outcome as a return code, so the call must be guarded: unguarded, the caller's set -e kills the whole run on the first failed emit instead of collecting it"
 },
 {
  "id": "lib.slang-version-floor",
  "target": "linux/scripts/lib/slang-compile.sh",
  "find": "    wgsl_emit_enabled=0",
  "replace": "    wgsl_emit_enabled=1",
  "test": "bash linux/scripts/tests/test-slang-compile.sh",
  "why": "below the manifest's slangc floor the combined emit drops @location(N); emitting anyway overwrites the correct checked-in WGSL with output naga rejects"
 },
 {
  "id": "lib.slang-dead-patch-warns",
  "target": "linux/scripts/lib/slang-compile.sh",
  "find": "    if [[ \"$before_sum\" == \"$after_sum\" ]]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-slang-compile.sh",
  "why": "a depth-texture patch that matches nothing means slangc's output moved under the pattern; silence there is how a patch table rots unnoticed"
 },
 {
  "id": "lib.slang-missing-source-skipped",
  "target": "linux/scripts/lib/slang-compile.sh",
  "find": "  if [[ ! -f \"$src_path\" ]]; then return 3; fi",
  "replace": "  if false; then return 3; fi",
  "test": "bash linux/scripts/tests/test-slang-compile.sh",
  "why": "a wgslMap row naming a file this tree does not have must be skipped, not compiled from a path that does not exist"
 },
 {
  "id": "wheels.ort-summary-one-owner",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native.sh",
  "find": "report_onnx_build_output \"Build complete\" \"${NATIVE_CPU_OUTPUT_DIR}\"",
  "replace": "info \"Build complete. Artifacts in ${NATIVE_CPU_OUTPUT_DIR}\"\ninfo \"Wheels in ${NATIVE_CPU_OUTPUT_DIR}/wheels\"\nls -lh \"${NATIVE_CPU_OUTPUT_DIR}/wheels\"/*.whl 2>/dev/null || true\nfind \"${NATIVE_CPU_OUTPUT_DIR}/lib\" -maxdepth 1 -type f -name \"*.so*\" -printf '%f\\n' 2>/dev/null | head -20 || true",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "a build script that re-lists its own wheels is the fifth copy of a block whose four copies had already drifted"
 },
 {
  "id": "wheels.ort-summary-listing-cap",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  find \"${output_dir}/lib\" -maxdepth 1 -type f -name \"*.so*\" -printf '%f\\n' 2>/dev/null | head -20 || true",
  "replace": "  find \"${output_dir}/lib\" -maxdepth 1 -type f -name \"*.so*\" -printf '%f\\n' 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "the summary lists at most 20 libraries; uncapped it buries the stage's own result under a shared-object dump"
 },
 {
  "id": "wheels.ort-summary-advisory",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  info \"Wheels in ${output_dir}/wheels\"\n  ls -lh \"${output_dir}/wheels\"/*.whl 2>/dev/null || true",
  "replace": "  info \"Wheels in ${output_dir}/wheels\"\n  ls -lh \"${output_dir}/wheels\"/*.whl 2>/dev/null",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "every line of the summary is advisory: under set -euo pipefail an unguarded ls kills a stage whose wheels directory it never fills"
 },
 {
  "id": "lib.agentic-engine-env-override",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "        (if $eo != \"\" then $eo else (.engine // \"opencode\" | v) end) as $e |",
  "replace": "        ((.engine // \"opencode\" | v)) as $e |",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "AGENTIC_ENGINE is the documented way to run the loop on the other engine without editing the config; ignoring it silently runs the wrong CLI"
 },
 {
  "id": "lib.agentic-missing-model-fatal",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "    if [[ -z \"$PLANNER_MODEL\" || -z \"$EXECUTOR_MODEL\" ]]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "a config with no model for the selected engine must stop here; continuing invokes the CLI with an empty model id"
 },
 {
  "id": "lib.agentic-retry-exhaustion",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "        if (( attempt > retries )); then",
  "replace": "        if (( attempt > 0 )); then",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "AGENT_RETRIES is the number of retries the loop actually spends; giving up on the first failure makes a flaky engine look like a broken one"
 },
 {
  "id": "lib.agentic-unknown-engine-fatal",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "            *)\n                log \"Unknown engine: '${AGENTIC_ENGINE}' (expected opencode|claude)\" \"FATAL\"\n                return 1 ;;",
  "replace": "            *)\n                invoke_opencode \"$role\" \"$model\" \"$message\" || rc=$? ;;",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "an unrecognised engine name must fail loudly; falling back to a default runs a typo'd config against the wrong CLI for hours"
 },
 {
  "id": "lib.agentic-drain-counts-progress",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "            _AL[tasks_completed]=$(( _AL[tasks_completed] + 1 ))",
  "replace": "            _AL[tasks_completed]=$(( _AL[tasks_completed] ))",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "the completed-task count is the loop's only record of what it achieved, and the after-task phases hang off the same branch"
 },
 {
  "id": "lib.agentic-blocked-not-queued",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "    _agentic_task_count \"${1:-BACKLOG.md}\" '^- \\[ \\]'",
  "replace": "    _agentic_task_count \"${1:-BACKLOG.md}\" '^- \\['",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "blocked tasks are deliberately not queue depth: counting them keeps the executor grinding on work it cannot do instead of letting the planner run"
 },
 {
  "id": "sccache.server-address-hoisted-setup-ccache",
  "target": "linux/scripts/01-core/compiler-cache.sh",
  "find": "    if _sccache_available; then\n      sccache_export_server_address || return 1\n    fi\n    _cc_launcher=\"$(_resolve_compiler_cache_launcher)\"",
  "replace": "    _cc_launcher=\"$(_resolve_compiler_cache_launcher)\"",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "YB root cause: with the address set only inside the $( ) resolver it never reaches ninja, every client falls back to TCP 4226 and concurrent BuildKit steps are served by each other's sccache server"
 },
 {
  "id": "sccache.server-address-hoisted-setup-sccache",
  "target": "linux/scripts/01-core/compiler-cache.sh",
  "find": "  mkdir -p \"${SCCACHE_DIR}\" 2>/dev/null || true\n  sccache_export_server_address",
  "replace": "  mkdir -p \"${SCCACHE_DIR}\" 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "same defect on the RUSTC_WRAPPER path: setup_sccache must export the address to its caller, not compute it inside the substitution"
 },
 {
  "id": "sccache.server-address-respects-the-caller",
  "target": "linux/scripts/01-core/sccache-server-address.sh",
  "find": "  if [ -n \"${SCCACHE_SERVER_UDS:-}\" ] || [ -n \"${SCCACHE_SERVER_PORT:-}\" ]; then\n    return 0\n  fi",
  "replace": "  if false; then\n    return 0\n  fi",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "an address the operator or an outer stage already chose must never be overwritten -- otherwise the shell and the compiles address two different servers, which is the same split this bug is made of"
 },
 {
  "id": "sccache.bypass-line-names-the-server",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "    printf 'sccache-launcher: sccache failed twice on its own account [server=%s]; compiling directly.\\n' \\\n      \"${SCCACHE_SERVER_UDS:-tcp:${SCCACHE_SERVER_PORT:-4226}}\" >&2",
  "replace": "    printf 'sccache-launcher: sccache failed twice on its own account; compiling directly.\\n' >&2",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "the address on the bypass line is what turns the next compile-heavy chain into the experiment: tcp:4226 in a bypass line is this bug still live in that step"
 },
 {
  "id": "sccache.launcher-keeps-hyphenated-env",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "#!/usr/bin/env bash\n",
  "replace": "#!/bin/sh\n",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "under dash a variable such as CARGO_BIN_EXE_burn-demos never reaches rustc, so a hyphenated binary's integration tests lose their path (CON132)"
 },
 {
  "id": "sccache.launcher-env-exports-to-caller",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    ensure_sccache_env >&2 || true\n  fi\n  return 0",
  "replace": "    (ensure_sccache_env) >&2 || true\n  fi\n  return 0",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "YB: the address has to land in the shell that runs the compiles. Established inside a subshell it dies with it, every client falls back to TCP 4226, and concurrent rootless BuildKit steps are served by each other's sccache server"
 },
 {
  "id": "sccache.launcher-env-is-total",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    ensure_sccache_env >&2 || true\n  fi\n  return 0",
  "replace": "    ensure_sccache_env >&2\n  fi\n  return 0",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "it runs in the CALLER's shell, ahead of the launcher substitution, so a host with no usable sccache would kill a build that was about to compile uncached perfectly well"
 },
 {
  "id": "sccache.launcher-env-honours-the-switch",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  if [ \"${USE_SCCACHE:-1}\" != \"0\" ]; then\n    ensure_sccache_env >&2 || true",
  "replace": "  if true; then\n    ensure_sccache_env >&2 || true",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "USE_SCCACHE=0 is the way a stage opts out; probing anyway starts a server for a build that asked for none"
 },
 {
  "id": "sccache.launcher-env-at-every-site",
  "target": "linux/scripts/05-frameworks/tvm-config.sh",
  "find": "  compiler_cache_launcher_env 2>/dev/null || true\n  _tvm_launcher=",
  "replace": "  _tvm_launcher=",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "one owner is only worth something if every resolution site calls it; a site that resolves the launcher without it addresses TCP 4226 exactly as before"
 },
 {
  "id": "sccache.toolchain-mounts-the-guard",
  "target": "linux/Dockerfile.toolchain",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n",
  "replace": "    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "these stages mount 01-core per FILE; without sccache-launcher.sh beside common.sh the GCC/LLVM stages run BARE sccache, where an sccache fault aborts the build instead of costing a cache entry"
 },
 {
  "id": "sccache.launcher-env-guarded",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "      compiler_cache_launcher_env 2>/dev/null || true",
  "replace": "      compiler_cache_launcher_env",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "this file documents running WITHOUT 01-core and the next line falls back to ccache for exactly that reason; a bare call is rc 127 under set -e and aborts the stage instead of degrading"
 },
 {
  "id": "trailing-conditional.group-is-unwrapped",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "    inner = unwrap_group(stmt)\n    if inner:\n        return is_finding(inner)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "a brace group returns its LAST inner statement's status; judging the group by its first word `{` misses every predicate inside one"
 },
 {
  "id": "trailing-conditional.brace-not-a-continuation",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "CONT_END = (\"\\\\\", \"&&\", \"||\", \"|\", \"(\", \"then\", \"do\", \"else\")",
  "replace": "CONT_END = (\"\\\\\", \"&&\", \"||\", \"|\", \"{\", \"(\", \"then\", \"do\", \"else\")",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "a `{` on its own line joined forward, so the predicate after it read as `{ [ -n .. ]` and hid behind the closer arm"
 },
 {
  "id": "vulkan.sdk-source-prune-wired",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "    _vulkan_prune_sdk_sources \"${target_dir}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the prune is unreachable unless the cross install calls it, and without the call every foreign lane carries 4.09 GB of ./vulkansdk build tree from the SDK stage all the way into the runtime image"
 },
 {
  "id": "vulkan.sdk-source-prune-guard",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  [ -d \"${target_dir}/source\" ] || return 0",
  "replace": "  [ -d \"${target_dir}/source\" ] || true",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "a tree with no source/ must be a silent no-op; without the early return the helper logs a prune it did not do and rm -rf's a path that is not there, which under the caller's errexit is one bad rm away from killing the SDK stage"
 },
 {
  "id": "packaging.vulkan-prune-host-arch-guard",
  "target": "linux/scripts/06-packaging/prune-vulkan-host-sdk.sh",
  "find": "  [ \"${arch_dir}\" != \"${prefix}\" ] || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-vulkan-host-sdk-prune.sh",
  "why": "on amd64 the builder prefix IS the prefix the image runs; without this arm the prune deletes /opt/vulkan/<ver>/x86_64 out of the amd64 image and takes VULKAN_SDK, the loader and every host tool with it"
 },
 {
  "id": "packaging.vulkan-prune-loader-precondition",
  "target": "linux/scripts/06-packaging/prune-vulkan-host-sdk.sh",
  "find": "  [ -e \"${version_dir}/${arch_dir}/lib/libvulkan.so.1\" ] || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-vulkan-host-sdk-prune.sh",
  "why": "the target loader existing is the whole precondition for dropping the host one; without it a lane whose cross Vulkan build failed ships an image with no loader at all instead of keeping the host prefix and warning"
 },
 {
  "id": "packaging.vulkan-prune-symlink-guard",
  "target": "linux/scripts/06-packaging/prune-vulkan-host-sdk.sh",
  "find": "  [ -d \"${version_dir}/${arch_dir}\" ] && [ ! -L \"${version_dir}/${arch_dir}\" ] || return 1",
  "replace": "  [ -d \"${version_dir}/${arch_dir}\" ] || return 1",
  "test": "bash linux/scripts/tests/test-vulkan-host-sdk-prune.sh",
  "why": "setup-vulkan-symlinks.sh makes aarch64 -> x86_64 as a fallback; -d follows that link, so without the -L test the prune reads the loader THROUGH the link and then deletes the very tree the link points at"
 },
 {
  "id": "packaging.vulkan-prune-arch-validation",
  "target": "linux/scripts/06-packaging/prune-vulkan-host-sdk.sh",
  "find": "  arch_deb_multiarch_triplet_for \"${target_arch}\" >/dev/null 2>&1 || {",
  "replace": "  true || {",
  "test": "bash linux/scripts/tests/test-vulkan-host-sdk-prune.sh",
  "why": "arch_uname_name_for echoes an unknown arch straight back, so an unvalidated arch silently names a prefix that does not exist and the prune keeps 1.86 GB while reporting success; the triplet lookup is the only thing that returns non-zero on an arch platform.sh cannot map"
 },
 {
  "id": "packaging.vulkan-prune-runs-before-the-copy",
  "target": "linux/Dockerfile.package",
  "find": "    bash /tmp/prune-vulkan-host-sdk.sh \"${TARGET_ARCH:-${TARGETARCH}}\"",
  "replace": "    true",
  "test": "bash linux/scripts/tests/test-vulkan-host-sdk-prune.sh",
  "why": "a perfect prune script that no stage runs saves nothing; the suite pins that Dockerfile.package invokes it in artifact-source and at a line BEFORE the /opt/vulkan COPY, since after the COPY the bytes are already a layer"
 },
 {
  "id": "tree-arch.vulkan-probed-whole",
  "target": "linux/scripts/runtime-artifacts.manifest",
  "find": "/opt/vulkan | Vulkan SDK + loader/layers",
  "replace": "/opt/vulkan/active | Vulkan SDK + loader/layers",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "narrowing the manifest entry is the other way to re-blind the tree-arch gate to this class: the scanner would look only at active/ again and a builder-arch prefix that came back would be invisible, exactly as it was for months"
 },
 {
  "id": "probe.tree-arch-vulkan-narrowing-returns",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    /opt/llvm-target) printf '%s' /usr/local/llvm-target ;;",
  "replace": "    /opt/vulkan)      printf '%s' /opt/vulkan/active ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "re-adding a /opt/vulkan arm to _rt_tree_probe_path restores the exemption HT5 removed -- the whole-tree walk is what turns 1 317 hidden X86-64 objects into a failure -- and dropping the llvm-target relocation at the same time breaks the arm the parity gate co-owns"
 },
 {
  "id": "probe.vulkan-loader-path-asserted",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "        /opt/vulkan/*) echo \"  OK  libvulkan.so.1 loads from ${_vk_lib} (${target_arch})\" ;;",
  "replace": "        *) echo \"  OK  libvulkan.so.1 loads from ${_vk_lib} (${target_arch})\" ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "Ubuntu's multiarch libvulkan.so.1 is in every image, so without the path arm a prune that removed the prefix the image actually runs still passes the load test on the distro loader -- the exact silent pass the tree-arch NOELF note leaves open"
 },
 {
  "id": "probe.vulkan-loader-path-parsed",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  printf '%s' \"${1}\" | sed -n 's/^VKLIB //p' | head -1",
  "replace": "  printf '%s' \"\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a reader that returns nothing sends every run down the non-fatal WARN arm, so the gate reports 'no path' forever and the assertion it exists to make never runs"
 },
 {
  "id": "llvm-target.repair-repoints-inside-the-prefix",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "ln -sfn \"$(realpath -m --relative-to=\"${e%/*}\" \"${prefix}/lib/${base}\")\" \"${e}\"",
  "replace": "ln -sfn \"${prefix}/lib/${base}\" \"${e}\"",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "an absolute /opt path dangles again after the package COPY, and a bare basename dangles four levels down in site-packages"
 },
 {
  "id": "llvm-target.repair-never-links-a-file-to-itself",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "            [ \"${prefix}/lib/${base}\" = \"${e}\" ] \\\n                || ln -sfn \"$(realpath -m --relative-to=\"${e%/*}\" \"${prefix}/lib/${base}\")\" \"${e}\"",
  "replace": "            ln -sfn \"$(realpath -m --relative-to=\"${e%/*}\" \"${prefix}/lib/${base}\")\" \"${e}\"",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "a Debian multiarch dev link (lib/libX.so.N -> ../../<triplet>/libX.so.N) resolves to its OWN basename, so the repair copies the real file exactly onto the link's path; relinking there replaces that file with a symlink to itself, which is dangling by definition and killed the whole sdk stage"
 },
 {
  "id": "llvm-target.repair-drops-what-the-prefix-does-not-own",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "           && _is_llvm_family \"${base}\"; then",
  "replace": "           && true; then",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "without the family filter the repair materialises a second libc++ ahead of the base image's on the loader path"
 },
 {
  "id": "llvm-target.repair-materialises-a-header-tree",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "if [ -d \"${real}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "dropping the include/llvm link instead of filling it leaves find_package(LLVM) succeeding and the compile failing"
 },
 {
  "id": "llvm-target.repair-fails-the-sdk-stage",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "    [ -z \"${links}\" ] || {",
  "replace": "    [ -z \"\" ] || {",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "shipping a link that resolves to nothing is exactly what put twelve of them in the image"
 },
 {
  "id": "llvm-target.family-covers-liblldb",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "libLLVM*|libclang*|liblldb*)",
  "replace": "libLLVM*|libclang*)",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "liblldb outside the family is why the walk's ldconfig arm passed 3 of 142 binaries that cannot start"
 },
 {
  "id": "llvm-target.repair-runs-on-every-arch",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "    _llvm_target_repair_links /opt/llvm-target /opt/llvm-target",
  "replace": "    true",
  "test": "bash linux/scripts/tests/test-llvm-target-prefix.sh",
  "why": "the foreign prefixes measure 0 dangling; the call keeps that true instead of assuming it"
 },
 {
  "id": "python.uv-group-text-accumulated-in-the-walk",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "        else if (depth >= 2) group = group c",
  "replace": "        else if (depth >= 2) group = group \"\"",
  "test": "bash linux/scripts/tests/test-uv-conflict-extras.sh",
  "why": "gathering the extras outside the character walk is what made an inline conflicts group invisible"
 },
 {
  "id": "python.uv-group-read-at-its-closing-bracket",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "          if (depth == 2) { g = extras(group); if (g != \"\") print g; group = \"\" }",
  "replace": "          if (depth == 2) { group = \"\" }",
  "test": "bash linux/scripts/tests/test-uv-conflict-extras.sh",
  "why": "no group means no exclusion and uv sync --all-extras dies on the conflict it was meant to route around"
 },
 {
  "id": "lib.agentic-fixer-role-maps-to-executor",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "if [[ \"$role\" == \"fixer\" ]]; then oc_agent=\"executor\"; fi",
  "replace": "if false; then oc_agent=\"executor\"; fi",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "opencode has no agent named fixer; the mapping is the only thing that routes it to the executor"
 },
 {
  "id": "lib.agentic-opencode-v2-standalone",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "--model \"$model\" --standalone",
  "replace": "--model \"$model\"",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "a v2 run without --standalone attaches to the background service, which keeps editing the tree after the loop's timeout kills the client"
 },
 {
  "id": "lib.agentic-opencode-v2-executor-auto",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "if [[ \"$agent\" == \"executor\" ]]; then echo --auto; fi",
  "replace": "if false; then echo --auto; fi",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "a headless v2 run auto-rejects every ask permission and exits 1; without --auto the executor fails on any path outside the project"
 },
 {
  "id": "lib.agentic-opencode-v1-refused",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "if [[ \"$(opencode_major_version \"$version_text\")\" -lt 2 ]]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "v1 takes neither --standalone nor v2's permission model; letting it through runs a v1 agent with flags it does not have"
 },
 {
  "id": "cross-build.media-init-refuses-a-missing-cross-predicate",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "  for _fn in log cross_build_is_active mem_capped_jobs; do",
  "replace": "  for _fn in log mem_capped_jobs; do",
  "test": "bash linux/scripts/tests/test-cross-fallback-parity.sh",
  "why": "this assertion is the ONLY reason the 03-media fallback clone could be deleted"
 },
 {
  "id": "cross-build.media-init-refusal-is-a-branch",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "    echo \"ERROR: media_common_init: critical module(s) did not load -- missing:${_missing}\" >&2",
  "replace": "    echo \"WARN: media_common_init: missing:${_missing}\" >&2",
  "test": "bash linux/scripts/tests/test-cross-fallback-parity.sh",
  "why": "a warning instead of a refusal lets the caller reach a function that is not there"
 },
 {
  "id": "dead-functions.unlinked-arm-wired",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "found_keys | scoped, allow,",
  "replace": "found_keys, allow,",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "the unlinked-definer arm must actually reach check_keys; dropping the union leaves the gate exactly as blind as before"
 },
 {
  "id": "dead-functions.unlinked-own-file-mention",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "if not peers or text is None or re.search(rf\"\\b{name}\\b\", _code(text)):",
  "replace": "if not peers or text is None or False:",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "a definition its own file names again was never a candidate; without this the arm fails live code"
 },
 {
  "id": "dead-functions.unlinked-outside-caller",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "if any(o != rel and name in words and o not in definers[name]",
  "replace": "if any(False and o != rel and name in words and o not in definers[name]",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "one mention from a file that does NOT define the name is a real caller and must stop the arm dead"
 },
 {
  "id": "dead-functions.unlinked-shared-basename",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "if any(reads(rel) & reads(peer) for peer in peers):",
  "replace": "if any(False and reads(rel) & reads(peer) for peer in peers):",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "the whole argument: a file naming both definers' basenames can load them into one shell, so the arm must stay quiet there"
 },
 {
  "id": "dead-functions.unlinked-reads-self",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "readers[rel] = {rel} | {o for o, text",
  "replace": "readers[rel] = {o for o, text",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "seeding the reader set with the file itself is what makes the link symmetric -- without it, the subject naming the peer (or the peer naming the subject) is not seen as a link"
 },
 {
  "id": "dead-functions.unlinked-tag",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "+ (\"  [unlinked definer]\" if k in scoped else \"\"),",
  "replace": "+ \"\",",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "the two arms ask for different fixes; an untagged row leaves the author guessing which one fired"
 },
 {
  "id": "gst.tflite-parent-calls-fix-pc",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "\n  _gst_tflite_fix_pc\n",
  "replace": "\n",
  "test": "bash linux/scripts/tests/test-pkgconfig-file.sh",
  "why": "the split must keep all three workarounds in the call path; dropping one from the parent is the exact way a decomposition silently loses a fix"
 },
 {
  "id": "gst.tflite-idirafter",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "append_flag_if_missing CPPFLAGS \"-idirafter ${tflite_includedir}\"",
  "replace": "append_flag_if_missing CPPFLAGS \"-I${tflite_includedir}\"",
  "test": "bash linux/scripts/tests/test-pkgconfig-file.sh",
  "why": "-idirafter, never -I: the target TFLite headers must lose to anything the cross toolchain already found"
 },
 {
  "id": "gst.tflite-rpath-link",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "append_flag_if_missing LDFLAGS \"-Wl,-rpath-link,${tflite_libdir}\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-pkgconfig-file.sh",
  "why": "-L alone lets the link start and the transitive resolve fail; -rpath-link is half the pair"
 },
 {
  "id": "gst.tflite-probe-first-match",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "tflite_pkg_config_name=\"${dep}\"\n        break",
  "replace": "tflite_pkg_config_name=\"${dep}\"",
  "test": "bash linux/scripts/tests/test-pkgconfig-file.sh",
  "why": "tensorflowlite_c must win over tensorflow-lite; without the break the last candidate silently wins instead"
 },
 {
  "id": "gst.tflite-pc-sed-idempotent",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "sed -i 's/-ltensorflow-lite}/-ltensorflow-lite/g'",
  "replace": "sed -i 's/-ltensorflow-lite/-ltensorflow-lite}/g'",
  "test": "bash linux/scripts/tests/test-pkgconfig-file.sh",
  "why": "the repair runs on every monorepo build, so a second pass must be a no-op rather than re-introducing the stray brace"
 },
 {
  "id": "gst.tflite-symlink-static",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "ln -sf /usr/local/lib/libtensorflow-lite.a \"${_gcc_dir}/libtensorflow-lite.a\" 2>/dev/null || true",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-pkgconfig-file.sh",
  "why": "Meson's -print-file-name probe asks for the static archive too; seeding only the .so leaves the static link unresolved"
 },
 {
  "id": "gst.tflite-library-path",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "export LIBRARY_PATH=\"/usr/local/lib:${LIBRARY_PATH:-}\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-pkgconfig-file.sh",
  "why": "the symlink farm and LIBRARY_PATH are one workaround; pkg-config's -L is precisely what -print-file-name ignores"
 },
 {
  "id": "gst.tflite-symlink-cross-only",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "[ \"${BUILD_MODE:-native}\" = \"cross\" ] && [ -f /usr/local/lib/libtensorflow-lite.so ]",
  "replace": "[ -f /usr/local/lib/libtensorflow-lite.so ]",
  "test": "bash linux/scripts/tests/test-pkgconfig-file.sh",
  "why": "a native build must not have foreign-arch symlinks planted into its own gcc search dirs"
 },
 {
  "id": "doc-links.header-open-backlog",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "UNFREEZABLE_PAGES = (\"refactoring-backlog.md\",)",
  "replace": "UNFREEZABLE_PAGES = ()",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "an OPEN backlog entry is archived the day it closes, so a header pointer at refactoring-backlog.md is built to rot and freezing it only hides that -- which is exactly what the nine group-(b) rows did before this wave re-pointed every one of them. Neutering the tuple lets a frozen row cover the shape again and the gate reports the tree clean"
 },
 {
  "id": "lib.agentic-engines-not-sourced",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "source \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)/agentic-engines.sh\"",
  "replace": ": # not sourced",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "agentic-loop.sh is the ONLY file a consumer sources; without this line every engine adapter is undefined and the loop dies at the first invoke_agent (19/34 red)"
 },
 {
  "id": "lib.agentic-engines-cwd-relative",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "source \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)/agentic-engines.sh\"",
  "replace": "source ./linux/scripts/lib/agentic-engines.sh",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "external repos source this by absolute path from their own tree via a submodule checkout, so resolving the sibling against cwd instead of BASH_SOURCE breaks every consumer but this one"
 },
 {
  "id": "lib.agentic-driver-half-leaked",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "_AGENTIC_JQ_PRELUDE=",
  "replace": "unchecked_task_count() { :; }\n_AGENTIC_JQ_PRELUDE=",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "the split is by subject -- a loop-driver function appearing in the engine half means a half moved back and the seam has stopped meaning anything"
 },
 {
  "id": "lib.agentic-adapter-second-copy",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "unchecked_task_count() {",
  "replace": "invoke_opencode() {\n    log \"second copy\"\n}\n\nunchecked_task_count() {",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "one owner per function: a re-inlined adapter in the driver half would drift silently, which is exactly how the lib/*.sh logging preamble rotted before it got an owner"
 },
 {
  "id": "lib.agentic-jq-prelude-seam",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "_AGENTIC_JQ_PRELUDE='def v:",
  "replace": "_AGENTIC_JQ_PRELUDE_UNUSED='def v:",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "the jq prelude is defined in the engine half and used by resolve_build_matrix_entry and _agentic_load_loop_config in the driver half; losing it across the seam makes `v` undefined and every MATRIX_*/_AL field silently empty rather than an error"
 },
 {
  "id": "lib.agentic-jq-precondition-owner",
  "target": "linux/scripts/lib/agentic-engines.sh",
  "find": "    if ! command -v jq &>/dev/null; then log \"jq required\" \"FATAL\"; return 1; fi",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "run_agentic_loop's own copy of this guard was removed because load_engine_config owns it; deleting the owner too would let a jq-less host reach the planner with an empty model id instead of a FATAL"
 },
 {
  "id": "probe.smoke-cross-clang-first-arch-only",
  "target": "linux/scripts/06-packaging/smoke-cross-all-arches.sh",
  "find": "  local clang_dump=\"$1\" target_arches=\"$2\" expected arch\n  for arch in $(smoke_arch_words \"${target_arches}\"); do",
  "replace": "  local clang_dump=\"$1\" target_arches=\"$2\" expected arch\n  for arch in $(smoke_arch_words \"${target_arches}\" | head -1); do",
  "test": "bash linux/scripts/tests/test-cross-arch-smoke-probes.sh",
  "why": "the historical bug: the sweep broke after the first arch, so a clang whose single default triple matched a LATER requested arch was reported as matching nothing"
 },
 {
  "id": "probe.smoke-cross-clang-no-match-passes",
  "target": "linux/scripts/06-packaging/smoke-cross-all-arches.sh",
  "find": "    fail \"clang (llvm-target): -dumpmachine=${clang_dump:-EMPTY} matches none of: ${target_arches}\"",
  "replace": "    pass \"clang (llvm-target): -dumpmachine=${clang_dump:-EMPTY} matches none of: ${target_arches}\"",
  "test": "bash linux/scripts/tests/test-cross-arch-smoke-probes.sh",
  "why": "this arm did not exist at all before -- a target clang built for the wrong arch shipped green; turning it back into a pass restores that"
 },
 {
  "id": "probe.smoke-cross-clang-guard-inverted",
  "target": "linux/scripts/06-packaging/smoke-cross-all-arches.sh",
  "find": "  [ -x \"${SMOKE_TARGET_CLANG}\" ] || return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-cross-arch-smoke-probes.sh",
  "why": "an image that carries no llvm-target is not a defect; without the guard every such image fails on an empty -dumpmachine"
 },
 {
  "id": "probe.smoke-cross-host-arch-cross-probed",
  "target": "linux/scripts/06-packaging/smoke-cross-all-arches.sh",
  "find": "    [ \"${arch}\" = \"${host_arch}\" ] && continue",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-cross-arch-smoke-probes.sh",
  "why": "the host arch has no <triplet>-gcc under GCC_PREFIX, so cross-probing it invents a failure on every image"
 },
 {
  "id": "probe.smoke-cross-missing-cross-gcc-passes",
  "target": "linux/scripts/06-packaging/smoke-cross-all-arches.sh",
  "find": "      fail \"Cross GCC for ${arch} not found at ${cross_gcc}\"",
  "replace": "      pass \"Cross GCC for ${arch} not found at ${cross_gcc}\"",
  "test": "bash linux/scripts/tests/test-cross-arch-smoke-probes.sh",
  "why": "a missing cross compiler is the whole point of this smoke; a pass here makes the wrapper-smoke stage green on a toolchain that cannot cross-build"
 },
 {
  "id": "probe.smoke-cross-missing-tool-passes",
  "target": "linux/scripts/06-packaging/smoke-cross-all-arches.sh",
  "find": "      fail \"${tool} not found in PATH\"",
  "replace": "      pass \"${tool} not found in PATH\"",
  "test": "bash linux/scripts/tests/test-cross-arch-smoke-probes.sh",
  "why": "cc/c++/gcc/g++ absent from PATH must be a failure, not a PASS line with an empty resolution target"
 },
 {
  "id": "probe.smoke-cross-main-drops-a-probe",
  "target": "linux/scripts/06-packaging/smoke-cross-all-arches.sh",
  "find": "  _smoke_probe_llvm_target_clang \"${target_arches}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-cross-arch-smoke-probes.sh",
  "why": "the new risk the split introduces: a dropped call retires a whole toolchain check silently, since the probe still exists and still parses"
 },
 {
  "id": "probe.smoke-cross-main-drops-summary",
  "target": "linux/scripts/06-packaging/smoke-cross-all-arches.sh",
  "find": "  smoke_summary",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-cross-arch-smoke-probes.sh",
  "why": "smoke_summary is what turns accumulated FAILURES into a non-zero exit; without it the smoke exits 0 no matter how many probes failed"
 },
 {
  "id": "sccache.media-launcher-env-after-resolve",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "    compiler_cache_launcher_env 2>/dev/null || true\n    _mcl_launcher=\"$(compiler_cache_launcher 2>/dev/null || true)\"",
  "replace": "    _mcl_launcher=\"$(compiler_cache_launcher 2>/dev/null || true)\"\n    compiler_cache_launcher_env 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "resolving before the server address is established is the TCP 4226 class: the compiles run against a launcher whose address was set after it was chosen"
 },
 {
  "id": "sccache.media-launcher-subshell-return",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "  local -n _mcl_launcher=\"$1\"\n  _mcl_launcher=\"\"",
  "replace": "  local _mcl_launcher=\"\"\n  trap 'printf \"%s\" \"${_mcl_launcher}\"' RETURN",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "the reason this helper takes an out-variable: a printing version is called as $( ), and the sccache server address compiler_cache_launcher_env exports dies with that subshell before any compile runs"
 },
 {
  "id": "sccache.media-launcher-use-ccache-ignored",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "if command -v ccache >/dev/null 2>&1 && is_truthy \"${USE_CCACHE:-true}\"; then",
  "replace": "if command -v ccache >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "Dockerfile.media documents USE_CCACHE=0/false/no/off as the way to disable ccache; ignoring it makes that switch a no-op"
 },
 {
  "id": "sccache.media-launcher-ccache-fallback-gone",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "    _mcl_launcher=\"ccache\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "the fallback is the whole second half of the ladder the two media scripts used to carry; losing it silently builds uncached wherever 01-core is not loaded"
 },
 {
  "id": "sccache.media-launcher-out-var-not-cleared",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "  local -n _mcl_launcher=\"$1\"\n  _mcl_launcher=\"\"",
  "replace": "  local -n _mcl_launcher=\"$1\"",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "an out-parameter must be defined by the call, not merely maybe-assigned: without the pre-clear a stale caller value survives on a cacheless host and becomes the compiler prefix"
 },
 {
  "id": "sccache.media-launcher-reinlined-at-ffmpeg",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "    media_compiler_launcher _ff_cc_launcher",
  "replace": "    if command -v compiler_cache_launcher >/dev/null 2>&1; then _ff_cc_launcher=ccache; fi",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "the drift pin for the F3 extraction: re-inlining the guard at a call site is how this family grew two copies that had already diverged on USE_CCACHE truthiness"
 },
 {
  "id": "critical-fixes.smoke-vulkan-any-path",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "grep -rlE 'bash .*smoke-vulkan\\.sh'",
  "replace": "grep -rlE 'bash[^\\n]*smoke-vulkan\\.sh'",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "[^\\n] is a NEGATED CHARACTER CLASS, not 'anything but a newline' - it excludes the letter n, so the realistic RUN bash /opt/scripts/06-packaging/smoke-vulkan.sh never matched and the check was dead"
 },
 {
  "id": "critical-fixes.bare-sccache-scan",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    if [ -n \"${_bad_sccache}\" ]; then",
  "replace": "    if [ -z \"${_bad_sccache}\" ] && false; then",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the repo-wide bare-sccache scan is the always-sccache decision's only enforcement; a launcher pointing at bare sccache ABORTS a build where ccache would only miss"
 },
 {
  "id": "critical-fixes.transient-classifier-runs",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    eval \"${_fn}\"",
  "replace": "    eval \"${_fn}\"; _cross_stage_push_error_is_transient() { true; }",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the classifier is EXTRACTED AND RUN, not grepped; a build error classified as transient retries a doomed push four times"
 },
 {
  "id": "critical-fixes.numpy-reseed-ban",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "quiet _critical_source_no_match \\\n    -qE 'for pkg in .*\\bnumpy\\b'",
  "replace": "quiet true \\\n    -qE 'for pkg in .*\\bnumpy\\b'",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "apt numpy seeded into the venv collides with uv's built wheel (bug E)"
 },
 {
  "id": "critical-fixes.base-mount-scope",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "quiet _critical_source_no_match \\\n    -qE -- '--mount=type=bind,source=linux/scripts,target'",
  "replace": "quiet true \\\n    -qE -- '--mount=type=bind,source=linux/scripts,target'",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a whole-tree scripts bind mount folds every script's checksum into the base cache key and busts the base layer on every edit"
 },
 {
  "id": "critical-fixes.ort-is-called",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "fix10_libstdcxx_nostdinc_2026_08 fix11_ort_single_source_2026_09)",
  "replace": "fix10_libstdcxx_nostdinc_2026_08)",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "fix11 is the only fast check that ORT stays chain-only; dropped from FIX_FUNCS every row below goes green unseen"
 },
 {
  "id": "critical-fixes.ort-opencv-download-switch",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "download_onnxruntime(_gpu)?(:bool)?=",
  "replace": "never_matches(_gpu)?(:bool)?=",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "DOWNLOAD_ONNXRUNTIME=ON forces OpenCV dnn to fetch a prebuilt 1.25.1 even with HAVE_ONNXRUNTIME pre-set"
 },
 {
  "id": "critical-fixes.ort-binary-url",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'(pythonhosted\\.org|pypi\\.org|nuget\\.org)/[^[:space:]]*onnxruntime|",
  "replace": "'(never_matches)/x|",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a pinned SHA256 does not make a PyPI/NuGet ORT binary chain-built (the onnxruntime-ep-webgpu wheel was exactly that)"
 },
 {
  "id": "critical-fixes.ort-nuget-id",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'microsoft\\.ml\\.onnxruntime|microsoft",
  "replace": "'never_matches|microsoft",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a NuGet Microsoft.ML.OnnxRuntime* install is how GenAI linked DirectML ORT 1.24.4"
 },
 {
  "id": "critical-fixes.ort-inbox-untouched",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'(system32|syswow64|winsxs|windir|systemroot|c:.windows)'",
  "replace": "'(never_matches)'",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "deleting or patching the OS's in-box ORT in a layer silences smoke section 25's INBOX instead of keeping the base digest"
 },
 {
  "id": "critical-fixes.ort-nuget-refusal-order",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "(g && t && n && t < n)",
  "replace": "(n)",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the hub facility must throw on an ORT id BEFORE nuget install runs, or consumers can still pull NuGet ORT through it"
 },
 {
  "id": "critical-fixes.ort-pypi-install",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "\"${tok}\" '--no-index'",
  "replace": "\"${tok}\" '.'",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a pip/uv install of an onnxruntime* name without --no-index reaches PyPI"
 },
 {
  "id": "critical-fixes.ort-apt",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "package list)\" \\\n    \"${tok}\"\n",
  "replace": "package list)\" \\\n    \"never_matches${tok}\"\n",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "apt libonnxruntime1.23 was pulled into media-arm64 on 2026-08-27 and shadowed the chain build"
 },
 {
  "id": "critical-fixes.ort-so-map-package",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "tolower($2) ~ /onnxruntime/ { print",
  "replace": "0 { print",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a SONAME map row naming a distro ORT package is the resolver path that pulled libonnxruntime1.23"
 },
 {
  "id": "critical-fixes.ort-so-map-deny-row",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "END { if (!d) print \"no libonnxruntime.so* -> source-built deny row\" }",
  "replace": "END { }",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "without the deny row the resolver guesses ^libonnxruntime[0-9] from apt-cache again"
 },
 {
  "id": "critical-fixes.ort-ffmpeg-vendor-pc",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'ffmpeg_probe_pkg_config_feature[[:space:]]+\"?libonnxruntime'",
  "replace": "'never_matches'",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "FFmpeg's vendor pkg-config fallback accepts ANY libonnxruntime.pc first on PKG_CONFIG_PATH"
 },
 {
  "id": "critical-fixes.ort-rearm-download",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "grep -E -e ': (ort_lib_path|ort_strategy|ort_skip_download|cargo_net_offline|ort_offline)=' \\",
  "replace": "grep -E -e ': (never_matches)=' \\",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "ort-sys reads ORT_LIB_PATH before ORT_LIB_LOCATION and CARGO_NET_OFFLINE before ORT_SKIP_DOWNLOAD"
 },
 {
  "id": "critical-fixes.ort-env-owners",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "grep -E -e ': (ort_lib_location|ort_dylib_path)=' \\",
  "replace": "grep -E -e ': (never_matches)=' \\",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a second writer of ORT_LIB_LOCATION/ORT_DYLIB_PATH can point the ort crate at a non-chain ORT"
 },
 {
  "id": "critical-fixes.ort-opencv-have-preset",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "if (fn && !fb) bad = bad FP[f] \" \"",
  "replace": "if (fn && fb < 0) bad = bad FP[f] \" \"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "OpenCV 5.0 dnn downloads ORT whenever HAVE_ONNXRUNTIME is not pre-set (dnn/CMakeLists.txt:141)"
 },
 {
  "id": "critical-fixes.ort-opencv-silent-off",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "\"-dwith_onnxruntime(:bool)?=[\\\"${q}]?(off|0|false)",
  "replace": "\"never_matches(:bool)?=[\\\"${q}]?(off|0|false)",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the silent WITH_ONNXRUNTIME=OFF fallback shipped OpenCV without the chain ORT instead of failing"
 },
 {
  "id": "critical-fixes.ort-genai-ort-home",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'-dort_home[:=]' 1+",
  "replace": "'-dort_home[:=]' 0+",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "without ORT_HOME, GenAI ortlib.cmake FetchContents Microsoft.ML.OnnxRuntime.DirectML from the aiinfra feed"
 },
 {
  "id": "critical-fixes.ort-genai-winml",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'use_winml' '' '' ''",
  "replace": "'never_matches' '' '' ''",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "USE_WINML overrides ORT_HOME with a Windows ML NuGet ORT"
 },
 {
  "id": "critical-fixes.ort-genai-linux-ort-home",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "[ \"${no}\" -ge \"${nb}\" ]",
  "replace": "[ \"${no}\" -ge 0 ]",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "one build.py call without --ort_home is one GenAI build that fetches ORT"
 },
 {
  "id": "critical-fixes.ort-crate-env-windows",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "1 \"${w} sets ORT_SKIP_DOWNLOAD=1\"",
  "replace": "0+ \"${w} sets ORT_SKIP_DOWNLOAD=1\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "G3: without ORT_SKIP_DOWNLOAD an unset location lets ort-sys fetch pyke's ORT"
 },
 {
  "id": "critical-fixes.ort-crate-env-windows-location",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "1 \"${w} sets ORT_LIB_LOCATION to the chain lib dir\"",
  "replace": "0+ \"${w} sets ORT_LIB_LOCATION to the chain lib dir\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "G3: ORT_LIB_LOCATION is what makes ort-sys link the chain instead of downloading"
 },
 {
  "id": "critical-fixes.ort-crate-env-linux-dylib",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "1 \"${l} sets ORT_DYLIB_PATH to the chain library\"",
  "replace": "0+ \"${l} sets ORT_DYLIB_PATH to the chain library\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "G3: without ORT_DYLIB_PATH ort load-dynamic opens whichever libonnxruntime.so the loader finds first"
 },
 {
  "id": "critical-fixes.ort-crate-env-custody",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "1 \"ONNX_ROOT is the chain install\"",
  "replace": "0+ \"ONNX_ROOT is the chain install\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "G3 names ONNX_ROOT; ONNX_ROOT must be where Build-OnnxFromSource.ps1 installs"
 },
 {
  "id": "critical-fixes.ort-crate-env-smokes",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'get-ortcrateenvfinding -onnxroot \\$env:onnx_root\\)' 1 \\",
  "replace": "'get-ortcrateenvfinding -onnxroot \\$env:onnx_root\\)' 0+ \\",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "G3 is asserted on the shipped image by smoke section 19; unwired, the ENV can rot"
 },
 {
  "id": "critical-fixes.ort-crate-env-linux-row",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'^_consumer_contract_rows=.*[\" ]ort-crate-env[\" ]' 1 \\",
  "replace": "'^_consumer_contract_rows=.*[\" ]ort-crate-env[\" ]' 0+ \\",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "G3 is asserted on the Linux image by the consumer contract; a dropped row asserts nothing"
 },
 {
  "id": "critical-fixes.ort-gate-calls-present",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "\"(^|[^a-z0-9_-])${call}([^a-z0-9_-]|\\$)\" 1 \"${f##*/} calls",
  "replace": "\"(^|[^a-z0-9_-])${call}([^a-z0-9_-]|\\$)\" 0+ \"${f##*/} calls",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "G2 and the consumer configure gates only protect a build that calls them"
 },
 {
  "id": "critical-fixes.ort-gate-calls-once",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "\"(^|[^a-z0-9_-])${call}([^a-z0-9_-]|\\$)\" 1 \"${f##*/} calls",
  "replace": "\"(^|[^a-z0-9_-])${call}([^a-z0-9_-]|\\$)\" 1+ \"${f##*/} calls",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a second call is a copy that drifts; exactly once, after configure"
 },
 {
  "id": "critical-fixes.ort-gate-calls-definition",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "\"function[[:space:]]+${call}([^a-z0-9_-]|\\$)|(^|[[:space:]])${call}\\\\(\\\\)\"",
  "replace": "\"\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a gate DEFINED in the consumer script must not count as its call"
 },
 {
  "id": "critical-fixes.ort-g2-per-file-mount-windows",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "\"--mount=type=bind,source=${F11_WIN_G2_MODULE,,},\" '^windows/Dockerfile'",
  "replace": "\".\" '^windows/Dockerfile'",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the G2 module in a buildmods COPY re-keys the ~75-min ONNX branch"
 },
 {
  "id": "critical-fixes.ort-g2-per-file-mount-linux",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "\"--mount=type=bind,source=${F11_LINUX_G2_HELPER},\" '^linux/Dockerfile'",
  "replace": "\".\" '^linux/Dockerfile'",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the G2 helper in the base COPY re-keys every media stage"
 },
 {
  "id": "critical-fixes.ort-g2-closure",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'^windows/scripts/(modules/WindowsSourceBuild\\.Common\\.psm1|build/Build-MediaCoreAll\\.ps1)$'",
  "replace": "'^never$'",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "WindowsSourceBuild.Common and Build-MediaCoreAll are mounted by the ONNX branch; importing G2 there re-keys it"
 },
 {
  "id": "critical-fixes.ort-g2-run-mount-windows",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "&& !index($0, wm) {",
  "replace": "&& 0 {",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a consumer RUN without the G2 module fails with CommandNotFound hours into the chain"
 },
 {
  "id": "critical-fixes.ort-g2-run-mount-linux",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "index($0, r[i]) && !index($0, lm)",
  "replace": "index($0, r[i]) && 0",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a Linux consumer RUN without the G2 helper cannot source it"
 },
 {
  "id": "critical-fixes.ort-g1-windows",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "'(get-ortcensusfinding|invoke-ort(image)?census|test-ortprovenancetree)' 1+",
  "replace": "'(get-ortcensusfinding|invoke-ort(image)?census|test-ortprovenancetree)' 0+",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "G1 is the only check on the shipped bytes; unwired from the smoke it proves nothing"
 },
 {
  "id": "critical-fixes.ort-g1-linux",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "check-ort-provenance\\.sh[[:space:]]+[^[:space:]]' 1+ \\",
  "replace": "check-ort-provenance\\.sh[[:space:]]+[^[:space:]]' 0+ \\",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the Linux census must be CALLED by a runtime smoke, not merely sourced"
 },
 {
  "id": "critical-fixes.ort-g5-heading",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "  _critical_source_pattern \"fix11: docs/windows-build-invariants.md carries the ORT single-source invariant (G5)\" \\\n    \"fix11: docs/windows-build-invariants.md lost '### ONNX Runtime has exactly one source: the chain (owner rule 2026-09-23)'\" \\\n    -qxF -e '### ONNX Runtime has exactly one source: the chain (owner rule 2026-09-23)' \"${REPO_ROOT}/docs/windows-build-invariants.md\"",
  "replace": "  pass \"fix11: docs/windows-build-invariants.md carries the ORT single-source invariant (G5)\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the invariant is what stops the next agent simplifying a pre-set or a shim away"
 },
 {
  "id": "critical-fixes.ort-census-root-windows",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "  if [ -n \"${win}\" ] && grep -qiF",
  "replace": "  if true || grep -qiF",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a renamed SourceDir turns every chain build into FOREIGN for the census, hours later"
 },
 {
  "id": "critical-fixes.ort-census-root-linux",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "  if [ -n \"${lin}\" ] && [ \"${lc}\" != \"${lc#*\"${lin}\"}\" ]; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a renamed ORT_SRC_DIR turns every chain build into FOREIGN for the Linux census"
 },
 {
  "id": "critical-fixes.ort-cargo-default-features",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "deps && (l ~ (\"^[[:space:]]*\" Q \"?ort(-sys)?\" Q \"?[[:space:]]*=\") ||",
  "replace": "deps && (0 ||",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "ort's DEFAULT features include download-binaries: a bare ort dependency is pyke's ORT"
 },
 {
  "id": "critical-fixes.ort-cargo-download-binaries",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "/download-binaries/ { print",
  "replace": "/never_matches/ { print",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "download-binaries spelled out is the same pyke fetch"
 },
 {
  "id": "critical-fixes.ort-apt-context-free",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "package list)\" \\\n    \"${tok}\"\n",
  "replace": "package list)\" \\\n    \"${tok}\" 'apt-get|dpkg'\n",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the hub's apt lists put package names on continuation lines with no apt-get on them; an apt-context rule never sees them"
 },
 {
  "id": "critical-fixes.ort-apt-backslash-terminator",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "),;|]|\\\\\\\\|\\$)\"",
  "replace": "),;|]|\\$)\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a package name glued to its line continuation (libonnxruntime-dev\\) is still that package"
 },
 {
  "id": "critical-fixes.ort-rearm-skip-value",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "=(1|true)$' || true)\"",
  "replace": "=.*$' || true)\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "ort-sys skips the download only on exactly 1/true; yes, on or an empty value re-arm pyke's fetch"
 },
 {
  "id": "critical-fixes.ort-env-not-a-comparison",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "if (s !~ /^[=~]/) emit(m, s)",
  "replace": "emit(m, s)",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a == or =~ test READS the variable; counting it as a write would refuse every smoke that checks it"
 },
 {
  "id": "critical-fixes.ort-env-form-brace",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "N \"[}]?[[:space:]]*:?=\"",
  "replace": "N \"[[:space:]]*:?=\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "${env:ORT_LIB_PATH} = ... is PowerShell's other assignment spelling"
 },
 {
  "id": "critical-fixes.ort-env-form-environ-index",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "IX = Q N Q \"[[:space:]]*[]][[:space:]]*=\"",
  "replace": "IX = \"never_matches\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "os.environ[\"CARGO_NET_OFFLINE\"] = \"false\" sets the variable for every cargo the script starts"
 },
 {
  "id": "critical-fixes.ort-env-form-setenv",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "API = \"(setenvironmentvariable|setdefault|putenv|setenv)",
  "replace": "API = \"(never_matches)",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "[Environment]::SetEnvironmentVariable('ORT_LIB_PATH', ...) sets it for the machine without an = in sight"
 },
 {
  "id": "critical-fixes.ort-env-form-set-item",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "PRV = \"(set-item|new-item)",
  "replace": "PRV = \"(never_matches)",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "Set-Item -Path Env:ORT_LIB_PATH is PowerShell's provider spelling of the same write"
 },
 {
  "id": "critical-fixes.ort-env-set-item-not-a-read",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "[^$a-z0-9_{])?env:",
  "replace": ".)?env:",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "New-Item -Path $env:ORT_LIB_LOCATION READS the variable; only an Env: provider path writes it"
 },
 {
  "id": "critical-fixes.ort-env-form-setx",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "SETX = \"(^|[^a-z0-9_-])setx",
  "replace": "SETX = \"(never_matches)setx",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "setx /M ORT_SKIP_DOWNLOAD 0 re-arms the download machine-wide"
 },
 {
  "id": "critical-fixes.ort-env-form-yaml",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "if (p ~ /\\.(ya?ml|py|json)$/) each(",
  "replace": "if (0) each(",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a workflow env: mapping (ORT_LIB_PATH: /opt/pyke) is how CI sets it, and it has no ="
 },
 {
  "id": "critical-fixes.ort-env-yaml-key-position",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "MAP = \"(^[[:space:]]*(-[[:space:]]+)?|[{,][[:space:]]*)\" Q",
  "replace": "MAP = \"(^|[^a-z0-9_])\" Q",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "echo \"ORT_LIB_PATH: $ORT_LIB_PATH\" in a run: step is a read; only a mapping KEY is a write"
 },
 {
  "id": "critical-fixes.ort-env-form-legacy-dockerfile",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "if (p ~ /(^|\\/)Dockerfile[^\\/]*$/) each(",
  "replace": "if (0) each(",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "ENV ORT_LIB_PATH /x (no =) and a bare ARG are Dockerfile writes too"
 },
 {
  "id": "critical-fixes.ort-cargo-table-form",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "if (one != \"\" && isort && !df) print",
  "replace": "if (0) print",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "[dependencies.ort] with version = only keeps the default features, download-binaries included"
 },
 {
  "id": "critical-fixes.ort-cargo-table-df",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "one != \"\" && l ~ (\"^[[:space:]]*\" DF) { df = 1 }",
  "replace": "0 { df = 1 }",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a [dependencies.ort] table that says default-features = false is the chain path and must pass"
 },
 {
  "id": "critical-fixes.ort-cargo-renamed-table",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "one != \"\" && l ~ (\"^[[:space:]]*package[[:space:]]*=[[:space:]]*\" O) { isort = 1 }",
  "replace": "0 { isort = 1 }",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "[dependencies.onnx] package = \"ort\" is ort under another name"
 },
 {
  "id": "critical-fixes.ort-cargo-renamed-inline",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": " || l ~ (\"[{,][[:space:]]*package[[:space:]]*=[[:space:]]*\" O))",
  "replace": ")",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "onnx = { package = \"ort\", version = ... } is ort under another name"
 },
 {
  "id": "critical-fixes.ort-cargo-dotted",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "for (n in dort) if (!(n in ddf)) print",
  "replace": "for (n in dort) if (0) print",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "ort.version = ... is a dotted-key dependency table with the default features"
 },
 {
  "id": "critical-fixes.ort-cargo-deps-only",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "deps && (l ~ (",
  "replace": "(l ~ (",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "ort = [\"dep:ort\"] under [features] is a feature, not a dependency; only dependency tables decide default features"
 },
 {
  "id": "critical-fixes.ort-cargo-header-comment",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "sub(/#.*/, \"\", h); ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a comment after [dependencies.ort] must not hide the table"
 },
 {
  "id": "probe.ort-crate-env-row",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": " web-lane-tools ort-crate-env chrome android-emulator cargo-qa-tools free-threaded-python lint-tools uv-cache-seed gtk4-dev gnu-time\"",
  "replace": " web-lane-tools chrome android-emulator cargo-qa-tools free-threaded-python lint-tools uv-cache-seed gtk4-dev gnu-time\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "G3 on the shipped Linux image: the row is the assertion"
 },
 {
  "id": "probe.ort-crate-env-lib-dir",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    /usr/local/lib/onnxruntime-cpu/lib|/usr/local/lib/onnxruntime-gpu/lib) ;;",
  "replace": "    *) ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "ORT_LIB_LOCATION must resolve into the chain prefix, not /opt/opencv5/lib"
 },
 {
  "id": "probe.ort-crate-env-link-lib",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "FACT ort-link-lib)\" != yes ]; then",
  "replace": "FACT ort-link-lib)\" = never ]; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "ort-sys's -l onnxruntime needs the linker name in that dir"
 },
 {
  "id": "probe.ort-crate-env-dylib",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    \"${lreal}\"/libonnxruntime.so*) ;;",
  "replace": "    *) ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "ORT_DYLIB_PATH must open the chain file, not the OpenCV install copy"
 },
 {
  "id": "probe.ort-crate-env-switches",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "      1|true) ;;",
  "replace": "      *) ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "ORT_PREFER_DYNAMIC_LINK and ORT_SKIP_DOWNLOAD must both be on"
 },
 {
  "id": "probe.ort-crate-env-lib-path",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  if [ \"${v}\" != '<unset>' ]; then\n    printf 'ORT_LIB_PATH is set",
  "replace": "  if false; then\n    printf 'ORT_LIB_PATH is set",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "ORT_LIB_PATH outranks ORT_LIB_LOCATION in ort-sys"
 },
 {
  "id": "probe.ort-crate-env-cargo-offline",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    '<unset>'|1|true) ;;\n    *) printf 'CARGO_NET_OFFLINE",
  "replace": "    *) ;;\n    *) printf 'CARGO_NET_OFFLINE",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a falsy CARGO_NET_OFFLINE shadows ORT_SKIP_DOWNLOAD"
 },
 {
  "id": "probe.ort-crate-env-nofact",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  if [ \"$(_consumer_contract_fact \"$2\" FACT ort-probe)\" != yes ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "an unset variable and a missing line read the same; only the completion fact tells them apart"
 },
 {
  "id": "probe.ort-crate-env-dispatch",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "        ort-crate-env) line=\"$(_consumer_ort_env_verdict \"${row}\" \"${probe}\")\" ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "without its arm the row falls to the directory verdict and never reads its facts"
 },
 {
  "id": "probe.ort-crate-env-probe-spliced",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  _consumer_ort_env_probe; _consumer_test_runtimes_probe; _consumer_gnu_time_probe; printf '%s\\n' 'echo CCPROBE_DONE'",
  "replace": "  _consumer_test_runtimes_probe; _consumer_gnu_time_probe; printf '%s\\n' 'echo CCPROBE_DONE'",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the facts must reach the probe the image runs"
 },
 {
  "id": "probe.ort-crate-env-lib-path-empty",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  if [ \"${v}\" != '<unset>' ]; then",
  "replace": "  if [ -n \"${v}\" ] && [ \"${v}\" != '<unset>' ]; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "ort-sys reads a set-but-EMPTY ORT_LIB_PATH before ORT_LIB_LOCATION"
 },
 {
  "id": "probe.ort-crate-env-cargo-offline-empty",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    '<unset>'|1|true) ;;",
  "replace": "    ''|'<unset>'|1|true) ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a set-but-empty CARGO_NET_OFFLINE is the first skip switch ort-sys finds, and it re-arms the download"
 },
 {
  "id": "probe.ort-crate-env-set-marker",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "\"${ORT_LIB_PATH-<unset>}\" \"${CARGO_NET_OFFLINE-<unset>}\"",
  "replace": "\"${ORT_LIB_PATH:-<unset>}\" \"${CARGO_NET_OFFLINE:-<unset>}\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "only ${X-...} tells an unset variable from an empty one; ${X:-...} reads both as unset"
 },
 {
  "id": "probe.cf-pc-prefix-resolved",
  "target": "linux/scripts/06-packaging/smoke-critical-fixes.sh",
  "find": "        \"${PYTHON_CROSS_ROOT}/${arch}\"|\"${PYTHON_CROSS_ROOT}/${arch}\"/*)",
  "replace": "        *)",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the probe must judge where the .pc prefix LANDS; a prefix resolving out of the staging tree makes every cross gst-python link pick the host libpython"
 },
 {
  "id": "probe.cf-absl-demander",
  "target": "linux/scripts/06-packaging/smoke-critical-fixes.sh",
  "find": "  if [ -n \"${demander}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "absl missing is only a defect where a shipped header includes it - and on the shipped runtime images 707 of them do"
 },
 {
  "id": "probe.cf-absl-empty-stub",
  "target": "linux/scripts/06-packaging/smoke-critical-fixes.sh",
  "find": "    hit=\"$(grep -rlm1 --include='*.h' -e 'include \"absl/' \"${dir}\" 2>/dev/null | head -1 || true)\"",
  "replace": "    hit=\"${dir}\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "/usr/local/include/tensorflow ships as an EMPTY two-directory stub on all three arches; treating a directory's existence as evidence is what made the old probe red against healthy images"
 },
 {
  "id": "probe.consumer-verdict-verb-is-readable",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    ''|0|no) printf 'BAD %s absent' \"${row}\" ;;",
  "replace": "    ''|0|no) printf 'FAIL %s absent' \"${row}\" ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "check_consumer_contract reads `verb row rest` through a case list of OK/EXEMPT/BAD/STALE/NOFACT/ASSERTED; any other verb falls to the catch-all and the row is reported as silently dropped. Emitting FAIL turned three healthy rows into one gate failure on 2026-09-06 and cost a whole runtime lane"
 },
 {
  "id": "packaging.absl-headers-copied",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "/usr/local/include/absl|copy\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "707 of the 1322 LiteRT headers this loop copies include absl/; without absl a consumer compiling against the shipped prefix fails on the first include"
 },
 {
  "id": "sccache.setup-log-names-address",
  "target": "linux/scripts/01-core/common.sh",
  "find": " [server=${SCCACHE_SERVER_UDS:-tcp:${SCCACHE_SERVER_PORT:-4226}}]\"",
  "replace": "\"",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "the launcher only prints its [server=] field when sccache FAILS, so a chain where the YB fix works would carry no evidence that it did"
 },
 {
  "id": "sccache.media-setup-log-names-address",
  "target": "linux/scripts/01-core/compiler-cache.sh",
  "find": " [server=${SCCACHE_SERVER_UDS:-tcp:${SCCACHE_SERVER_PORT:-4226}}]\"",
  "replace": "\"",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "the media stages run the other setter; one grep must cover both or half the chain goes unread"
 },
 {
  "id": "version-snapshot.snapshot-ored",
  "target": "docs/scripts/sync_versions.py",
  "find": "        result = check_snapshot(render_snapshot())",
  "replace": "        result = 0",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "the generated snapshot block in README.md is what a reader trusts for every pinned version"
 },
 {
  "id": "version-snapshot.marker-tokens-ored",
  "target": "docs/scripts/sync_versions.py",
  "find": "        result |= validate_inline_marker_tokens()",
  "replace": "        result |= 0",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "a typo'd marker name is silently SKIPPED by the updater, so without this pass it stays stale forever"
 },
 {
  "id": "version-snapshot.inline-markers-ored",
  "target": "docs/scripts/sync_versions.py",
  "find": "        result |= check_inline_markers(versions)",
  "replace": "        result |= 0",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "every inline version literal in docs/ and README.md rides on this one call"
 },
 {
  "id": "version-snapshot.deps-table-ored",
  "target": "docs/scripts/sync_versions.py",
  "find": "        result |= check_deps_table(versions)",
  "replace": "        result |= 0",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "the third-party dependency table is a licence record, not decoration"
 },
 {
  "id": "version-snapshot.dockerfile-args-ored",
  "target": "docs/scripts/sync_versions.py",
  "find": "        result |= check_dockerfile_args(versions)",
  "replace": "        result |= 0",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "an ARG default drifting from versions.env is what a manual docker build silently gets"
 },
 {
  "id": "version-snapshot.doc-literals-ored",
  "target": "docs/scripts/sync_versions.py",
  "find": "        result |= check_doc_literals(versions)",
  "replace": "        result |= 0",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "the /opt/gcc-<version> and clang literals prose carries cannot use inline markers, so only this scan holds them"
 },
 {
  "id": "version-snapshot.licence-subprocess-ored",
  "target": "docs/scripts/sync_versions.py",
  "find": "        return lic.returncode",
  "replace": "        return 0",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "generate-website-licenses.py is a separate program whose verdict decides this slug too"
 },
 {
  "id": "vulkan.sdk-rest-wired",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  _vulkan_target_build_sdk_rest \"${arch_suffix}\" \"${archdir}\" \"${target_dir}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the table is dead text unless _build_vulkan_targets walks it; without the call the foreign prefix falls back to the four TVM needs and every other SDK component silently stops being cross-built"
 },
 {
  "id": "vulkan.sdk-rest-src-first-candidate",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "    [ -d \"${root}/${d}\" ] && { printf '%s' \"${root}/${d}\"; return 0; }",
  "replace": "    [ -d \"${root}/${d}\" ] && { printf '%s' \"${root}/${d}\"; }",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the candidates are ordered, and shaderc's real CMake project is the FIRST of them (shaderc/src) with the bare checkout name behind it; without the return every later candidate is appended too and the argv names a path that does not exist"
 },
 {
  "id": "vulkan.sdk-rest-extra-args",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "      -DSPIRV_HEADERS_INSTALL_DIR=\"${archdir}\" \\\n      ${extra}",
  "replace": "      -DSPIRV_HEADERS_INSTALL_DIR=\"${archdir}\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the third column is the only place a row says what it needs -- VOLK_INSTALL=ON, SHADERC_ENABLE_INSTALL=ON, SPIRV_CROSS_CLI=ON; dropping it configures every component with defaults that install nothing"
 },
 {
  "id": "vulkan.sdk-rest-missing-source-skips",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  [ -d \"${src}\" ] || { log \"${label}: source missing at ${src}; skipping\"; return 0; }",
  "replace": "  [ -d \"${src}\" ] || log \"${label}: source missing at ${src}; skipping\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "./vulkansdk fetches a different subset per lane, so most rows have no source; without the early return each one is counted as attempted and cmake is configured against a path that is not there"
 },
 {
  "id": "vulkan.spirv-tools-executables-built",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "        -DSPIRV_SKIP_EXECUTABLES=OFF \\",
  "replace": "        -DSPIRV_SKIP_EXECUTABLES=ON \\",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the spirv-* executables are what make the foreign-arch prefix a usable SDK rather than link fodder for TVM; skipping them ships libs with no tools, which is the state HT5's prune would then make permanent"
 },
 {
  "id": "packaging.appimage-runtime-staged-when-present",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "        info \"appimagetool already present: $(command -v appimagetool)\"\n        ensure_appimagetool_runtime",
  "replace": "        info \"appimagetool already present: $(command -v appimagetool)\"",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "the already-present arm is the one a cached layer takes on every rebuild, so dropping the stager there ships the common case without a runtime and every consumer AppImage build goes back to fetching it from GitHub"
 },
 {
  "id": "packaging.appimage-runtime-staged-when-installed",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "    info \"appimagetool is now available: $dest\"\n    ensure_appimagetool_runtime",
  "replace": "    info \"appimagetool is now available: $dest\"",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "the just-installed arm is the one a cold build takes; the stager has to be on BOTH success paths or the image that most needs it is the one that ships without it"
 },
 {
  "id": "packaging.appimage-runtime-offset-validated",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "        ''|*[!0-9]*)",
  "replace": "        'never-matches-this')",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "head -c with an empty or non-numeric offset writes a garbage runtime that appimagetool will happily prepend to every AppImage; the guard is what turns an unreadable offset into a WARN instead of a corrupt artifact"
 },
 {
  "id": "packaging.appimage-runtime-not-downloaded",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "        head -c \"${offset}\" \"${tool}\" > \"${dir}/runtime-${arch_name}\"",
  "replace": "        download_file \"https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-${arch_name}\" \"${dir}/runtime-${arch_name}\"",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "the runtime is only published under the moving `continuous` tag, which is exactly the mutable-asset trap TS1 recorded: taking it from appimagetool's own SHA-pinned bytes is what makes it pinned transitively and arch-correct by construction"
 },
 {
  "id": "packaging.appimage-runtime-missing-tool-noop",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "    tool=\"$(command -v appimagetool 2>/dev/null)\" || return 0",
  "replace": "    tool=\"$(command -v appimagetool 2>/dev/null)\"",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "riscv64 has no upstream appimagetool at all, so the stager must be a silent no-op there rather than a toolchain-stage failure over a runtime nobody on that arch can use"
 },
 {
  "id": "packaging.flatpak-all-seven-refs",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "        \"org.freedesktop.Platform.Locale//${version}\" \\\n        \"org.freedesktop.Sdk.Locale//${version}\" \\",
  "replace": "",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "only Platform and Sdk were installed before; the other five were left to every consumer run and are most of the ~1.9 GB that made this the single largest download in their build"
 },
 {
  "id": "packaging.flatpak-gl-extra-sibling",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "        \"org.freedesktop.Platform.GL.default//${version}-extra\" \\",
  "replace": "",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "the `extra` sibling is a SEPARATE ref on the same branch, not a variant of the base one -- resolving GL.default still fetches it, so dropping the row just moves that download back into the consumer's run"
 },
 {
  "id": "packaging.flatpak-codecs-extra-branch",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "        \"org.freedesktop.Platform.codecs-extra//${version}-extra\"",
  "replace": "        \"org.freedesktop.Platform.codecs-extra//${version}\"",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "codecs-extra (the runtime's FFmpeg, x264 and x265 since 25.08) is published only on the runtime's <ver>-extra branch; ${version} alone names a ref flathub does not have and the install 404s"
 },
 {
  "id": "packaging.flatpak-gl-extra-hyphen",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "        \"org.freedesktop.Platform.GL.default//${version}-extra\" \\",
  "replace": "        \"org.freedesktop.Platform.GL.default//${version}extra\" \\",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "24.08 spelled the GL sibling <ver>extra; 25.08 and 26.08 publish only <ver>-extra, so the old spelling 404s on every image build"
 },
 {
  "id": "env-knob-default.flatpak-runtimes-on",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "INSTALL_FLATPAK_RUNTIMES=\"${INSTALL_FLATPAK_RUNTIMES:-true}\"",
  "replace": "INSTALL_FLATPAK_RUNTIMES=\"${INSTALL_FLATPAK_RUNTIMES:-false}\"",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "off by default is what put ZERO refs in the shipped image; the default IS the fix, since no consumer sets this knob"
 },
 {
  "id": "rust.web-lane-nightly-pin",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    if \"${rustup}\" toolchain install \"${nightly_toolchain}\" --profile minimal \\\n         --component rust-src --target wasm32-unknown-unknown; then",
  "replace": "    if true; then",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "CON1: the dated pin is immutable, so `rustup toolchain install <pin>` is a genuine no-op on a warm image; without it every consumer run auto-installs nightly through a path rustup itself calls deprecated, and a floating channel would be UPDATED -- which renames files out of the read-only image layer (EXDEV)"
 },
 {
  "id": "rust.web-lane-crates-pinned",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    \"${CARGO_HOME:-/usr/local/cargo}/bin/cargo\" install --locked \"$1\" --version \"$2\" --root \"$3\"",
  "replace": "    \"${CARGO_HOME:-/usr/local/cargo}/bin/cargo\" install \"$1\" --root \"$3\"",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "--locked plus an explicit version is what makes the consumer get the build this image was tested with; resolving the index at build time reintroduces the drift the pins exist to stop"
 },
 {
  "id": "rust.web-lane-unpinned-skipped",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "        [ -n \"${version}\" ] || { echo \"WARN: no version pinned for ${name}; skipping\"; continue; }",
  "replace": "        :",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "an empty version reaches `--version ''`, which is not a skip but an install of whatever cargo resolves; the guard is the only thing that keeps an unset knob from silently un-pinning a 258-crate build"
 },
 {
  "id": "rust.web-lane-non-fatal",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    echo \"WARN: cargo install ${tool} ${version} failed; the web lane will build it per run\"\n    return 0",
  "replace": "    echo \"ERROR: cargo install ${tool} ${version} failed\" >&2\n    return 1",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "the whole step is a build-time convenience: a consumer that has to build its own tools is slow, one that cannot build the image at all is worse, so a crates.io hiccup must never fail the package stage"
 },
 {
  "id": "rust.web-lane-requires-cargo-home",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    if [ ! -x \"${rustup}\" ] || [ ! -x \"${cargo}\" ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "without the precondition the function runs ${CARGO_HOME}/bin/rustup as a bare path that is not there, and the stage dies on 127 in an arch that simply has no Rust rather than skipping"
 },
 {
  "id": "package.rust-wipe-spares-the-cargo-registry",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    rm -rf \"${RUSTUP_HOME:?}\"\n    if [ -d \"${CARGO_HOME:?}\" ]; then\n        find \"${CARGO_HOME}\" -mindepth 1 -maxdepth 1 ! -name registry -exec rm -rf {} +\n    fi",
  "replace": "    rm -rf \"${RUSTUP_HOME}\" \"${CARGO_HOME}\"",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "Dockerfile.package keeps the crate downloads on a BuildKit cache mount at ${CARGO_HOME}/registry, and rm -rf over a live mountpoint fails EBUSY -- it took the entire arm64 package image down on 2026-09-05. amd64 never reaches the wipe because its copied toolchain is already native, so the defect ships looking green"
 },
 {
  "id": "mutations.copy-failure-loud",
  "target": "docs/scripts/verify_mutations.py",
  "find": "            except OSError as e:\n                raise SystemExit(",
  "replace": "            except OSError as e:\n                continue; raise SystemExit(",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k heavy",
  "why": "a swallowed copy error produced 0-byte tests and nineteen false vacuous bites"
 },
 {
  "id": "mutations.ignored-not-copied",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    skip |= {os.path.normpath(dst)} | _git_ignored(src)",
  "replace": "    skip |= {os.path.normpath(dst)}",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k heavy",
  "why": "gitignored bulk filled the temp filesystem on every gate run -- and with --jobs that cost is paid once per shard"
 },
 {
  "id": "mutations.timeout-kills-tree",
  "target": "docs/scripts/verify_mutations.py",
  "find": "encoding=\"utf-8\", errors=\"replace\", start_new_session=True)",
  "replace": "encoding=\"utf-8\", errors=\"replace\", start_new_session=False)",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k tree",
  "why": "a timed-out test left its grandchildren running; one orphan burned CPU for twenty minutes"
 },
 {
  "id": "mutations.changed-by-test-path",
  "target": "docs/scripts/mutation_push.py",
  "find": "path == entry[\"target\"] or path in str(entry[\"test\"])",
  "replace": "path == entry[\"target\"]",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k changed",
  "why": "a commit that only weakened a test selected no mutation"
 },
 {
  "id": "vulkan.cross-library-architecture",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "      -DCMAKE_LIBRARY_ARCHITECTURE=\"${_xbuild_triplet}\" \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "without it find_library never looks in /usr/lib/<triplet>, so the TARGET's X11, XCB, ZSTD and OpenGL read as 'NOT found' with the dev packages installed -- the 2026-09-05 gfxreconstruct failure"
 },
 {
  "id": "vulkan.required-component-is-fatal",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "    die \"REQUIRED Vulkan cross-component(s) failed for ${arch_suffix}",
  "replace": "    log \"REQUIRED Vulkan cross-component(s) failed for ${arch_suffix}",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "a lost loader/SPIRV-Tools/glslang/shaderc/Vulkan-Tools/ValidationLayers is a regression, not optionality; downgrading it to a log is how the prefix shipped 2 tools of 52 for months"
 },
 {
  "id": "vulkan.dynamic-args-wired",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "    _vulkan_target_dynamic_args \"${label}\" \"${target_dir}\" \"${archdir}\" \"${triplet}\" dyn\n",
  "replace": "    dyn=()\n",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the path-shaped flags a static table cannot carry: without the call slang cross-builds its own generators and runs them (exit 127) and the caps viewer never finds the target Qt6"
 },
 {
  "id": "vulkan.slang-generators-must-exist",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "      if [ -x \"${gen}/slang-embed\" ]; then",
  "replace": "      if true; then",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "pointing SLANG_GENERATORS_PATH at a directory the host build never produced hands the cross configure a path with no generators in it, which fails later and further from the cause"
 },
 {
  "id": "probe.vk-toolset-floor-below-fails",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  if [ \"${have}\" -lt \"${floor}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a prefix can keep every REQUIRED name and still lose tools; the frozen floor is the only thing that notices, and 2-of-52 is what that looks like"
 },
 {
  "id": "probe.vk-toolset-frozen-row-required",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      fail \"no _VK_TOOLSET_FROZEN row for ${target_arch}",
  "replace": "      echo \"  WARN no _VK_TOOLSET_FROZEN row for ${target_arch}",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "an arch with no frozen row would inherit silence -- exactly the shape that let the foreign prefixes ship unasserted"
 },
 {
  "id": "probe.vk-layer-manifest-is-fatal",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      || fail \"no validation layer manifest in the ${target_arch} SDK prefix",
  "replace": "      || echo \"  WARN no validation layer manifest in the ${target_arch} SDK prefix",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the layers are what the foreign-arch SDK exercise was for; as a WARN their loss is invisible in a green run"
 },
 {
  "id": "package.webtools-prebuilt-needs-a-pin",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    if [ -z \"${sha}\" ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "without the pin check an unpinned arch downloads and installs release bytes nothing verified, which is strictly worse than the cargo build it replaces"
 },
 {
  "id": "package.webtools-prebuilt-arch-gate",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "        *) echo \"NOTE: no ${name} release binary for ${machine}; building it from source\"; return 1 ;;",
  "replace": "        *) target=\"${machine}-unknown-linux-musl\" ;;",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "upstream publishes no riscv64 asset; inventing the target name turns a from-source build into a 404 the lane discovers instead of a documented fallback"
 },
 {
  "id": "packaging.flatpak-failed-ref-is-diagnosed",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "            || { _flatpak_diagnose_ref \"${ref}\"",
  "replace": "            || { :",
  "test": "bash linux/scripts/tests/test-packaging-deps.sh",
  "why": "a published branch whose extra-data payload would not download and a branch that does not exist read identically as 'did not install'; the remote is the only thing that tells them apart"
 },
 {
  "id": "disk-guard.image-lever-refuses-in-flight",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if [ \"${in_flight}\" = \"1\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "removing an image while a stage is unpacking pulls a blob out from under it -- that killed the arm64 runtime lane on 2026-09-06, and the sampler calls this lever on every sample"
 },
 {
  "id": "disk-guard.image-lever-spares-protected-tags",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "        printf '%s\\n' \"${protected_nl}\" | grep -qxF -- \"${tag}\" && continue",
  "replace": "        :",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "without the filter the lever removes the stage image the NEXT stage builds FROM, which under the local OCI handoff is not re-pullable at all"
 },
 {
  "id": "disk-guard.image-lever-tries-each-tag-once",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "    protected=\"${protected}\n${tag}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a tag still listed after its own rmi stays the head of the candidate list forever -- the loop spins for the rest of the run, which is the exact defect the cache-export victim loop already guards"
 },
 {
  "id": "disk-guard.give-up-names-the-image-store",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "by itself. $(_disk_guard_image_store_hint)\"",
  "replace": "by itself.\"",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "'NOTHING was reclaimable' reads like an environment limit; on 2026-09-05 it was a coverage gap with 295 GB in the store the guard never looked at"
 },
 {
  "id": "chain-status.image-lever-wired-between-stages",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "      _disk_guard_image_store_fallback \"${bc_dir}\" \"${threshold}\" \"$(_disk_guard_stage_tags \"${completed_stage}\" 1)\" 0\n",
  "replace": "      :\n",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "the between-stage guard is one of the two places nothing is in flight; unwired, the chain gives up on cache exports with the image store untouched"
 },
 {
  "id": "chain-status.image-lever-protects-the-completed-stage",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "\"$(_disk_guard_stage_tags \"${completed_stage}\" 1)\" 0\n",
  "replace": "\"$(_disk_guard_stage_tags \"${completed_stage}\" 0)\" 0\n",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "the stage just completed is the NEXT stage's parent; dropping it from the protected set is how a local OCI handoff loses the image it is about to read"
 },
 {
  "id": "chain-status.evict-protects-the-undeletable",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "      _prot_ref=\"${_prot_ref},${victim}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "an undeletable slug that does not join the protected list stays the LRU pick forever and the eviction loop spins for the rest of the run"
 },
 {
  "id": "chain-status.evict-protected-is-a-nameref",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  local -n _prot_ref=\"$2\"",
  "replace": "  local _prot_ref=\"$2\"",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a by-value copy makes the anti-spin append invisible to the next pick_victim call -- the same spin, one level further from the symptom"
 },
 {
  "id": "probe.llvm-target-startable-wired",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    check_llvm_target_startable \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a gate main() never calls is the shape this repo keeps finding: liblldb shipped 3 unstartable binaries past every green run"
 },
 {
  "id": "probe.llvm-target-broken-is-fatal",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    elif [ \"${broken:-1}\" -gt 0 ]; then",
  "replace": "    elif false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the sdk stage resolved these sonames against the BUILDER's ldconfig cache; a binary that cannot start in the shipped image is a defect, not a warning"
 },
 {
  "id": "probe.llvm-target-empty-walk-is-not-clean",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    if [ -z \"${total}\" ]; then\n      fail \"the ${target_arch} llvm-target walk printed no COUNT",
  "replace": "    if false; then\n      fail \"the ${target_arch} llvm-target walk printed no COUNT",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a probe that never ran prints no COUNT, and without this arm that reads exactly like a prefix with zero broken binaries"
 },
 {
  "id": "dead-functions.stale-row-names-its-disarmer",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "                    describe_stale=lambda k: k.replace(\"\\t\", \"  \") + _stale_note(k, corpus_texts))",
  "replace": "                    )",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "the stale heading says 'the function is called again or gone'; for a disarmed unlinked row both halves are false, and the reader deletes a freeze that still holds"
 },
 {
  "id": "dead-functions.disarmer-needs-both-basenames",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "            if base in text and pbase in text:",
  "replace": "            if base in text or pbase in text:",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k mask",
  "why": "the arm is disarmed only when ONE file could load BOTH definitions; either basename alone names a file that cannot mask anything, so 'or' explains rows that were never disarmed"
 },
 {
  "id": "gate-fixture.harness-catches-a-misused-assertion",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  [ \"$2\" = \"2\" ] || return 1",
  "replace": "  return 1",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "`t_assert_fails test -f X \"why\"` runs `test -f X why`, which exits 2 -- 'not zero', so the case passes for the wrong reason; four of those were written in one wave and nothing in the harness caught them"
 },
 {
  "id": "gate-fixture.harness-guard-is-narrow",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  case \"$1\" in test|'[') return 0 ;; *) return 1 ;; esac",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "only test/[ report a usage error as rc 2; treating every rc 2 as a misuse rewrites a real failure into a harness complaint"
 },
 {
  "id": "gate-fixture.host-skip-only-on-git-bash",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  case \"$(uname -s)\" in MINGW* | MSYS* | CYGWIN*) return 0 ;; esac",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-host-skips.sh",
  "why": "a skip on Linux would shrink CI's coverage without a red line; only a Git Bash host may waive a prerequisite (CON61)"
 },
 {
  "id": "gate-fixture.host-skip-exits-77",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  [ \"${rc}\" -ne 1 ] || exit 77",
  "replace": "  [ \"${rc}\" -ne 1 ] || exit 0",
  "test": "bash linux/scripts/tests/test-host-skips.sh",
  "why": "exit 0 reads as a suite that ran and passed; 77 is what lets run-tests.sh list the suite as skipped instead"
 },
 {
  "id": "gate-fixture.host-waiver-ends-with-its-case",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "t_case() { _T_CASE=\"$1\"; _T_WAIVED_CASE=\"\"; }",
  "replace": "t_case() { _T_CASE=\"$1\"; }",
  "test": "bash linux/scripts/tests/test-host-skips.sh",
  "why": "a waiver that outlives its t_case silences every later case in the suite, the ones the host can run included"
 },
 {
  "id": "gate-fixture.host-waiver-is-counted",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "    _T_WAIVED=$((_T_WAIVED + 1))\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-host-skips.sh",
  "why": "t_summary must say how many failures it waived, or a waived suite reads exactly like a passing one"
 },
 {
  "id": "gate-fixture.symlink-probe-reads-a-link",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "[ -L \"$2/b\" ]",
  "replace": "[ -e \"$2/b\" ]",
  "test": "bash linux/scripts/tests/test-host-skips.sh",
  "why": "Git Bash's ln -s leaves a copy that exists; only -L tells the copy from a link"
 },
 {
  "id": "gate-fixture.mode-probe-reads-the-bits",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "[ \"$(stat -c %a \"$1\" 2>/dev/null)\" = 711 ]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-host-skips.sh",
  "why": "chmod exits 0 on Git Bash without setting the bits; the probe must read them back"
 },
 {
  "id": "gate-fixture.elf-probe-reads-the-magic",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "| tail -c 3)\" = ELF ]; then return 0",
  "replace": "| tail -c 3)\" != x ]; then return 0",
  "test": "bash linux/scripts/tests/test-host-skips.sh",
  "why": "a PE bash handed to readelf yields an empty machine; the probe must reject anything without the ELF magic"
 },
 {
  "id": "script-tests.skip-only-on-git-bash",
  "target": "linux/scripts/tests/run-tests.sh",
  "find": "MINGW* | MSYS* | CYGWIN*) SKIP_OK=1 ;; *) SKIP_OK=0 ;;",
  "replace": "*) SKIP_OK=1 ;;",
  "test": "bash linux/scripts/tests/test-host-skips.sh",
  "why": "on Linux a stray exit 77 must fail the run; accepting it there lets any suite opt out of CI by exiting 77"
 },
 {
  "id": "ordered-jobs.reap-job-group",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  if _oj_stop_owned \"${_OJ_COMMAND_PID:-}\"; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-run-tests-reaping.sh",
  "why": "a child a suite leaves behind outlives the run: a spinning fixture held a core for 2.8 days and 24 headless Chromes 22 GB"
 },
 {
  "id": "script-tests.reap-on-interrupt",
  "target": "linux/scripts/tests/run-tests.sh",
  "find": "trap 'oj_reap; rm -rf \"${_RUN_TMP}\"' EXIT",
  "replace": "trap 'rm -rf \"${_RUN_TMP}\"' EXIT",
  "test": "bash linux/scripts/tests/test-run-tests-reaping.sh",
  "why": "a preflight killed at its timeout must not leave the suite it was running behind"
 },
 {
  "id": "script-tests.suite-timeout",
  "target": "linux/scripts/tests/run-tests.sh",
  "find": "export OJ_TIMEOUT=\"${RUN_TESTS_SUITE_TIMEOUT:-900}\"",
  "replace": "export OJ_TIMEOUT=\"\"",
  "test": "bash linux/scripts/tests/test-run-tests-reaping.sh",
  "timeout": 90,
  "why": "a hung suite held the whole preflight 27 minutes (test-docs-sidebars.sh, CON144); without a timeout it holds it forever"
 },
 {
  "id": "ghost-watch.orphans-only",
  "target": "linux/host-config/ghost-watch.sh",
  "find": "if (($2 != 1 && $2 != mgr) || $3 < min_s || cmd ~ allow) next",
  "replace": "if ($3 < min_s || cmd ~ allow) next",
  "test": "bash linux/scripts/tests/test-ghost-watch.sh",
  "why": "a busy compiler with a live parent is a build, not a ghost; only orphans of PID 1 or the user's systemd count"
 },
 {
  "id": "ghost-watch.leftover-patterns",
  "target": "linux/host-config/ghost-watch.sh",
  "find": "if ($4 >= cpu || $5 >= rss || cmd ~ ghost)",
  "replace": "if ($4 >= cpu || $5 >= rss)",
  "test": "bash linux/scripts/tests/test-ghost-watch.sh",
  "why": "an orphaned headless Chrome idles at 3 % CPU and 230 MB, under both thresholds; 24 of them held 22 GB"
 },
 {
  "id": "ghost-watch.exit-status",
  "target": "linux/host-config/ghost-watch.sh",
  "find": "fi\nexit 1",
  "replace": "fi\nexit 0",
  "test": "bash linux/scripts/tests/test-ghost-watch.sh",
  "why": "the timer's unit fails on a ghost, which is what systemctl --user --failed shows"
 },
 {
  "id": "ghost-watch.allow-through-environ",
  "target": "linux/host-config/ghost-watch.sh",
  "find": "allow = ENVIRON[\"GW_ALLOW\"]",
  "replace": "allow = ENVIRON[\"GW_NOPE\"]",
  "test": "bash linux/scripts/tests/test-ghost-watch.sh",
  "why": "the regexes reach awk through ENVIRON because gawk rewrites -v escapes; an unread allow list matches every process and reports none"
 },
 {
  "id": "mutations.reap-finished-test",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if hasattr(os, \"killpg\"):\n        # A surviving child can keep a capture pipe open after the test exits.",
  "replace": "    if False:\n        # A surviving child can keep a capture pipe open after the test exits.",
  "test": "bash linux/scripts/tests/test-mutation-pipe-reaping.sh",
  "why": "a descendant holding captured stdout or stderr kept a completed test baseline pending until its timeout"
 },
 {
  "id": "mutations.reap-on-signal",
  "target": "docs/scripts/verify_mutations.py",
  "find": "            signal.signal(getattr(signal, _sig), _exit_on_signal)",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k tree",
  "why": "a gate killed at a preflight's timeout left its running tests orphaned; a SIGTERM must take their sessions down"
 },
 {
  "id": "cross-build.regcache-drop-after-two",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "  [ \"${_cbrc_fails}\" -ge 2 ] || return 0",
  "replace": "  [ \"${_cbrc_fails}\" -ge 99 ] || return 0",
  "test": "bash linux/scripts/tests/test-cross-stage-build-cmd.sh",
  "why": "the ghcr cache IMPORT is itself the failing read (2026-08-18), so a retry that keeps type=registry re-reads the same broken blob for the rest of the ladder"
 },
 {
  "id": "cross-build.regcache-drop-keeps-local",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "      --cache-from:type=registry*|--cache-to:type=inline*)",
  "replace": "      --cache-from:*|--cache-to:*)",
  "test": "bash linux/scripts/tests/test-cross-stage-build-cmd.sh",
  "why": "widening the drop to every cache tier takes the LOCAL export with it, and the local cache is exactly what still fast-forwards the retry"
 },
 {
  "id": "gst.media-jobs-default-cap",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "    compute_jobs_with_mem_cap \"\" \"${1:-2000}\"",
  "replace": "    compute_jobs_with_mem_cap \"\" 2000",
  "test": "bash linux/scripts/tests/test-media-jobs.sh",
  "why": "a fixed 2000 is what forced the android gstreamer lane to keep its own copy of the whole block for one number"
 },
 {
  "id": "gst.media-jobs-android-caller",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "[ -n \"${JOBS:-}\" ] || JOBS=\"$(media_jobs \"${PER_JOB_MB}\")\"",
  "replace": "[ -n \"${JOBS:-}\" ] || JOBS=\"$(media_jobs)\"",
  "test": "bash linux/scripts/tests/test-media-jobs.sh",
  "why": "ANDROID_GSTREAMER_PER_JOB_MB exists because that lane OOMs at the generic budget; dropping it at the call site silently restores the 2000 MB it was tuned away from"
 },
 {
  "id": "version-snapshot.sync-unquotes-once",
  "target": "docs/scripts/sync_versions.py",
  "find": "        return value[1:-1]",
  "replace": "        return value",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "a quoted versions.env value (CUDA_ARCHITECTURES has to be quoted) re-quotes its target on every run, so --write is never idempotent and --check never goes green"
 },
 {
  "id": "version-snapshot.sync-writes-only-on-change",
  "target": "docs/scripts/sync_versions.py",
  "find": "    if not dry_run and changed:",
  "replace": "    if not dry_run:",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "rewriting every scanned file on every --write churns files nothing changed in, and the shared owner is now the only place that decision lives"
 },
 {
  "id": "version-snapshot.consumer-pins-tag-prefix",
  "target": "docs/scripts/consumer_pins.py",
  "find": "    return re.sub(r\"^v(?=\\d)\", \"\", version)",
  "replace": "    return version",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "versions.env spells PYTORCH_VERSION, TORCHVISION_VERSION and ONNXRUNTIME_GENAI_VERSION as GitHub tags (v2.14.0) while a consumer pins the bare number, so without the strip every correctly pinned consumer reads as drifted and the gate is red on a tree that agrees with the hub"
 },
 {
  "id": "version-snapshot.consumer-pins-torch-row",
  "target": "docs/scripts/consumer_pins.py",
  "find": "        r'\"torch(?=[=<>~!\\[\",;])',",
  "replace": "        r'\"torch(?=NEVER)',",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "a torch row that never finds its mention skips silently, so a consumer pinning an older torch than the image force-installs passes the gate and a dev box and the image run different torch with nothing red"
 },
 {
  "id": "version-snapshot.consumer-pins-flet-extras",
  "target": "docs/scripts/consumer_pins.py",
  "find": "        r'\"flet(?:\\[[^\\]]*\\])?==([^\"\\s;,]+)',",
  "replace": "        r'\"flet==([^\"\\s;,]+)',",
  "test": "bash linux/scripts/tests/test-consumer-pins-toml.sh",
  "why": "OrchestrANT pins the SDK as flet[desktop]==; a row that cannot read the extras form reports it unpinned or skips it, and the client and SDK drift apart with nothing red"
 },
 {
  "id": "version-snapshot.consumer-pins-uv-floor-above",
  "target": "docs/scripts/consumer_pins.py",
  "find": "    if not pinned or parts(match.group(1)) > parts(pinned):",
  "replace": "    if not pinned:",
  "test": "bash linux/scripts/tests/test-consumer-pins-toml.sh",
  "why": "a required-version above the image's uv makes every uv command in the image refuse the project"
 },
 {
  "id": "version-snapshot.consumer-pins-uv-floor-form",
  "target": "docs/scripts/consumer_pins.py",
  "find": "    match = re.fullmatch(r\">=\\s*(\\d+(?:\\.\\d+)*)\", str(floor).strip())",
  "replace": "    match = re.search(r\"(\\d+(?:\\.\\d+)*)\", str(floor).strip())",
  "test": "bash linux/scripts/tests/test-consumer-pins-toml.sh",
  "why": "an exact uv pin breaks on the next image; only a lower bound passes"
 },
 {
  "id": "mutations.mirror-name-unset",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    env = {**os.environ, \"MUTATION_MIRROR\": os.path.basename(os.path.normpath(root))}",
  "replace": "    env = dict(os.environ)",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "a recipe that keeps one build cache for every parallel mirror lets a mutant run the other mirror's unmutated binary; MUTATION_MIRROR is what tells the mirrors apart"
 },
 {
  "id": "lib.cgroup-remaining-clamps-at-zero",
  "target": "linux/scripts/01-core/parallelism.sh",
  "find": "    [ \"${remaining}\" -lt 0 ] 2>/dev/null && remaining=0",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-parallelism.sh",
  "why": "usage above the limit makes remaining NEGATIVE, and a negative reads as the smallest cap in _mem_available_mb's min -- every job throttled by a number that is not memory"
 },
 {
  "id": "lib.cgroup-unlimited-is-unknown",
  "target": "linux/scripts/01-core/parallelism.sh",
  "find": "  { [ \"${max}\" -gt 0 ] && [ \"${max}\" -lt 9223372036854771712 ]; } 2>/dev/null || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-parallelism.sh",
  "why": "cgroup v1 spells 'no limit' as 0 or a kernel-huge number; taking either as a real limit caps the build at 0 MB or hands the caller a nonsense ceiling"
 },
 {
  "id": "lib.cgroup-v1-is-reached",
  "target": "linux/scripts/01-core/parallelism.sh",
  "find": "  _cgroup_remaining_mb_from \"${root}/memory/memory.limit_in_bytes\" \\\n                            \"${root}/memory/memory.usage_in_bytes\" && return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-parallelism.sh",
  "why": "a cgroup v1 host would silently report no limit at all, which is how a memory-capped builder ends up choosing jobs for a machine it is not on"
 },
 {
  "id": "handoff.manifest-build-region-is-guarded",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    _manifest_build_and_smoke\n  else",
  "replace": "    :\n  else",
  "test": "bash linux/scripts/tests/test-manifest-wrapper-gate.sh",
  "why": "unguarded there is nothing left to build the wrappers or smoke them, and the index would go live over whatever happened to be tagged"
 },
 {
  "id": "handoff.manifest-build-phases-stay-inside",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  if [ \"${BUILD_IMAGES}\" -eq 1 ]; then\n    log \"Building ${ARTIFACT_BUILD_MODE}",
  "replace": "  ensure_foreign_binfmt \"${TARGET_ARCHES}\"\n  if [ \"${BUILD_IMAGES}\" -eq 1 ]; then\n    log \"Building ${ARTIFACT_BUILD_MODE}",
  "test": "bash linux/scripts/tests/test-manifest-wrapper-gate.sh",
  "why": "a build-only phase that drifts back into main() runs on --manifest-only and --repair, which exist precisely NOT to build"
 },
 {
  "id": "probe.opencv-riscv64-png-fails-early",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "genuinely acceptable.\" >&2\n        exit 1",
  "replace": "genuinely acceptable.\" >&2\n        _otarp_opts+=(\"-DWITH_PNG=OFF\")",
  "test": "bash linux/scripts/tests/test-opencv-riscv64-seams.sh",
  "why": "a PNG-less riscv64 OpenCV builds green and only surfaces as a red runtime smoke a stage later -- that fail-late footgun cost iree-0714a..e, which is why this exits instead of degrading"
 },
 {
  "id": "probe.opencv-riscv64-freetype-says-what-is-missing",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "        echo \"[WARN] riscv64 OpenCV: static target harfbuzz not staged",
  "replace": "        echo \"[WARN] riscv64 OpenCV: freetype off (",
  "test": "bash linux/scripts/tests/test-opencv-riscv64-seams.sh",
  "why": "the WARN names each of the four files and whether it is there; without that the operator cannot tell a missing .a from a missing .pc, and the freetype module just silently is not there"
 },
 {
  "id": "probe.opencv-riscv64-seams-are-wired",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "            _ota_riscv64_freetype _ota_cmake_opts\n            _ota_riscv64_png _ota_cmake_opts\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-opencv-riscv64-seams.sh",
  "why": "two extracted helpers nothing calls are two functions' worth of riscv64 knowledge that stops reaching the cmake line -- the dead-function gate is what catches an extraction that forgot its call site"
 },
 {
  "id": "code-dupes.ps-kind-recognised",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    if name.endswith((\".ps1\", \".psm1\")):\n        return \"ps\"",
  "replace": "    if False:\n        return \"ps\"",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "50,862 lines of .ps1/.psm1 the gate cannot even name a kind for are 50,862 lines it cannot guard"
 },
 {
  "id": "code-dupes.ps-before-dockerfile",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    if name.endswith((\".ps1\", \".psm1\")):\n        return \"ps\"\n    if name.startswith(\"Dockerfile\"):\n        return \"docker\"",
  "replace": "    if name.startswith(\"Dockerfile\"):\n        return \"docker\"\n    if name.endswith((\".ps1\", \".psm1\")):\n        return \"ps\"",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "windows/scripts/tests/Dockerfile.EolAttributes.Tests.ps1 is a Pester suite; read as a Dockerfile it yields no instruction and is guarded by nothing"
 },
 {
  "id": "code-dupes.ps-windows-in-scope",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "KIND_SKIP_DIRS = {\"shell\": {\"windows\"}, \"docker\": {\"windows\"}, \"md\": {\"windows\"}}",
  "replace": "KIND_SKIP_DIRS = {\"shell\": {\"windows\"}, \"docker\": {\"windows\"}, \"md\": {\"windows\"}, \"ps\": {\"windows\"}}",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "the windows skip was blanket only while no kind could read PowerShell; keeping it for ps leaves the whole lane unscanned again"
 },
 {
  "id": "code-dupes.ps-block-comment-blanked",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    text = PS_BLOCK_COMMENT.sub(lambda m: \"\\n\" * m.group(0).count(\"\\n\"),\n                                path.read_text(encoding=\"utf-8\", errors=\"replace\"))",
  "replace": "    text = path.read_text(encoding=\"utf-8\", errors=\"replace\")",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "an unbalanced brace inside a <# #> comment ends the function there, splitting one copied block into stubs no threshold reaches"
 },
 {
  "id": "code-dupes.ps-brace-may-open-next-line",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "PS_FUNC = re.compile(r\"^\\s*(?:function|filter)\\s+([^\\s({]+)\\s*(?:\\([^)]*\\))?\\s*\\{?\\s*$\",",
  "replace": "PS_FUNC = re.compile(r\"^\\s*(?:function|filter)\\s+([^\\s({]+)\\s*(?:\\([^)]*\\))?\\s*\\{\\s*$\",",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "PowerShell opens a body on the header line or the next one; demanding it on the header turns every other-styled function into loose chunks"
 },
 {
  "id": "code-dupes.ps-scope-var-folded",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "KIND_FOLD = {\"ps\": lambda text: PS_SCOPE_VAR.sub(\"$\", text)}",
  "replace": "KIND_FOLD = {}",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "$env:X is one variable; left as $V : X a copy that renamed it stops matching, which is exactly the type-2 clone this gate exists for"
 },
 {
  "id": "code-dupes.ps-param-block-idiom",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "    marked = mark_spans(text, ps_param_spans(structure))",
  "replace": "    marked = text",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "a param block is the language's parameter list; counted, two functions that only take the same inputs read as a copy that nothing short of retyping the parameters can shrink"
 },
 {
  "id": "code-dupes.ps-param-pairs-skip-idiom",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "        counted = _pair_holders(shingle, holders, param_only)",
  "replace": "        counted = holders",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "the census keeps the param-block holders on purpose, so the pair count must drop them itself or the block still counts"
 },
 {
  "id": "code-dupes.ps-param-stays-in-census",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "                owners[sh].add(unit)\n                if j == 0:",
  "replace": "                if j not in touching:\n                    owners[sh].add(unit)\n                if j == 0:",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "out of the census, parameter shapes stop pushing the same shapes elsewhere past MAX_OWNERS, so pairs nobody touched grow and fail"
 },
 {
  "id": "code-dupes.ps-param-literal-parens",
  "target": "docs/scripts/code_dupes_ps.py",
  "find": "PS_LITERAL_BRACKETS = \"{}()\"",
  "replace": "PS_LITERAL_BRACKETS = \"{}\"",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "a ')' default or a '(' in a comment then ends the block early or never, and the rest of the parameter list counts as code again"
 },
 {
  "id": "code-dupes.ps-param-keyword-only",
  "target": "docs/scripts/code_dupes_ps.py",
  "find": "PS_PARAM = re.compile(r\"(?<![\\w$.:-])param\\s*\\(\", re.IGNORECASE)",
  "replace": "PS_PARAM = re.compile(r\"param\\s*\\(\", re.IGNORECASE)",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "$builder.Param( and -Param ( are a method call and an argument; read as blocks, real code drops out of the count"
 },
 {
  "id": "code-dupes.ps-param-marks-every-line",
  "target": "docs/scripts/code_dupes_ps.py",
  "find": "        out += [text[last:start], \"\\n\".join(_mark_line(p) for p in text[start:end].split(\"\\n\"))]",
  "replace": "        out += [text[last:start], f\" {PARAM_OPEN} {text[start:end]} {PARAM_CLOSE} \"]",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "a blank line splits a script-level block across loose chunks; a chunk that starts mid-block holds no open mark and counts its parameters as code"
 },
 {
  "id": "code-dupes.ps-param-reach-in",
  "target": "docs/scripts/code_dupes_ps.py",
  "find": "                touching.update(range(max(0, len(kept) - width + 1), len(kept) + 1))",
  "replace": "                touching.update(range(len(kept), len(kept) + 1))",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "a shingle that starts before the block and ends inside it is still parameter text; counted, a twin block lengthens the shared run before it"
 },
 {
  "id": "code-dupes.ps-param-mark-ends-with-line",
  "target": "docs/scripts/code_dupes_ps.py",
  "find": "    for line in lines:\n        # Marks pair up within a line, so one a string folded away cannot leak past it.\n        inside = False",
  "replace": "    inside = False\n    for line in lines:",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "a close mark folded into a string the gate misreads would leave every later line of the unit inside the block, dropping real code from the count"
 },
 {
  "id": "lint-gates.shell-list-is-git-not-a-glob",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  done < <(git -C \"${_LINT_GATES_ROOT}\" ls-files -z -- \"${spec}\")",
  "replace": "  done < <(cd \"${_LINT_GATES_ROOT}\" && printf '%s\\0' */*.sh)",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "the shellcheck scope is `git ls-files`, not a glob: `*/*.sh` does not recurse without globstar, so the gate reads the directories somebody remembered and reports green over the rest"
 },
 {
  "id": "lint-gates.non-ascii-path-needs-nul",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  done < <(git -C \"${_LINT_GATES_ROOT}\" ls-files -z -- \"${spec}\")",
  "replace": "  done < <(git -C \"${_LINT_GATES_ROOT}\" ls-files -- \"${spec}\" | tr '\\n' '\\0')",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "without -z git QUOTES a non-ASCII path (\"a\\303\\237-dir/d.sh\") and the quoted string names no file, so that script is silently never linted"
 },
 {
  "id": "lint-gates.empty-shell-list-refuses",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    printf 'zero file arguments falls back to ANTfrastructure OWN tree and passes.)\\n' >&2\n    return 1",
  "replace": "    printf 'zero file arguments falls back to ANTfrastructure OWN tree and passes.)\\n' >&2\n    return 0",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "an empty file list must FAIL, not merely print: lint-shell.sh with zero file arguments lints ANTfrastructure's own tree and exits 0, which is green over the consumer's nothing"
 },
 {
  "id": "lint-gates.vendored-dir-default-exclusion",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  [ \"${#_LINT_GATES_EXCLUDE[@]}\" -gt 0 ] || _LINT_GATES_EXCLUDE=(third_party)",
  "replace": "  [ \"${#_LINT_GATES_EXCLUDE[@]}\" -gt 0 ] || _LINT_GATES_EXCLUDE=()",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "third_party is excluded by DEFAULT; without that default the vendored subtrees are graded here as well as in their own repos, which is the 82-false-positive run this scope was built to stop"
 },
 {
  "id": "lint-gates.consumer-file-inside-vendored-kept",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  case \"$1\" in */*/*) return 1 ;; esac",
  "replace": "  return 1",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "the tracked plain files directly inside an excluded directory are the consumer's own (a third_party/CMakeLists.txt); dropping the whole prefix drops them from the secret scan with the vendored tree"
 },
 {
  "id": "lib.gates-failure-is-recorded",
  "target": "linux/scripts/01-core/gates.sh",
  "find": "  _GATE_FAILURES+=(\"${name}\")",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "run_gate returns 0 for a FAILING gate on purpose; the failure survives only because it is recorded here, so an unrecorded one is suppression"
 },
 {
  "id": "lib.gates-failures-are-re-raised",
  "target": "linux/scripts/01-core/gates.sh",
  "find": "  if [ \"${#_GATE_FAILURES[@]}\" -gt 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "assert_gates is the one place recorded failures become an exit status; without the re-raise `|| FAILED=1` is suppression wearing a costume"
 },
 {
  "id": "lib.gates-nothing-ran-is-not-green",
  "target": "linux/scripts/01-core/gates.sh",
  "find": "  if [ \"${_GATE_RAN}\" -eq 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "a batch in which no gate ran at all must not report green -- an aggregator that graded nothing is the hazard this library exists for"
 },
 {
  "id": "lib.gates-missing-command-is-a-caller-bug",
  "target": "linux/scripts/01-core/gates.sh",
  "find": "    printf 'run_gate: gate \"%s\" was given no command to run.\\n' \"${name}\" >&2\n    return 2",
  "replace": "    printf 'run_gate: gate \"%s\" was given no command to run.\\n' \"${name}\" >&2\n    return 0",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "run_gate with no command is a CALLER bug (2), not a finding; returning 0 counts a gate that never ran as one that passed"
 },
 {
  "id": "ci-image-ref.missing-key-is-fatal",
  "target": "linux/scripts/ci-image-ref.sh",
  "find": "  if [ -z \"${value}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "a key missing from versions.env must be a hard failure; an empty value composes \":tag\" or \"prefix:\", and an empty image reference reaches docker run as \"run the next argument as an image\" and fails a long way from the cause"
 },
 {
  "id": "ci-image-ref.missing-key-diagnostic-is-not-swallowed",
  "target": "linux/scripts/ci-image-ref.sh",
  "find": "    printf 'ci-image-ref.sh: %s is not set in %s\\n' \"${key}\" \"${file}\" >&2",
  "replace": "    printf 'ci-image-ref.sh: %s is not set in %s\\n' \"${key}\" \"${file}\"",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "the key reader's stdout IS its return value, read inside a command substitution: a diagnostic printed without >&2 is captured into that value instead of reaching the user, so the gate fails in silence with no key named"
 },
 {
  "id": "ci-image-ref.windows-tag-key",
  "target": "linux/scripts/ci-image-ref.sh",
  "find": "    windows) tag_key=CI_IMAGE_WINDOWS_TAG ;;",
  "replace": "    windows) tag_key=CI_IMAGE_LINUX_TAG ;;",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "--windows must resolve the WINDOWS tag; a Linux tag handed to a Windows lane is a valid-looking reference for the wrong operating system, which is the failure verify_ci_image_refs.py's check C exists for"
 },
 {
  "id": "ci-image-ref.windows-arm64-tag-key",
  "target": "linux/scripts/ci-image-ref.sh",
  "find": "    windows-arm64) tag_key=CI_IMAGE_WINDOWS_ARM64_TAG ;;",
  "replace": "    windows-arm64) tag_key=CI_IMAGE_WINDOWS_TAG ;;",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "--windows-arm64 must resolve the cross bundle's OWN key; falling back to the plain Windows tag hands a cross lane an x64 payload, and it links arm64 objects against x64 libraries far from the cause"
 },
 {
  "id": "ci-image-ref.quotes-unwrapped",
  "target": "linux/scripts/ci-image-ref.sh",
  "find": "  value=\"${value%\\\"}\"; value=\"${value#\\\"}\"\n  value=\"${value%\\'}\"; value=\"${value#\\'}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "versions.env values may be quoted; a surviving quote reaches docker as data (the class that broke CUDA_ARCHITECTURES) instead of delimiting the value"
 },
 {
  "id": "ci-image-ref.unknown-argument-is-a-usage-error",
  "target": "linux/scripts/ci-image-ref.sh",
  "find": "      printf 'ci-image-ref.sh: unknown argument \"%s\" (expected --linux, --windows or --windows-arm64)\\n' \"$1\" >&2\n      return 2",
  "replace": "      printf 'ci-image-ref.sh: unknown argument \"%s\" (expected --linux, --windows or --windows-arm64)\\n' \"$1\" >&2\n      return 0",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "a typo'd platform flag must be a usage error, not a silent success: returning 0 prints no reference at all and the caller runs docker with an empty image argument"
 },
 {
  "id": "cmake-format.empty-walk-refused",
  "target": "linux/scripts/preflight.sh",
  "find": "    if [[ ${#files[@]} -eq 0 ]]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-cmake-format.sh",
  "why": "a CMake walk that returned nothing is a broken scope/exclude list, not a pass: cmake-format with zero file arguments exits 0 and the gate reports green over nothing",
  "timeout": 900
 },
 {
  "id": "lib.cmake-format-check-does-not-rewrite",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "    mode=(--check)",
  "replace": "    mode=(-i)",
  "test": "bash linux/scripts/tests/test-cmake-format.sh",
  "why": "--check must VERDICT on drift, not silently reformat it away: with -i the gate rewrites the offending file and exits 0, so formatting drift can never fail a build",
  "timeout": 900
 },
 {
  "id": "lib.cmake-walk-covers-dot-cmake",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  local find_args=(\"${root}\" -type f '(' -name 'CMakeLists.txt' -o -name '*.cmake' ')')",
  "replace": "  local find_args=(\"${root}\" -type f '(' -name 'CMakeLists.txt' ')')",
  "test": "bash linux/scripts/tests/test-cmake-format.sh",
  "why": "the walk covers *.cmake as well as CMakeLists.txt; dropping the module half hides every .cmake file in the tree from the format gate",
  "timeout": 900
 },
 {
  "id": "workflow-lint.action-default-drifted",
  "target": "linux/scripts/verify_ci_image_refs.py",
  "find": "        elif value != refs[platform]:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "check A: each of the four container actions' `image` default is COMPARED with the ref versions.env composes FOR THAT ACTION'S PLATFORM; without the comparison a canonical-but-wrong default (the Windows ref on a Linux action) passes every other check and four copies drift away from the one owner"
 },
 {
  "id": "workflow-lint.action-default-required",
  "target": "linux/scripts/verify_ci_image_refs.py",
  "find": "        if value is None:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "an `image` input with no default is not 'nothing to compare': every caller then re-types the tag, which is where the copies drift apart"
 },
 {
  "id": "workflow-lint.every-image-input-graded",
  "target": "linux/scripts/verify_ci_image_refs.py",
  "find": "        for input_name, platform in sorted(inputs.items()):",
  "replace": "        for input_name, platform in sorted(inputs.items())[:1]:",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "check A grades EVERY image input of an action, not its first: the Windows actions' `image-arm64` default is what every cross lane inherits, and a wrong or missing one would pass with only `image` graded"
 },
 {
  "id": "workflow-lint.non-canonical-literal-fails",
  "target": "linux/scripts/verify_ci_image_refs.py",
  "find": "            if tag in canonical_tags:\n                continue",
  "replace": "            if True:\n                continue",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "check B: every kataglyphis_beschleuniger:<tag> literal under .github/ must name one of the two canonical tags -- an arch-suffixed or stale ':latest' has to fail here rather than at docker pull in someone else's lane"
 },
 {
  "id": "workflow-lint.call-site-platform-checked",
  "target": "linux/scripts/verify_ci_image_refs.py",
  "find": "            if found and found.group(1) != refs[platform].rsplit(\":\", 1)[1]:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "check C is the half check B cannot do: every tag is canonical, so a Linux action handed ':winamd64' passes B and runs the wrong operating system"
 },
 {
  "id": "workflow-lint.call-site-input-platform",
  "target": "linux/scripts/verify_ci_image_refs.py",
  "find": "            platform = pending[0][image.group(1)]",
  "replace": "            platform = next(iter(pending[0].values()))",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "check C takes the ref of the INPUT a literal is handed to: a Windows action's `image` and `image-arm64` want different images, and grading both against the first would wave the amd64 image through as a cross lane's bundle"
 },
 {
  "id": "workflow-lint.no-yaml-is-a-refusal",
  "target": "linux/scripts/verify_ci_image_refs.py",
  "find": "    if not files:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ci-image-ref.sh",
  "why": "a root with no workflow or action YAML is the wrong root, not a clean repo; grading zero files and printing OK is the vacuous green this gate takes a root to avoid"
 },
 {
  "id": "lib.tool-checks-names-every-missing",
  "target": "linux/scripts/01-core/tool-checks.sh",
  "find": "      command -v \"${tool}\" >/dev/null 2>&1 || missing+=(\"${tool}\")",
  "replace": "      command -v \"${tool}\" >/dev/null 2>&1 || { missing=(\"${tool}\"); break; }",
  "test": "bash linux/scripts/tests/test-tool-checks.sh",
  "why": "require_tools names EVERY missing tool at once; stopping at the first turns 'install these four' into four failed runs, which is the whole reason the loop collects instead of dying inside it"
 },
 {
  "id": "lib.tool-checks-missing-is-fatal",
  "target": "linux/scripts/01-core/tool-checks.sh",
  "find": "      err \"Required tools not found: ${missing[*]}\"",
  "replace": "      warn \"Required tools not found: ${missing[*]}\"",
  "test": "bash linux/scripts/tests/test-tool-checks.sh",
  "why": "a missing tool must END the caller (err exits 1); warning and returning lets the build continue toolless and fail later somewhere unrelated"
 },
 {
  "id": "lib.tool-checks-caller-require-tools-wins",
  "target": "linux/scripts/01-core/tool-checks.sh",
  "find": "if ! declare -F require_tools >/dev/null 2>&1; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-tool-checks.sh",
  "why": "the per-definition `declare -F` guard is what the two inline copies had: a consumer whose own common.sh defines require_tools keeps ITS version, and sourcing this module must never clobber it"
 },
 {
  "id": "lib.tool-checks-caller-has-tool-wins",
  "target": "linux/scripts/01-core/tool-checks.sh",
  "find": "if ! declare -F has_tool >/dev/null 2>&1; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-tool-checks.sh",
  "why": "same guard for the other half of the pair: a caller's has_tool (which may know about a vendored toolchain that is not on PATH) must survive the source"
 },
 {
  "id": "shared-config.verdict-reaches-the-exit-code",
  "target": "shared/config/sync-shared-config.sh",
  "find": "    if [ ${#SSC_MISSING[@]} -gt 0 ] || [ ${#SSC_DRIFTED[@]} -gt 0 ]; then return 1; fi",
  "replace": "    if false; then return 1; fi",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "the MISSING/DRIFTED lists must decide the exit code; printing them and returning 0 is a gate that reports every drift and blocks none of it"
 },
 {
  "id": "shared-config.missing-copy-is-a-verdict",
  "target": "shared/config/sync-shared-config.sh",
  "find": "    if [ ! -e \"$target\" ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "a declared asset whose copy is not there is MISSING; without this arm the file is compared as if it existed and the consumer is told something else entirely"
 },
 {
  "id": "shared-config.body-mode-drops-the-header",
  "target": "shared/config/sync-shared-config.sh",
  "find": "    if [ \"$mode\" = body ]; then first=\"$(_ssc_first_code_line \"$path\")\"; fi",
  "replace": "    if false; then first=\"$(_ssc_first_code_line \"$path\")\"; fi",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "body mode compares from the first CODE line down: the consumer's own header prose is the legitimate per-consumer delta, and grading it turns every template copy into permanent drift"
 },
 {
  "id": "shared-config.knob-values-are-masked",
  "target": "shared/config/sync-shared-config.sh",
  "find": "            SSC_MASKED=\"<knob> ${knob}\"",
  "replace": "            SSC_MASKED=\"$line\"",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "a declared knob line may carry any VALUE -- it is the one line the template tells the consumer to adjust; comparing its value makes a correctly adjusted copy read as drifted"
 },
 {
  "id": "shared-config.line-endings-normalised",
  "target": "shared/config/sync-shared-config.sh",
  "find": "        SSC_LINES+=(\"${line%\"${_SSC_CR}\"}\")",
  "replace": "        SSC_LINES+=(\"$line\")",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "the CR is stripped on both sides before comparing; without it a Windows and a Linux checkout of the same bytes disagree, and the twin's verdict depends on which OS ran it"
 },
 {
  "id": "shared-config.write-refuses-body-assets",
  "target": "shared/config/sync-shared-config.sh",
  "find": "    if [ \"${SSC_MODE[$id]}\" = body ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "--write is a verbatim copy, so it must refuse a body-mode asset: copying over one would delete the consumer's header prose and its knob values, which is a merge, not a copy"
 },
 {
  "id": "shared-config.unknown-id-is-broken-input",
  "target": "shared/config/sync-shared-config.sh",
  "find": "        if [ -z \"${SSC_MODE[$id]:-}\" ]; then",
  "replace": "        if false; then",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "an id ANTfrastructure does not own is a broken manifest (exit 2) named with the known ids, not a mystery failure later when the row's canonical path is read"
 },
 {
  "id": "shared-assets.exact-mode-is-declared-in-the-manifest",
  "target": "shared/config/shared-assets.manifest",
  "find": "clang-format         | shared/config/.clang-format                      | .clang-format                           | exact |",
  "replace": "clang-format         | shared/config/.clang-format                      | .clang-format                           | body  |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "the manifest row is what decides how an asset is compared: graded as body, a consumer's edits to .clang-format's leading comments stop being drift."
 },
 {
  "id": "consumer-inventory.root-file-boundary",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "    if entry[\"root_file\"]:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "a suffix like cmake-format.requirements.txt or another project's generated requirements file is not a caller of the hub root file"
 },
 {
  "id": "consumer-inventory.external-is-not-self",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "    external = [r for r in reached_by if not r[1]]",
  "replace": "    external = reached_by",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "hub-internal use is not a consumer: counting the hub's own repository as an external caller marks every internal helper 'load-bearing outside this repository' and the report stops answering the question it exists for"
 },
 {
  "id": "consumer-inventory.mention-is-not-a-call",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "    if Path(rel).suffix.lower() in DOC_SUFFIXES:\n        return MENTIONED",
  "replace": "    if False:\n        return MENTIONED",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "a hub script named in a consumer's README or CHANGELOG keeps nothing alive; graded as a call it makes a dead entry point look load-bearing, which is how a deletion gets refused forever"
 },
 {
  "id": "consumer-inventory.self-mention-is-not-a-caller",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "        if ctx[\"is_self\"] and (rel == needle or rel.startswith(needle + \"/\")):\n            continue  # only the hub's own file naming itself is not a caller; a consumer's namesake calls it",
  "replace": "        if False:\n            continue  # only the hub's own file naming itself is not a caller; a consumer's namesake calls it",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "an entry point that names its own path (a usage line, a self-referential log message) would otherwise be its own caller, and nothing in the hub could ever be reported as unreferenced"
 },
 {
  "id": "consumer-inventory.dangling-fails-the-run",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "    broken_paths = print_dangling(dangling)",
  "replace": "    broken_paths = 0",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "a consumer calling a hub path that no longer exists must FAIL the run; printed and exited 0 it is a broken build for someone else, filed as a paragraph in a report nobody reads"
 },
 {
  "id": "consumer-inventory.dangling-only-counts-executable-positions",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "            if use_kind(rel, line) == REACHED:",
  "replace": "            if True:",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "a comment recording that a hub path was removed, or naming one as an example, is prose about a path -- failing the run on it makes every consumer's history a permanent red"
 },
 {
  "id": "consumer-inventory.own-module-is-not-dangling",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "                    if name in have or name in own or not name.startswith(\"Windows\"):",
  "replace": "                    if name in have or not name.startswith(\"Windows\"):",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "a consumer's own Windows* module resolves through Resolve-BuildModule's fallback; reporting it as a dangling hub module failed the whole inventory on OxidANT's WindowsOrtPayload.Common (run 36019965353)"
 },
 {
  "id": "consumer-inventory.fixture-psm1-is-not-own",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "    own = {Path(rel).stem for rel in files if rel.endswith(\".psm1\") and not is_fixture(rel)}",
  "replace": "    own = {Path(rel).stem for rel in files if rel.endswith(\".psm1\")}",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "a .psm1 in a test tree is a fixture that exists to be absent from the hub; counting it as the consumer's own would hide a genuinely dangling module name"
 },
 {
  "id": "ffmpeg-makedef.empty-dump-refused",
  "target": "windows/scripts/patches/ffmpeg/makedef",
  "find": "if [ -z \"$dump\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ffmpeg-makedef.sh",
  "why": "an llvm-nm that lists nothing must stop the recipe with its stderr; written as an empty EXPORTS list, the DLL exports nothing and every library linking it fails on undefined symbols (the rocm lane's avutil-61.dll, 2026-09-24)"
 },
 {
  "id": "ffmpeg-makedef.empty-exports-refused",
  "target": "windows/scripts/patches/ffmpeg/makedef",
  "find": "if [ -z \"$exports\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ffmpeg-makedef.sh",
  "why": "globs that match no symbol are the same empty DLL by another route; refusing only the empty dump would leave this one silent"
 },
 {
  "id": "ffmpeg-makedef.nm-stderr-kept",
  "target": "windows/scripts/patches/ffmpeg/makedef",
  "find": "dump=$(\"$nm\" --defined-only -g \"@$nm_objects\" 2>\"$nm_errors\" \\",
  "replace": "dump=$(\"$nm\" --defined-only -g \"@$nm_objects\" 2>/dev/null \\",
  "test": "bash linux/scripts/tests/test-ffmpeg-makedef.sh",
  "why": "llvm-nm's stderr is the only evidence of why the dump is empty; discarding it is how the rocm failure surfaced forty seconds later as a link error with no cause"
 },
 {
  "id": "ffmpeg-makedef.llvm-nm-override",
  "target": "windows/scripts/patches/ffmpeg/makedef",
  "find": "nm=\"${LLVM_NM:-llvm-nm}\"",
  "replace": "nm=\"llvm-nm\"",
  "test": "bash linux/scripts/tests/test-ffmpeg-makedef.sh",
  "why": "the build hands makedef the compiler's own llvm-nm; a bare llvm-nm is whatever bash finds first on a PATH that puts scoop's shims ahead of the compiler"
 },
 {
  "id": "ffmpeg-makedef.objects-by-response-file",
  "target": "windows/scripts/patches/ffmpeg/makedef",
  "find": "dump=$(\"$nm\" --defined-only -g \"@$nm_objects\" 2>\"$nm_errors\" \\",
  "replace": "dump=$(xargs \"$nm\" --defined-only -g < \"$nm_objects\" 2>\"$nm_errors\" \\",
  "test": "bash linux/scripts/tests/test-ffmpeg-makedef.sh",
  "why": "the object list must reach llvm-nm as @file; through xargs it rides a command line, and Git for Windows' xargs aborts once the environment eats the ~32K limit (the rocm lane, 2026-09-24: 'assertion \"bc_ctl.arg_max >= LINE_MAX\" failed')"
 },
 {
  "id": "compiler-llvm-tools.cmakecache-compiler-wins",
  "target": "linux/scripts/lib/compiler-llvm-tools.sh",
  "find": "    cxx=\"$(sed -n 's/^CMAKE_CXX_COMPILER:[A-Z]*=//p' \"${build_dir}/CMakeCache.txt\" | head -n 1)\"",
  "replace": "    cxx=\"\"",
  "test": "bash linux/scripts/tests/test-compiler-llvm-tools.sh",
  "why": "the tree's own compiler must answer: PATH's clang++ can be another LLVM, whose llvm-profdata cannot merge this tree's raw profiles"
 },
 {
  "id": "compiler-llvm-tools.relative-answer-fails",
  "target": "linux/scripts/lib/compiler-llvm-tools.sh",
  "find": "  [[ \"${path}\" == /* && -x \"${path}\" ]] || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-compiler-llvm-tools.sh",
  "why": "-print-prog-name answers with the bare name when the compiler has no such tool; taken as a hit, PATH's mismatched copy would run under the compiler's name"
 },
 {
  "id": "compiler-llvm-tools.every-tool-required",
  "target": "linux/scripts/lib/compiler-llvm-tools.sh",
  "find": "    if [[ ! -x \"${dir}/${tool}\" ]]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-compiler-llvm-tools.sh",
  "why": "llvm-profdata and llvm-cov must come as a matched pair; prepending a directory that holds only one mixes two LLVMs in a single coverage report"
 },
 {
  "id": "consumer-inventory.empty-class-is-refused",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "        if not hits:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "an entry point class whose glob expands to zero files narrows the report below what it claims to cover, and the shrunken report still reads as complete"
 },
 {
  "id": "consumer-inventory.self-consumer-required",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "    if not [c for c in data[\"consumers\"] if c[\"self\"]]:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "with no consumer marked self:true nothing can tell hub-internal use from an external caller, and every hub-internal helper is reported as a published entry point"
 },
 {
  "id": "consumer-inventory.unobtainable-consumer-says-so",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "    if offline:\n        raise Failure(f\"{name}: --offline was given and no --local path was supplied \"\n                      \"for it. Skipping it would make the inventory lie.\")",
  "replace": "    if offline:\n        return work / name",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh",
  "why": "a consumer that cannot be obtained must fail AS ITSELF: degraded into some later 'not a git checkout' error the operator reads it as a broken fixture, not as the missing evidence that makes 'no caller found' a lie"
 },
 {
  "id": "consumer-inventory.namesake-is-a-caller",
  "target": "linux/scripts/verify_consumer_inventory.py",
  "find": "        if ctx[\"is_self\"] and (rel == needle or rel.startswith(needle + \"/\")):",
  "replace": "        if rel == needle or rel.startswith(needle + \"/\"):",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh -k namesake",
  "why": "a consumer file named like its hub callee (a caller workflow, a wrapper) must count as a caller"
 },
 {
  "id": "consumer-inventory.shared-python-class",
  "target": ".github/consumers.json",
  "find": "\"glob\": \"shared/python/*.py\"",
  "replace": "\"glob\": \"shared/python/none/*.py\"",
  "test": "bash linux/scripts/tests/test-consumer-inventory.sh -k declared",
  "why": "the shared Python verifiers consumers run by path must remain graded by the inventory"
 },
 {
  "id": "python.static-analysis-verdict-is-raised",
  "target": "linux/scripts/02-toolchain/python/ci_static_analysis.sh",
  "find": "# The verdict, once, and after the teardown above so a failing gate still cleans up.\nassert_gates",
  "replace": "# The verdict, once, and after the teardown above so a failing gate still cleans up.\ntrue",
  "test": "bash linux/scripts/tests/test-python-static-analysis.sh",
  "why": "run_gate RECORDS a failing analyser and returns 0; assert_gates is the only place that becomes an exit code, so without it the lane is green whatever the six find -- the state this driver was in until 2026-09-08"
 },
 {
  "id": "python.static-analysis-tool-failure-is-not-swallowed",
  "target": "linux/scripts/02-toolchain/python/ci_static_analysis.sh",
  "find": "run_gate \"bandit\" uv_run bandit -r \"$PACKAGE_NAME\" ${EXTRA_PATHS[@]+\"${EXTRA_PATHS[@]}\"} -x \"$BANDIT_EXCLUDES\"",
  "replace": "uv_run bandit -r \"$PACKAGE_NAME\" ${EXTRA_PATHS[@]+\"${EXTRA_PATHS[@]}\"} -x \"$BANDIT_EXCLUDES\" 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-python-static-analysis.sh",
  "why": "the old per-tool `2>/dev/null || true` is the exact suppression this batch removed: the findings reach no log and the verdict reaches no exit code, and the batch quietly grades five analysers while reporting six"
 },
 {
  "id": "python.static-analysis-ruff-does-not-rewrite",
  "target": "linux/scripts/02-toolchain/python/ci_static_analysis.sh",
  "find": "run_gate \"ruff check\" uv_run ruff check --no-fix \"$PACKAGE_NAME\" tests docs/source/conf.py setup.py",
  "replace": "run_gate \"ruff check\" uv_run ruff check --fix \"$PACKAGE_NAME\" tests docs/source/conf.py setup.py",
  "test": "bash linux/scripts/tests/test-python-static-analysis.sh",
  "why": "a gate judges the tree as COMMITTED: --fix repairs the working tree and then reports on the repaired copy, so the step can only ever be green and the finding surfaces in the next git status instead"
 },
 {
  "id": "python.static-analysis-format-is-a-check",
  "target": "linux/scripts/02-toolchain/python/ci_static_analysis.sh",
  "find": "run_gate \"ruff format\" uv_run ruff format --check --diff \"$PACKAGE_NAME\" tests docs/source/conf.py setup.py",
  "replace": "run_gate \"ruff format\" uv_run ruff format \"$PACKAGE_NAME\" tests docs/source/conf.py setup.py",
  "test": "bash linux/scripts/tests/test-python-static-analysis.sh",
  "why": "same argument for the formatter: a bare `ruff format` rewrites the files and exits 0, so formatting drift can never fail the lane -- --check --diff reports it instead"
 },
 {
  "id": "gate-fixture.consumer-vendored-is-a-gitlink",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "    git -C \"${d}/${T_VENDORED}\" init -q",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "the vendored checkout must be a NESTED repository, which git records as a gitlink: without its own .git the fixture's files become the consumer's own tracked files, and the suites asserting that a vendored tree is out of scope would pass over a fixture that never had one"
 },
 {
  "id": "mirror-consistency.pocket-skew-is-caught",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "if len(sites) > 1:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "two writers disagreeing on -security is the VK2 bug itself; without this branch the gate reads the call sites and reports nothing"
 },
 {
  "id": "mirror-consistency.no-writer-is-not-a-pass",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "if not sites:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "a scan that finds no call site would otherwise be indistinguishable from a scan that found them all in agreement"
 },
 {
  "id": "mirror-consistency.helper-symmetry-is-asserted",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "if ! cmp -s \"${fixture_root}/host.suites\" \"${fixture_root}/ports.suites\" \\\n   || ! [ -s \"${fixture_root}/host.suites\" ]; then\n  echo \"ERROR: ubuntu_write_deb822_source is asymmetric for equal flags (host vs ports):\" >&2\n  diff -u \"${fixture_root}/host.suites\" \"${fixture_root}/ports.suites\" | sed 's/^/    /' >&2\n  _mirror_consistency_error\nfi",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "equal flags must yield equal suite sets; a helper that special-cases the host arch defeats every call-site check above it"
 },
 {
  "id": "python.host-apt-source-keeps-security",
  "target": "linux/scripts/02-toolchain/python/build_python.sh",
  "find": "      \"${_host_url}\" \"${_codename}\" \"${_build_arch}\" 1",
  "replace": "      \"${_host_url}\" \"${_codename}\" \"${_build_arch}\" 0",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "this is the compiler-stage host stanza that cost riscv64 its Qt6: amd64 without -security stranded libcurl3t64-gnutls one version behind ports and broke Multi-Arch:same co-installation"
 },
 {
  "id": "cross-build.pocket-align-is-wired",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "  apt_sources_set_architectures \"${host_sources}\" \"${build_arch}\"\n  cross_align_host_apt_pockets \"${host_sources}\" \"${distro}\"",
  "replace": "  apt_sources_set_architectures \"${host_sources}\" \"${build_arch}\"",
  "test": "bash linux/scripts/tests/test-cross-apt.sh",
  "why": "the function existing but never being called from the host-sources rewrite is the exact shape this repo keeps shipping"
 },
 {
  "id": "cross-build.pocket-align-forces-reupdate",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "    '/^Suites:/ && !added { print $0 \" \" sec; added = 1; next } { print }' || return 1\n  _CROSS_ENV_APT_UPDATED=0",
  "replace": "    '/^Suites:/ && !added { print $0 \" \" sec; added = 1; next } { print }' || return 1",
  "test": "bash linux/scripts/tests/test-cross-apt.sh",
  "why": "a new pocket in the sources is invisible until apt-get update runs again; install_target_packages skips the update when the flag is already 1"
 },
 {
  "id": "cross-build.pocket-align-is-idempotent",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "  if grep -q -e \"^Suites:.*${codename}-security\" \"${host_sources}\"; then\n    return 0\n  fi",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-cross-apt.sh",
  "why": "without the presence check the stock two-stanza Ubuntu layout gains a duplicate pocket and apt warns \"configured multiple times\" on every call"
 },
 {
  "id": "cross-build.pocket-align-touches-one-stanza",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "    '/^Suites:/ && !added { print $0 \" \" sec; added = 1; next } { print }' || return 1",
  "replace": "    '/^Suites:/ { print $0 \" \" sec; next }' || return 1",
  "test": "bash linux/scripts/tests/test-cross-apt.sh",
  "why": "appending the pocket to every stanza double-defines it across mirrors that carry different subsets"
 },
 {
  "id": "cross-build.sources-rewrite-bails-before-mv",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "    rm -f \"${tmp}\"\n    printf '%s: awk rewrite of %s failed; file left unchanged\\n' \\\n      \"${caller}\" \"${sources_file}\" >&2\n    return 1\n  fi",
  "replace": "    printf '%s: awk rewrite of %s failed; file left unchanged\\n' \\\n      \"${caller}\" \"${sources_file}\" >&2\n  fi",
  "test": "bash linux/scripts/tests/test-cross-apt.sh",
  "why": "the original mv'd unconditionally, so a failing awk replaced the host sources with truncated output and still returned 0 -- every later apt-get died with 'Unable to locate package' and no trace of the cause"
 },
 {
  "id": "cross-build.sources-rewrite-keeps-0644",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "  chmod 0644 \"${tmp}\"\n  mv \"${tmp}\" \"${sources_file}\"",
  "replace": "  mv \"${tmp}\" \"${sources_file}\"",
  "test": "bash linux/scripts/tests/test-cross-apt.sh",
  "why": "mktemp creates 0600 and mv carries that mode onto the target; apt sources are 0644 root:root everywhere else in /etc/apt/sources.list.d"
 },
 {
  "id": "cross-build.pocket-check-reads-suites-only",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "grep -q -e \"^Suites:.*${codename}-security\"",
  "replace": "grep -q -e \"${codename}-security\"",
  "test": "bash linux/scripts/tests/test-cross-apt.sh",
  "why": "an unanchored match hits a COMMENT naming the pocket and silently disables the whole repair on a file that does not carry it"
 },
 {
  "id": "vulkan.host-list-checks-out-vk4",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  _vulkan_sdk_components_ref+=(vulkan-tools gfxreconstruct vcv slang vulkantools dxc cdl)",
  "replace": "  _vulkan_sdk_components_ref+=(vulkan-tools gfxreconstruct vcv slang)",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "a name dropped here takes the CHECKOUT with it, so the row skips at the -d test and is never even counted as attempted -- exactly how riscv64 lost slang and how dxc/vulkantools/cdl went unnoticed for months"
 },
 {
  "id": "vulkan.dxc-reads-the-vendor-cache",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "      [ -f \"${src}/cmake/caches/PredefinedParams.cmake\" ] \\\n        && _vk_dyn_ref+=(-C\"${src}/cmake/caches/PredefinedParams.cmake\")",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "most of DXC's option set does not exist until the vendor -C cache file is read; without it the configure takes defaults that build none of the dx* tools"
 },
 {
  "id": "vulkan.dxc-uses-host-tblgen",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "        _vk_dyn_ref+=(-DLLVM_TABLEGEN=\"${gen}/llvm-tblgen\")\n        [ -x \"${gen}/clang-tblgen\" ] && _vk_dyn_ref+=(-DCLANG_TABLEGEN=\"${gen}/clang-tblgen\")",
  "replace": "        :",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "an LLVM 3.7 fork cross-builds its own tblgens for the TARGET and then tries to run them: exit 127, the same Canadian cross llvm-cross.sh and slang already solve"
 },
 {
  "id": "vulkan.vulkantools-gets-qt-and-the-loader",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "      _vk_dyn_ref+=(-DQT_HOST_PATH=/usr -DCMAKE_REQUIRE_FIND_PACKAGE_Qt6=TRUE)\n      _vk_dyn_ref+=(-DCMAKE_PREFIX_PATH=\"${archdir};/usr/lib/${triplet}\")\n      _vk_dyn_ref+=(-DVULKAN_LOADER_INSTALL_DIR=\"${archdir}\")\n      _vk_dyn_ref+=(-DVULKAN_UTILITY_LIBRARIES_INSTALL_DIR=\"${archdir}\")",
  "replace": "      _vk_dyn_ref+=(-DVULKAN_UTILITY_LIBRARIES_INSTALL_DIR=\"${archdir}\")",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "vkconfig-gui is Qt6 and the layers resolve the loader by raw path; without both the component dies the same two ways the caps viewer did"
 },
 {
  "id": "vulkan.vulkantools-qt-is-required",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "-DQT_HOST_PATH=/usr -DCMAKE_REQUIRE_FIND_PACKAGE_Qt6=TRUE",
  "replace": "-DQT_HOST_PATH=/usr",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "upstream find_package(Qt6 QUIET) skips the whole configurator with a message() and exits 0, so the row counts as BUILT and the SDK ships without vkconfig -- a vacuous success no downstream check can see"
 },
 {
  "id": "vulkan.dxc-vendored-spirv-tools-no-werror",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "-DHLSL_INCLUDE_TESTS=OFF -DSPIRV_WERROR=OFF -DLLVM_ENABLE_WERROR=OFF",
  "replace": "-DHLSL_INCLUDE_TESTS=OFF",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "MEASURED 2026-09-09: without it the riscv64 cross-build dies at external/SPIRV-Tools/source/util/timer.h on GCC 16 -Warray-bounds promoted by -Werror, and the lane silently ships 23/24 -- the standalone SPIRV-Tools builder in the same file already carries the flag for the identical warning"
 },
 {
  "id": "vulkan.dxc-nonsdk-prune-wired",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  _vulkan_target_prune_nonsdk_dxc \"${archdir}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the helper is unreachable unless _build_vulkan_targets calls it, and without the call both foreign prefixes keep the 1 278 LLVM 3.7 headers and 4 validator libs LunarG's own clean_nonsdk_files drops -- the VK7 asymmetry amd64 has never had"
 },
 {
  "id": "vulkan.dxc-nonsdk-prune-runs-after-the-row-that-writes-them",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  _vulkan_target_build_sdk_rest \"${arch_suffix}\" \"${archdir}\" \"${target_dir}\" \"${target_triplet}\"\n  _vulkan_target_prune_nonsdk_dxc \"${archdir}\"",
  "replace": "  _vulkan_target_prune_nonsdk_dxc \"${archdir}\"\n  _vulkan_target_build_sdk_rest \"${arch_suffix}\" \"${archdir}\" \"${target_dir}\" \"${target_triplet}\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "dxc is the LAST row of _VK_TARGET_COMPONENTS and the sole writer of all eight paths; a prune ahead of it deletes nothing and still logs and exits 0, which is the silent shape VK4 already paid for"
 },
 {
  "id": "vulkan.dxc-nonsdk-prune-marker-guard",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  [ -f \"${archdir}/include/dxc/dxcapi.h\" ] || return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "dxcapi.h is the vendor's own marker that a dxc install landed in THIS prefix; without it the helper rm -rf's include/llvm out of whatever directory it is handed, and /opt/llvm-target's include/llvm is 41 MB of real LLVM 23 headers that LLVMConfig.cmake and 1.3 GB of libLLVM*.a resolve through"
 },
 {
  "id": "vulkan.dxc-nonsdk-prune-keeps-the-public-api",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  for rel in include/clang include/clang-c include/llvm include/llvm-c \\\n",
  "replace": "  for rel in include/dxc include/clang include/clang-c include/llvm include/llvm-c \\\n",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "clean_nonsdk_files KEEPS include/dxc -- build_dxc installs dxcapi.h and WinAdapter.h there on purpose and amd64 ships them; over-pruning swaps the VK7 asymmetry for its mirror image and takes the only public DXC API header with it"
 },
 {
  "id": "vulkan.glslang-shared-pass-exists",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "        -DBUILD_SHARED_LIBS=ON \\\n      || log \"glslang: shared pass failed; the prefix keeps the static half only\"",
  "replace": "        -DBUILD_SHARED_LIBS=OFF \\\n      || log \"glslang: shared pass failed; the prefix keeps the static half only\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "VK6: without BUILD_SHARED_LIBS=ON the first pass is a duplicate of the second and libglslang.so/libSPIRV.so/libglslang-default-resource-limits.so never exist on the foreign arches -- 9 of the 13 files amd64 has and they do not"
 },
 {
  "id": "vulkan.glslang-static-pass-lands-last",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "-DBUILD_SHARED_LIBS=OFF; then",
  "replace": "-DBUILD_SHARED_LIBS=ON; then",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the LAST install owns lib/cmake/glslang, so a shared-last order makes find_package(glslang) describe SHARED imported targets and silently changes what every consumer links -- the flags are exclusive, not additive"
 },
 {
  "id": "vulkan.spirv-cross-emits-the-shared-c-api",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "-DSPIRV_CROSS_CLI=ON -DSPIRV_CROSS_ENABLE_TESTS=OFF -DSPIRV_CROSS_SHARED=ON",
  "replace": "-DSPIRV_CROSS_CLI=ON -DSPIRV_CROSS_ENABLE_TESTS=OFF",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "VK6: SPIRV_CROSS_SHARED defaults OFF, so libspirv-cross-c-shared.so* and lib/pkgconfig/spirv-cross-c-shared.pc simply never install on the foreign arches"
 },
 {
  "id": "cross-build.arch-table-knows-ports",
  "target": "linux/scripts/01-core/ubuntu-mirror.sh",
  "find": "    amd64|i386|386) return 1 ;;\n    \"\") return 1 ;;\n    *) return 0 ;;",
  "replace": "    *) return 1 ;;",
  "test": "bash linux/scripts/tests/test-cross-apt.sh",
  "why": "AS1: every non-x86 Ubuntu arch lives on ports.ubuntu.com; answering 'archive' for arm64 routes the HOST stanza at a URL that 404s binary-arm64, and apt cannot skip a wrongly-routed arch because the Release file advertises all seven"
 },
 {
  "id": "cross-build.target-ports-comes-from-the-table",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "cross_target_uses_ubuntu_ports() {\n  ubuntu_arch_uses_ports \"$(cross_target_arch)\"\n}",
  "replace": "cross_target_uses_ubuntu_ports() {\n  case \"$(cross_target_arch)\" in\n    arm64|riscv64) return 0 ;;\n    *) return 1 ;;\n  esac\n}",
  "test": "bash linux/scripts/tests/test-cross-apt.sh",
  "why": "a second inline list is how the host and target halves drift apart -- the VK2 pocket skew was exactly two places answering one question differently"
 },
 {
  "id": "cross-build.fast-mirror-rewrites-security",
  "target": "linux/scripts/01-core/base-image.sh",
  "find": "  rewrite_security=\"${FAST_UBUNTU_REWRITE_SECURITY:-true}\"",
  "replace": "  rewrite_security=\"${FAST_UBUNTU_REWRITE_SECURITY:-false}\"",
  "test": "bash linux/scripts/tests/test-base-image-parse-options.sh",
  "why": "AS1: false leaves the host -security on security.ubuntu.com while the target pocket comes from the fast mirror -- same pocket, two archives, and a lagging mirror reproduces the Multi-Arch:same skew that cost riscv64 its Qt6"
 },
 {
  "id": "renovate.refusal-exits-two",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  EXIT_CODE=\"${EXIT_REFUSED}\"",
  "replace": "  EXIT_CODE=0",
  "test": "bash linux/scripts/tests/test-renovate-exit.sh",
  "why": "a plan-time refusal exiting 0 is indistinguishable, to a caller, from a repo with nothing behind -- which is what it did until 2026-09-10"
 },
 {
  "id": "renovate.rollback-survives-a-raising-audit",
  "target": "linux/scripts/renovate_planner.py",
  "find": "        problems = _audited(files)\n    except BaseException as exc:                   # noqa: BLE001 -- see above\n        sys.exit(_refused(\n            [f\"  the audit itself raised {type(exc).__name__}: {exc}\"],\n            files))",
  "replace": "        problems = _audited(files)\n    except BaseException:\n        raise",
  "test": "bash linux/scripts/tests/test-renovate-audit.sh",
  "why": "an exception from the audit travelled past _put_back(), so a hostile write stayed on disk at rc 1; the rollback must not rest on the audit finishing"
 },
 {
  "id": "renovate.duplicate-key-is-refused",
  "target": "linux/scripts/renovate_audit.py",
  "find": "                if key in seen:\n                    raise Unreadable(_duplicate(\"mapping\", key))\n                seen.add(key)",
  "replace": "                seen.add(key)",
  "test": "bash linux/scripts/tests/test-renovate-audit.sh",
  "why": "PyYAML and a line reader BOTH take the last of two equal keys, so they agree, the edit lands on the winner, and the file is left saying two things about one dependency"
 },
 {
  "id": "renovate.dry-run-predicts-the-write",
  "target": "linux/scripts/renovate_planner.py",
  "find": "    \"verify\": lambda a: predict(_verify(cast(list[PlanEdit], load(a[1])), a[0])),",
  "replace": "    \"verify\": lambda a: _verify(cast(list[PlanEdit], load(a[1])), a[0]),",
  "test": "bash linux/scripts/tests/test-renovate-audit.sh",
  "why": "without the prediction --dry-run printed a clean plan at rc 0 for a write --apply then refused, while claiming to show the exact writes it would make"
 },
 {
  "id": "renovate.signal-rolls-the-run-back",
  "target": "linux/scripts/renovate-local.sh",
  "find": "trap 'on_signal INT 130' INT\ntrap 'on_signal TERM 143' TERM\ntrap 'on_signal HUP 129' HUP",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-renovate-exit.sh",
  "why": "untrapped, a signal during the lock refresh left the manifest written, the lockfile half-written and the copies deleted -- at rc 0 for SIGINT"
 },
 {
  "id": "renovate.unproven-backup-is-kept",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "    applied|restored) rm -rf \"${BACKUP_DIR:?}\" ;;",
  "replace": "    *) rm -rf \"${BACKUP_DIR:?}\" ;;",
  "test": "bash linux/scripts/tests/test-renovate-exit.sh",
  "why": "a copy may be deleted only because the file was PROVEN put back; deleting it whenever nothing failed also deletes it when no restore was ever attempted"
 },
 {
  "id": "renovate.rollback-restores-the-mtime",
  "target": "linux/scripts/renovate_planner.py",
  "find": "            was = target[\"stat\"]\n            os.utime(target[\"path\"], ns=(was.st_atime_ns, was.st_mtime_ns))",
  "replace": "            _was = target[\"stat\"]",
  "test": "bash linux/scripts/tests/test-renovate-audit.sh",
  "why": "a rolled-back manifest stamped with now is a change to every timestamp-driven tool downstream, over an edit that was undone"
 },
 {
  "id": "renovate.hash-pinned-pin-is-located",
  "target": "linux/scripts/renovate_locator.py",
  "find": "    return stripped[:-1] if stripped.endswith(\"\\\\\") else body",
  "replace": "    return body",
  "test": "bash linux/scripts/tests/test-renovate-audit.sh",
  "why": "unjoined, `ruff==0.9.0 \\` reads as the value `==0.9.0 \\`, so a hash-pinned file was refused one step early for the WRONG reason and the digest rule was reachable by nothing"
 },
 {
  "id": "renovate.gitlink-is-snapshotted",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "  snapshot_gitlinks ${APPLY_PATHS[@]+\"${APPLY_PATHS[@]}\"}\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-renovate-exit.sh",
  "why": "with no gitlink recorded the undo has nothing to put a submodule back to, which is why a signal or a failure in the submodule half undid NOTHING while the header, the docs and the report all promised a rollback"
 },
 {
  "id": "renovate.both-halves-settle-together",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  apply_files\n  apply_default_submodules\n",
  "replace": "  apply_files\n  settle_targets\n  apply_default_submodules\n",
  "test": "bash linux/scripts/tests/test-renovate-exit.sh",
  "why": "settling between the halves is exactly the bug: apply_files discarded its safety net one line before the gitlink half began, so a signal there found BACKUP_STATE=applied and rolled nothing back"
 },
 {
  "id": "renovate.submodule-failure-undoes-the-run",
  "target": "linux/scripts/renovate-submodules.sh",
  "find": "    || undo_run \"submodule checkout failed for ${APPLY_PATHS[i]}\"",
  "replace": "    || err \"submodule checkout failed for ${APPLY_PATHS[i]}\"",
  "test": "bash linux/scripts/tests/test-renovate-submodule-default.sh",
  "why": "a later checkout failure must restore earlier gitlinks and manifest bytes before rc 1 claims the tree is unchanged"
 },
 {
  "id": "renovate.remote-default-tip-is-selected",
  "target": "linux/scripts/renovate-submodules.sh",
  "find": "    && { [ \"${checked}\" != \"${SUB_QUERY_SHA}\" ] || [ \"${pinned}\" != \"${SUB_QUERY_SHA}\" ]; }; then",
  "replace": "    && { [ \"${checked}\" != \"${pinned}\" ]; }; then",
  "test": "bash linux/scripts/tests/test-renovate-submodule-default.sh",
  "why": "a local checkout matching its pinned gitlink can still be several commits behind the remote default branch; comparing only local state misses that update"
 },
 {
  "id": "renovate.submodule-path-selection",
  "target": "linux/scripts/renovate-submodules.sh",
  "find": "  if { [ \"${#SELECTED_SUBMODULES[@]}\" -eq 0 ] || rl_has \"${path}\" \"${SELECTED_SUBMODULES[@]}\"; } \\\n",
  "replace": "  if true \\\n",
  "test": "bash linux/scripts/tests/test-renovate-submodule-default.sh",
  "why": "an exact submodule selection must not move an excluded direct gitlink"
 },
 {
  "id": "renovate.sigpipe-is-trapped",
  "target": "linux/scripts/renovate-local.sh",
  "find": "trap 'on_signal PIPE 141' PIPE",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-renovate-exit.sh",
  "why": "SIGPIPE is fatal by default, so `--apply | head` killed the run at whatever byte it had reached -- measured leaving the manifest at its new value with the lockfile never refreshed, while the caller read head's rc 0 as the script's"
 },
 {
  "id": "renovate.kill-leaves-a-marker",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "  write_inflight\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-renovate-exit.sh",
  "why": "SIGKILL cannot be trapped, so the marker written before the first byte is the only record that a half-applied tree exists; without it the next run over the same report exited 0 calling the wreckage 'already applied'"
 },
 {
  "id": "renovate.wreckage-is-refused",
  "target": "linux/scripts/renovate-local.sh",
  "find": "assert_no_wreckage\ndetect_managers",
  "replace": "detect_managers",
  "test": "bash linux/scripts/tests/test-renovate-exit.sh",
  "why": "a marker nobody reads is a file, not a guard: the refusal is what turns an untrappable kill into rc 1 with instructions instead of rc 0 over a manifest whose lock was never refreshed"
 },
 {
  "id": "renovate.backup-copies-are-named",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "  printf '%s\\t%s\\n' \"${n}\" \"${rel}\" >> \"${BACKUP_DIR}/MANIFEST\" \\\n    || err \"cannot record ${rel} in ${BACKUP_DIR}/MANIFEST; nothing written\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-renovate-exit.sh",
  "why": "the copies are named 0 and 1 because restore_targets indexes them by position; with the mapping only in a shell array, a kill left a directory of anonymous files and nothing to say where any of them belonged"
 },
 {
  "id": "code-size.root-argument-is-the-tree",
  "target": "linux/scripts/verify_code_size.py",
  "find": "        root = gate_scope.resolve_root(args.root, ROOT)",
  "replace": "        root = os.path.abspath(ROOT)",
  "test": "bash linux/scripts/tests/test-code-size.sh",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "code-complexity.root-argument-is-the-tree",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "        root = gate_scope.resolve_root(args.root, ROOT)",
  "replace": "        root = os.path.abspath(ROOT)",
  "test": "bash linux/scripts/tests/test-code-complexity.sh",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "masked-decls.root-argument-is-the-tree",
  "target": "linux/scripts/verify_masked_assignments.py",
  "find": "        root = gate_scope.resolve_root(args.root, ROOT)",
  "replace": "        root = os.path.abspath(ROOT)",
  "test": "bash linux/scripts/tests/test-masked-assignments.sh",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "trailing-conditional.root-argument-is-the-tree",
  "target": "linux/scripts/verify_trailing_conditional.py",
  "find": "        root = gate_scope.resolve_root(args.root, ROOT)",
  "replace": "        root = os.path.abspath(ROOT)",
  "test": "bash linux/scripts/tests/test-trailing-conditional.sh",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "dead-functions.root-argument-is-the-tree",
  "target": "linux/scripts/verify_dead_functions.py",
  "find": "        GRADED = gate_scope.resolve_root(args.root, ROOT)",
  "replace": "        GRADED = os.path.abspath(ROOT)",
  "test": "bash linux/scripts/tests/test-dead-functions.sh -k root",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "stdout-returns.root-argument-is-the-tree",
  "target": "linux/scripts/verify_stdout_returns.py",
  "find": "        root = Path(gate_scope.resolve_root(args.root, str(ROOT)))",
  "replace": "        root = ROOT",
  "test": "bash linux/scripts/tests/test-stdout-returns.sh",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "stdout-returns.one-line-function-body",
  "target": "linux/scripts/verify_stdout_returns.py",
  "find": "(?:([^\\n]*)\\}[ \\t]*$|(.*?)^\\})",
  "replace": "(?:()(?!)|(.*?)^\\})",
  "test": "bash linux/scripts/tests/test-stdout-returns.sh",
  "why": "a one-line function read to the next column-0 brace takes a later function's log lines as its own"
 },
 {
  "id": "shellcheck-warnings.root-argument-is-the-tree",
  "target": "linux/scripts/verify_shellcheck_warnings.py",
  "find": "        root = gate_scope.resolve_root(args.root, ROOT)",
  "replace": "        root = os.path.abspath(ROOT)",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-shellcheck-warnings.sh",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "doc-links.root-argument-is-the-tree",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "        REPO_ROOT = Path(gate_scope.resolve_root(args.root, str(HUB_ROOT)))",
  "replace": "        REPO_ROOT = HUB_ROOT",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "doc-dupes.root-argument-is-the-tree",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "        REPO_ROOT = Path(gate_scope.resolve_root(args.root, str(HUB_ROOT)))",
  "replace": "        REPO_ROOT = HUB_ROOT",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "code-dupes.root-argument-is-the-tree",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "        root = Path(gate_scope.resolve_root(arg, str(HUB_ROOT)))",
  "replace": "        root = HUB_ROOT",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "the argument is the only thing that puts a consumer's tree in front of this gate; ignoring it grades ANTfrastructure -- which is clean and frozen -- and reports that verdict as the consumer's, which is a green run over a tree nobody looked at"
 },
 {
  "id": "python.static-analysis-bandit-takes-one-r",
  "target": "linux/scripts/02-toolchain/python/ci_static_analysis.sh",
  "find": "uv_run bandit -r \"$PACKAGE_NAME\" ${EXTRA_PATHS[@]+\"${EXTRA_PATHS[@]}\"}",
  "replace": "uv_run bandit -r \"$PACKAGE_NAME\" ${EXTRA_PATHS[@]+\"-r\" \"${EXTRA_PATHS[@]}\"}",
  "test": "bash linux/scripts/tests/test-python-static-analysis.sh",
  "why": "one -r PER extra path is the bug this fixed: bandit's -r is store_true against a single nargs='*' positional, so argparse rejects the run with exit 2"
 },
 {
  "id": "python.static-analysis-bandit-excludes-knob",
  "target": "linux/scripts/02-toolchain/python/ci_static_analysis.sh",
  "find": "BANDIT_EXCLUDES=\"${BANDIT_EXCLUDES:-tests,",
  "replace": "BANDIT_EXCLUDES=\"${BANDIT_EXCLUDES_UNREAD:-tests,",
  "test": "bash linux/scripts/tests/test-python-static-analysis.sh",
  "why": "a knob the driver never reads is a knob a consumer sets and does not get; the default would still look right"
 },
 {
  "id": "python.ci-tests-default-leg-is-the-image-interpreter",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "    printf '%s\\n' \"$DEFAULT_PYTHON_VERSION\"\n",
  "replace": "    printf '%s\\n' \"3.13 $DEFAULT_PYTHON_VERSION\"\n",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "a default stable leg on another interpreter cannot take the chain's wheels for the pinned tag, so every ORT consumer on the default matrix fails its sync"
 },
 {
  "id": "python.ci-tests-default-adds-the-free-threaded-leg",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "    printf '%s %st\\n' \"$DEFAULT_PYTHON_VERSION\" \"$DEFAULT_PYTHON_VERSION\"\n",
  "replace": "    printf '%s\\n' \"$DEFAULT_PYTHON_VERSION\"\n",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "a project that declares free-threading would lose its X.Yt leg whenever it passes no version list"
 },
 {
  "id": "python.ci-tests-pinned-token",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "  PY_VERSIONS=\"${PY_VERSIONS//pinned/${DEFAULT_PYTHON_VERSION:?no pinned Python for the pinned leg: keep versions.env beside python_uv.sh}}\"\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "a row that names its legs as pinned would ask uv for an interpreter called pinned"
 },
 {
  "id": "python.ci-docs-report-without-a-version",
  "target": "linux/scripts/02-toolchain/python/ci_build_docs.sh",
  "find": "  [ ! -f \"$SRC/pytest-report-${COVERAGE_VERSION}.${ext}\" ] || cp \"$SRC/pytest-report-${COVERAGE_VERSION}.${ext}\" \"$dst/pytest-report.${ext}\"\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "a docs page that links pytest-report.html would break on the first Python upgrade"
 },
 {
  "id": "uv-chain-ort.sync-skips-pypi-ort",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    _args+=(--no-install-package \"${ort}\")\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "a locked sync on a Python that PyPI's ORT has no wheel for fails before the chain wheels can stand in"
 },
 {
  "id": "uv-chain-ort.reconcile-installs-for-skipped",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    [[ \" ${_drop[*]} \" == *\" ${skipped} \"* ]] || _drop+=(\"${skipped}\")\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "the ORT the sync left out would never be installed, and the venv would run without ONNX Runtime"
 },
 {
  "id": "python.ci-docs-default-coverage-is-the-image-interpreter",
  "target": "linux/scripts/02-toolchain/python/ci_build_docs.sh",
  "find": "COVERAGE_VERSION=\"${1:-${COVERAGE_VERSION:-${DEFAULT_PYTHON_VERSION:?no pinned Python: keep versions.env beside python_uv.sh, or pass a version}}}\"",
  "replace": "COVERAGE_VERSION=\"${1:-${COVERAGE_VERSION:-3.13}}\"",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "the docs venv syncs on that interpreter too, and the page would publish the coverage of a leg the default matrix no longer runs"
 },
 {
  "id": "python.ci-tests-runs-the-configured-testpaths",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "    \"${test_paths[@]}\" -v",
  "replace": "    tests/unit -v",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "a hard-coded subdirectory is how WebDavClient's real WebDAV tests and every consumer's integration suite ran on no lane for a year"
 },
 {
  "id": "python.ci-tests-free-threaded-leg-syncs-its-own-extras",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "    UV_SYNC_EXTRAS=\"$leg_extras\" uv_sync_project",
  "replace": "    uv_sync_project",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "with all extras the free-threaded leg needs wheels that only exist for the GIL build, so its sync fails and it tests nothing"
 },
 {
  "id": "python.ci-tests-sync-extras-every-leg",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "  if [ -n \"$SYNC_EXTRAS\" ]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "a riscv64 row must not sync all extras: the full set builds wheels from source under QEMU and the row would never finish, so the gate must bite"
 },
 {
  "id": "python.ci-tests-experimental-sync-failure-is-annotated",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "      echo \"::warning title=Python ${V} not tested::its dependencies did not sync, so no test ran on it (experimental leg)\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "a green job over a leg that ran nothing is the false coverage 3.14t gave every Python consumer; the annotation is the only signal that survives the green check"
 },
 {
  "id": "lib.cmake-build-configure-args-reach-cmake",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "      cmake -B \"${BUILD_DIR}\" --preset \"${PRESET}\" ${CMAKE_BUILD_CONFIGURE_ARGS[@]+\"${CMAKE_BUILD_CONFIGURE_ARGS[@]}\"}",
  "replace": "      cmake -B \"${BUILD_DIR}\" --preset \"${PRESET}\"",
  "test": "bash linux/scripts/tests/test-lib-smoke.sh",
  "why": "a parsed-but-not-forwarded --configure-arg is the exact shape of a knob that looks wired and changes nothing"
 },
 {
  "id": "lib.cmake-build-configure-arg-accumulates",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "      CMAKE_BUILD_CONFIGURE_ARGS+=(\"$2\"); return 2 ;;",
  "replace": "      CMAKE_BUILD_CONFIGURE_ARGS=(\"$2\"); return 2 ;;",
  "test": "bash linux/scripts/tests/test-lib-smoke.sh",
  "why": "the flag is REPEATABLE; overwriting keeps only the last -D and the consumer that needs two silently loses one"
 },
 {
  "id": "lib.cmake-build-configure-args-reset-per-parse",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "  CMAKE_BUILD_CONFIGURE_ARGS=( ${CMAKE_BUILD_DEFAULT_CONFIGURE_ARGS[@]+\"${CMAKE_BUILD_DEFAULT_CONFIGURE_ARGS[@]}\"} )",
  "replace": "  CMAKE_BUILD_CONFIGURE_ARGS=( ${CMAKE_BUILD_CONFIGURE_ARGS[@]+\"${CMAKE_BUILD_CONFIGURE_ARGS[@]}\"} ${CMAKE_BUILD_DEFAULT_CONFIGURE_ARGS[@]+\"${CMAKE_BUILD_DEFAULT_CONFIGURE_ARGS[@]}\"} )",
  "test": "bash linux/scripts/tests/test-lib-smoke.sh",
  "why": "two parses in one shell must not compound; a wrapper that parses twice would configure with flags it dropped"
 },
 {
  "id": "lib.cmake-build-configure-arg-empty-is-fatal",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "      [[ -n \"${2:-}\" ]] || err \"--configure-arg expects a value (e.g. --configure-arg -DCMAKE_LINK_WHAT_YOU_USE=FALSE)\"",
  "replace": "      [[ -n \"${2:-}\" ]] || true",
  "test": "bash linux/scripts/tests/test-lib-smoke.sh",
  "why": "an empty value reaches cmake as an empty argument, whose error names the source directory and not the caller"
 },
 {
  "id": "packaging.flatpak-cmake-install-stages-container-native",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  local stage_root=\"${flatpak_work}/cmake-install\"",
  "replace": "  local stage_root=\"${out_dir}/flatpak\"",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "out_dir is routinely the build directory on a mounted workspace, and everything flatpak touches needs fchmod, which a bind mount refuses"
 },
 {
  "id": "packaging.flatpak-cmake-install-ostree-is-the-verdict",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  if ! ostree --repo=\"$repo_dir\" refs 2>/dev/null | grep -q \"^app/${app_id}/\"; then",
  "replace": "  if [ \"$fb_rc\" -ne 0 ]; then",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "flatpak-builder can export the app completely and still fail in Pruning cache, and can exit 0 having committed nothing; the exit code is not the verdict. Pinned on the shared helper both flatpak packagers call"
 },
 {
  "id": "packaging.flatpak-cmake-install-missing-binary-is-fatal",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  if [[ ! -x \"${source_dir}/app/bin/${project_name}\" ]]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "an app committed with a command that is not in the bundle fails on a user machine instead of in CI"
 },
 {
  "id": "packaging.flatpak-cmake-install-asserts-the-artifact",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  app_packaging_assert_artifact \"${out_dir}/${out_name}\"",
  "replace": "  echo \"Created: ${out_dir}/${out_name}\"",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "convention 3 of this file: an unconditional Created: line is how a packaging step reported success with no file on disk"
 },
 {
  "id": "packaging.flatpak-cmake-install-renames-to-the-app-id",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  app_packaging_rename_installed_file \"${source_dir}/app/share/applications\" \\",
  "replace": "  true \"${source_dir}/app/share/applications\" \\",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "CMake installs name after the project; flatpak resolves by app id, and a .desktop under the wrong name is an unlaunchable app"
 },
 {
  "id": "packaging.flatpak-tool-check-requires-ostree",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  for _t in flatpak flatpak-builder ostree; do",
  "replace": "  for _t in flatpak flatpak-builder; do",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "ostree is the VERDICT both flatpak packagers ask, and Debian's and Ubuntu's flatpak package depends on libostree rather than on the CLI -- without it in the check, a box with both declared tools present fails at `ostree refs` over an export that succeeded, which is the measurement that kept a consumer on a local copy of this check"
 },
 {
  "id": "packaging.flatpak-tool-check-names-the-reason",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "    echo \"Error: ${_t} not found. Install '${_t}' to build Flatpak bundles: ${_why}.\" >&2",
  "replace": "    echo \"Error: ${_t} not found.\" >&2",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "the tool name alone names no package to install and does not say what the packaging step wanted it for; for ostree that sentence IS the fix, because nothing about a flatpak build suggests a separate CLI"
 },
 {
  "id": "packaging.flatpak-tool-check-reports-every-missing-tool",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "    _missing=1",
  "replace": "    return 1",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "one apt-get installs all three, so a check that stops at the first missing tool costs a second round trip to discover the next"
 },
 {
  "id": "packaging.flatpak-runtime-skips-installed-refs",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "    if flatpak info --user \"$_ref\" >/dev/null 2>&1 \\\n       || flatpak info --system \"$_ref\" >/dev/null 2>&1; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "a ref is 1-2 GB, and reinstalling one the machine already has system-wide creates a second copy"
 },
 {
  "id": "packaging.flatpak-runtime-user-install-falls-back-to-system",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "      flatpak --user install -y --noninteractive flathub \"$_ref\" \\\n        || flatpak --system install -y --noninteractive flathub \"$_ref\" \\\n        || return 1",
  "replace": "      flatpak --user install -y --noninteractive flathub \"$_ref\" \\\n        || return 1",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "an unprivileged user cannot always write the user installation either; without the fallback the runtime is simply absent"
 },
 {
  "id": "packaging.flatpak-runtime-install-failure-is-fatal",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "        || flatpak --system install -y --noninteractive flathub \"$_ref\" \\\n        || return 1",
  "replace": "        || flatpak --system install -y --noninteractive flathub \"$_ref\" \\\n        || true",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "a missing runtime surfaces as a flatpak-builder manifest error much later, naming nothing the caller can act on"
 },
 {
  "id": "packaging.archive-unknown-type-fails",
  "target": "linux/scripts/06-packaging/package_archive.sh",
  "find": "        *) err \"unknown package type '$format' (tar, deb, appimage, flatpak)\"; exit 1 ;;",
  "replace": "        *) ;;",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "an unknown format used to be skipped without a word, so a typo in PACKAGE_TYPES shipped a lane with one artifact fewer and a green run"
 },
 {
  "id": "packaging.archive-removed-flags-fail",
  "target": "linux/scripts/06-packaging/package_archive.sh",
  "find": "            err \"$1 was removed: the flatpak manifest is generated from the staged bundle (docs/shared-script-libraries.md)\"\n            exit 1 ;;",
  "replace": "            shift ;;",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "--flatpak-manifest and --appdata-file were accepted and never read for two months; taking them silently again hides that the project's files are ignored"
 },
 {
  "id": "packaging.archive-stages-the-binary",
  "target": "linux/scripts/06-packaging/package_archive.sh",
  "find": "    install -m 0755 \"$SourceBinary\" \"$Stage/$Binary\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "the staged bundle is the only thing the deb, AppImage and flatpak pack; without the binary in it they package an empty directory"
 },
 {
  "id": "packaging.archive-strips-tag-v",
  "target": "linux/scripts/06-packaging/package_archive.sh",
  "find": "    PackageVersion=\"${Version#v}\"",
  "replace": "    PackageVersion=\"${Version}\"",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "dpkg-deb refuses a version that does not start with a digit, and a release tag is v2.3.4"
 },
 {
  "id": "packaging.archive-rust-deb-depends",
  "target": "linux/scripts/06-packaging/package_archive.sh",
  "find": "\"${APP_PACKAGING_DEB_DEPENDS:-libc6, libgcc-s1}\"",
  "replace": "\"${APP_PACKAGING_DEB_DEPENDS:-libc6, libstdc++6, libgtk-3-0}\"",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "the Flutter default makes apt pull GTK for a CLI that links only libc, libm and libgcc_s"
 },
 {
  "id": "packaging.bundle-dir-knob",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  echo \"${APP_PACKAGING_BUNDLE_DIR:-build/linux/${matrix_arch}/release/bundle}\"",
  "replace": "  echo \"build/linux/${matrix_arch}/release/bundle\"",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "without the knob every packager reads Flutter's bundle path, which a cargo project does not have"
 },
 {
  "id": "packaging.icon-size-reads-header",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "    printf '%sx%s' \"$w\" \"$h\"",
  "replace": "    printf '512x512'",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "a 128x128 logo filed under hicolor/512x512 is the wrong-size icon flatpak export and desktop shells scale or reject"
 },
 {
  "id": "packaging.desktop-file-from-project",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "    app_packaging_adapt_desktop_file \"$APP_PACKAGING_DESKTOP_FILE\" \"$file_path\" \"$exec_name\" \"$icon_name\"\n    return\n",
  "replace": "    true\n",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "--desktop-file was checked and never read; the project's Name, Terminal and Categories must reach the package"
 },
 {
  "id": "packaging.out-dir-knob",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  out_dir=\"${APP_PACKAGING_OUT_DIR:-out}\"",
  "replace": "  out_dir=\"out\"",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "package_archive.sh's artifacts go to --archive-dir, which its lane uploads; a hard-coded out/ is a directory nobody uploads"
 },
 {
  "id": "bind-mount.chown-is-selective",
  "target": "linux/scripts/01-core/bind-mount-ownership.sh",
  "find": "  if printf '%s\\0' \"${wrong[@]}\" | xargs -0 --no-run-if-empty chown -h \"${owner_uid}:${owner_gid}\"; then",
  "replace": "  if chown -R \"${owner_uid}:${owner_gid}\" \"${target}\"; then",
  "test": "bash linux/scripts/tests/test-bind-mount-ownership.sh",
  "why": "a blanket chown -R over a mostly-correct tree asks the kernel for a chown it refuses for a non-owner, turning a no-op into an error"
 },
 {
  "id": "bind-mount.non-root-failure-is-tolerated",
  "target": "linux/scripts/01-core/bind-mount-ownership.sh",
  "find": "  if [ \"$(id -u)\" -ne 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-bind-mount-ownership.sh",
  "why": "only root can hand a file to another uid; failing there is a red an operator cannot act on, which is what the old || true was hiding from"
 },
 {
  "id": "bind-mount.root-failure-is-fatal",
  "target": "linux/scripts/01-core/bind-mount-ownership.sh",
  "find": "  err \"chown -h ${owner_uid}:${owner_gid} under ${target} failed as root; the host user cannot clean or regenerate it.\"",
  "replace": "  warn \"chown -h ${owner_uid}:${owner_gid} under ${target} failed as root; the host user cannot clean or regenerate it.\"",
  "test": "bash linux/scripts/tests/test-bind-mount-ownership.sh",
  "why": "as root the failure is a read-only or broken mount and the tree really is left unusable; a warning is the || true this replaced"
 },
 {
  "id": "bind-mount.already-correct-is-a-no-op",
  "target": "linux/scripts/01-core/bind-mount-ownership.sh",
  "find": "  if [ \"${#wrong[@]}\" -eq 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-bind-mount-ownership.sh",
  "why": "a tree that is already correct must not be chowned at all"
 },
 {
  "id": "bind-mount.missing-target-is-not-an-error",
  "target": "linux/scripts/01-core/bind-mount-ownership.sh",
  "find": "  if [ ! -d \"${target}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-bind-mount-ownership.sh",
  "why": "a docs step that produced nothing has nothing to hand back; failing there makes the finalize step the thing that breaks the lane"
 },
 {
  "id": "windows-lane.powershell-lint-defaults-off",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "which is what lint-path is.\n        required: false\n        type: boolean\n        default: false",
  "replace": "which is what lint-path is.\n        required: false\n        type: boolean\n        default: true",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "an input that defaults ON makes every caller that predates it suddenly run a Windows lint job"
 },
 {
  "id": "windows-lane.arm64-tests-defaults-off",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "existing callers are unchanged.\n        required: false\n        type: boolean\n        default: false",
  "replace": "existing callers are unchanged.\n        required: false\n        type: boolean\n        default: true",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "on by default, every existing caller gets a windows-11-arm job its lock was never checked for"
 },
 {
  "id": "windows-lane.arm64-job-gated",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "    if: ${{ inputs.arm64-tests }}\n    needs: stage-python-for-windows-arm64\n",
  "replace": "    if: ${{ true }}\n    needs: stage-python-for-windows-arm64\n",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "an ungated device job runs on every caller, whatever arm64-tests says"
 },
 {
  "id": "windows-lane.arm64-inputs-through-env",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "\"$name=$([Environment]::GetEnvironmentVariable($name))\"",
  "replace": "\"$name=${{ inputs.arm64-python-versions }}\"",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "an input interpolated into the script is a script injection; env carries it as data into the container"
 },
 {
  "id": "windows-lane.arm64-stage-gated",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "    if: ${{ inputs.arm64-tests }}\n    name: stage the arm64 legs in :winarm64\n",
  "replace": "    if: ${{ true }}\n    name: stage the arm64 legs in :winarm64\n",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "an ungated stage job pulls :winarm64 and cross-builds for every caller, whatever arm64-tests says"
 },
 {
  "id": "windows-lane.arm64-device-installs-nothing",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "          ./Invoke-StagedTests.ps1 *>&1 | Tee-Object -FilePath $log\n",
  "replace": "          uv pip install --system pytest\n          ./Invoke-StagedTests.ps1 *>&1 | Tee-Object -FilePath $log\n",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "the device runs what :winarm64 staged; an install there is a CI-time download the image exists to remove (CON113)"
 },
 {
  "id": "windows-lane.arm64-failed-leg-fails",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "if ($failed -gt 0) { throw \"$failed arm64 test(s) or wheel proof(s) failed\" }",
  "replace": "if ($false) { throw \"$failed arm64 test(s) or wheel proof(s) failed\" }",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "a failed test or wheel proof on the device must red the job, not only the summary line"
 },
 {
  "id": "windows-lane.powershell-lint-job-is-gated",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "    if: ${{ inputs.lint-powershell }}",
  "replace": "    if: ${{ always() }}",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "without the gate the job runs for every caller regardless of the input, which is the same defect as defaulting it on"
 },
 {
  "id": "windows-lane.powershell-lint-fails-on-analyzer",
  "target": ".github/workflows/powershell-quality.yml",
  "find": "if ($env:LINT_ANALYZER_STRICT -eq 'true') { $lintArgs += '-FailOnAnalyzer' }",
  "replace": "if ($env:LINT_ANALYZER_STRICT -eq 'true') { $lintArgs += '-NoProfile' }",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "without -FailOnAnalyzer the analyzer prints its findings and exits 0: a check that cannot fail"
 },
 {
  "id": "windows-lane.powershell-analyzer-is-version-pinned",
  "target": ".github/workflows/powershell-quality.yml",
  "find": "Install-PinnedPowerShellModule -Name PSScriptAnalyzer -Version $pin",
  "replace": "Install-PinnedPowerShellModule -Name PSScriptAnalyzer",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "an unpinned analyzer lets a new release add a rule that fails the lane with no commit to blame"
 },
 {
  "id": "windows-lane.python-build-job-is-gated",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "    if: ${{ inputs.build-python-package }}",
  "replace": "    if: ${{ always() }}",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "without the gate the build job runs for every caller, so the PowerShell lint cannot be taken alone: a repo with no Python package would trade a two-minute lint for a winamd64 image pull, a package build and a ./dist/ upload, which is why one consumer kept a hand-written copy of a job it had measured as identical"
 },
 {
  "id": "windows-lane.python-build-gate-defaults-on",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "        default: true",
  "replace": "        default: false",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "an input that gates the build must default ON, or every caller written before it silently stops building and the lane goes green having done nothing"
 },
 {
  "id": "windows-lane.build-job-asserts-its-ghcr-token",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "          if (-not $env:GHCR_PAT) {",
  "replace": "          if ($false) {",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "GHCR_PAT is required: false so a lint-only caller need not own a registry token; the job that DOES need one must then say so itself, or an empty secret surfaces four steps later as a ghcr docker login failure that names the registry instead of the missing input"
 },
 {
  "id": "linux-lane.arches-default-keeps-both-rows",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "        default: x64 arm64",
  "replace": "        default: x64",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "every caller written before the input would silently lose its arm64 row and stay green"
 },
 {
  "id": "linux-lane.unknown-arch-fails",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "              *) echo \"::error::arches: unknown arch '${arch}' (known: x64 arm64 riscv64)\"; exit 1 ;;",
  "replace": "              *) continue ;;",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "a typo like `x64 arn64` would run one row instead of two and report green"
 },
 {
  "id": "linux-lane.repeated-arch-fails",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "              *\" ${arch} \"*) echo \"::error::arches: '${arch}' is listed twice\"; exit 1 ;;",
  "replace": "              *\" ${arch} \"*) : ;;",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "two identical rows upload artifacts under the same name and fail half-way through the run, far from the input that caused it"
 },
 {
  "id": "linux-lane.empty-arches-fails",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "          if [ -z \"${rows}\" ]; then",
  "replace": "          if false; then",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "an empty list must be refused by the plan job, not handed to GitHub as an empty matrix"
 },
 {
  "id": "linux-lane.arm-row-keeps-its-runner",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "row='{\"runs_on\":\"ubuntu-26.04-arm\",",
  "replace": "row='{\"runs_on\":\"ubuntu-latest\",",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "the runner labels sit in a run: block the workflow-convention gate cannot read; a moving or wrong label there would pass every YAML gate"
 },
 {
  "id": "linux-lane.build-reads-the-plan",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "    needs: plan\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "without needs: plan the build job cannot read the plan's output and its matrix evaluates to nothing"
 },
 {
  "id": "linux-lane.multi-line-arches-keep-every-row",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "read -r -d '' -a want <<< \"${ARCHES}\" || true",
  "replace": "read -r -a want <<< \"${ARCHES}\"",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "a caller that writes arches as a block scalar would get its first line's rows only, and the lane would stay green"
 },
 {
  "id": "uv-chain-ort.census-proof",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  out=\"$(\"${py}\" -I \"${_UV_ORT_CENSUS}\" --check --store \"${store}\" 2>&1)\" || {",
  "replace": "  out=\"\" || {",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "the census, not uv's exit code, proves no PyPI ORT is left in a consumer venv"
 },
 {
  "id": "uv-chain-ort.sync-calls-reconcile",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  uv_reconcile_chain_ort \"${_venv}\"\n}",
  "replace": "  true\n}",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "uv_sync_project is the entry point every Python CI driver and consumer calls"
 },
 {
  "id": "uv-chain-ort.failed-sync-returns",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  env \"${_env_clear[@]}\" uv \"${sync_args[@]}\" || return\n",
  "replace": "  env \"${_env_clear[@]}\" uv \"${sync_args[@]}\" || true\n",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "a failed uv sync must not be reported green because the reconcile after it succeeded"
 },
 {
  "id": "uv-chain-ort.outside-only-warns",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  if [ \"${#drop[@]}\" -eq 0 ] || [ -z \"${store}\" ]; then",
  "replace": "  if [ \"${#drop[@]}\" -eq 0 ]; then",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "outside our images (no store) the venv keeps today's behaviour plus a notice"
 },
 {
  "id": "uv-chain-ort.no-wheel-no-uninstall",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  if [ \"${#wheels[@]}\" -eq 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "a store with no ORT wheel must fail before PyPI ORT is uninstalled"
 },
 {
  "id": "uv-chain-ort.hold-uv-run",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  _uv_chain_ort_hold_sync hold\n",
  "replace": "  true\n",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "uv run re-syncs to the lock and would reinstall PyPI ORT over the chain wheels"
 },
 {
  "id": "uv-chain-ort.image-census-path",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "[ -f \"${_UV_ORT_CENSUS}\" ] || _UV_ORT_CENSUS=\"${_UV_ORT_CENSUS%/runtime/*}/final/ort-venv-census.py\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "the torch image's own python_uv.sh has no 03-media/runtime; without the final/ copy every in-image reconcile would fail on a missing census"
 },
 {
  "id": "uv-chain-ort.torch-census-copy-dest",
  "target": "linux/Dockerfile.torch",
  "find": "linux/scripts/03-media/runtime/ort-venv-census.py /opt/scripts/03-media/final/ort-venv-census.py",
  "replace": "linux/scripts/03-media/runtime/ort-venv-census.py /opt/scripts/03-media/ort-venv-census.py",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "the image the store is declared in must ship the census where its own python_uv.sh looks; elsewhere every in-image sync fails on a missing census"
 },
 {
  "id": "uv-chain-ort.import-proof",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  out=\"$(\"${py}\" -I -c 'import sys; print(sys.version); import onnxruntime' 2>&1)\" || {",
  "replace": "  out=\"\" || {",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "a chain wheel of the right ABI tag the venv still cannot load (a missing DLL) passes the byte census; only the import shows it"
 },
 {
  "id": "uv-chain-ort.stage-installed-flavour",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  done < <(printf '%s\\n' \"${out}\" | sed -n 's/^ORT-CENSUS chain .* = \\([^/]*\\.whl\\)$/\\1/p')",
  "replace": "  done < <(cd /opt/wheels && ls onnxruntime*.whl)",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "the store must hold only the flavour /opt/venv runs, or every consumer venv gets two cores"
 },
 {
  "id": "uv-chain-ort.stage-venv-proof",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  out=\"$(\"${VENV}/bin/python\" -I \"${census}\" --check --store /opt/wheels 2>&1)\" \\",
  "replace": "  out=\"$(\"${VENV}/bin/python\" -I \"${census}\" --purge-list 2>&1)\" \\",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "a PyPI ORT in /opt/venv must stop the image build, not be staged as chain"
 },
 {
  "id": "uv-chain-ort.pinned-target",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  uv_reconcile_chain_ort \"${_venv}\"\n}",
  "replace": "  uv_reconcile_chain_ort \"${UV_PROJECT_ENVIRONMENT:-${PWD}/.venv}\"\n}",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "every hub driver syncs through uv_venv_create's _CURRENT_VENV_PATH, where UV_PROJECT_ENVIRONMENT is set only for the uv call; reconciling any other venv proves the wrong one"
 },
 {
  "id": "uv-chain-ort.unowned-import",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    [ -z \"${store}\" ] || _uv_chain_ort_unowned \"${venv}\" \"${py}\" \"${store}\" || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "the purge list names distributions only; an ORT import package no distribution owns would pass an in-image sync unchecked"
 },
 {
  "id": "uv-chain-ort.abi-fits",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  _uv_chain_ort_abi_fits \"${venv}\" \"${py}\" \"${wheels[@]}\" || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "uv installs a path wheel of another cp tag without complaint; a leg on another interpreter must fail before its venv is touched, naming the remedy"
 },
 {
  "id": "uv-chain-ort.abi3-fits",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    case \"${tag}\" in \"${abi}\"|abi3|none) ;; *) bad+=\" ${w##*/}\" ;; esac\n",
  "replace": "    case \"${tag}\" in \"${abi}\") ;; *) bad+=\" ${w##*/}\" ;; esac\n",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "an abi3 or none wheel loads on every interpreter; refusing it would fail legs the chain can serve"
 },
 {
  "id": "ort-chain.opencv-missing-chain",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "if [ ! -d \"${chain}/include\" ] || [ ! -e \"${chain}/lib/libonnxruntime.so\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a missing chain ORT must stop OpenCV, not build it without ORT"
 },
 {
  "id": "ort-chain.opencv-silent-off",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "|| die \"OpenCV must build against the chain ONNX Runtime at ${OPENCV_ORT_CHAIN_ROOT}\"",
  "replace": "|| cmake_opts+=(\"-DWITH_ONNXRUNTIME=OFF\")",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the silent WITH_ONNXRUNTIME=OFF fallback must not come back"
 },
 {
  "id": "ort-chain.opencv-download-line",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "-e 'DNN: Downloading ONNX Runtime' ",
  "replace": "-e 'DNN: NEVER-PRINTED' ",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "dnn's 1.25.1 download line must fail the configure gate"
 },
 {
  "id": "ort-chain.opencv-enabled-line",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "|| echo \"configure log: no 'DNN: ONNX Runtime enabled' (dnn did not take ORT)\"",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "dnn must positively report ORT enabled"
 },
 {
  "id": "ort-chain.opencv-summary-version",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "| grep -qF -e \"YES (ver ${ver})\"",
  "replace": "| grep -qF -e \"YES (ver\"",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the summary must name the chain version, not 1.25.1"
 },
 {
  "id": "ort-chain.opencv-root-dir",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "[ \"${v}\" = \"${compat}\" ] || echo \"CMakeCache: ONNXRT_ROOT_DIR",
  "replace": "true || echo \"CMakeCache: ONNXRT_ROOT_DIR",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a FORCEd ONNXRT_ROOT_DIR (the download branch) must fail"
 },
 {
  "id": "ort-chain.opencv-cached-version",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "[ \"${v}\" = \"${ver}\" ] || echo \"CMakeCache: ONNX_VERSION",
  "replace": "true || echo \"CMakeCache: ONNX_VERSION",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "ONNX_VERSION must be the chain's"
 },
 {
  "id": "ort-chain.opencv-lib-in-chain",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "        *) echo \"${what}='${v}' resolves to '${lib}', not into ${chain_real}\" ;;",
  "replace": "        *) ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the linked ORT must resolve into the chain lib dir"
 },
 {
  "id": "ort-chain.opencv-static",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "*.a) echo \"${what}='${v}' is a static ORT (a second ORT inside OpenCV)\" ;;",
  "replace": "*.a) ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a static ORT inside OpenCV must fail"
 },
 {
  "id": "ort-chain.opencv-cmake-package",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "*) echo \"CMakeCache: ${key}='${v}' (a CMake ORT package was found)\" ;;",
  "replace": "*) ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a found ORT CMake package must fail"
 },
 {
  "id": "ort-chain.opencv-forward-refuses",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "if [ ! -L \"${f}\" ] && ! cmp -s \"${f}\" \"${chain_lib}/${name}\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "bytes the chain lacks must never be forwarded"
 },
 {
  "id": "ort-chain.opencv-install-copy",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "echo \"COPY ${f} (a second ORT file; only links into the chain are allowed)\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a real ORT file under /opt/opencv5 must fail"
 },
 {
  "id": "ort-chain.opencv-install-foreign",
  "target": "linux/scripts/03-media/build/opencv/opencv-ort.sh",
  "find": "_opencv_ort_lib_finding \"installed\" \"${f}\" \"${chain_real}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a link out of the chain must fail"
 },
 {
  "id": "ort-chain.opencv-wired-configure",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "opencv_ort_assert_configure \"${build_dir}\" \"${ort_compat}\" \"${ort_ver}\" \\",
  "replace": "true \"${build_dir}\" \"${ort_compat}\" \"${ort_ver}\" \\",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "configure_opencv must run the configure gate"
 },
 {
  "id": "ort-chain.opencv-wired-install",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "opencv_ort_assert_installed \"${OPENCV_PREFIX}\" \\",
  "replace": "true \"${OPENCV_PREFIX}\" \\",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "install_opencv must run the install gate"
 },
 {
  "id": "ort-chain.ffmpeg-missing-fatal",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "if [ ! -f \"${onnx_base}/lib/libonnxruntime.so\" ] || [ ! -f \"${onnx_base}/include/onnxruntime_c_api.h\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a missing chain must stop FFmpeg"
 },
 {
  "id": "ort-chain.ffmpeg-synth-fatal",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "echo \"ERROR: the chain ONNX Runtime at ${onnx_base} does not compile and link for this target (probe detail above)\" >&2",
  "replace": "return 1",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a chain the probe cannot link must stop FFmpeg, not build it without ORT"
 },
 {
  "id": "ort-chain.ffmpeg-vendor-fallback",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "echo \"ERROR: the chain ONNX Runtime at ${onnx_base} does not compile and link for this target (probe detail above)\" >&2",
  "replace": "ffmpeg_probe_pkg_config_feature \"libonnxruntime\" \"libonnxruntime\" \"onnxruntime_c_api.h\" \"OrtGetApiBase\" && return 0",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the vendor pkg-config fallback must not come back"
 },
 {
  "id": "ort-chain.ffmpeg-root-recorded",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "_FFMPEG_ONNX_ROOT=\"${onnx_base}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the link gate needs the chain root the probe used"
 },
 {
  "id": "ort-chain.ffmpeg-ldflags-first",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "if [ \"${_fol_placed}\" = 0 ] && [[ \"${_fol_o}\" == --extra-ldflags=* ]]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the chain -L must precede the cross multiarch -L"
 },
 {
  "id": "ort-chain.ffmpeg-ldflags-wired",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "ffmpeg_ort_ldflags_first _ffpdb_out || die \"chain ORT -L missing (ffmpeg_probe_libonnxruntime set none)\"",
  "replace": "_ffpdb_out+=(\"--extra-ldflags=${_FFMPEG_ONNX_EXTRA_LDFLAGS}\")",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the DNN step must hoist the chain -L, not append it after the cross one"
 },
 {
  "id": "ort-chain.ffmpeg-link-order",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "for d in \"$@\"; do",
  "replace": "for d in $(printf '%s\\n' \"$@\" | tac); do",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the gate must take the FIRST -L dir holding ORT, as ld does"
 },
 {
  "id": "ort-chain.ffmpeg-link-foreign",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "*) echo \"LIB ${t} -> '${real:-unresolved}' is not in the chain lib dir ${lib}\" ;;",
  "replace": "*) ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a -lonnxruntime resolving outside the chain must fail"
 },
 {
  "id": "ort-chain.ffmpeg-link-static",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "\"${lib}\"/*.a) echo \"LIB ${t} -> '${real}' is a static ORT, not the chain's shared one\" ;;",
  "replace": "\"${lib}\"/*.a) ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a static ORT must fail"
 },
 {
  "id": "ort-chain.ffmpeg-link-so-first",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "'libonnxruntime.so libonnxruntime.a'",
  "replace": "'libonnxruntime.a libonnxruntime.so'",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "ld takes the .so before the .a in one dir"
 },
 {
  "id": "ort-chain.ffmpeg-link-enabled",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "grep -qx -e 'CONFIG_LIBONNXRUNTIME=yes' \"${mak}\" || echo",
  "replace": "true || echo",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "FFmpeg configured without libonnxruntime must fail"
 },
 {
  "id": "ort-chain.ffmpeg-link-refs",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "[ \"${refs}\" -gt 0 ] || echo \"${mak}: no link variable names libonnxruntime\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a link naming no ORT is a finding, not a pass"
 },
 {
  "id": "ort-chain.ffmpeg-link-vars",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "s/^(SHFLAGS|LDFLAGS|LDSOFLAGS|LDEXEFLAGS|EXTRALIBS(-[A-Za-z0-9_]+)?)=//p",
  "replace": "s/^(SHFLAGS|LDFLAGS|LDSOFLAGS|LDEXEFLAGS)=//p",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the EXTRALIBS lines carry -lonnxruntime and must be read"
 },
 {
  "id": "ort-chain.ffmpeg-link-librarypath",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "IFS=':' read -r -a lpath <<< \"${LIBRARY_PATH:-}\"",
  "replace": "lpath=()",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "LIBRARY_PATH is the tail of ld's walk"
 },
 {
  "id": "ort-chain.ffmpeg-link-split-l",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "case \"${prev}\" in -L) d=\"${t}\" ;; esac",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a '-L dir' spelling must be walked"
 },
 {
  "id": "ort-chain.ffmpeg-link-sysroot-eq",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "d=\"${d#=}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a '-L=dir' spelling must be walked"
 },
 {
  "id": "ort-chain.ffmpeg-link-relative",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "*) printf '%s\\n' \"$1/${d}\" ;;",
  "replace": "*) ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a relative -L is read against FFmpeg's source top"
 },
 {
  "id": "ort-chain.ffmpeg-link-path-ref",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "/*libonnxruntime*.so*|/*libonnxruntime*.a) readlink -f -- \"${t}\" 2>/dev/null || true ;;",
  "replace": "/*libonnxruntime*.so*|/*libonnxruntime*.a) return 1 ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "an ORT linked by path must be judged"
 },
 {
  "id": "ort-chain.ffmpeg-link-l-colon",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "-l:libonnxruntime*) _ffmpeg_ort_ld_pick \"${t#-l:}\" \"$@\" ;;",
  "replace": "-l:libonnxruntime*) _ffmpeg_ort_ld_pick libonnxruntime.so \"$@\" ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "-l:<name> searches that exact file name"
 },
 {
  "id": "ort-chain.ffmpeg-link-wired",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "ort_findings=\"$(ffmpeg_ort_link_findings ffbuild/config.mak \"${_FFMPEG_ONNX_ROOT:-}\")\"",
  "replace": "ort_findings=\"\"",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "configure_ffmpeg must run the link gate"
 },
 {
  "id": "ort-chain.ffmpeg-link-die",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "[ -z \"${ort_findings}\" ] || die \"FFmpeg links an ONNX Runtime other than the chain: ${ort_findings}\"",
  "replace": "[ -z \"${ort_findings}\" ] || echo \"FFmpeg links an ONNX Runtime other than the chain: ${ort_findings}\"",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a link finding must stop the build"
 },
 {
  "id": "ort-chain.gst-lib-foreign",
  "target": "linux/scripts/03-media/build/gstreamer/common/gst-onnx-ort.sh",
  "find": "_gst_onnx_under \"${real}\" \"$@\" || echo \"LIB ${t} -> '${real:-unresolved}' is not a chain ORT\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a non-chain libonnxruntime in the gstonnx link must fail"
 },
 {
  "id": "ort-chain.gst-l-flag",
  "target": "linux/scripts/03-media/build/gstreamer/common/gst-onnx-ort.sh",
  "find": "-lonnxruntime) name=\"libonnxruntime.so\" ;;",
  "replace": "-lonnxruntime) continue ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "-lonnxruntime must be resolved through -L and LIBRARY_PATH"
 },
 {
  "id": "ort-chain.gst-no-refs",
  "target": "linux/scripts/03-media/build/gstreamer/common/gst-onnx-ort.sh",
  "find": "[ \"${refs}\" -gt 0 ] || echo",
  "replace": "true || echo",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a gstonnx link naming no ORT must fail"
 },
 {
  "id": "ort-chain.gst-header",
  "target": "linux/scripts/03-media/build/gstreamer/common/gst-onnx-ort.sh",
  "find": "|| echo \"HDR ${d} provides onnxruntime_c_api.h but is not a chain include dir\"",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a non-chain ORT header dir must fail"
 },
 {
  "id": "ort-chain.gst-header-none",
  "target": "linux/scripts/03-media/build/gstreamer/common/gst-onnx-ort.sh",
  "find": "[ \"${hits}\" -gt 0 ] || echo",
  "replace": "true || echo",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "no ORT header dir at all must fail"
 },
 {
  "id": "ort-chain.gst-wired",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "  _gst_monorepo_meson_setup_run\n  _gst_monorepo_onnx_ort_gate\n",
  "replace": "  _gst_monorepo_meson_setup_run\n",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "the gate must run between meson setup and compile"
 },
 {
  "id": "ort-chain.gst-gate-exits",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "    exit 1\n  fi\n  echo \"gst onnx plugin:",
  "replace": "    true\n  fi\n  echo \"gst onnx plugin:",
  "test": "bash linux/scripts/tests/test-ort-chain-build-gates.sh",
  "why": "a gst finding must stop the build"
 },
 {
  "id": "ort-chain.rt-denied-in-code",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "  ort_is_denied_soname \"${so_name}\" && return 2\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "ORT sonames must be denied even with no map"
 },
 {
  "id": "ort-chain.rt-map-row",
  "target": "linux/scripts/03-media/runtime/so-package-map.txt",
  "find": "libonnxruntime.so*\tsource-built",
  "replace": "libonnxruntime.so.*\tsource-built",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "the map row must cover the unversioned soname"
 },
 {
  "id": "ort-chain.rt-distro-names",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "libonnxruntime*|onnxruntime*|python3-onnxruntime*) return 0 ;;",
  "replace": "onnxruntime*) return 0 ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "libonnxruntime*/python3-onnxruntime must count as ORT"
 },
 {
  "id": "ort-chain.rt-dpkg-status",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "*\" installed\"|*\" unpacked\"|*\" half-configured\"|*\" half-installed\"|*\" triggers-\"*) ;;",
  "replace": "*\" installed\") ;;",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "an unpacked ORT package has its files on disk too"
 },
 {
  "id": "ort-chain.rt-plan-gate",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "\"$(ort_apt_plan_findings \"$(apt-get -s install",
  "replace": "\"$(true \"$(apt-get -s install",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "an apt plan pulling ORT must fail"
 },
 {
  "id": "ort-chain.rt-dpkg-gate",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "\"$(ort_dpkg_findings \"$(dpkg-query",
  "replace": "\"$(true \"$(dpkg-query",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "an installed ORT package must fail"
 },
 {
  "id": "ort-chain.rt-loader-foreign",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "_ort_in_roots \"${real}\" \"$@\" || echo \"FOREIGN ${f} -> ${real} (not a chain file)\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "a non-chain ORT on a loader path must fail"
 },
 {
  "id": "ort-chain.rt-loader-dangling",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "[ -e \"${f}\" ] || { echo \"DANGLING ${f}\"; continue; }",
  "replace": "[ -e \"${f}\" ] || continue",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "a dead ORT link on a loader path must fail"
 },
 {
  "id": "ort-chain.rt-loader-none",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "[ \"${have}\" = 1 ] || echo \"NONE",
  "replace": "true || echo \"NONE",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "an empty chain must fail, not pass vacuously"
 },
 {
  "id": "ort-chain.rt-loader-providers",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "\"${d}\"/libonnxruntime.so* \"${d}\"/libonnxruntime_providers_*.so*; do",
  "replace": "\"${d}\"/libonnxruntime.so*; do",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "provider libraries are ORT too"
 },
 {
  "id": "ort-chain.rt-runtime-dpkg",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "    ort_dpkg_gate || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "ort_runtime_gate must include the dpkg gate"
 },
 {
  "id": "ort-chain.rt-runtime-loader",
  "target": "linux/scripts/03-media/runtime/ort-runtime-gate.sh",
  "find": "/usr/local/lib)\" || return 1\n    echo \"OK: every loader path",
  "replace": "/usr/local/lib)\" || true\n    echo \"OK: every loader path",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "a loader finding must fail ort_runtime_gate"
 },
 {
  "id": "ort-chain.rt-conf-000",
  "target": "linux/scripts/03-media/runtime/configure-runtime.sh",
  "find": "write_conf /etc/ld.so.conf.d/000-onnxruntime.conf",
  "replace": "write_conf /etc/ld.so.conf.d/onnxruntime.conf",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "the chain conf must sort first (AGENTS.md priority 5)"
 },
 {
  "id": "ort-chain.rt-conf-gate-wired",
  "target": "linux/scripts/03-media/runtime/configure-runtime.sh",
  "find": "ort_runtime_gate \"/usr/local/lib/onnxruntime-cpu/lib:",
  "replace": "true \"/usr/local/lib/onnxruntime-cpu/lib:",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "configure-runtime must run the runtime gate"
 },
 {
  "id": "ort-chain.rt-validate-plan-wired",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "  ort_apt_plan_gate \"${UNIQ_PKGS[@]}\" || exit 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "the repair must simulate before it installs"
 },
 {
  "id": "ort-chain.rt-validate-dpkg-wired",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "ort_dpkg_gate || exit 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-chain-runtime-gate.sh",
  "why": "validate-media-runtime must end with the dpkg gate"
 },
 {
  "id": "ort-chain.genai-home-missing",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "      echo \"${cache} has no ORT_HOME, so ortlib.cmake fetched its own ONNX Runtime\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "a cache without ORT_HOME means ortlib.cmake took its NuGet download branch"
 },
 {
  "id": "ort-chain.genai-home-root",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "if [ \"${ok}\" != 1 ]; then echo",
  "replace": "if false; then echo",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "an ORT_HOME outside the chain roots must fail"
 },
 {
  "id": "ort-chain.genai-no-cache",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "if [ \"${have_cache}\" != 1 ]; then echo",
  "replace": "if false; then echo",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "a tree with no top-level CMakeCache.txt proves nothing"
 },
 {
  "id": "ort-chain.genai-cache-depth",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "-mindepth 3 -maxdepth 3 -name CMakeCache.txt",
  "replace": "-name CMakeCache.txt",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "FetchContent sub-build caches carry no ORT_HOME; only build/<platform>/<config> is GenAI's"
 },
 {
  "id": "ort-chain.genai-fetchcontent-dir",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "-prune -printf 'FetchContent populated ONNX Runtime content at %p\\n'",
  "replace": "-prune -printf ''",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "an ortlib-*/onnxruntime-* FetchContent dir is a fetched ORT"
 },
 {
  "id": "ort-chain.genai-byte-rule",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "*) echo \"${path} is not the chain's ${name} (foreign ONNX Runtime bytes)${sfx}\" ;;",
  "replace": "*) : ;;",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "a file named like a chain ORT file must carry the chain bytes"
 },
 {
  "id": "ort-chain.genai-unreadable",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "|| sum=\"unreadable\"",
  "replace": "|| sum=\"${GENAI_ORT_CHAIN_SHA[${1##*/}]# }\"",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "a dangling link under a chain ORT name must fail, not be skipped"
 },
 {
  "id": "ort-chain.genai-archive",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "        echo \"an ONNX Runtime archive sits in the tree: ${f}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "an ORT archive in the tree is a download"
 },
 {
  "id": "ort-chain.genai-anchor",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "[ -n \"${GENAI_ORT_CHAIN_SHA[${f}]:-}\" ] || echo \"no chain",
  "replace": "true || echo \"no chain",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "an empty chain must fail, not pass the byte rule vacuously"
 },
 {
  "id": "ort-chain.genai-artifacts-no-tree",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "    return 1\n  fi\n  echo \"GENAI-ORT SKIP",
  "replace": "    return 0\n  fi\n  echo \"GENAI-ORT SKIP",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "GenAI artifacts with no build tree cannot be proven"
 },
 {
  "id": "ort-chain.genai-findings-fail",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "    return 1\n  fi\n  echo \"GENAI-ORT OK",
  "replace": "    return 0\n  fi\n  echo \"GENAI-ORT OK",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "any finding must fail the RUN"
 },
 {
  "id": "ort-chain.genai-wired",
  "target": "linux/Dockerfile.media",
  "find": "      bash /opt/scripts/03-media/verify-genai-ort.sh --src-dir /opt/onnxruntime-genai \\\n",
  "replace": "      true /opt/scripts/03-media/verify-genai-ort.sh --src-dir /opt/onnxruntime-genai \\\n",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "the genai verify RUN must run the gate"
 },
 {
  "id": "ort-chain.genai-no-image-dir",
  "target": "linux/Dockerfile.media",
  "find": "COPY --chmod=755 linux/scripts/03-media/runtime /opt/scripts/03-media/runtime\n",
  "replace": "COPY --chmod=755 linux/scripts/03-media /opt/scripts/03-media\n",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "a whole-dir COPY holding the build-only gate ships it and re-keys final on every edit"
 },
 {
  "id": "ort-chain.genai-no-image-copy",
  "target": "linux/Dockerfile.package",
  "find": "COPY --chmod=755 linux/scripts/03-media/runtime/ /opt/scripts/03-media/final/\n",
  "replace": "COPY --chmod=755 linux/scripts/03-media/runtime/ /opt/scripts/03-media/final/\nCOPY --chmod=755 linux/scripts/03-media/verify-genai-ort.sh /opt/scripts/03-media/final/verify-genai-ort.sh\n",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "a per-file COPY ships the build-only gate in the package image"
 },
 {
  "id": "ort-chain.genai-no-image-mount-dir",
  "target": "linux/Dockerfile.media",
  "find": "--mount=type=bind,source=linux/scripts/01-core,target=/opt/scripts/core,readonly \\\n    --mount=type=bind,source=linux/scripts/patches/onnxruntime-genai,",
  "replace": "--mount=type=bind,source=linux/scripts,target=/opt/scripts/all,readonly \\\n    --mount=type=bind,source=linux/scripts/patches/onnxruntime-genai,",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "a bind mount of a dir holding the gate re-keys that RUN on every gate edit"
 },
 {
  "id": "ort-census.foreign",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  if [ -n \"${foreign}\" ]; then printf 'FOREIGN",
  "replace": "  if false; then printf 'FOREIGN",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a foreign build root must be FOREIGN"
 },
 {
  "id": "ort-census.stale",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  elif [ \"${chain}\" = 1 ]; then printf 'STALE",
  "replace": "  elif false; then printf 'STALE",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a chain-rooted non-chain copy must be STALE"
 },
 {
  "id": "ort-census.relative",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  elif [ \"${relative}\" = 1 ]; then printf 'FOREIGN",
  "replace": "  elif false; then printf 'FOREIGN",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "remapped source paths are not the chain"
 },
 {
  "id": "ort-census.unproven",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  else printf 'UNPROVEN\\t%s\\tan ORT-named",
  "replace": "  else : 'UNPROVEN\\t%s\\tan ORT-named",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an unfingerprinted foreign ORT name must fail"
 },
 {
  "id": "ort-census.unread",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "      UNREAD) printf 'UNPROVEN",
  "replace": "      UNREAD) : 'UNPROVEN",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an unreadable ORT file is not a clean one"
 },
 {
  "id": "ort-census.elsewhere",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  _ort_under \"${2%%!*}\" \"${_ORTC_ALLOW[@]}\" || printf 'ELSEWHERE",
  "replace": "  true || printf 'ELSEWHERE",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a chain copy outside its homes must fail"
 },
 {
  "id": "ort-census.unregistered",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "      USE) if [ \"${b}\" = \"-\" ] && [ -z \"${_ORTC_REF[${e}]:-}\" ]; then",
  "replace": "      USE) if false; then",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an ORT user outside the contract must fail"
 },
 {
  "id": "ort-census.stamp-armed",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "      STAMP) if [ \"$2\" = 1 ]; then _ort_stamp_verdict",
  "replace": "      STAMP) if false; then _ort_stamp_verdict",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an armed STAMP arm must grade the stamps"
 },
 {
  "id": "ort-census.stamp-core",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "[ -z \"${_ORTC_CORE[${s}]:-}\" ] || return 0",
  "replace": "return 0",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a stamp must name THIS chain's core lib"
 },
 {
  "id": "ort-census.dist",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  if [ \"${#owners[@]}\" -gt 1 ]; then printf 'DIST",
  "replace": "  if [ \"${#owners[@]}\" -gt 9 ]; then printf 'DIST",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "two onnxruntime distributions must fail"
 },
 {
  "id": "ort-census.unresolved-none",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    printf 'UNRESOLVED\\t%s\\tno %s on its ld.so search path",
  "replace": "    : 'UNRESOLVED\\t%s\\tno %s on its ld.so search path",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an import nothing satisfies must fail"
 },
 {
  "id": "ort-census.unresolved-foreign",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  elif [ -z \"${_ORTC_REF[$4]:-}\" ]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an import that lands on a non-chain file must fail"
 },
 {
  "id": "ort-census.none-probe",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  [ \"${_ORTC_DONE}\" = 1 ] || printf 'NONE",
  "replace": "  true || printf 'NONE",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a probe that did not finish is not a pass"
 },
 {
  "id": "ort-census.none-reference",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  [ \"${#_ORTC_REF[@]}\" -gt 0 ] || printf 'NONE",
  "replace": "  true || printf 'NONE",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "no reference means nothing is proven"
 },
 {
  "id": "ort-census.none-scan",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  [ \"${_ORTC_NBIN}\" -gt 0 ] || printf 'NONE",
  "replace": "  true || printf 'NONE",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a scan that found no ORT is vacuous"
 },
 {
  "id": "ort-census.reference-self",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "      REF) _ort_ref_verdict \"${b}\" \"${c}\" ;;",
  "replace": "      REF) : ;;",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the reference itself must carry a chain root"
 },
 {
  "id": "ort-census.exempt-stale",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    else printf \"EXEMPT-STALE",
  "replace": "    else : \"EXEMPT-STALE",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an exemption that matches nothing must fail"
 },
 {
  "id": "ort-census.exempt-arch",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    [ \"${e_arch}\" = '*' ] || [ \"${e_arch}\" = \"${arch}\" ] || continue",
  "replace": "    true",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an exemption only waives its own arch"
 },
 {
  "id": "ort-census.under-boundary",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    case \"${p}\" in \"${q}\" | \"${q}\"/* | \"${q}\"\\\\*) return 0 ;; esac",
  "replace": "    case \"${p}\" in \"${q}\"*) return 0 ;; esac",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "/opt/onnxruntime-androidx is not under /opt/onnxruntime"
 },
 {
  "id": "ort-census.crlf",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  local probe=\"${1//$'\\r'/}\"",
  "replace": "  local probe=\"$1\"",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "CRLF probe text must read the same"
 },
 {
  "id": "ort-census.main-exit",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  if [ \"${bad}\" -gt 0 ]; then echo \"ORT census FAILED",
  "replace": "  if false; then echo \"ORT census FAILED",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the consumer CLI must exit 1 on a finding"
 },
 {
  "id": "ort-census.probe-content",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "        instance = bool(INSTANCE.match(name) or roots)",
  "replace": "        instance = bool(INSTANCE.match(name))",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a renamed ORT is found by its fingerprint"
 },
 {
  "id": "ort-census.probe-archive",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "        if name.lower().endswith(ARCHIVE_EXT):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "wheel members are scanned"
 },
 {
  "id": "ort-census.probe-ldconf",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "            self.search = ld_conf_dirs(self.root) + multi",
  "replace": "            self.search = multi",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "ld.so.conf order decides the importer's copy"
 },
 {
  "id": "ort-census.probe-ldpath",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "        for d in rpath + self.ldpath + runpath + self.search:",
  "replace": "        for d in rpath + runpath + self.search + self.ldpath:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "LD_LIBRARY_PATH precedes the cache"
 },
 {
  "id": "ort-census.probe-origin",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": ".replace(\"$ORIGIN\", origin)",
  "replace": ".replace(\"$NOPE\", origin)",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "$ORIGIN RUNPATHs resolve inside the bundle"
 },
 {
  "id": "ort-census.probe-symlink",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "        if os.path.islink(host(root, nxt)):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "symlinks resolve inside the root, not on the host"
 },
 {
  "id": "ort-census.probe-dist",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "            if any(line.startswith(\"onnxruntime/\") for line in fh):",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "RECORD ownership of onnxruntime is read"
 },
 {
  "id": "ort-census.probe-nomanifest",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "    except FileNotFoundError:\n        emit(\"NOMANIFEST\", manifest)",
  "replace": "    except FileNotFoundError:\n        pass",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a missing wheel manifest is reported"
 },
 {
  "id": "ort-census.smoke-wired",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    check_ort_census \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the runtime smoke must run the census"
 },
 {
  "id": "ort-census.smoke-fail-arm",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      *) bad=$((bad + 1)); fail \"ORT census:",
  "replace": "      *) : \"ORT census:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "every non-EXEMPT verdict fails the smoke"
 },
 {
  "id": "ort-census.manifest-written",
  "target": "linux/scripts/03-media/runtime/collect-artifacts.sh",
  "find": "write_ort_wheel_manifest /usr/local/lib/onnxruntime-cpu\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the chain wheel manifest is written before the wheels move"
 },
 {
  "id": "ort-census.manifest-genai",
  "target": "linux/scripts/03-media/runtime/collect-artifacts.sh",
  "find": "onnxruntime(?:[_-](?!genai)[a-z0-9]+)?-\" + re.escape",
  "replace": "onnxruntime(?:[_-][a-z0-9]+)?-\" + re.escape",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "GenAI's wheel is not chain ORT, even when its version equals ORT's"
 },
 {
  "id": "ort-census.manifest-version",
  "target": "linux/scripts/03-media/runtime/collect-artifacts.sh",
  "find": "+ re.escape(sys.argv[2]) +",
  "replace": "+ r\"[0-9][^-]*\" +",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "only this build's ORT version is chain truth; another ORT wheel in the prefix must not become reference"
 },
 {
  "id": "ort-census.manifest-no-version",
  "target": "linux/scripts/03-media/runtime/collect-artifacts.sh",
  "find": "to pin the chain wheel to\" >&2\n    return 1\n",
  "replace": "to pin the chain wheel to\" >&2\n",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "with no version to pin to, the writer fails rather than list an unpinned manifest"
 },
 {
  "id": "ort-census.manifest-graded",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  if [ \"${_ORTC_REF[$1]}\" = m ] && ! _ort_roots_chain \"$3\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a manifest row carries no roots, so the bytes matching it must name a chain root (check (a))"
 },
 {
  "id": "ort-census.manifest-follow-rehash",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "    return f\"{got}  {hits[0]}!{member}\\n\", None",
  "replace": "    return f\"{sha}  {hits[0]}!{member}\\n\", None",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "follow re-hashes the rewritten member: the as-built sha leaves a stripped cross venv ORT STALE"
 },
 {
  "id": "ort-census.manifest-check-bytes",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "if wheel not in present or members(wheel).get(member) != sha:",
  "replace": "if wheel not in present:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a foreign wheel under the chain wheel's name fails the check before the strip"
 },
 {
  "id": "ort-census.manifest-follow-unique",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "if len(hits) == 1 else None",
  "replace": "if hits else None",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "two wheels of the chain wheel's name: nothing is re-pointed"
 },
 {
  "id": "ort-census.manifest-check-called",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "ort_manifest_rows check \"${WHEELS_DIR}\" \"${_ORT_MANIFESTS[@]}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the manifest rows are proven against /opt/wheels before anything rewrites a wheel"
 },
 {
  "id": "ort-census.manifest-follow-cross",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "  ort_manifest_rows follow \"${WHEELS_DIR}\" \"${_ORT_MANIFESTS[@]}\"\n  exit 0",
  "replace": "  exit 0",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the cross path re-points the manifest after its strip and retag"
 },
 {
  "id": "ort-census.manifest-follow-native",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "|| true\nort_manifest_rows follow \"${WHEELS_DIR}\" \"${_ORT_MANIFESTS[@]}\"\n",
  "replace": "|| true\n",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the native path re-points the manifest after auditwheel"
 },
 {
  "id": "ort-census.manifest-check-twins",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "    if twins:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a foreign wheel of the chain wheel's name, platform tag aside, fails the check before the retag renames it onto the chain wheel"
 },
 {
  "id": "ort-census.manifest-row-kind",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "REF) if [ \"${c}\" = '?' ]; then",
  "replace": "REF) if false; then",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a manifest-only sha must stay marked ungraded, or its bytes are trusted outright"
 },
 {
  "id": "ort-chain.g2-byte-compare",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "*) echo \"${path} is not the chain's ${name} (foreign ONNX Runtime bytes)${sfx}\" ;;",
  "replace": "*) : ;;",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "an ORT file under a chain name must carry the chain's bytes"
 },
 {
  "id": "ort-chain.g2-unknown-binary",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "    echo \"${path} is an ONNX Runtime binary the chain does not build${sfx}\"",
  "replace": "    : \"${path} is an ONNX Runtime binary the chain does not build${sfx}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "an ORT binary the chain does not build is foreign"
 },
 {
  "id": "ort-chain.g2-archive",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "      echo \"an ONNX Runtime archive: ${path}${sfx}\"",
  "replace": "      : \"an ONNX Runtime archive: ${path}${sfx}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "an ORT archive (release, NuGet, wheel, pyke .tar.lzma2) in a build input fails"
 },
 {
  "id": "ort-chain.g2-fetched-dir",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "      D) echo \"fetched ONNX Runtime content at ${path}${sfx}\" ;;",
  "replace": "      D) : ;;",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a FetchContent/NuGet/release ORT dir in the tree fails even when it is empty"
 },
 {
  "id": "ort-chain.g2-hidden",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "\\( \"${file_candidates[@]}\" \\) \\\n        -printf",
  "replace": "\\( \"${file_candidates[@]}\" \\) ! -path '*/.*' \\\n        -printf",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "hidden files and dirs are scanned too"
 },
 {
  "id": "ort-chain.g2-pyke",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "if [ -n \"${f}\" ]; then echo \"pyke's ORT download cache holds ${f}\"; fi",
  "replace": "if false; then echo \"pyke's ORT download cache holds ${f}\"; fi",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "anything in pyke's ORT cache is a foreign ORT"
 },
 {
  "id": "ort-chain.g2-record-file",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "if [ -f \"${tok}\" ]; then _ortg_name_finding \"${tok}\" | sed -e \"s#^#${rec}: #\"",
  "replace": "if [ -f \"${tok}\" ]; then :",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "an ORT file a record names outside the chain must carry chain bytes"
 },
 {
  "id": "ort-chain.g2-record-absent",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "else echo \"${rec} names ${tok}, an ONNX Runtime file outside the chain (not on disk to compare)\"; fi",
  "replace": "else :; fi",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "an ORT file a record names outside the chain fails even when it is gone"
 },
 {
  "id": "ort-chain.g2-record-segment",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "echo \"${rec} names an ONNX Runtime path outside the chain: ${tok}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a record naming an ORT dir outside the chain fails"
 },
 {
  "id": "ort-chain.g2-record-searchdir",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "      _ortg_name_finding \"${d}\" | sed -e \"s#^#${rec} searches ${d%/*}: #\"",
  "replace": "      : \"${d}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a search dir a record names must not hold a foreign ORT (a distro libonnxruntime)"
 },
 {
  "id": "ort-chain.g2-record-symlink",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "if _ortg_under \"${reals[${i}]:-}\" \"${_ORTG_REFS_AT[@]+\"${_ORTG_REFS_AT[@]}\"}\"; then _ORTG_REFS=$((_ORTG_REFS + 1))",
  "replace": "if false; then _ORTG_REFS=$((_ORTG_REFS + 1))",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a record naming the chain through a symlink still counts as the chain"
 },
 {
  "id": "ort-chain.g2-chain-ref",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "if [ \"${_ORTG_REFS}\" -eq 0 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a build no record ties to the chain proves nothing and fails"
 },
 {
  "id": "ort-chain.g2-log",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "{ grep -n -i -E -e \"${_ORTG_FETCH_RE}\" || true; }",
  "replace": "{ grep -n -i -E -e \"no-such-fetch-line\" || true; }",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a configure/build log that fetched ORT fails"
 },
 {
  "id": "ort-chain.g2-log-genai",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "-e 's/onnx ?runtime[-_. ]?(genai|extensions)/GENAI/Ig'",
  "replace": "-e 's/no-such-text/GENAI/Ig'",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "GenAI's and extensions' own fetches are not ORT fetches"
 },
 {
  "id": "ort-chain.g2-shim-link",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "        echo \"the shim link ${l} leaves the chain for ${real}\"",
  "replace": "        :",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a shim's links must land in the chain"
 },
 {
  "id": "ort-chain.g2-shim-dangling",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "then echo \"the shim link ${l} is dangling\"; continue; fi",
  "replace": "then continue; fi",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a dangling shim link fails"
 },
 {
  "id": "ort-chain.g2-vacuous",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "then echo \"the tree(s) hold no files: a vacuous scan, not a clean build\"; fi",
  "replace": "then :; fi",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "an empty tree is a vacuous scan, not a pass"
 },
 {
  "id": "ort-chain.g2-no-tree",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "then echo \"no tree at ${r} to check\"; continue; fi",
  "replace": "then continue; fi",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a tree that is not there fails"
 },
 {
  "id": "ort-chain.g2-anchors",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "[ -n \"${_ORTG_SHA[${name}]:-}\" ] || echo \"the chain ONNX Runtime (${all% }) has no ${name} to compare against\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a chain without its C API header or core lib cannot be compared against"
 },
 {
  "id": "ort-chain.g2-no-chain",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "if [ \"${#_ORTG_ROOTS[@]}\" -eq 0 ]; then echo \"no chain ONNX Runtime at any of: ${all% }\"; fi",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "no chain root at all fails"
 },
 {
  "id": "ort-chain.g2-one-line",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  all=\"$(printf '%s ' \"$@\")\"",
  "replace": "  all=\"$*\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a finding stays one line under the consumers' IFS=$'\\n\\t'"
 },
 {
  "id": "ort-chain.g2-missing-record",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "then echo \"the build record ${rec} is missing\"; continue; fi",
  "replace": "then continue; fi",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a build record that is not there fails"
 },
 {
  "id": "ort-chain.g2-missing-log",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "then echo \"the build log ${log} is missing\"; continue; fi",
  "replace": "then continue; fi",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a build log that is not there fails"
 },
 {
  "id": "ort-chain.g2-fail-closed",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  if [ \"${n}\" != 0 ]; then",
  "replace": "  if [ \"${n}\" = 999999 ]; then",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "any finding fails the gate and writes no stamp"
 },
 {
  "id": "ort-chain.g2-stale-stamp",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "${SUDO_WRAP:+\"${SUDO_WRAP}\"} rm -f \"${stamp}\"",
  "replace": ": \"${stamp}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a failing rerun leaves no earlier stamp behind"
 },
 {
  "id": "ort-chain.g2-stamp-core",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "for root in \"${_ORTG_ROOTS[@]}\"; do body+=",
  "replace": "for root in \"${_ORTG_ROOTS[@]}\"; do : body+=",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "the stamp names the chain core lib's sha256, which the census requires"
 },
 {
  "id": "ort-chain.g2-no-stamp-arg",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "if [ -z \"${stamp}\" ]; then echo \"no --stamp file given\" > \"${out}\"; fi",
  "replace": "if false; then echo \"no --stamp file given\" > \"${out}\"; fi",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a gate run without a stamp file fails"
 },
 {
  "id": "ort-chain.g2-bad-consumer",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "case \"${consumer}\" in \"\" | *[!a-z0-9-]*) echo",
  "replace": "case \"${consumer}\" in \"NEVER\") echo",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a consumer name the census contract cannot hold fails"
 },
 {
  "id": "ort-chain.g2-opencv-fatal",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "|| die \"OpenCV's build inputs reach an ONNX Runtime other than the chain's\"",
  "replace": "|| true \"OpenCV's build inputs reach an ONNX Runtime other than the chain's\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "OpenCV dies on a G2 finding"
 },
 {
  "id": "ort-chain.g2-opencv-stamp-path",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "--stamp \"${OPENCV_PREFIX}/ort-provenance/opencv.json\"",
  "replace": "--stamp \"${OPENCV_PREFIX}/opencv.json\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "OpenCV's stamp lands where the census reads it"
 },
 {
  "id": "ort-chain.g2-opencv-sourced",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "source \"${SCRIPT_DIR}/../../ort-provenance.sh\"",
  "replace": ": \"${SCRIPT_DIR}/../../ort-provenance.sh\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "build-opencv.sh sources G2 by its per-file path"
 },
 {
  "id": "ort-chain.g2-ffmpeg-fatal",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "|| die \"FFmpeg's build inputs reach an ONNX Runtime other than the chain's\"",
  "replace": "|| true \"FFmpeg's build inputs reach an ONNX Runtime other than the chain's\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "FFmpeg dies on a G2 finding"
 },
 {
  "id": "ort-chain.g2-gst-fatal",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "--log builddir/meson-logs/meson-log.txt || exit 1",
  "replace": "--log builddir/meson-logs/meson-log.txt || true",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "GStreamer exits on a G2 finding"
 },
 {
  "id": "ort-chain.g2-gst-called",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "  _gst_monorepo_install\n  _gst_monorepo_ort_provenance\n}",
  "replace": "  _gst_monorepo_install\n}",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "the GStreamer build runs G2 after its install"
 },
 {
  "id": "ort-chain.g2-genai-called",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "  _genai_ort_g2 \"${src}\" \"${out}\" \"${roots[@]}\"",
  "replace": "  : \"${src}\" \"${out}\" \"${roots[@]}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "the GenAI verify step runs G2 once its own gate passed"
 },
 {
  "id": "ort-chain.g2-mount",
  "target": "linux/Dockerfile.media",
  "find": "verify-genai-ort.sh,readonly \\\n    --mount=type=bind,source=linux/scripts/03-media/ort-provenance.sh,target=/opt/scripts/03-media/ort-provenance.sh,readonly \\\n",
  "replace": "verify-genai-ort.sh,readonly \\\n",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "every consumer RUN mounts G2 per file"
 },
 {
  "id": "ort-chain.g2-census-arm",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "local g2=\"${_ORT_CENSUS_HERE}/../03-media/ort-provenance.sh\"",
  "replace": "local g2=\"${_ORT_CENSUS_HERE}/../03-media/core/ort-provenance.sh\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "the census arms STAMP on G2's real path"
 },
 {
  "id": "ort-chain.g2-link-walked",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "        queue+=(\"${real}\")",
  "replace": "        : \"${real}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a dir link in a tree whose target leaves the trees and the chain is walked too"
 },
 {
  "id": "ort-chain.g2-link-listed",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "      L) _ORTG_FOUND_LINKS+=(\"${path}\") ;;",
  "replace": "      L) : ;;",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "the tree scan lists every dir link it meets, for the walk and for the record paths spelled through it"
 },
 {
  "id": "ort-chain.g2-link-holds-tree",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "then echo \"the link ${l} points at ${real}, which holds the tree itself\"; continue; fi",
  "replace": "then continue; fi",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a dir link to an ancestor of the tree (or /) is a finding, not a walk of the whole disk"
 },
 {
  "id": "ort-chain.g2-link-recorded",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "      _ORTG_TREE_LINKS+=(\"${l}\")",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "the dir links found land where the record split reads them"
 },
 {
  "id": "ort-chain.g2-link-record-resolved",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "        && ! _ortg_under \"${tok}\" \"${_ORTG_TREE_LINKS[@]+\"${_ORTG_TREE_LINKS[@]}\"}\"; then _ortg_intree \"${tok}\"",
  "replace": "        ; then _ortg_intree \"${tok}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a record path lexically in a tree but spelled through one of its dir links is read at its target, not exempted"
 },
 {
  "id": "ort-chain.g2-segment-real",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "elif _ortg_ort_segment \"${tok}\" || _ortg_ort_segment \"$3\"; then",
  "replace": "elif _ortg_ort_segment \"${tok}\"; then",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "an ORT dir name reached through a link counts as an ORT path"
 },
 {
  "id": "ort-chain.g2-static-component",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "_ORTG_BIN_RE='^(lib)?onnxruntime(_[a-z0-9_]+)?\\.",
  "replace": "_ORTG_BIN_RE='^(lib)?onnxruntime(_providers_[a-z0-9_]+)?\\.",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a static ORT component (libonnxruntime_session.a, libonnxruntime_providers.a) is an ORT binary"
 },
 {
  "id": "ort-chain.g2-bin-genai-excluded",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  if _ortg_component_name \"${lc}\"; then return 1; fi",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "GenAI's and extensions' own libraries are not ORT binaries"
 },
 {
  "id": "ort-chain.g2-intree-graded",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "      if [ -f \"${f}\" ]; then _ortg_name_finding \"${f}\" | sed -e \"s#^#${rec}: #\"; fi",
  "replace": "      : \"${f}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "an ORT library a record names inside a tree is graded, not exempted"
 },
 {
  "id": "ort-chain.g2-cache-whole",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "    CMakeCache.txt) { sed -n -E",
  "replace": "    CMakeCache.NEVER) { sed -n -E",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a CMakeCache value is read whole, so a path with spaces is not cut"
 },
 {
  "id": "ort-chain.g2-arg-whole",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "if (s ~ /^\\// && s !~ /[ \\t][-\\/][A-Za-z]/) print \"P\" s; else print \"T\" $0",
  "replace": "print \"T\" $0",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "an argument that is one absolute path is kept whole, spaces and all"
 },
 {
  "id": "ort-chain.g2-ninja-space",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "-e 's/\\$ /\\x01/g'",
  "replace": "-e 's/NEVER /\\x01/g'",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "ninja's escaped space stays inside the path"
 },
 {
  "id": "ort-chain.g2-quoted-whole",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "-e \"s#\\\"${_ORTG_FLAG_RE}?(/[^\\\"]+)\\\"# ${q}\\\\2${q} #g\"",
  "replace": "-e \"s#NEVER##g\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a quoted path (a flag's, a JSON string) is kept whole"
 },
 {
  "id": "ort-chain.g2-core-session",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "for sub in onnxruntime onnxruntime/core/session; do",
  "replace": "for sub in onnxruntime; do",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a searched include dir is read in ORT's older onnxruntime/core/session layout too"
 },
 {
  "id": "ort-chain.g2-log-mandatory",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "if [ \"${#_ORTG_LOGS[@]}\" -eq 0 ]; then echo \"no build log was given",
  "replace": "if false; then echo \"no build log was given",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a gate run with no build log is a finding: the fetch-trace arm would otherwise never run"
 },
 {
  "id": "ort-chain.g2-no-tmp",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "out=\"$(mktemp)\" || { echo \"ORT-GATE FAILED (${consumer}): no temp file for the findings, so nothing was checked\" >&2; return 1; }",
  "replace": "out=\"$(mktemp)\" || true",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "no temp file for the findings fails the gate by name"
 },
 {
  "id": "ort-chain.g2-count-unreadable",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  if [ \"${n}\" != 0 ]; then",
  "replace": "  if [ \"${n}\" -gt 0 ]; then",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a finding count that is not a number fails closed (an integer test would pass it)"
 },
 {
  "id": "ort-chain.g2-resolve-count",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "if [ \"${#reals[@]}\" -ne \"${#raw[@]}\" ]; then echo \"$1: only ${#reals[@]} of its ${#raw[@]} path(s) resolved\"; return 0; fi",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "record paths realpath did not resolve are a finding, not a shorter list"
 },
 {
  "id": "ort-chain.g2-cache-sdks",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": " tree \"${FFMPEG_SDK_CACHE:-/var/cache/ffmpeg-sdks}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "the FFmpeg SDK cache mount is a default G2 root"
 },
 {
  "id": "ort-chain.g2-cache-cargo",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "tree \"${cargo}/registry\" tree \"${cargo}/git\"",
  "replace": "tree \"${cargo}/git\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "cargo's registry mount is a default G2 root"
 },
 {
  "id": "ort-chain.g2-cache-uv",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": " uv \"${UV_CACHE_DIR:-${xdg}/uv}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "uv's cache is a default G2 root, at UV_CACHE_DIR when set"
 },
 {
  "id": "ort-chain.g2-cache-pip",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": " pip \"${PIP_CACHE_DIR:-${xdg}/pip}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "pip's cache is a default G2 root, at PIP_CACHE_DIR when set"
 },
 {
  "id": "ort-chain.g2-cache-nuget",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "    tree \"${NUGET_PACKAGES:-${HOME:-/root}/.nuget/packages}\" tree \"${QNN_SDK_CACHE_DIR:-/var/cache/qnn-sdk}\"\n",
  "replace": "    tree \"${QNN_SDK_CACHE_DIR:-/var/cache/qnn-sdk}\"\n",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "NuGet's package folder is a default G2 root, as on Windows"
 },
 {
  "id": "ort-chain.g2-uv-http-only",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "-type f -name '*.http' -printf",
  "replace": "-type f -printf",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "only an ORT wheel uv fetched over HTTP fails: a local chain wheel (.rev) and resolver metadata do not"
 },
 {
  "id": "ort-chain.g2-uv-genai",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "      onnxruntime-genai* | onnxruntime-extensions*) ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "GenAI's and extensions' wheels in uv's cache are not ORT"
 },
 {
  "id": "ort-chain.g2-uv-unreadable",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "      *) echo \"cannot read all of $1: ${line}\"; continue ;;",
  "replace": "      *) continue ;;",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a uv cache G2 cannot read is a finding, not a pass"
 },
 {
  "id": "ort-chain.g2-pip-top-level",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "any(n.startswith(\"onnxruntime/\") for n in zf.namelist())",
  "replace": "any(\"onnxruntime/\" in n for n in zf.namelist())",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "only a top-level onnxruntime/ package is ORT: optimum's optimum/onnxruntime/ is not"
 },
 {
  "id": "ort-chain.g2-pip-no-python",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "|| { echo \"cannot inspect pip's HTTP cache at $1/http-v2 (python3 failed)\"; return 0; }",
  "replace": "|| return 0",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a pip cache G2 cannot inspect is a finding, not a pass"
 },
 {
  "id": "ort-chain.g2-pip-unreadable",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "      \"E \"*) echo \"pip's HTTP cache at $1/http-v2: ${rel#E }\" ;;",
  "replace": "      \"E \"*) ;;",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a pip cache body or directory G2 cannot read is a finding, not a pass"
 },
 {
  "id": "ort-chain.g2-pip-open",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "    with open(path, \"rb\") as fh:\n        if fh.read(4) != b\"PK\\x03\\x04\":\n            return False\n",
  "replace": "    if not zipfile.is_zipfile(path):\n        return False\n",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "is_zipfile() swallows an unreadable body's OSError; the scanner opens it so the read error is a finding"
 },
 {
  "id": "ort-chain.g2-cache-tree",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "else _ortg_tree_findings \"$2\"; fi ;;",
  "replace": "else :; fi ;;",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "cargo, the FFmpeg SDK cache, NuGet and every --cache are graded like a tree"
 },
 {
  "id": "ort-chain.g2-cache-counters",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  local kind dir\n  (\n    while IFS=$'\\t' read -r kind dir; do _ortg_cache_findings \"${kind}\" \"${dir}\"; done < <(ort_gate_default_caches)\n    for dir in \"${_ORTG_CACHES[@]+\"${_ORTG_CACHES[@]}\"}\"; do _ortg_cache_findings tree \"${dir}\"; done\n  )\n",
  "replace": "  local kind dir\n  {\n    while IFS=$'\\t' read -r kind dir; do _ortg_cache_findings \"${kind}\" \"${dir}\"; done < <(ort_gate_default_caches)\n    for dir in \"${_ORTG_CACHES[@]+\"${_ORTG_CACHES[@]}\"}\"; do _ortg_cache_findings tree \"${dir}\"; done\n  }\n",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a cache walk runs in a subshell, so its files never reach the stamp's tree count"
 },
 {
  "id": "ort-chain.g2-root-token",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  [ -n \"${name}\" ] || return 0\n  if [ -n \"${_ORTG_SHA[${name}]:-}\" ] || _ortg_is_bin \"${name}\"; then\n    if [ -f",
  "replace": "  if [ -n \"${_ORTG_SHA[${name}]:-}\" ] || _ortg_is_bin \"${name}\"; then\n    if [ -f",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "a record token of '/' (a cross build's CMAKE_FIND_ROOT_PATH) must not die on an empty subscript"
 },
 {
  "id": "ort-chain.g2-genai-fetch-uv",
  "target": "linux/Dockerfile.media",
  "find": "ort-provenance.sh,readonly \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/01-core/path-helpers.sh,readonly \\\n    --mount=type=cache,target=/root/.cache/uv,id=uv-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/root/.cache/pip,id=pip-cache-${TARGETARCH} --mount=type=cache,target=/var/cache/qnn-sdk,sharing=locked,id=qnn-sdk-${TARGET_ARCH} \\\n    set -euo pipefail; \\\n    if [ \"${BUILD_GENAI:-true}\"",
  "replace": "ort-provenance.sh,readonly \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/01-core/path-helpers.sh,readonly \\\n    --mount=type=cache,target=/root/.cache/pip,id=pip-cache-${TARGETARCH} --mount=type=cache,target=/var/cache/qnn-sdk,sharing=locked,id=qnn-sdk-${TARGET_ARCH} \\\n    set -euo pipefail; \\\n    if [ \"${BUILD_GENAI:-true}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "GenAI's G2 RUN grades the uv cache the GenAI build RUN fetched into"
 },
 {
  "id": "ort-chain.g2-genai-fetch-pip",
  "target": "linux/Dockerfile.media",
  "find": "    --mount=type=cache,target=/root/.cache/pip,id=pip-cache-${TARGETARCH} --mount=type=cache,target=/var/cache/qnn-sdk,sharing=locked,id=qnn-sdk-${TARGET_ARCH} \\\n    set -euo pipefail; \\\n    if [ \"${BUILD_GENAI:-true}\"",
  "replace": "    --mount=type=cache,target=/var/cache/qnn-sdk,sharing=locked,id=qnn-sdk-${TARGET_ARCH} \\\n    set -euo pipefail; \\\n    if [ \"${BUILD_GENAI:-true}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "GenAI's G2 RUN grades the pip cache the GenAI build RUN fetched into"
 },
 {
  "id": "ort-chain.g2-genai-log-passed",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "--tree \"${src}\" --log \"${src}/build/genai-build.log\" \"${g2[@]}\"",
  "replace": "--tree \"${src}\" \"${g2[@]}\"",
  "test": "bash linux/scripts/tests/test-genai-ort.sh",
  "why": "GenAI's G2 call reads the build log 60-build-genai.sh tees"
 },
 {
  "id": "ort-chain.g2-genai-log-teed",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "--ort_home \"${ORT_HOME}\" 2>&1 | tee -a \"${GENAI_BUILD_LOG}\"",
  "replace": "--ort_home \"${ORT_HOME}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "both GenAI build.py calls tee into the log G2 reads"
 },
 {
  "id": "ort-chain.g2-genai-log-path",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "GENAI_BUILD_LOG=\"${GENAI_SRC_DIR}/build/genai-build.log\"",
  "replace": "GENAI_BUILD_LOG=\"${GENAI_SRC_DIR}/genai-build.log\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "the GenAI build log sits where verify-genai-ort.sh reads it"
 },
 {
  "id": "ort-chain.g2-opencv-records",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": " --record \"${OPENCV_SRC}/build/CMakeCache.txt\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "OpenCV hands G2 both of its records"
 },
 {
  "id": "ort-chain.g2-ffmpeg-record",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "--record \"${FFMPEG_SRC}/ffbuild/config.mak\" ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "FFmpeg hands G2 its config.mak"
 },
 {
  "id": "ort-chain.g2-gst-records",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": " --record builddir/meson-info/intro-dependencies.json",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "GStreamer hands G2 meson's dependency record as well as build.ninja"
 },
 {
  "id": "pre-commit.plan-strips-cr",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "<<'PY' | tr -d '\\r'",
  "replace": "<<'PY'",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "on Windows python prints CRLF; a kept \\r makes every sampled id unknown and the commit aborts"
 },
 {
  "id": "dockerfile-lint.image-env-name-rule",
  "target": "linux/scripts/verify_image_env.py",
  "find": "    if BUILD_HOST_NAME.match(name):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "a build-host sccache variable fails whatever its value"
 },
 {
  "id": "dockerfile-lint.image-env-address-rule",
  "target": "linux/scripts/verify_image_env.py",
  "find": "if any(addr in net for net in PRIVATE_V4) and _host_position(",
  "replace": "if False and _host_position(",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "an RFC1918/link-local address in a host position fails"
 },
 {
  "id": "dockerfile-lint.image-env-url-authority",
  "target": "linux/scripts/verify_image_env.py",
  "find": "if AUTHORITY.search(before) or",
  "replace": "if False or",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "an address after scheme:// is a host, never a path fragment"
 },
 {
  "id": "dockerfile-lint.image-env-version-exemption",
  "target": "linux/scripts/verify_image_env.py",
  "find": "return \"VERSION\" not in name.upper()",
  "replace": "return True",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "a version that parses as 10/8 (CURAND 10.4.4.72, baked into the Windows Machine env) passes"
 },
 {
  "id": "dockerfile-lint.image-env-path-fragment",
  "target": "linux/scripts/verify_image_env.py",
  "find": "    if before and before[-1] not in LEAD:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "a version inside a directory name (/opt/TensorRT-10.13.3.9/lib) passes"
 },
 {
  "id": "dockerfile-lint.image-env-env-expansion",
  "target": "linux/scripts/verify_image_env.py",
  "find": "if BUILD_HOST_NAME.match(ref)]",
  "replace": "if False]",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "an ENV that expands the endpoint ARG under another name fails"
 },
 {
  "id": "dockerfile-lint.image-env-compile-run-arg",
  "target": "linux/scripts/verify_image_env.py",
  "find": "and not ENDPOINT_SECRET.search(body):",
  "replace": "and False:",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "a compiling RUN that does not mount the endpoint secret fails"
 },
 {
  "id": "dockerfile-lint.image-env-arg-in-history",
  "target": "linux/scripts/verify_image_env.py",
  "find": "        if BUILD_HOST_ADDRESS_NAME.match(key) or CREDENTIAL_NAME.match(key):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "an ARG of a cache endpoint, bucket, region or key fails: BuildKit writes its value into the image history"
 },
 {
  "id": "dockerfile-lint.image-env-escape-directive",
  "target": "linux/scripts/verify_image_env.py",
  "find": "            return m.group(1)",
  "replace": "            return \"\\\\\"",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "a Windows Dockerfile's backtick continuation is joined, or its continued ENV lines go unread"
 },
 {
  "id": "dockerfile-lint.image-env-env-file-floor",
  "target": "linux/scripts/verify_image_env.py",
  "find": "        if checked < args.min_vars:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "an image environment that was never read fails instead of passing"
 },
 {
  "id": "dockerfile-lint.image-env-lint-wired",
  "target": "linux/scripts/lint-dockerfiles.sh",
  "find": "python3 linux/scripts/verify_image_env.py --dockerfile \"${DOCKERFILES[@]}\" || FAILED=1",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "lint-dockerfiles.sh runs the static pass"
 },
 {
  "id": "image-env.manifest-reads-config",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "       || ! python3 \"${REPO_ROOT}/linux/scripts/verify_image_env.py\" --env-file \"${env_lines}\" --label \"${tag}\"; then",
  "replace": "       ; then",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "the manifest gate grades the config ENV it read, not merely that it could read one"
 },
 {
  "id": "image-env.manifest-fails",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "      failed=\"${failed:+${failed} }${arch}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "a leaking or unreadable wrapper fails the index"
 },
 {
  "id": "image-env.manifest-no-switch",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  _manifest_image_env_gate || err \"manifest image-env gate refused",
  "replace": "  [ \"${RUNTIME_IMAGE_SMOKE}\" = \"1\" ] && _manifest_image_env_gate || err \"manifest image-env gate refused",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "create_manifest runs the gate unconditionally; RUNTIME_IMAGE_SMOKE=0 once skipped it"
 },
 {
  "id": "image-env.manifest-pull-if-missing",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    if ! image_exists \"${NERDCTL_BIN:-nerdctl}\" \"${tag}\"; then\n      run \"${NERDCTL_BIN:-nerdctl}\" pull -q --platform",
  "replace": "    if true; then\n      run \"${NERDCTL_BIN:-nerdctl}\" pull -q --platform",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "an existing wrapper tag is graded as it is, never re-pointed at the published image by a pull"
 },
 {
  "id": "image-env.windows-endpoint-env",
  "target": "windows/Dockerfile.media-builder",
  "find": "ENV SCCACHE_DIR=\"${SCCACHE_DIR}\" `",
  "replace": "ENV SCCACHE_WEBDAV_ENDPOINT=\"${SCCACHE_WEBDAV_ENDPOINT}\" `\n    SCCACHE_DIR=\"${SCCACHE_DIR}\" `",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "re-adding the 2026-09-23 ENV line to the media common stage fails the shipped tree"
 },
 {
  "id": "image-env.windows-endpoint-secret",
  "target": "windows/Dockerfile.media-merge-builder",
  "find": "make a shared L0 a hit, not a conflict.\nRUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT ",
  "replace": "make a shared L0 a hit, not a conflict.\nRUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    ",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "a compiling RUN that loses its endpoint secret (it would compile uncached) fails the shipped tree"
 },
 {
  "id": "image-env.windows-endpoint-arg",
  "target": "windows/Dockerfile.toolchain-builder",
  "find": "ARG SCCACHE_FORCE_LOCAL\nARG SCCACHE_LOG=\"warn\"",
  "replace": "ARG SCCACHE_ENDPOINT\nARG SCCACHE_FORCE_LOCAL\nARG SCCACHE_LOG=\"warn\"",
  "test": "bash linux/scripts/tests/test-image-env.sh",
  "why": "re-adding an endpoint ARG, whose value BuildKit writes into the image history, fails the shipped tree"
 },
 {
  "id": "critical-fixes.ort-judge-verdict-count",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "  if [ \"${seen}\" -ne \"${#_F11_RULES[@]}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "every corpus verdict comes out of ONE awk run; a run that dies or prints nothing would otherwise pass every rule it was handed"
 },
 {
  "id": "critical-fixes.ort-judge-deny-verdict",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "else if (F[1] == \"deny\") verdict(!n,",
  "replace": "else if (F[1] == \"deny\") verdict(1,",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a deny rule is judged by its hit count; a verdict that ignores it passes every download, NuGet and apt line in the tree"
 },
 {
  "id": "critical-fixes.ort-judge-path-scope",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "if ((PI != \"\" && FP[f] !~ PI) || (PX != \"\" && FP[f] ~ PX)) continue",
  "replace": "if (PX != \"\" && FP[f] ~ PX) continue",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "a require rule counts the lines of ONE file; unscoped, 'calls it exactly once' counts every consumer's call together"
 },
 {
  "id": "critical-fixes.ort-judge-exactly",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "verdict(F[9] ~ /\\+$/ ? n >= F[9] + 0 : n == F[9] + 0,",
  "replace": "verdict(n >= F[9] + 0,",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "'1' means exactly once and only '1+' means at least once; read as a floor, a second, drifting G2 call passes"
 },
 {
  "id": "critical-fixes.ort-judge-count-reaches-bash",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "print \"N\\t\" F[2] \"\\t\" (n + 0)",
  "replace": "print \"N\\t\" F[2] \"\\t\" 1",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the GenAI build.py/--ort_home ratio is judged in bash from the counted lines; a constant count hides a build.py call that fetches ORT"
 },
 {
  "id": "critical-fixes.ort-env-prefilter-names",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "if (t !~ N) next",
  "replace": "if (t !~ \"ort_lib_path\") next",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the prefilter skips lines naming no ort-sys variable; it must use the whole name set, or every other variable's write is skipped unread"
 },
 {
  "id": "ort-census.probe-whole-path",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "[\\\\/][\\w.+\\\\/-]*?\\.(?:cc|cpp|cxx|c|h|hpp|inc|cu|cuh)(?:\\x00|\\Z)\")",
  "replace": "[\\\\/]\")",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a consumer naming the chain directory as data (liboxidant.so) is an importer, not an ORT copy"
 },
 {
  "id": "ort-census.probe-terminator",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "(?:\\x00|\\Z)\")",
  "replace": "\")",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a path-shaped word is a __FILE__ path only when its NUL follows"
 },
 {
  "id": "ort-census.probe-cuda-ext",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "|inc|cu|cuh)",
  "replace": "|inc)",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "CUDA sources fingerprint an ORT build too"
 },
 {
  "id": "ort-census.probe-relative-dot",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "joined = \"|\".join(r or \".\" for r in roots)",
  "replace": "joined = \"|\".join(roots)",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a lone relative root must not print as '-', which means no fingerprint"
 },
 {
  "id": "ort-census.relative-dot",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    if [ -z \"${r}\" ] || [ \"${r}\" = . ]; then relative=1",
  "replace": "    if [ -z \"${r}\" ]; then relative=1",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "'.' is the probe's relative root"
 },
 {
  "id": "ort-census.probe-dlopen-res",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "for name in needed or ([\"libonnxruntime.so\"] if \"OrtGetApiBase\" in abi else []):",
  "replace": "for name in needed:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a dlopen-only importer is resolved too"
 },
 {
  "id": "native-gcc-san.scope",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "[ \"${HOST_TRIPLET}\" = \"${TARGET_TRIPLET}\" ]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "a Canadian with host != target must not ask for libsanitizer"
 },
 {
  "id": "native-gcc-san.build",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": " ${_gcc_san:+\"all-${_gcc_san}\"}",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the Canadian native must build libsanitizer"
 },
 {
  "id": "native-gcc-san.install",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": " ${_gcc_san:+\"install-${_gcc_san}\"}",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "built but never installed ships nothing"
 },
 {
  "id": "native-gcc-san.producer-assert",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "[ -z \"${_gcc_san}\" ] || _gcc_assert_sanitizer_installed",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the silent SANITIZER_SUPPORTED=no path must fail the GCC build, not ship green"
 },
 {
  "id": "native-gcc-san.hwasan-arch",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "amd64|arm64) libs+=(hwasan) ;;",
  "replace": "none) ;;",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "an arm64 image without libhwasan must fail"
 },
 {
  "id": "native-gcc-san.libdir",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": " || compgen -G \"${prefix}/lib/lib${lib}.so.*.*\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "riscv64 installs its runtime in lib/, which must pass"
 },
 {
  "id": "native-gcc-san.header-glob",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "\"${prefix}/lib/gcc/*/${GCC_VERSION}",
  "replace": "\"${prefix}/lib/gcc/${arch}/${GCC_VERSION}",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the header sits under the GCC triplet (Debian- or config.guess-shaped), not the OCI arch"
 },
 {
  "id": "native-gcc-san.elf",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": " else assert_elf_arch \"${hit%%$'\\n'*}\" \"${arch}\";",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "a builder-arch libasan in a target image must fail"
 },
 {
  "id": "native-gcc-san.wiring",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "    _assert_native_gcc_sanitizers \"/opt/gcc-${GCC_VERSION}\" \"${TARGET_ARCH}\"\n    echo \"Using host-native",
  "replace": "    echo \"Using host-native",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the host-native GCC (amd64, Jetson, X100 build hosts) must be checked too"
 },
 {
  "id": "native-gcc-san.cross-wiring",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "  fi\n  _assert_native_gcc_sanitizers \"/opt/gcc-${GCC_VERSION}\" \"${TARGET_ARCH}\"\n",
  "replace": "  fi\n",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the relocated Canadian GCC -- the arm64/riscv64 image's cc -- must be checked"
 },
 {
  "id": "native-gcc-san.smoke-fatal",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "    validate_fail \"gcc-sanitizers\"",
  "replace": "    echo \"gcc-sanitizers\"",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "a -fsanitize compile or link failure must fail the wrapper smoke"
 },
 {
  "id": "native-gcc-san.smoke-wiring",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  _smoke_optimization_level\n  _smoke_gcc_sanitizers\n",
  "replace": "  _smoke_optimization_level\n",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "validate_smoke must call the sanitizer smoke"
 },
 {
  "id": "native-gcc-san.native-only-run",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "if [ \"${target_arch}\" = \"$(smoke_host_arch)\" ]; then _san_run=1; fi",
  "replace": "if [ \"${target_arch}\" != \"$(smoke_host_arch)\" ]; then _san_run=1; fi",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "ASan must run natively only, never under qemu"
 },
 {
  "id": "native-gcc-san.core-libs",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "local -a libs=(asan ubsan lsan tsan)",
  "replace": "local -a libs=(asan)",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "libubsan, liblsan and libtsan are each required, not only libasan"
 },
 {
  "id": "native-gcc-san.smoke-flags",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "if g++ -O1 -fsanitize=address,undefined \"${d}/s.cpp\"",
  "replace": "if g++ -O1 \"${d}/s.cpp\"",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the wrapper smoke must compile and link with -fsanitize=address,undefined"
 },
 {
  "id": "native-gcc-san.smoke-program",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  printf '#include <sanitizer/common_interface_defs.h>\\nalignas(8) static char b[8];\\nint main(int c, char **) {\\n  __sanitizer_annotate_contiguous_container(b, b + 8, b + 8, b + 8);\\n  return (8 >> c) == 4 ? 0 : 1;\\n}\\n' > \"${d}/s.cpp\"",
  "replace": "  printf 'int main(){return 0;}\\n' > \"${d}/s.cpp\"",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the smoke TU must include the header the arm64 image lacked, and call UBSan"
 },
 {
  "id": "native-gcc-san.smoke-ubsan-call",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "return (8 >> c) == 4 ? 0 : 1;",
  "replace": "return (c << 3) == 8 ? 0 : 1;",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "a constant shift exponent makes no UBSan call under C++20, so an --as-needed link drops libubsan"
 },
 {
  "id": "native-gcc-san.battery-run-gate",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "if [ \"$SAN_RUN\" = 1 ]; then",
  "replace": "if [ \"$SAN_RUN\" = 0 ]; then",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the in-container RUN follows SAN_RUN: natively always, under qemu never"
 },
 {
  "id": "native-gcc-san.battery-run-report",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "report \"C++ sanitizer RUN (native)\" $?",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "a failing sanitized RUN must fail the battery"
 },
 {
  "id": "native-gcc-san.battery-flags",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "{ \"$cxx\" -O1 -fsanitize=address,undefined \"$d/s.cpp\"",
  "replace": "{ \"$cxx\" -O1 \"$d/s.cpp\"",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the battery must compile and link with -fsanitize=address,undefined"
 },
 {
  "id": "native-gcc-san.battery-header",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "printf \"#include <sanitizer/common_interface_defs.h>\\nalignas(8)",
  "replace": "printf \"alignas(8)",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the battery TU must include the header the arm64 image lacked"
 },
 {
  "id": "native-gcc-san.battery-ubsan-call",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "return (8>>c)==4?0:1;",
  "replace": "return (c<<3)==8?0:1;",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "a constant shift exponent makes no UBSan call under C++20, so an --as-needed link drops libubsan"
 },
 {
  "id": "native-gcc-san.battery-leaks",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "{ ASAN_OPTIONS=detect_leaks=0 \"$d/s\" 2>\"$d/e\"; }",
  "replace": "{ \"$d/s\" 2>\"$d/e\"; }",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the RUN must turn LSan off: it needs ptrace, which a container may not allow"
 },
 {
  "id": "native-gcc-san.libsubdir-wiring",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "    _link_runtime_into_libsubdir \"${triplet}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-swap-native-gcc-libsubdir.sh",
  "why": "the relocated riscv64 GCC must get the links, or a link without LIBRARY_PATH misses -lgcc_s_asneeded"
 },
 {
  "id": "native-gcc-san.libsubdir-target",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "ln -s \"../../../${f##*/}\"",
  "replace": "ln -s \"../../${f##*/}\"",
  "test": "bash linux/scripts/tests/test-swap-native-gcc-libsubdir.sh",
  "why": "libsubdir is three levels under lib/, so a shorter link dangles"
 },
 {
  "id": "native-gcc-san.libsubdir-skip-la",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "case \"${f}\" in *.la|*.py) continue ;; esac",
  "replace": "case \"${f}\" in *.py) continue ;; esac",
  "test": "bash linux/scripts/tests/test-swap-native-gcc-libsubdir.sh",
  "why": "libsubdir gets only what the driver and ld read, and a libtool archive is neither"
 },
 {
  "id": "native-gcc-san.libsubdir-files-only",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "[ -f \"${f}\" ] || continue",
  "replace": "[ -e \"${f}\" ] || continue",
  "test": "bash linux/scripts/tests/test-swap-native-gcc-libsubdir.sh",
  "why": "lib/gcc itself must not get a link inside its own subtree"
 },
 {
  "id": "native-gcc-san.libsubdir-keep",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "[ -e \"${libsubdir}/${f##*/}\" ] || ln -s",
  "replace": "ln -sf",
  "test": "bash linux/scripts/tests/test-swap-native-gcc-libsubdir.sh",
  "why": "libsubdir's own files must not be replaced by links into lib/"
 },
 {
  "id": "native-gcc-san.battery-bare-c",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "{ env -u LIBRARY_PATH \"$cc\"",
  "replace": "{ \"$cc\"",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "the image's LIBRARY_PATH hid riscv64's missing -lgcc_s_asneeded from every other C case"
 },
 {
  "id": "native-gcc-san.battery-bare-cxx",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "{ env -u LIBRARY_PATH \"$cxx\"",
  "replace": "{ \"$cxx\"",
  "test": "bash linux/scripts/tests/test-native-gcc-sanitizers.sh",
  "why": "a C++ link without LIBRARY_PATH must be proven too"
 },
 {
  "id": "native-gcc-ma.flag",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "if _gcc_is_canadian_native; then printf '%s' --enable-multiarch; fi",
  "replace": "if _gcc_is_canadian_native; then printf '%s' --disable-multiarch; fi",
  "test": "bash linux/scripts/tests/test-native-gcc-multiarch.sh",
  "why": "the Canadian native must ask for multiarch: --with-native-system-header-dir turned the auto-check off"
 },
 {
  "id": "native-gcc-ma.wired",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "    ${_gcc_ma:+\"${_gcc_ma}\"}\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-gcc-multiarch.sh",
  "why": "defined but not wired changes nothing"
 },
 {
  "id": "native-gcc-ma.swap-compare",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "[ \"${got}\" = \"${triplet}\" ] ||",
  "replace": "true ||",
  "test": "bash linux/scripts/tests/test-native-gcc-multiarch.sh",
  "why": "a relocated GCC without the image's multiarch must fail the swap"
 },
 {
  "id": "native-gcc-ma.swap-tolerance",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "if ! \"${gcc}\" -dumpversion >/dev/null 2>&1; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-native-gcc-multiarch.sh",
  "why": "a GCC this build host cannot run is noted, not failed, like the smoke"
 },
 {
  "id": "native-gcc-ma.swap-wiring",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "    _assert_native_gcc_multiarch \"/opt/gcc-${GCC_VERSION}/bin/gcc\" \"${triplet}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-gcc-multiarch.sh",
  "why": "a gate nothing invokes is not a gate"
 },
 {
  "id": "rust.web-lane-gate-machine",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    *\"${machine}\"*) ;;",
  "replace": "    *) ;;",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "the ELF machine check is what refuses an x86-64 (or any foreign) binary presented as the image's own arch"
 },
 {
  "id": "rust.web-lane-gate-readelf-fatal",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  command -v readelf >/dev/null 2>&1 || { _wlt_why \"readelf\" \"\" \"binutils on PATH\"; return 1; }",
  "replace": "  command -v readelf >/dev/null 2>&1 || return 0",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "platform.sh's assert_elf_arch WARNs and passes without readelf; this gate must refuse instead, or every check below it passes vacuously"
 },
 {
  "id": "rust.web-lane-gate-lp64d",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    *\"double-float ABI\"*) return 0 ;;",
  "replace": "    *) return 0 ;;",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a soft-float riscv64 binary cannot call the image's lp64d glibc; the e_flags check is the only thing that sees it"
 },
 {
  "id": "rust.web-lane-gate-interp",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  [ \"${interp}\" = \"${loader}\" ] || { _wlt_why \"PT_INTERP\" \"${interp}\" \"${loader}\"; return 1; }",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a musl or foreign interpreter execs nowhere in the image; PT_INTERP must be glibc's own loader"
 },
 {
  "id": "rust.web-lane-gate-needed-allowlist",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    case \" ${WLT_NEEDED_OK} ${loader##*/} \" in",
  "replace": "    case \" ${WLT_NEEDED_OK} ${loader##*/} ${so} \" in",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "NEEDED outside libc's family (libbz2 from the build host, libstdc++) is the host-library leak the vendored C env exists to prevent"
 },
 {
  "id": "rust.web-lane-gate-max-glibc",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    _wlt_gate_glibc \"${file}\" \"${ceiling}\" || return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a GLIBC_ symbol version above the image's glibc loads nowhere; the ceiling check is what bounds the sysroot"
 },
 {
  "id": "rust.web-lane-gate-version-exec",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    _wlt_gate_exec \"${tool}\" \"${file}\" \"${version}\" || return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "running --version is the one check that the bytes are the pinned tool and execute on this arch"
 },
 {
  "id": "rust.web-lane-key-rustc",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "\"${WLT_KEY_SCHEMA}\" \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"${WLT_C_ENV_KEY}\"",
  "replace": "\"${WLT_KEY_SCHEMA}\" \"$1\" \"$2\" \"$3\" \"\" \"$5\" \"${WLT_C_ENV_KEY}\"",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "without the rustc release in the key, a toolchain bump reuses binaries built by the old one, and pin skew goes unseen"
 },
 {
  "id": "rust.web-lane-sha",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    [ \"${got}\" = \"${want}\" ] || { _wlt_why \"sha256\" \"${got}\" \"${want:-a recorded sha256}\"; return 1; }",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a cache entry or cross artifact whose bytes differ from its manifest must never be installed"
 },
 {
  "id": "rust.web-lane-cache-stale-rejected",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  if [ \"$(_wlt_manifest_key_text \"${entry}/manifest\")\" != \"${keytext}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "an entry is trusted only for the exact key text it was stored under"
 },
 {
  "id": "rust.web-lane-cache-store-cleanup",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  rm -rf \"${tmp}\"\n  echo \"WARN: web-lane ${tool}: the cache store failed",
  "replace": "  echo \"WARN: web-lane ${tool}: the cache store failed",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a store that fails must leave nothing behind in the cachemount"
 },
 {
  "id": "rust.web-lane-cache-trim",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    if [ \"${n}\" -gt 3 ]; then rm -rf \"${d}\"; fi",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "the ids are fixed, so without the trim every pin bump grows the cachemount for good"
 },
 {
  "id": "rust.web-lane-cache-refresh-no-read",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  if [ \"${cache}\" = on ] \\",
  "replace": "  if [ \"${cache}\" != off ] \\",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "refresh is the only way past a good entry (RUNTIME_NO_CACHE does not empty a cachemount); it must not read"
 },
 {
  "id": "rust.web-lane-cache-off-no-write",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  if [ \"${cache}\" != off ]; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "off means the cache is neither read nor written"
 },
 {
  "id": "rust.web-lane-claimed-good-fatal",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    echo \"ERROR: web-lane ${tool}: the cross artifact claims status=ok, but ${_WLT_WHY}\" >&2\n    return 1",
  "replace": "    return 2",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "owner rule: a binary that claims to be good and fails integrity is a defect, fatal in auto as in cross, never a quiet fallback"
 },
 {
  "id": "rust.web-lane-cross-required",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  if [ \"$1\" = cross ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "WEB_LANE_TOOLS_SOURCE=cross exists to prove the cross path; an absent or failed artifact must stop it"
 },
 {
  "id": "rust.web-lane-native-ignores-artifact",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  if [ \"${mode}\" != native ]; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "the owner's native switch: WEB_LANE_TOOLS_SOURCE=native must never take the cross-built binary"
 },
 {
  "id": "rust.web-lane-knob-validated",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    auto|cross|native|legacy) ;;",
  "replace": "    *) ;;",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a typo'd WEB_LANE_TOOLS_SOURCE would silently mean auto; a bad knob must stop the build"
 },
 {
  "id": "rust.web-lane-producer-target-dir",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  CARGO_TARGET_DIR=\"$(mktemp -d \"${TMPDIR:-/tmp}/wlt-target.XXXXXX\")\" || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "cross-env.sh defaults CARGO_TARGET_DIR to /opt/cargo-target, which would land ~390 MB of target tree in the producer stage"
 },
 {
  "id": "rust.web-lane-producer-vendored-c",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  export CARGO_TARGET_DIR RUSTC_WRAPPER=\"\" CARGO_NET_RETRY=5\n  wlt_c_env",
  "replace": "  export CARGO_TARGET_DIR RUSTC_WRAPPER=\"\" CARGO_NET_RETRY=5",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "under PKG_CONFIG_ALLOW_CROSS bzip2-sys/lzma-sys link the build host's .so; the vendored static C is what keeps the cross link target-only"
 },
 {
  "id": "rust.web-lane-native-vendored-c",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    wlt_c_env\n    \"${CARGO_HOME:-/usr/local/cargo}/bin/cargo\" install --locked",
  "replace": "    \"${CARGO_HOME:-/usr/local/cargo}/bin/cargo\" install --locked",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "the native key claims the vendored C env; the build must actually have it"
 },
 {
  "id": "rust.web-lane-producer-skip-native-host",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  if [ \"${target}\" = \"${build}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "on a native build host (X100, Jetson) the target is the host's own arch: there is nothing to cross-build and auto must go native"
 },
 {
  "id": "rust.web-lane-producer-rustflags-drift",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  [ \"${RUSTFLAGS:-}\" = \"${want}\" ] || { _wlt_why \"RUSTFLAGS drift\" \"${RUSTFLAGS:-}\" \"${want}\"; return 1; }",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "the producer keys its output with the flags it really used; drift from wlt_rustflags would make every consumer key mismatch"
 },
 {
  "id": "rust.web-lane-rustflags-copy",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    riscv64) printf '%s' '-C target-feature=+v,+zvl128b' ;;",
  "replace": "    riscv64) printf '%s' '-C target-feature=+v' ;;",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "wlt_rustflags copies cross-env.sh's riscv64 RUSTFLAGS; the drift test must catch the two parting"
 },
 {
  "id": "rust.web-lane-producer-core-mounted",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    [ -f \"$1/${f}\" ] || { echo \"ERROR: web-lane producer: $1/${f} is not mounted\" >&2; return 1; }",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a missing per-file mount must fail android loudly, never degrade into a half-sourced cross env"
 },
 {
  "id": "rust.web-lane-producer-non-fatal",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "      _wlt_mark \"${out}/${triple}\" \"${tool}\" failed \"${_WLT_WHY:-unexpected error}\"",
  "replace": "      return 1",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a crates.io outage or a failed cross build records status=failed and leaves android green; the package stage decides"
 },
 {
  "id": "rust.web-lane-producer-mount-closure",
  "target": "linux/Dockerfile.android",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/cross-apt.sh,target=/tmp/wlt/01-core/cross-apt.sh,ro \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "android-sdk's /opt/scripts/core is an older 01-core; every file cross-env.sh sources must be mounted fresh"
 },
 {
  "id": "rust.web-lane-producer-copy-last",
  "target": "linux/Dockerfile.android",
  "find": "\nCOPY --link --from=web-lane-tools /opt/web-lane-tools /opt/web-lane-tools\n",
  "replace": "\n",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "final must carry the producer's output, and last: above the GCC swap it re-runs a prefix-sized copy"
 },
 {
  "id": "rust.web-lane-package-artifact-mount",
  "target": "linux/Dockerfile.package",
  "find": "    --mount=type=bind,from=web-lane-tools-src,source=/opt/web-lane-tools,target=/tmp/wlt/artifact,ro \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "without the artifact mount the package stage never sees the cross build and silently compiles under QEMU"
 },
 {
  "id": "rust.web-lane-switch-forwarded",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "_VERSION_BUILD_ARG_VARS+=(WEB_LANE_TOOLS_SOURCE WEB_LANE_TOOLS_CACHE WEB_LANE_TOOLS_CROSS_ARCHES)",
  "replace": "_VERSION_BUILD_ARG_VARS+=()",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "an exported WEB_LANE_TOOLS_SOURCE=native must reach BuildKit, or the owner's native switch is a no-op"
 },
 {
  "id": "rust.web-lane-legacy-dispatch",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  if [ \"${mode}\" = legacy ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "WEB_LANE_TOOLS_SOURCE=legacy is the owner's way back to the pre-2026-09-23 build; it must never reach the artifact, the cache or the gate"
 },
 {
  "id": "rust.web-lane-legacy-verbatim-env",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "_wlt_legacy() {  # <tool> <version>\n  if \"${CARGO_HOME:-/usr/local/cargo}/bin/cargo\" install",
  "replace": "_wlt_legacy() {  # <tool> <version>\n  wlt_c_env\n  if \"${CARGO_HOME:-/usr/local/cargo}/bin/cargo\" install",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "legacy runs cargo in the stage's own env, as before; a forced C env is the native leg, not the old one"
 },
 {
  "id": "rust.web-lane-legacy-non-fatal",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  echo \"WARN: cargo install $1 $2 failed; the web lane will build it per run\"\n  return 0",
  "replace": "  return 1",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "the old leg only WARNed on a failed cargo install; legacy must keep that trade"
 },
 {
  "id": "rust.web-lane-no-rustc-cross-fatal",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    if [ \"${mode}\" = cross ] && [ \"$(wlt_manifest_get \"${WLT_ARTIFACT_DIR}/${triple}/${tool}.manifest\" status)\" != skipped ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "cross exists to prove the artifact; with no rustc release there is no key to prove it by, so it must stop rather than quietly skip"
 },
 {
  "id": "rust.web-lane-no-rustc-skips",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    echo \"WARN: web-lane ${tool}: rustc -V reports no release; the web lane will build it per run\"\n    return 0",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "with no rustc release every key is wrong; auto must skip loudly, never build or install under an empty key"
 },
 {
  "id": "rust.web-lane-glibc-ceiling-fatal",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  ceiling=\"$(wlt_glibc_ceiling)\" || return 1",
  "replace": "  ceiling=\"$(wlt_glibc_ceiling)\" || true",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "an empty ceiling skips the GLIBC check inside the gate; an image whose glibc cannot be read must install nothing"
 },
 {
  "id": "rust.web-lane-gate-glibc-needs-present",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    _wlt_why \"GLIBC version needs\" \"\" \"at least one GLIBC_ entry\"\n    return 1",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a glibc-loader binary with no GLIBC_ version needs means readelf could not read it; the ceiling would pass vacuously"
 },
 {
  "id": "rust.web-lane-install-failure-fatal",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "    echo \"ERROR: web-lane ${tool}: install into ${CARGO_HOME:-/usr/local/cargo}/bin failed\" >&2\n    return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "a failed install must stop the stage, not print OK and write provenance for a binary that is not there"
 },
 {
  "id": "rust.web-lane-producer-timeout",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  timeout 1800 \"${CARGO_HOME:-/usr/local/cargo}/bin/cargo\" install --locked --root \"$4\" \\",
  "replace": "  \"${CARGO_HOME:-/usr/local/cargo}/bin/cargo\" install --locked --root \"$4\" \\",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "the producer adds a crates.io fetch to android; without the 30-minute bound a hung fetch stalls the whole stage"
 },
 {
  "id": "rust.web-lane-producer-build-arch",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  unset BUILDARCH BUILDPLATFORM   # the arch this RUN executes on, not the builder node's",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "android-sdk's ENV BUILDARCH names the builder node; on a Jetson building under QEMU that is not the arch the RUN executes on"
 },
 {
  "id": "rust.web-lane-producer-sysroot-ceiling",
  "target": "linux/scripts/06-packaging/web-lane-tools.sh",
  "find": "  ceiling=\"$(_wlt_sysroot_glibc \"${target}\")\"",
  "replace": "  ceiling=\"\"",
  "test": "bash linux/scripts/tests/test-web-lane-tools.sh",
  "why": "the producer bounds GLIBC by its cross sysroot, so a binary above it is recorded failed instead of cached and shipped"
 },
 {
  "id": "rust.web-lane-knob-validated-upfront",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    wlt_validate_knobs || return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "on amd64/arm64 the prebuilt usually succeeds and the from-source leg never runs; only the up-front check stops a typo'd switch there"
 },
 {
  "id": "ort-census.probe-defines",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "    if \"OrtGetApiBase\" in abi and elf_defines(mm, b\"OrtGetApiBase\"):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a renamed ORT with its fingerprints stripped is still found by the OrtGetApiBase it defines"
 },
 {
  "id": "ort-census.probe-defines-instance",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "roots) or defines",
  "replace": "roots)",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a file that defines OrtGetApiBase is an ORT instance graded by its bytes, never an importer"
 },
 {
  "id": "ort-census.probe-defines-undef",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "if struct.unpack_from(end + \"H\", mm, at + shndx)[0] and ",
  "replace": "if ",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an undefined (imported) OrtGetApiBase is a reference, not a definition"
 },
 {
  "id": "ort-census.probe-gnu-hash",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "    if gnu is not None:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the definition is looked up through DT_GNU_HASH, as ld.so does"
 },
 {
  "id": "ort-census.probe-sysv-hash",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "    elif sysv is not None:",
  "replace": "    elif False:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an ELF with only a DT_HASH table is looked up too"
 },
 {
  "id": "ort-census.unproven-def",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  elif [ \"${3:-}\" = def ]; then printf 'UNPROVEN",
  "replace": "  elif [ \"${3:-}\" = def ]; then : 'UNPROVEN",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an unfingerprinted ORT under another name must fail, and say why"
 },
 {
  "id": "mutations.verdicts-stream",
  "target": "docs/scripts/verify_mutations.py",
  "find": "            stream.flush()",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "Python block-buffers a piped stdout: unflushed, a job killed at its timeout loses every verdict it had reached, header included (2026-09-23)"
 },
 {
  "id": "mutations.verdicts-tagged",
  "target": "docs/scripts/verify_mutations.py",
  "find": "stream.write(getattr(self._cur, \"tag\", \"\") + text)",
  "replace": "stream.write(text)",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "streamed verdicts arrive in completion order; the shard tag is what says which mirror proved a line"
 },
 {
  "id": "mutations.shard-slices-partition",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    return entries[k::n]",
  "replace": "    return entries[k::max(n - 1, 1)]",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "N CI jobs prove the manifest only if their slices partition it: an overlap proves entries twice and a gap never proves them"
 },
 {
  "id": "mutations.shard-spec-checked",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if not 0 <= k < n:",
  "replace": "    if n == 0:",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "a K outside 0..N-1 selects nothing or the wrong slice, and reads as a green job"
 },
 {
  "id": "mutations.ci-shard-passed-through",
  "target": "linux/scripts/preflight.sh",
  "find": " \\\n  ${PREFLIGHT_MUTATION_SHARD:+--shard \"${PREFLIGHT_MUTATION_SHARD}\"}",
  "replace": "",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "without the pass-through every CI mutations job proves the WHOLE manifest, eight times over, into the timeout the split exists to avoid"
 },
 {
  "id": "mutations.ci-costs-passed-through",
  "target": "linux/scripts/preflight.sh",
  "find": " \\\n  ${PREFLIGHT_MUTATION_COSTS:+--shard-costs \"${PREFLIGHT_MUTATION_COSTS}\"}",
  "replace": "",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "without the pass-through the CI jobs plan nothing and prove the round-robin slices, paying every baseline once per shard"
 },
 {
  "id": "mutations.ci-plans-from-the-table",
  "target": ".github/workflows/linux-x64.yml",
  "find": " PREFLIGHT_MUTATION_COSTS=docs/scripts/mutation-costs.json bash linux/scripts/preflight.sh",
  "replace": " bash linux/scripts/preflight.sh",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "the mutations jobs must name the checked-in cost table, or the hub falls back to the round-robin split"
 },
 {
  "id": "mutations.ci-shards-cover-the-manifest",
  "target": ".github/workflows/linux-x64.yml",
  "find": "        shard: [0, 1, 2, 3, 4, 5, 6, 7, 8]",
  "replace": "        shard: [0, 1, 2, 3, 4, 5, 6, 7]",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "a matrix that stops short of N-1 leaves a ninth of the manifest proven by nobody, green"
 },
 {
  "id": "mutations.ci-preflight-skips-the-slug",
  "target": ".github/workflows/linux-x64.yml",
  "find": "run: PREFLIGHT_SKIP=mutations bash linux/scripts/preflight.sh",
  "replace": "run: bash linux/scripts/preflight.sh",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "the whole gate inside the preflight job is what hit its 45-minute timeout on 2026-09-23"
 },
 {
  "id": "mutations.ci-same-setup",
  "target": ".github/workflows/linux-x64.yml",
  "find": "      - name: Install pytest (mutation-gate baselines)\n        run: pip install --quiet pytest\n      - name: Install PyYAML (renovate_audit.py's real YAML parser)\n        run: pip install --quiet pyyaml\n      - name: Mutation gate,",
  "replace": "      - name: Mutation gate,",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k callsites",
  "why": "without pytest and PyYAML the baselines fail unmutated and every entry under them reads vacuous (2026-09-07)"
 },
 {
  "id": "linux-lane.hub-develop-running-proof-survives",
  "target": ".github/workflows/linux-x64.yml",
  "find": "  cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}",
  "replace": "  cancel-in-progress: true",
  "test": "bash linux/scripts/tests/test-linux-x64-concurrency.sh",
  "why": "a newer develop push must not cancel a nearly complete preflight and eight mutation shards before they produce a verdict"
 },
 {
  "id": "critical-fixes.summary-reaches-exit",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "done\n\nsmoke_summary",
  "replace": "done\n\necho \"=== Results: ${FAILURES} failure(s) ===\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "every row runs an EXTRACTED fix, so only the real-gate Cargo case reaches the gate's own summary; a gate that prints its FAILs and exits 0 is green in preflight"
 },
 {
  "id": "wheels-source.unknown-value",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "      return 2\n      ;;",
  "replace": "      return 0\n      ;;",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "a typo'd RUNTIME_WHEELS_SOURCE must be a usage error, not an empty mode that runs"
 },
 {
  "id": "wheels-source.setup-refuses",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  RUNTIME_WHEELS_MODE=\"$(runtime_wheels_source_mode)\" || return 2",
  "replace": "  RUNTIME_WHEELS_MODE=\"$(runtime_wheels_source_mode)\" || true",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "the lanes' setup must stop on an unknown value before any build"
 },
 {
  "id": "wheels-source.chain-checks-first",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  runtime_wheels_source_mode >/dev/null || exit 2",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "the chain must refuse a typo at its start, not at the runtime lane hours later"
 },
 {
  "id": "wheels-source.manifest-lane-setup",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "  runtime_wheels_setup || exit $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "without setup the knob is never resolved and export mode silently runs as image"
 },
 {
  "id": "wheels-source.artifacts-lane-setup",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "  runtime_wheels_setup || exit $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "the artifacts lane must resolve the knob the same way the manifest lane does"
 },
 {
  "id": "wheels-source.manifest-lane-loop",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "run_parallel_arch_loop runtime_wheels_arch_chain ",
  "replace": "run_parallel_arch_loop runtime_build_chain ",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "looping runtime_build_chain directly would never stage the wheelhouse"
 },
 {
  "id": "wheels-source.no-fallback",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "    runtime_wheels_wrapper_args _awba_out \"${arch}\" || return 1",
  "replace": "    _append_wheels_image_args _awba_out \"${arch}\" || return 1",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "in export mode the wrapper must mount the staged directory, never fall back to the android image"
 },
 {
  "id": "wheels-source.export-build-rc",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "    . || return 1\n  _runtime_wheels_seal \"${arch}\" \"${ref}\"",
  "replace": "    . || true\n  _runtime_wheels_seal \"${arch}\" \"${ref}\"",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "a failed export build must fail the arch even when it left wheels on disk"
 },
 {
  "id": "wheels-source.failed-export-stops-chain",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  if [ \"${rc}\" -eq 0 ]; then\n    runtime_build_chain \"$@\" || rc=$?",
  "replace": "  if true; then\n    runtime_build_chain \"$@\" || rc=$?",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "no base, package or wrapper may build after the export failed"
 },
 {
  "id": "wheels-source.empty-export",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  if ! compgen -G \"${dir}/opt/wheels/*.whl\" >/dev/null; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "an export that produced no wheel must stop at the export, naming the directory and the image"
 },
 {
  "id": "wheels-source.wrapper-reverify",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  if [ ! -s \"${dir}.sha256\" ] || ! _runtime_wheels_manifest \"${dir}/opt\" 2>/dev/null | cmp -s - \"${dir}.sha256\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "a wheelhouse changed, added to or unsealed between export and wrapper must not be mounted"
 },
 {
  "id": "wheels-source.layout-identity",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  if [ -z \"${have}\" ] || [ \"${have}\" != \"${want}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "under ARTIFACT_CONTEXT_ROOT the export may read the android layout only when it IS the image image mode mounts"
 },
 {
  "id": "wheels-source.same-image",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  ref=\"$(runtime_wheels_image_ref \"${arch}\")\"",
  "replace": "  ref=\"$(runtime_artifact_image_ref \"${arch}\")\"",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "the export must read the ref image mode mounts, not the package's ARTIFACT_IMAGE"
 },
 {
  "id": "wheels-source.discard",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "    rm -rf \"${RUNTIME_WHEELS_EXPORT_ROOT:?}/$1\" \"${RUNTIME_WHEELS_EXPORT_ROOT:?}/$1.sha256\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "each arch's staged wheelhouse must be removed after its wrapper"
 },
 {
  "id": "wheels-source.pull-parity",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  runtime_pushes_intermediate_images || pull=\"--pull=false\"",
  "replace": "  pull=\"--pull=false\"",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "the export must resolve its image with the same pull policy as the wrapper build it replaces"
 },
 {
  "id": "wheels-source.timed-rc",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  log \"[runtime-timing] arch=${arch} step=${step} secs=$(( $(date +%s) - t0 )) rc=${rc}\"\n  return \"${rc}\"",
  "replace": "  log \"[runtime-timing] arch=${arch} step=${step} secs=$(( $(date +%s) - t0 )) rc=${rc}\"\n  return 0",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "the timing wrapper must not turn a failed runtime step into success"
 },
 {
  "id": "wheels-source.export-stage-source",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --link --from=wheels-source /opt/wheels /opt/wheels",
  "replace": "COPY --link --from=torch /opt/wheels /opt/wheels",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "wheels-export must copy the one stage the torch RUN mounts in image mode"
 },
 {
  "id": "wheels-source.torch-run-stamp",
  "target": "linux/Dockerfile.torch",
  "find": "    echo \"[torch-run] start epoch=$(date -u +%s) arch=${TARGETARCH}\"; \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "the torch RUN's start stamp is how a lane log splits the wait before the RUN from the work in it"
 },
 {
  "id": "wheels-source.in-run-never-fatal",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "digest=\"$( (wheelhouse_manifest \"${d}\" | sha256sum) 2>/dev/null || true)\"",
  "replace": "digest=\"$( (wheelhouse_manifest \"${d}\" | sha256sum) 2>/dev/null)\"",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "the wheelhouse line is diagnostics; under set -Eeuo pipefail it must never kill the torch RUN"
 },
 {
  "id": "wheels-source.in-run-digest-agrees",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "(wheelhouse_manifest \"${d}\" | sha256sum)",
  "replace": "(wheelhouse_manifest \"${d}\" | sed -n '1p' | sha256sum)",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "the in-RUN digest must equal the host's [wheels] digest, or the A/B cannot compare the two modes"
 },
 {
  "id": "wheels-source.in-run-marks",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  cleanup_wheelhouse\n  _stv_mark cleanup_wheelhouse",
  "replace": "  cleanup_wheelhouse",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "every torch-venv step is timed, the last one included"
 },
 {
  "id": "wheels-source.timed-steps",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  _runtime_timed wrapper \"${arch}\" runtime_build_wrapper_image \"${arch}\" || return 1",
  "replace": "  runtime_build_wrapper_image \"${arch}\" || return 1",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "every runtime-lane step prints its [runtime-timing] line; the wrapper's is one the A/B measures"
 },
 {
  "id": "wheels-source.nopush-published-ref",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  ref=\"$(runtime_wheels_image_ref \"${arch}\")\"\n  if is_dry_run; then",
  "replace": "  ref=\"$(runtime_wheels_image_ref \"${arch}\")\"\n  ! runtime_use_local_artifact_context || ref=\"$(cross_android_tag \"${arch}\")\"\n  if is_dry_run; then",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "on a --no-push chain whose android tag is published the export must refuse, not quietly read another android than image mode; switching its ref is an owner decision"
 },
 {
  "id": "hailo.carrier-home",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "      HOME=\"${carrier}\" cmake \"$@\" || rc=$?",
  "replace": "      cmake \"$@\" || rc=$?",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the carrier reaches the nested build only through the configure's HOME; without it carry is the uncached build"
 },
 {
  "id": "hailo.carrier-exported-only",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  compgen -e | grep -E -e '^(SCCACHE_",
  "replace": "  compgen -v | grep -E -e '^(SCCACHE_",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "only EXPORTED cache variables cross: compiler-cache.sh's unexported 10G default must not become the nested server's cap"
 },
 {
  "id": "hailo.carrier-server-address",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "'^(SCCACHE_[A-Z0-9_]+|CCACHE_",
  "replace": "'^(SCCACHE_DIR|CCACHE_",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the sccache server address must cross env -i, or the nested clients reach no server of this RUN"
 },
 {
  "id": "hailo.carrier-login-file",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "    [ -z \"${login}\" ] || printf '. %q\\n' \"${login}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the nested bash -l still runs the real HOME's login file, as it did before the carrier"
 },
 {
  "id": "hailo.carrier-mirror",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "    [ \"${name}\" = .bash_profile ] || ln -s \"${entry}\" \"${dir}/${name}\" || return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the configure reads the real HOME through the carrier (git config, the CMake package registry)"
 },
 {
  "id": "hailo.carrier-cache-bin",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "    printf 'export PATH=%q:\"${PATH}\"\\n' \"${dir}/.hailo-cache-bin\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the nested client must be the server's own sccache; the clean PATH finds the distro 0.13 first"
 },
 {
  "id": "hailo.channel-guard",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  if grep -Fq -e \"${_HAILO_CLEAN_ENV_CHANNEL}\" \"$1\" 2>/dev/null; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "a HailoRT bump that changes the clean-env channel must stop a carry build, not lose the cache silently"
 },
 {
  "id": "hailo.gate-bypass",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  if [ $((2 * req)) -lt \"${objs}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "a nested build that bypassed the cache (1 request for 200 objects, the as-is number) must fail carry mode"
 },
 {
  "id": "hailo.gate-moved-build",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  if [ -z \"${objs}\" ] || [ \"${objs}\" -eq 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "a nested build that left no .ninja_log moved upstream; the gate must fail instead of passing on nothing"
 },
 {
  "id": "hailo.gate-off-warns",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  if [ \"${mode}\" = off ]; then\n    _hailo_warn \"HAILO_NESTED_CACHE=off",
  "replace": "  if false; then\n    _hailo_warn \"HAILO_NESTED_CACHE=off",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "HAILO_NESTED_CACHE=off is the build before 2026-09-24: the gate reports it and never fails it"
 },
 {
  "id": "hailo.counters-anchored",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "        /^Compile requests[[:space:]]+[0-9]+[[:space:]]*$/ { r = $NF }",
  "replace": "        /^Compile requests/ { r = $NF }",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "sccache also prints 'Compile requests executed'; an unanchored match reads that line instead"
 },
 {
  "id": "hailo.pyext-pyinit",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "       | awk '$4 == \"FUNC\" && $7 != \"UND\" && $8 == \"PyInit__pyhailort\" { f = 1 } END { exit !f }'; then",
  "replace": "       | awk '{ f = 1 } END { exit !f }'; then",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the stub every image shipped exports no PyInit__pyhailort; a check that accepts any symbol table lets it ship again"
 },
 {
  "id": "hailo.pyext-machine",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  if [ \"${machine}\" != \"${want}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "a module built for another arch fails the build"
 },
 {
  "id": "hailo.ipo-patch",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  sed -i -E \"s/^([[:space:]]*set\\(CMAKE_INTERPROCEDURAL_OPTIMIZATION) ${from}\\)/\\1 ${to})/\" \"${file}\" || return 1",
  "replace": "  true",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "upstream's forced IPO makes GCC emit slim LTO objects that lld links into an empty module"
 },
 {
  "id": "hailo.ipo-upstream-restores",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  if [ \"${mode}\" = upstream ]; then from=FALSE; to=TRUE; fi",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "HAILO_PYHAILORT_IPO=upstream restores upstream's line in the cached source, or the switch back does nothing"
 },
 {
  "id": "hailo.pyext-upstream-warns",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  if [ \"$3\" = upstream ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "HAILO_PYHAILORT_IPO=upstream is the build before 2026-09-24, stub included: it warns and never fails"
 },
 {
  "id": "hailo.knob-nested-values",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "    carry|off) printf '%s' \"${HAILO_NESTED_CACHE:-carry}\" ;;",
  "replace": "    *) printf '%s' \"${HAILO_NESTED_CACHE:-carry}\" ;;",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "a typo'd HAILO_NESTED_CACHE is rc 2, never a third mode"
 },
 {
  "id": "hailo.knob-ipo-values",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "    off|upstream) printf '%s' \"${HAILO_PYHAILORT_IPO:-off}\" ;;",
  "replace": "    *) printf '%s' \"${HAILO_PYHAILORT_IPO:-off}\" ;;",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "a typo'd HAILO_PYHAILORT_IPO is rc 2, never a third mode"
 },
 {
  "id": "hailo.cap-parity",
  "target": "linux/Dockerfile.torch",
  "find": "        SCCACHE_CACHE_SIZE=30G CCACHE_MAXSIZE=30G \\",
  "replace": "        CCACHE_MAXSIZE=30G \\",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "without base's cap the Hailo RUN's sccache server runs at compiler-cache.sh's 10G and trims the shared mount"
 },
 {
  "id": "hailo.dockerfile-default",
  "target": "linux/Dockerfile.torch",
  "find": "ARG HAILO_NESTED_CACHE=carry",
  "replace": "ARG HAILO_NESTED_CACHE=off",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the chain's default is the Dockerfile ARG; it must be the library's default"
 },
 {
  "id": "hailo.forwarded",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "_VERSION_BUILD_ARG_VARS+=(HAILO_NESTED_CACHE HAILO_PYHAILORT_IPO)",
  "replace": "",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "an exported switch reaches the wrapper build only through the forwarded set"
 },
 {
  "id": "hailo.chain-start-check",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  runtime_wheels_source_mode >/dev/null || exit 2\n  hailo_validate_knobs || exit 2",
  "replace": "  runtime_wheels_source_mode >/dev/null || exit 2",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "a typo'd switch stops the chain before its first stage, not at the wrapper hours later"
 },
 {
  "id": "hailo.manifest-lane-check",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "  runtime_wheels_setup || exit $?\n  hailo_validate_knobs || exit 2",
  "replace": "  runtime_wheels_setup || exit $?",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the standalone runtime lane checks the switches before its first build too"
 },
 {
  "id": "hailo.artifacts-lane-check",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "  runtime_wheels_setup || exit $?\n  hailo_validate_knobs || exit 2",
  "replace": "  runtime_wheels_setup || exit $?",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the artifacts lane checks the switches before its first build too"
 },
 {
  "id": "hailo.script-validates",
  "target": "linux/scripts/03-media/build/hailo/build-hailort.sh",
  "find": "esac\nhailo_validate_knobs || exit 2\n",
  "replace": "esac\n",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "build-hailort.sh stops on a typo with rc 2 before it fetches or builds anything"
 },
 {
  "id": "hailo.configure-through-carrier",
  "target": "linux/scripts/03-media/build/hailo/build-hailort.sh",
  "find": "    hailo_nested_configure hailort-configure \"${HAILORT_SRC}/hailort/external/protobuf-build\" \\\n      \"${HAILORT_SRC}/hailort/cmake/execute_cmake.cmake\" \\\n      -S \"${HAILORT_SRC}\"",
  "replace": "    cmake -S \"${HAILORT_SRC}\"",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "a bare configure bypasses the carrier and its gate: the nested protobuf build is uncached again"
 },
 {
  "id": "hailo.pyhailort-parallel",
  "target": "linux/scripts/03-media/build/hailo/build-hailort.sh",
  "find": "  CMAKE_BUILD_PARALLEL_LEVEL=\"$(compute_cpp_heavy_jobs \"\")\" \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "twelve -O3 pybind11 TUs at ninja's nproc can exhaust memory under QEMU; they take the heavy-C++ cap"
 },
 {
  "id": "hailo.ipo-applied",
  "target": "linux/scripts/03-media/build/hailo/build-hailort.sh",
  "find": "  hailo_pyhailort_ipo \"${ipo}\" \"${platform_dir}/../src/CMakeLists.txt\" \\\n    || die \"pyhailort: cannot apply HAILO_PYHAILORT_IPO=${ipo}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the build applies HAILO_PYHAILORT_IPO to the cached source before every wheel build"
 },
 {
  "id": "hailo.wheel-checked",
  "target": "linux/scripts/03-media/build/hailo/build-hailort.sh",
  "find": "    hailo_check_pyext \"${w}\" \"${TARGET_ARCH:-amd64}\" \"${ipo}\" \\\n",
  "replace": "    true \"${w}\" \"${TARGET_ARCH:-amd64}\" \"${ipo}\" \\\n",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the built wheel's module is checked before it is installed or staged"
 },
 {
  "id": "hailo.installed-module-checked",
  "target": "linux/scripts/03-media/build/hailo/build-hailort.sh",
  "find": "    hailo_check_pyext \"${so:-/opt/venv/<no _pyhailort*.so>}\" \"${TARGET_ARCH:-amd64}\" \"${ipo}\" \\\n",
  "replace": "    true \"${so:-/opt/venv/<no _pyhailort*.so>}\" \"${TARGET_ARCH:-amd64}\" \"${ipo}\" \\\n",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the module installed into /opt/venv is the shipped byte; checking only the wheel lets a broken install ship"
 },
 {
  "id": "hailo.off-keeps-home",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  else\n    cmake \"$@\" || rc=$?\n  fi",
  "replace": "  else\n    HOME=/nonexistent-home cmake \"$@\" || rc=$?\n  fi",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "off, and carry without a launcher, run the configure with the caller's HOME, as before 2026-09-24"
 },
 {
  "id": "hailo.no-launcher-no-carrier",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  if [ \"${mode}\" = carry ] && [ -n \"${launcher}\" ]; then",
  "replace": "  if [ \"${mode}\" = carry ]; then",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "with no launcher there is nothing to carry: the configure keeps the caller's HOME"
 },
 {
  "id": "hailo.carrier-login-first",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "    [ -z \"${login}\" ] || printf '. %q\\n' \"${login}\"\n    # shellcheck disable=SC2016  # ${PATH} is the nested shell's\n    printf 'export PATH=%q:\"${PATH}\"\\n' \"${dir}/.hailo-cache-bin\"\n    while IFS= read -r v; do printf 'export %s=%q\\n' \"${v}\" \"${!v}\"; done < <(hailo_cache_env_names)\n",
  "replace": "    # shellcheck disable=SC2016  # ${PATH} is the nested shell's\n    printf 'export PATH=%q:\"${PATH}\"\\n' \"${dir}/.hailo-cache-bin\"\n    while IFS= read -r v; do printf 'export %s=%q\\n' \"${v}\" \"${!v}\"; done < <(hailo_cache_env_names)\n    [ -z \"${login}\" ] || printf '. %q\\n' \"${login}\"\n",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "the carrier's exports come after the real login file, so a login file that sets PATH or a cache variable cannot undo them"
 },
 {
  "id": "hailo.install-failure-fatal",
  "target": "linux/scripts/03-media/build/hailo/build-hailort.sh",
  "find": "    [ \"${ipo}\" = upstream ] \\\n      || die \"pyhailort: installing $(basename \"${wheel}\") into /opt/venv failed",
  "replace": "    [ \"${ipo}\" = upstream ] \\\n      || warn \"pyhailort: installing $(basename \"${wheel}\") into /opt/venv failed",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "under HAILO_PYHAILORT_IPO=off a failed install stops the build; a warning would ship /opt/venv without a checked module"
 },
 {
  "id": "hailo.install-no-wheel-fatal",
  "target": "linux/scripts/03-media/build/hailo/build-hailort.sh",
  "find": "    [ \"${ipo}\" = upstream ] || die \"pyhailort: no hailort-*.whl in",
  "replace": "    [ \"${ipo}\" = upstream ] || warn \"pyhailort: no hailort-*.whl in",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "under HAILO_PYHAILORT_IPO=off no wheel to install stops the build instead of shipping /opt/venv without pyhailort"
 },
 {
  "id": "hailo.install-no-wheel-guard",
  "target": "linux/scripts/03-media/build/hailo/build-hailort.sh",
  "find": "hailort-*.whl 2>/dev/null | head -1 || true)\"",
  "replace": "hailort-*.whl 2>/dev/null | head -1)\"",
  "test": "bash linux/scripts/tests/test-hailo-build.sh",
  "why": "an unguarded ls | head under pipefail turns 'no wheel' into errexit's silent rc 2 (shell-safety class 2)"
 },
 {
  "id": "cmake-arch.cetcompat-unconditional",
  "target": "cmake/Hardening.cmake",
  "find": "    if(NOT\n       CMAKE_SYSTEM_PROCESSOR\n       MATCHES\n       \"^([Aa][Rr][Mm]64|aarch64)$\")\n      list(APPEND NEW_LINK_OPTIONS /CETCOMPAT)\n    endif()\n",
  "replace": "    list(APPEND NEW_LINK_OPTIONS /CETCOMPAT)\n",
  "test": "bash linux/scripts/tests/test-cmake-windows-arch.sh",
  "why": "an ARM64 cross build links with /CETCOMPAT, which the ARM64 linker refuses"
 },
 {
  "id": "cmake-arch.cetcompat-dropped-on-x64",
  "target": "cmake/Hardening.cmake",
  "find": "      list(APPEND NEW_LINK_OPTIONS /CETCOMPAT)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cmake-windows-arch.sh",
  "why": "x64 binaries silently lose CET shadow-stack compatibility"
 },
 {
  "id": "cmake-arch.cetcompat-arm64-spellings",
  "target": "cmake/Hardening.cmake",
  "find": "\"^([Aa][Rr][Mm]64|aarch64)$\"",
  "replace": "\"^ARM64$\"",
  "test": "bash linux/scripts/tests/test-cmake-windows-arch.sh",
  "why": "a host that spells its processor arm64 or aarch64 would get /CETCOMPAT"
 },
 {
  "id": "cmake-arch.arm64-runtime-keeps-arm64ec",
  "target": "cmake/CPackCommon.cmake",
  "find": "  list(\n    FILTER\n    _libs\n    EXCLUDE\n    REGEX\n    \"[/\\\\\\\\]vcruntime[0-9]+_1\\\\.dll$\")\n",
  "replace": "  list(FILTER _libs EXCLUDE REGEX \"^$\")\n",
  "test": "bash linux/scripts/tests/test-cmake-windows-arch.sh",
  "why": "an arm64 package ships the ARM64EC (x64-machine) vcruntime140_1.dll and the cross lane's arch gate fails it"
 },
 {
  "id": "cmake-arch.package-dlls-installed",
  "target": "cmake/CPackCommon.cmake",
  "find": "    install(\n      DIRECTORY \"${KATAGLYPHIS_PACKAGE_DLL_DIR}/\"\n      DESTINATION bin\n      FILES_MATCHING\n      PATTERN \"*.dll\")\n",
  "replace": "    message(STATUS \"package DLLs: ${KATAGLYPHIS_PACKAGE_DLL_DIR}\")\n",
  "test": "bash linux/scripts/tests/test-cmake-windows-arch.sh",
  "why": "the staged DLL closure never reaches a package, so an MSI or ZIP misses the media stack on a clean machine"
 },
 {
  "id": "cmake-arch.package-dlls-only-dlls",
  "target": "cmake/CPackCommon.cmake",
  "find": "      FILES_MATCHING\n      PATTERN \"*.dll\")\n",
  "replace": "      )\n",
  "test": "bash linux/scripts/tests/test-cmake-windows-arch.sh",
  "why": "whatever else sits in the staging directory (a closure log) ships in every package"
 },
 {
  "id": "tvm-llvm.native-takes-shipped-package",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "    [ -n \"$llvm_dir\" ] || llvm_dir=\"$(detect_native_llvm_cmake_dir)\"\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-tvm-llvm-resolve.sh",
  "why": "a native TVM links llvm-config's apt bootstrap again, which the image does not carry, so its compiler library cannot load (BACKLOG CON35)"
 },
 {
  "id": "tvm-llvm.native-lib-dir",
  "target": "linux/scripts/05-frameworks/tvm-detect.sh",
  "find": "for dir in \"${1:-/opt/llvm-target}/lib/cmake/llvm\" \"${1:-/opt/llvm-target}/lib64/cmake/llvm\"; do",
  "replace": "for dir in \"${1:-/opt/llvm-target}/lib64/cmake/llvm\"; do",
  "test": "bash linux/scripts/tests/test-tvm-llvm-resolve.sh",
  "why": "the shipped tree keeps its package under lib/cmake/llvm, so a native build falls back to llvm-config"
 },
 {
  "id": "vulkan.loader-wsi-on",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "        -DBUILD_WSI_XCB_SUPPORT=ON \\\n        -DBUILD_WSI_XLIB_SUPPORT=ON \\\n",
  "replace": "        -DBUILD_WSI_XCB_SUPPORT=OFF \\\n        -DBUILD_WSI_XLIB_SUPPORT=OFF \\\n",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "CON41: the arm64/riscv64 loader was cross-built with WSI OFF, so it listed no X11 surface extension and every windowed Vulkan test aborted there while amd64's LunarG loader drove llvmpipe under xvfb-run"
 },
 {
  "id": "vulkan.loader-wsi-exports-checked",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "      if [ -n \"${_wsi_missing}\" ]; then",
  "replace": "      if false; then",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "CON41: a loader that configured and installed but exports no vkCreate{Xcb,Xlib,Wayland}SurfaceKHR must fail the REQUIRED verdict at build time, not ship and abort a consumer's windowed tests"
 },
 {
  "id": "vulkan.loader-wsi-reads-every-symbol",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "    grep -qw -- \"${s}\" <<<\"${syms}\" || missing=\"${missing} ${s}\"",
  "replace": "    grep -q -- \"vkCreate\" <<<\"${syms}\" || missing=\"${missing} ${s}\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "any vkCreate* export (vkCreateInstance is always there) must not stand in for the three surface entry points"
 },
 {
  "id": "probe.vulkan-wsi-verdict-wired",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      _vk_wsi_verdict \"${_vk_out}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "CON41: the WSI verdict is unreachable unless check_vulkan_loader calls it, and then a WSI-less loader ships green on every arch again"
 },
 {
  "id": "probe.vulkan-wsi-required-set",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_VK_WSI_REQUIRED=\"VK_KHR_surface VK_KHR_xcb_surface VK_KHR_xlib_surface VK_KHR_wayland_surface\"",
  "replace": "_VK_WSI_REQUIRED=\"VK_KHR_surface\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "VK_KHR_surface alone is exactly what the WSI-less arm64/riscv64 loader listed; the platform surfaces are the assertion"
 },
 {
  "id": "probe.vulkan-wsi-empty-list-fails",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    fail \"the ${2} Vulkan loader listed no instance extensions, so its window-system support is unproven\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a probe that printed no VKEXT line must not pass vacuously"
 },
 {
  "id": "probe.vulkan-wsi-whole-word",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    case \" ${exts} \" in *\" ${e} \"*) ;; *) missing=\"${missing} ${e}\" ;; esac",
  "replace": "    case \" ${exts} \" in *\" ${e}\"*) ;; *) missing=\"${missing} ${e}\" ;; esac",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "VK_KHR_surface_maintenance1 is listed by every loader, WSI or not; a prefix match would accept it as VK_KHR_surface"
 },
 {
  "id": "python.uv-request-gil-suffix",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "then printf '%s+gil' \"$1\";",
  "replace": "then printf '%s' \"$1\";",
  "test": "bash linux/scripts/tests/test-uv-python-request.sh",
  "why": "a bare 3.14 must not let uv pick a cached free-threaded build (CON40)"
 },
 {
  "id": "python.uv-request-venv-uses-request",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    uv_args+=(\"--python=$(uv_python_request \"$python_version\")\")",
  "replace": "    uv_args+=(\"--python=$python_version\")",
  "test": "bash linux/scripts/tests/test-uv-python-request.sh",
  "why": "uv_venv_create must hand uv the GIL request, not the bare version (CON40)"
 },
 {
  "id": "python.uv-request-keeps-t",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    exe_ver=\"${req_version}\"",
  "replace": "    exe_ver=\"${req_version%t}\"",
  "test": "bash linux/scripts/tests/test-uv-python-request.sh",
  "why": "python3.14 must not satisfy a 3.14t request (CON40)"
 },
 {
  "id": "packaging.clang-cfg-beside-every-link",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "find -L \"${link_dirs[@]}\" -maxdepth 1 -samefile \"${real}\" -printf '%h\\n' 2>/dev/null || true;",
  "replace": "true;",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "clang-tidy reaches clang through /usr/bin, so the cfg pair must sit there too (CON39)"
 },
 {
  "id": "packaging.legacy-rt-link",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "        ln -sfn \"../${triple}/${src}\" \"${resdir}/lib/linux/libclang_rt.${rt}-${arch}.a\"",
  "replace": "        :",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "atheris probes lib/linux/libclang_rt.fuzzer_no_main-<arch>.a only (CON38)"
 },
 {
  "id": "packaging.legacy-rt-suffixed-source",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "        [ -f \"${resdir}/lib/${triple}/${src}\" ] || src=\"libclang_rt.${rt}-${arch}.a\"",
  "replace": "        :",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "TheRock's staged fuzzer_no_main carries only the suffixed name (CON38)"
 },
 {
  "id": "packaging.gtk4-prefix-dev-packages",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "        printf '%s\\n' libgraphene-1.0-dev libvulkan-dev",
  "replace": "        printf '%s\\n' libgtk-4-dev",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "amd64 would take the distro libgtk-4-dev, and with it the distro GStreamer runtime CON21 drops (CON129)"
 },
 {
  "id": "packaging.gtk4-floor",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    if ! pkg-config --atleast-version=\"${floor}\" gtk4 2>/dev/null || ! pkg-config --cflags --libs gtk4 >/dev/null; then",
  "replace": "    if ! pkg-config --cflags --libs gtk4 >/dev/null; then",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "a gtk4 older than gtk4-rs 0.11's v4_10 would ship, and OxidANT's GTK GUI would fail in a consumer lane (CON129)"
 },
 {
  "id": "packaging.gtk4-every-requires",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    if ! pkg-config --atleast-version=\"${floor}\" gtk4 2>/dev/null || ! pkg-config --cflags --libs gtk4 >/dev/null; then",
  "replace": "    if ! pkg-config --atleast-version=\"${floor}\" gtk4 2>/dev/null; then",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "--modversion answers while a Requires is missing; :latest's amd64 gtk4.pc lacked graphene-gobject-1.0 (CON129)"
 },
 {
  "id": "packaging.gtk4-library-loads",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    if [ -n \"${unresolved}\" ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "a libgtk-4.so.1 with an unresolved NEEDED builds gtk4-rs and fails at its first start (CON129)"
 },
 {
  "id": "packaging.gtk4-dev-packages-installed",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    mapfile -t -O \"${#_sdp_out[@]}\" _sdp_out < <(gtk4_dev_packages)",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "the package stage would install no GTK 4 dev package (CON129)"
 },
 {
  "id": "packaging.gtk4-gate-wired",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    verify_gtk4_dev_surface\n}",
  "replace": "}",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "an image without a buildable GTK 4 would pass the package stage (CON129)"
 },
 {
  "id": "packaging.gtk4-contract-row-listed",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": " uv-cache-seed gtk4-dev gnu-time\"",
  "replace": " uv-cache-seed gnu-time\"",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "the shipped-image smoke would never check GTK 4 as uid 1001 (CON129)"
 },
 {
  "id": "packaging.gtk4-contract-row-bad",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    \"OK: gtk4 \"*) printf 'OK %s %s' \"${row}\" \"${have#OK: }\" ;;",
  "replace": "    *) printf 'OK %s %s' \"${row}\" \"${have#OK: }\" ;;",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "the gate's ERROR line would read as a passing contract row (CON129)"
 },
 {
  "id": "packaging.gnu-time-by-name",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    _sdp_out+=(time)",
  "replace": "    append_available_packages _sdp_out time",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "a best-effort append ships an image without /usr/bin/time when apt lacks it, and uid 1001 cannot install it later"
 },
 {
  "id": "packaging.gnu-time-every-arch",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    _sdp_out+=(time)",
  "replace": "    [ \"$(dpkg --print-architecture)\" != amd64 ] || _sdp_out+=(time)",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "the arm64 and riscv64 lanes measure peak RSS in their own images too"
 },
 {
  "id": "probe.gnu-time-row-listed",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": " gtk4-dev gnu-time\"",
  "replace": " gtk4-dev\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "without the row the shipped-image smoke never runs /usr/bin/time -v as the image user"
 },
 {
  "id": "probe.gnu-time-row-dispatched",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "        gnu-time)      line=\"$(_consumer_gnu_time_verdict \"${row}\" \"${probe}\")\" ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "without its arm the row falls to the directory verdict and never reads its fact"
 },
 {
  "id": "probe.gnu-time-probe-spliced",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_consumer_test_runtimes_probe; _consumer_gnu_time_probe; printf",
  "replace": "_consumer_test_runtimes_probe; printf",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the fact must reach the probe the image runs, or every run is NOFACT"
 },
 {
  "id": "probe.gnu-time-probe-stderr",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "_gt=\"$(/usr/bin/time -v true 2>&1)\"",
  "replace": "_gt=\"$(/usr/bin/time -v true)\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "GNU time writes its report to stderr, so without the redirect a working binary reads as absent"
 },
 {
  "id": "probe.gnu-time-probe-verbose",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "/usr/bin/time -v true 2>&1",
  "replace": "/usr/bin/time true 2>&1",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "only -v prints the peak RSS line a lane reads"
 },
 {
  "id": "probe.gnu-time-absent-is-fact",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "\"${_gt_peak:-$(printf '%s\\n' \"${_gt}\" | head -1)}\"",
  "replace": "\"${_gt_peak}\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a missing binary must arrive as a fact with the shell's error, not as an empty line"
 },
 {
  "id": "probe.gnu-time-zero-peak-bad",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  *': '[1-9]*) printf 'FACT gnu-time yes\\n' ;;",
  "replace": "  *': '[0-9]*) printf 'FACT gnu-time yes\\n' ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a zero peak RSS is no measurement, so it must not hold the row"
 },
 {
  "id": "probe.gnu-time-absent-bad",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  _consumer_require_fact \"$2\" \"$1\" gnu-time \"/usr/bin/time -v true gave no peak RSS above zero: ${peak}\" || return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "today's :latest has no /usr/bin/time, and the row must say so"
 },
 {
  "id": "probe.gnu-time-absent-answers-no",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  *) printf 'FACT gnu-time no\\n' ;;",
  "replace": "  *) : ;;",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "an image without the binary must answer no, or the row reads NOFACT instead of naming the gap"
 },
 {
  "id": "packaging.pwsh-asset-arch",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "        x86_64)  arch=x64;   key=PWSH_LINUX_X64_SHA256 ;;",
  "replace": "        x86_64)  arch=amd64; key=PWSH_LINUX_X64_SHA256 ;;",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "PowerShell names its amd64 tarball linux-x64; the package stage would fetch a 404 (CON131)"
 },
 {
  "id": "packaging.pwsh-pins-required",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    if [ -n \"${version}\" ] && [ -n \"${sha}\" ]; then\n        printf",
  "replace": "    if true; then\n        printf",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "pwsh or PSScriptAnalyzer without its SHA-256 pin would reach the download instead of stopping the stage (CON131)"
 },
 {
  "id": "packaging.pwsh-report-compares",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    [ \"${report}\" = \"$1\" ] && return 0\n",
  "replace": "    return 0\n",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "a pwsh that does not start, or answers another version, would pass as the pin (CON131)"
 },
 {
  "id": "packaging.pwsh-reports-its-pin",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    _pwsh_reports \"${version}\" pwsh \"${bindir}/pwsh\" '$PSVersionTable.PSVersion.ToString()' || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "pwsh would ship unchecked against PWSH_VERSION (CON131)"
 },
 {
  "id": "packaging.pssa-listed-at-its-pin",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    _pwsh_reports \"${version}\" \"pwsh's ${name}\" \"${prefix}/pwsh\" \\\n        \"(Get-Module -ListAvailable -Name ${name}).Version.ToString()\" || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "a module pwsh cannot list, or lists at another version, would ship; the lab's analyzer test would skip (CON131)"
 },
 {
  "id": "packaging.pwsh-riscv64-note",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "        *) echo \"NOTE: PowerShell publishes no ${machine} build; no pwsh on this arch (docs/image-decisions.md)\"; return 0 ;;",
  "replace": "        *) echo \"NOTE: PowerShell publishes no ${machine} build; no pwsh on this arch (docs/image-decisions.md)\"; return 1 ;;",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "riscv64, which upstream does not build, would fail its package stage (CON131)"
 },
 {
  "id": "packaging.pssa-drops-packaging-parts",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    rm -rf \"${mod:?}/_rels\" \"${mod:?}/package\" \"${mod:?}/[Content_Types].xml\" \"${mod:?}/${name}.nuspec\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "the nupkg's OPC parts would sit in the module directory, which Install-Module never leaves (CON131)"
 },
 {
  "id": "packaging.pwsh-installs-pssa",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    install_psscriptanalyzer \"${env_file}\" \"${prefix}\" || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "pwsh would ship without PSScriptAnalyzer, and the lab's analyzer test would skip (CON131)"
 },
 {
  "id": "packaging.pwsh-unverified-lands-nothing",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    download_verified_file \"${url}\" \"${sha}\" \"${dir}/asset\" && rm -rf \"${dest}\" && mkdir -p \"${dest}\" || rc=1\n",
  "replace": "    download_verified_file \"${url}\" \"${sha}\" \"${dir}/asset\"; rm -rf \"${dest}\" && mkdir -p \"${dest}\" || rc=1\n",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "an asset that failed its SHA-256 check would still be unpacked and installed (CON131)"
 },
 {
  "id": "packaging.pwsh-wired-into-setup",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    install_cargo_qa_tools\n    install_pwsh\n",
  "replace": "    install_cargo_qa_tools\n",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "without the call the package stage ships no pwsh, and the consumers' PowerShell tests skip on every lane (CON131)"
 },
 {
  "id": "packaging.glib-yield-only-when-older",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    if [ ! -f \"${theirs}\" ] || [ \"$(printf '%s\\n' \"${theirs##*/}\" \"${ours##*/}\" | sort -V | tail -n 1)\" = \"${ours##*/}\" ]; then",
  "replace": "    if [ ! -f \"${theirs}\" ]; then",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "a prefix GLib as new as the distro's would be deleted too, against the rule that our build wins its soname (CON129)"
 },
 {
  "id": "packaging.glib-yield-removes-the-family",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    rm -f \"${dir}\"/lib{glib,gobject,gio,gmodule,gthread,girepository}-2.0.so* \\",
  "replace": "    rm -f \"${dir}\"/libglib-2.0.so* \\",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "half a GLib in the prefix: riscv64 would load the prefix's 2.86 gobject/gio beside Ubuntu's 2.88 glib (CON129)"
 },
 {
  "id": "packaging.glib-yield-wired",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    yield_older_prefix_glib\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "riscv64's GTK 4 would ship unloadable: undefined symbol g_get_monotonic_time_ns (CON129)"
 },
 {
  "id": "packaging.atheris-probes-legacy-path",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "    x86_64 | aarch64) lib=\"lib/linux/libclang_rt.fuzzer_no_main-${machine}.a\" ;;",
  "replace": "    x86_64 | aarch64) lib=\"lib/${machine}-unknown-linux-gnu/libclang_rt.fuzzer_no_main.a\" ;;",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "the smoke must probe what atheris probes, not what clang finds (CON38)"
 },
 {
  "id": "packaging.atheris-sanitizer-siblings",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "    [ -f \"${found/.fuzzer_no_main/.${rt}}\" ] || validate_fail",
  "replace": "    true || validate_fail",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "atheris merges the sanitizers named after the libFuzzer path (CON38)"
 },
 {
  "id": "packaging.tidy-gcc-graded",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "    _smoke_gcc_selection \"clang-tidy via ${cc}\" \"${sel}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "clang-tidy's GCC selection must be graded, not only the bare driver's (CON39)"
 },
 {
  "find": "[[ \"${!v:-}\" =~ ^[0-9a-f]{64}$ ]] || echo \"${v}='${!v:-}' is not a 64-hex sha256\"",
  "id": "deepstream.pin-sha256-shape",
  "replace": "true",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a malformed sha256 pin must be refused before any download"
 },
 {
  "find": "^10(\\.[0-9]+){3}$",
  "id": "deepstream.trt10-only",
  "replace": "^[0-9]+(\\.[0-9]+){3}$",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "DeepStream 9.1 does not build against TensorRT 11, so a non-10 pin must be refused"
 },
 {
  "find": "    arm64) ds_sbsa_problem ;;",
  "id": "deepstream.arch-arm64",
  "replace": "    arm64) return 0 ;;",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "arm64 without the staged SBSA libraries has no route and must be refused"
 },
 {
  "find": "[ \"${ENABLE_NVIDIA:-false}\" = \"true\" ] || { echo \"ENABLE_DEEPSTREAM=true needs",
  "id": "deepstream.needs-nvidia",
  "replace": "true || { echo \"ENABLE_DEEPSTREAM=true needs",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "DeepStream outside the nvidia variant must be refused"
 },
 {
  "find": "  \"src/gst-plugins/gst-nvinferserver|Triton: links libnvds_infer_server.so (src/utils/nvdsinferserver)\"\n",
  "id": "deepstream.exclusion-triton",
  "replace": "",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a component that cannot build here must stay excluded"
 },
 {
  "find": "grep -E ' (gst_plugin_[A-Za-z0-9_]+_get_desc|gst_plugin_desc)$' >/dev/null || printf '%s\\n' \"${f}\"",
  "id": "deepstream.non-plugin-detect",
  "replace": "grep -E ' (gst_plugin_[A-Za-z0-9_]+_get_desc|gst_plugin_desc)$' >/dev/null || true",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a helper .so left in gst-plugins/ crashes the registry scan, so it must be found"
 },
 {
  "find": "[ ! -e \"${DS_OPT}\" ] ||",
  "id": "deepstream.assert-absent",
  "replace": "true ||",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "an ENABLE_DEEPSTREAM=false image carrying the tree must fail"
 },
 {
  "find": "  [ \"${ENABLE_DEEPSTREAM:-false}\" = \"true\" ] || return 0\n",
  "id": "deepstream.copy-gate",
  "replace": "",
  "target": "linux/scripts/06-packaging/copy-media-payloads.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "an image that did not ask must not receive the artifact's DeepStream tree"
 },
 {
  "find": "    printf '[ERROR] ENABLE_DEEPSTREAM=true but the artifact has no /opt/nvidia/deepstream\\n' >&2\n    return 1",
  "id": "deepstream.copy-missing-fatal",
  "replace": "    return 0",
  "target": "linux/scripts/06-packaging/copy-media-payloads.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "asking for DeepStream from an artifact without it must fail"
 },
 {
  "find": "    printf 'BROKEN %s -> %s\\n' \"${file}\" \"${soname}\"",
  "id": "deepstream.verify-broken",
  "replace": "    :",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "an unexcused unresolved soname must fail the closure gate"
 },
 {
  "find": "[ -n \"${used[${f}|${n}]:-}\" ] ||",
  "id": "deepstream.verify-stale",
  "replace": "true ||",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "an allowlist entry that no longer applies must fail as stale"
 },
 {
  "find": "*) printf 'SECOND-GSTREAMER",
  "id": "deepstream.verify-second-gstreamer",
  "replace": "*) : 'SECOND-GSTREAMER",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a plugin resolving GStreamer outside /opt/gstreamer must fail"
 },
 {
  "find": "if [ \"${ENABLE_DEEPSTREAM:-false}\" = \"true\" ] && [ \"${CROSS_GPU_VARIANT}\" != \"nvidia\" ]; then",
  "id": "stage-graph.deepstream-needs-nvidia-chain",
  "replace": "if false; then",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "a default or rocm chain must refuse ENABLE_DEEPSTREAM=true"
 },
 {
  "find": "      append_deepstream_build_arg _csba_out \"${arch}\" \"media ${arch}\"\n",
  "id": "stage-graph.deepstream-media-arg",
  "replace": "      true\n",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "without the build arg the media stage builds no DeepStream"
 },
 {
  "find": "  append_optional_build_arg \"$1\" ENABLE_DEEPSTREAM \"${ENABLE_DEEPSTREAM:-}\"\n",
  "id": "deepstream.runtime-arg-forwarded",
  "replace": "  true\n",
  "target": "linux/scripts/01-core/build-helpers.sh",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "without the build arg the package asserts the tree absent and fails"
 },
 {
  "find": "  [ -z \"${pulled}\" ] || ds_die \"these packages would install a distro GStreamer",
  "id": "deepstream.no-distro-gstreamer",
  "replace": "  true || ds_die \"these packages would install a distro GStreamer",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a build dependency that pulls a distro GStreamer puts a second copy beside /opt/gstreamer"
 },
 {
  "find": "    CXX:gcc|CXX:cc|CC:*) ;;",
  "id": "deepstream.c-compiler-kept",
  "replace": "    CXX:gcc|CXX:cc|CC:*) base=g++ ;;",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "each Makefile's own compiler must survive: CXX:=gcc compiles C, and CC:=g++ links C++"
 },
 {
  "find": "grep -E ' (gst_plugin_[A-Za-z0-9_]+_get_desc|gst_plugin_desc)$' >/dev/null ||",
  "id": "deepstream.non-plugin-no-sigpipe",
  "replace": "grep -qE ' (gst_plugin_[A-Za-z0-9_]+_get_desc|gst_plugin_desc)$' ||",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "grep -q SIGPIPEs nm on a large plugin, and under pipefail a real plugin is moved out of gst-plugins/"
 },
 {
  "id": "deepstream.link-builder-resources",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "    ln -sfn \"${f}\" \"${dir}/${f##*/}\"\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "libnvinfer.so.10 dlopen()s its builder resources by file name, which ld.so.cache never holds; without the links no engine builds"
 },
 {
  "id": "deepstream.link-v4l2-plugin",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  ln -sfn \"${plugin}\" \"${dir}/libcuvidv4l2_plugin.so\"\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the distro libv4l2 loads plugins only from its own dir; without the link nvv4l2decoder opens /dev/nvidia0 as a plain V4L2 node"
 },
 {
  "id": "deepstream.stage-runtime-links-v4l2",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  if [ \"$(ds_arch)\" = amd64 ]; then ds_link_v4l2_plugin; else ds_log",
  "replace": "  if false; then ds_link_v4l2_plugin; else ds_log",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the package stage is the only place the amd64 NVDEC plugin gets linked"
 },
 {
  "id": "deepstream.verify-builder-resources",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "find": "|| bad+=\" ${f##*/}\"",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a missing builder-resource link must fail the gate, not wait for the first engine build on a GPU"
 },
 {
  "id": "deepstream.verify-v4l2-plugin-wired",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "find": "    if [ \"$(dsv_arch)\" = amd64 ]; then dsv_check_v4l2_plugin; else dsv_ok",
  "replace": "    if false; then dsv_check_v4l2_plugin; else dsv_ok",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the amd64 NVDEC plugin link is a gate of the package stage"
 },
 {
  "id": "deepstream.new-nvstreammux-env",
  "target": "linux/Dockerfile.package",
  "find": "ENV USE_NEW_NVSTREAMMUX=${DS_NEW_MUX/true/yes}",
  "replace": "ENV USE_NEW_NVSTREAMMUX=",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "NVIDIA's prebuilt legacy nvstreammux reads GstMapInfo.data after gst_buffer_unmap(); GStreamer >= 1.28 clears it and every batch fails"
 },
 {
  "find": "    \"libcudnn${CUDNN_MAJOR}-dev-cuda-${CUDA_MAJOR}=${CUDNN_VERSION}*\" \\\n    \"libcudnn${CUDNN_MAJOR}-headers-cuda-${CUDA_MAJOR}=${CUDNN_VERSION}*\"; } || \\",
  "id": "cuda-stack.cudnn-headers-pinned",
  "replace": "    \"libcudnn${CUDNN_MAJOR}-dev-cuda-${CUDA_MAJOR}=${CUDNN_VERSION}*\"; } || \\",
  "target": "linux/scripts/01-core/install-cuda-stack.sh",
  "test": "bash linux/scripts/tests/test-cuda-cross-sbsa.sh",
  "why": "without the headers pin the pinned cuDNN tier always fails and an unpinned cuDNN is installed"
 },
 {
  "id": "no-libunwind.gstreamer",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "\"-Dgstreamer:libunwind=disabled\"",
  "replace": "\"-Dgstreamer:libunwind=auto\"",
  "test": "bash linux/scripts/tests/test-no-libunwind.sh",
  "why": "libgstreamer's libunwind.so.8 ahead of libgcc_s turns an exception through std::call_once into a segfault"
 },
 {
  "id": "no-libunwind.libcamera",
  "target": "linux/scripts/03-media/build/libcamera/build-libcamera.sh",
  "find": "  -Dlibunwind=disabled\n",
  "replace": "  -Dlibunwind=auto\n",
  "test": "bash linux/scripts/tests/test-no-libunwind.sh",
  "why": "libcamera-base's libunwind.so.8 crashes a process the same way, even under RTLD_LOCAL"
 },
 {
  "id": "lavapipe-width.package-env",
  "target": "linux/Dockerfile.package",
  "find": "ENV LP_NATIVE_VECTOR_WIDTH=256\n",
  "replace": "ENV LP_NATIVE_VECTOR_WIDTH=128\n",
  "test": "bash linux/scripts/tests/test-lavapipe-vector-width.sh",
  "why": "128-bit NEON/RVV gives lavapipe 4-lane subgroups and its BVH sort SEGVs"
 },
 {
  "id": "lavapipe-width.smoke-width",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    if [ \"${width}\" != 256 ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-lavapipe-vector-width.sh",
  "why": "an image without the variable must fail even where the CPU default hides it"
 },
 {
  "id": "lavapipe-width.smoke-subgroup",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    elif [ \"${sub}\" != 8 ]; then",
  "replace": "    elif false; then",
  "test": "bash linux/scripts/tests/test-lavapipe-vector-width.sh",
  "why": "4-lane subgroups are the cause; the knob alone is not proof"
 },
 {
  "id": "lavapipe-width.smoke-no-icd",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      fail \"lavapipe's ICD (lvp_icd.json) is missing",
  "replace": "      pass \"lavapipe's ICD (lvp_icd.json) is missing",
  "test": "bash linux/scripts/tests/test-lavapipe-vector-width.sh",
  "why": "no lavapipe means nothing was measured"
 },
 {
  "id": "lavapipe-width.smoke-called",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    check_lavapipe_subgroup \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lavapipe-vector-width.sh",
  "why": "an uncalled check guards nothing"
 },
 {
  "id": "gst-blacklist.undocumented",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      undocumented=\"${undocumented} ${p}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-gst-validate-ssim.sh",
  "why": "libgstvalidatessim.so sat blacklisted in :latest with the plugin-health check green"
 },
 {
  "id": "gst-blacklist.unreadable",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "GST_BLACKLIST_DONE fail \\\n    \"the GStreamer registry blacklist could not be read",
  "replace": "GST_BLACKLIST_DONE pass \\\n    \"the GStreamer registry blacklist could not be read",
  "test": "bash linux/scripts/tests/test-gst-validate-ssim.sh",
  "why": "an unread blacklist is not an empty one"
 },
 {
  "id": "gst-blacklist.parse",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "/BLACKLISTED \\1/p\"",
  "replace": "/LISTED \\1/p\"",
  "test": "bash linux/scripts/tests/test-gst-validate-ssim.sh",
  "why": "the probe must turn gst-inspect-1.0 -b's list into BLACKLISTED lines"
 },
 {
  "id": "gst-blacklist.called",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    _gst_check_stale_exceptions \"${target_arch}\" \"${failed}\" \"${_gtk4_wl}\"\n    _gst_check_blacklist \"${target_arch}\"\n",
  "replace": "    _gst_check_stale_exceptions \"${target_arch}\" \"${failed}\" \"${_gtk4_wl}\"\n",
  "test": "bash linux/scripts/tests/test-gst-validate-ssim.sh",
  "why": "the plugin-health check must fail on a blacklisted plugin, not only warn"
 },
 {
  "id": "gst-blacklist.called-early",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      fi\n      _gst_check_blacklist \"${target_arch}\"\n",
  "replace": "      fi\n",
  "test": "bash linux/scripts/tests/test-gst-validate-ssim.sh",
  "why": "a scanner pass that did not finish must not skip the blacklist"
 },
 {
  "id": "gst-validate-ssim.frames",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    elif [ \"${frames:-0}\" -ge 1 ] 2>/dev/null; then",
  "replace": "    elif true; then",
  "test": "bash linux/scripts/tests/test-gst-validate-ssim.sh",
  "why": "the SSIM override must write frames under gst-validate"
 },
 {
  "id": "gst-validate-ssim.amd64-ships",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "        fail \"gst-validate-1.0 is missing from the amd64 image",
  "replace": "        pass \"gst-validate-1.0 is missing from the amd64 image",
  "test": "bash linux/scripts/tests/test-gst-validate-ssim.sh",
  "why": "amd64 builds gst-devtools natively, so its absence is a regression"
 },
 {
  "id": "gst-validate-ssim.patch-wired",
  "target": "linux/scripts/03-media/build/gstreamer/common/patch-gstreamer-sources.sh",
  "find": "\"${_patch_dir}/007-validate-ssim-register-outside-validate.patch\"",
  "replace": "\"${_patch_dir}/007-disabled.patch\"",
  "test": "bash linux/scripts/tests/test-gst-validate-ssim.sh",
  "why": "without 007 the core registry blacklists the SSIM plugin"
 },
 {
  "id": "gst-validate-ssim.patch-content",
  "target": "linux/scripts/patches/gstreamer/007-validate-ssim-register-outside-validate.patch",
  "find": "+    return TRUE;\n",
  "replace": "+    return FALSE;\n",
  "test": "bash linux/scripts/tests/test-gst-validate-ssim.sh",
  "why": "FALSE outside gst-validate is what blacklisted the plugin"
 },
 {
  "id": "no-libunwind.smoke-hits",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    if [ -n \"${hits}\" ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-no-libunwind.sh",
  "why": "a shipped file that needs libunwind.so.8 must fail the image"
 },
 {
  "id": "no-libunwind.smoke-done",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    _smoke_probe_required marker \"${out}\" UNWIND_SCAN_DONE fail \\\n      \"the libunwind scan did not complete in the ${target_arch} image: $(printf '%s\\n' \"${out}\" | tail -1)\" || return 0",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-no-libunwind.sh",
  "why": "an unfinished scan is not a clean one"
 },
 {
  "id": "no-libunwind.smoke-empty",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    elif ! [ \"${scanned:-0}\" -ge 1 ] 2>/dev/null; then",
  "replace": "    elif false; then",
  "test": "bash linux/scripts/tests/test-no-libunwind.sh",
  "why": "a scan that read nothing proves nothing"
 },
 {
  "id": "no-libunwind.smoke-called",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    check_no_libunwind_closure \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-no-libunwind.sh",
  "why": "an uncalled check guards nothing"
 },
 {
  "id": "renovate-cmake.git-tag-form",
  "target": "default.json",
  "find": "(?:\\\\.git)?\\\"?\\\\s+GIT_TAG\\\\s+",
  "replace": "(?:\\\\.git)?\\\"?\\\\s+GIT_TAGX\\\\s+",
  "test": "bash linux/scripts/tests/test-renovate-cmake.sh",
  "why": "GIT_REPOSITORY + GIT_TAG is how GSL and corrosion are declared without a hint; a pattern that no longer matches leaves them silent, which is where every CMake pin in the family sat before CON46"
 },
 {
  "id": "renovate-cmake.floating-ref-skipped",
  "target": "default.json",
  "find": "(?<currentValue>[\\\\w+-]+(?:\\\\.[\\\\w+-]+)+)",
  "replace": "(?<currentValue>[\\\\w.+-]+)",
  "test": "bash linux/scripts/tests/test-renovate-cmake.sh",
  "why": "only a dotted value is a version: without that rule `GIT_TAG master` and a 40-hex SHA are reported as versions, and Renovate proposes moving a branch name to a release tag"
 },
 {
  "id": "renovate-cmake.one-row-per-pin",
  "target": "default.json",
  "find": "(?:\\\\.git)?\\\"?\\\\s+GIT_TAG\\\\s+",
  "replace": "(?:\\\\.git)?\\\"?(?:\\\\s|#[^\\\\n]*)+GIT_TAG\\\\s+",
  "test": "bash linux/scripts/tests/test-renovate-cmake.sh",
  "why": "a URL form that reads through comment lines also reads AccelerANTgine's annotated abseil and GSL, so each is reported twice and --apply refuses both as ambiguous"
 },
 {
  "id": "renovate-cmake.tag-archive-form",
  "target": "default.json",
  "find": "/archive/refs/tags/(?<currentValue>",
  "replace": "/archive/refs/tagz/(?<currentValue>",
  "test": "bash linux/scripts/tests/test-renovate-cmake.sh",
  "why": "the tag archive is the form googletest moves to; without it the dependency in four files is invisible again"
 },
 {
  "id": "renovate-cmake.annotated-git-tag",
  "target": "default.json",
  "find": "[ \\\\t]*GIT_TAG\\\\s+\\\"?(?<currentValue>[\\\\w.+-]+)",
  "replace": "[ \\\\t]*GIT_TAGX\\\\s+\\\"?(?<currentValue>[\\\\w.+-]+)",
  "test": "bash linux/scripts/tests/test-renovate-cmake.sh",
  "why": "a hint directly above GIT_TAG is how a pin with a comment block between URL and tag stays visible (AccelerANTgine's abseil)"
 },
 {
  "id": "renovate-cmake.annotated-set",
  "target": "default.json",
  "find": "[Ss][Ee][Tt]\\\\s*\\\\(",
  "replace": "[Ss][Ee][Tt]X\\\\s*\\\\(",
  "test": "bash linux/scripts/tests/test-renovate-cmake.sh",
  "why": "set(ABSL_TAG ...) under its hint is BeschleunigerBallett's abseil pin; GIT_TAG ${ABSL_TAG} names no version, so the set() is the only place it can be read"
 },
 {
  "id": "renovate-cmake.annotated-quoted",
  "target": "default.json",
  "find": "[ \\\\t]*\\\"(?<currentValue>",
  "replace": "[ \\\\t]*\\\"X(?<currentValue>",
  "test": "bash linux/scripts/tests/test-renovate-cmake.sh",
  "why": "a quoted value on the line under its hint is how a multi-line set() pins cxxbridge-cmd; unmatched, it drops out of every report"
 },
 {
  "id": "renovate-cmake.locator-reads-cmake",
  "target": "linux/scripts/renovate_locator.py",
  "find": "        return CMAKE\n    return manager",
  "replace": "        return manager\n    return manager",
  "test": "bash linux/scripts/tests/test-renovate-cmake.sh",
  "why": "the regex manager over a CMake file must be read as CMake; dispatched by manager name alone it goes to the versions.env reader, which finds no KEY= line and refuses every CMake update"
 },
 {
  "id": "renovate-cmake.url-hash-refused",
  "target": "linux/scripts/renovate_cmake.py",
  "find": "match.start(2), match.end(2), _hashed(args))]",
  "replace": "match.start(2), match.end(2), \"\")]",
  "test": "bash linux/scripts/tests/test-renovate-cmake.sh",
  "why": "a tag archive behind a URL_HASH moved alone leaves the hash of the OLD archive, so the next configure fails its download check; the edit must be refused, not written"
 },
 {
  "id": "riscv64-cross.llvm-needs-riscv64-backend",
  "target": "linux/scripts/lib/riscv64-cross.sh",
  "find": "grep -q -e ' riscv64 '",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "the image's own clang 23 is X86-only and newest; picked for its version, it fails every riscv64 compile with 'No available targets'"
 },
 {
  "id": "riscv64-cross.wrapper-no-unused-arguments",
  "target": "linux/scripts/lib/riscv64-cross.sh",
  "find": " --start-no-unused-arguments -fuse-ld=lld",
  "replace": " -fuse-ld=lld",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "link flags on every compile line warn 'argument unused during compilation', which a -Werror consumer turns into a failed build"
 },
 {
  "id": "riscv64-cross.wrapper-gcc-runtime-dir",
  "target": "linux/scripts/lib/riscv64-cross.sh",
  "find": " -L${sysroot}/opt/gcc-16.2.0/lib",
  "replace": "",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "clang does not search a cross GCC's lib/ for libstdc++; every C++ link fails 'unable to find library -lstdc++'"
 },
 {
  "id": "riscv64-cross.strip-host-triplet-dirs",
  "target": "linux/scripts/lib/riscv64-cross.sh",
  "find": "      /opt/*/lib/*-linux-gnu | /opt/*/lib/*-linux-gnu/*) continue ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "QEMU opens the host's amd64 dir when the sysroot lacks it; every riscv64 test then warns through ~300 amd64 plugins"
 },
 {
  "id": "riscv64-cross.strip-keeps-riscv64-dirs",
  "target": "linux/scripts/lib/riscv64-cross.sh",
  "find": "      /opt/*/lib/riscv64-linux-gnu | /opt/*/lib/riscv64-linux-gnu/*) ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "the riscv64 dirs are the ones the sysroot does have; dropping them would hide the target's own plugins"
 },
 {
  "id": "riscv64-cross.env-strips-runtime-lists",
  "target": "linux/scripts/lib/riscv64-cross.sh",
  "find": "  for var in GST_PLUGIN_PATH GI_TYPELIB_PATH LD_LIBRARY_PATH; do",
  "replace": "  for var in GI_TYPELIB_PATH; do",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "the helper is only half the fix; riscv64_cross_env must apply it to the plugin and loader paths"
 },
 {
  "id": "riscv64-cross.env-refuses-missing-sysroot",
  "target": "linux/scripts/lib/riscv64-cross.sh",
  "find": "if [ ! -e \"${sysroot}/lib/ld-linux-riscv64-lp64d.so.1\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "without a sysroot the lane would fail later and far from the cause, or compile against nothing it can run"
 },
 {
  "id": "riscv64-cross.sysroot-relativizes-absolute-links",
  "target": "linux/scripts/02-toolchain/riscv64-sysroot.sh",
  "find": "-lname '/*'",
  "replace": "-lname '/nothing/*'",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "an absolute link in a mounted sysroot resolves against the build container's root, so /etc/alternatives and .so dev links point at amd64 files or nothing"
 },
 {
  "id": "riscv64-cross.sysroot-index-from-repodigests",
  "target": "linux/scripts/02-toolchain/riscv64-sysroot.sh",
  "find": "sed -n \"s|^${repo}@||p\"",
  "replace": "sed -n \"s|^nothing@||p\"",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "a tag re-read from the registry can be a newer push than the amd64 image the lane pulled, pairing mismatched sysroot and toolchain"
 },
 {
  "id": "riscv64-cross.index-lookup-matches-arch",
  "target": "linux/scripts/02-toolchain/registry-platform-digest.py",
  "find": "        and m.get(\"platform\", {}).get(\"architecture\") == want_arch\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-riscv64-cross.sh",
  "why": "matching on the OS alone takes whichever linux manifest comes first, and an amd64 sysroot under a riscv64 compiler fails only at link time"
 },
 {
  "id": "riscv64-cross.extract-applies-whiteouts",
  "target": "linux/scripts/02-toolchain/oci-layers-extract.py",
  "find": "                rec[\"whiteouts\"].append(target)",
  "replace": "                pass",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "a file an upper layer deleted stays in the sysroot, where a link or the loader can still pick it"
 },
 {
  "id": "riscv64-cross.extract-applies-opaque-dirs",
  "target": "linux/scripts/02-toolchain/oci-layers-extract.py",
  "find": "                rec[\"opaque\"].append(parent)",
  "replace": "                pass",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "an opaque directory keeps the lower layers' files, so a replaced tree carries stale files beside its new ones"
 },
 {
  "id": "riscv64-cross.extract-whiteout-of-an-ancestor",
  "target": "linux/scripts/02-toolchain/oci-layers-extract.py",
  "find": " or any(p.startswith(name + \"/\") for p in self.paths)",
  "replace": "",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "a whiteout of an allowlisted path's ancestor (/.wh.opt under opt/gcc) would leave the deleted tree in the sysroot"
 },
 {
  "id": "riscv64-cross.extract-refuses-climbing-members",
  "target": "linux/scripts/02-toolchain/oci-layers-extract.py",
  "find": "            raise ExtractError(f\"member {name!r} climbs out of the image root\")",
  "replace": "            continue",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "a '..' member read as a path instead of refused is a registry blob choosing where on the runner it writes"
 },
 {
  "id": "riscv64-cross.extract-never-writes-through-symlinks",
  "target": "linux/scripts/02-toolchain/oci-layers-extract.py",
  "find": "        if is_real_dir(s) and is_real_dir(d):",
  "replace": "        if is_real_dir(s) and os.path.isdir(d):",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "a lower layer's absolute symlink would route an upper layer's files onto the host directory it names"
 },
 {
  "id": "riscv64-cross.extract-modes-as-tar",
  "target": "linux/scripts/02-toolchain/oci-layers-extract.py",
  "find": "    os.chmod(path, member.mode & 0o777 & ~umask)",
  "replace": "    os.chmod(path, member.mode)",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "export mode's non-root tar applies the umask and drops setuid; without the same rule the two modes build different sysroots"
 },
 {
  "id": "riscv64-cross.extract-outside-link-target",
  "target": "linux/scripts/02-toolchain/oci-layers-extract.py",
  "find": "        copy_link_targets(blob, staging, outside, umask)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "a hard link into the allowlist whose target lies outside it would vanish from the sysroot without an error"
 },
 {
  "id": "riscv64-cross.sysroot-skopeo-fetches-the-child-digest",
  "target": "linux/scripts/02-toolchain/riscv64-sysroot.sh",
  "find": "\"docker://${ref}\" \"dir:${layout}\"",
  "replace": "\"docker://${ref%@*}:latest\" \"dir:${layout}\"",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "a fetch by tag can take a newer push than the amd64 image the lane pulled, pairing a mismatched sysroot and toolchain"
 },
 {
  "id": "riscv64-cross.sysroot-skopeo-missing-stops",
  "target": "linux/scripts/02-toolchain/riscv64-sysroot.sh",
  "find": "command -v \"${skopeo}\" >/dev/null 2>&1 || die",
  "replace": "command -v \"${skopeo}\" >/dev/null 2>&1 || return 0 || die",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "without skopeo the step would report success over a sysroot it never built"
 },
 {
  "id": "riscv64-cross.sysroot-mode-is-validated",
  "target": "linux/scripts/02-toolchain/riscv64-sysroot.sh",
  "find": "    export | skopeo) ;;",
  "replace": "    export | skopeo | *) ;;",
  "test": "bash linux/scripts/tests/test-oci-layers-extract.sh",
  "why": "an unknown mode falls through to export, so a caller's misspelt sysroot-mode would pass unnoticed"
 },
 {
  "id": "chrome-emulator.wrapper-no-sandbox",
  "target": "linux/scripts/06-packaging/install-chrome-for-testing.sh",
  "find": "--no-sandbox --no-zygote",
  "replace": "--no-zygote",
  "test": "bash linux/scripts/tests/test-chrome-and-emulator.sh",
  "why": "a container gives uid 1001 neither a setuid helper nor user namespaces, so Chrome's sandbox cannot start"
 },
 {
  "id": "chrome-emulator.wrapper-no-zygote",
  "target": "linux/scripts/06-packaging/install-chrome-for-testing.sh",
  "find": "--no-sandbox --no-zygote --disable-dev-shm-usage",
  "replace": "--no-sandbox --disable-dev-shm-usage",
  "test": "bash linux/scripts/tests/test-chrome-and-emulator.sh",
  "why": "under qemu-user the zygote's children die with SIGTRAP, so an emulated arm64 package build renders nothing"
 },
 {
  "id": "chrome-emulator.cft-headless-check",
  "target": "linux/scripts/06-packaging/install-chrome-for-testing.sh",
  "find": "case \"${dom}\" in *cft-42*) ;;",
  "replace": "case \"${dom}\" in *) ;;",
  "test": "bash linux/scripts/tests/test-chrome-and-emulator.sh",
  "why": "a browser that starts but renders nothing would ship as a working CHROME_EXECUTABLE"
 },
 {
  "id": "chrome-emulator.cache-reverified",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "if [ -f \"${cached}\" ] && printf '%s  %s\\n' \"${sha}\" \"${cached}\" | sha256sum -c - >/dev/null 2>&1; then",
  "replace": "if [ -f \"${cached}\" ]; then",
  "test": "bash linux/scripts/tests/test-chrome-and-emulator.sh",
  "why": "a cache mount outlives every build, so an entry trusted without re-hashing is an unverified download"
 },
 {
  "id": "chrome-emulator.emu-sysimg-revision",
  "target": "linux/scripts/06-packaging/install-android-emulator.sh",
  "find": "_emu_expect \"${img}\" Pkg.Revision \"${ANDROID_EMULATOR_SYSIMG_REVISION}\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-chrome-and-emulator.sh",
  "why": "a system image other than the pin can carry a translator that SIGILLs on arm64 code"
 },
 {
  "id": "chrome-emulator.emu-amd64-only",
  "target": "linux/scripts/06-packaging/install-android-emulator.sh",
  "find": "if [ \"${arch}\" != amd64 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-chrome-and-emulator.sh",
  "why": "the Linux emulator is x86_64-only; on arm64 it would ship 4.4 GB that cannot run"
 },
 {
  "id": "chrome-emulator.smoke-headless",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "printf 'BAD %s headless chrome rendered no page as the image user'",
  "replace": "printf 'OK %s headless chrome rendered no page as the image user'",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the runtime smoke must fail an image whose browser cannot render as uid 1001"
 },
 {
  "id": "chrome-emulator.smoke-riscv64-exempt",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    riscv64:chrome) return 0 ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "riscv64 has no Chrome for Testing build; without the arm the row reads BAD there"
 },
 {
  "id": "chrome-emulator.smoke-emulator-image",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  _consumer_version_matches \"${row}\" \"${got}\" \"${img}\" 'system image' none || return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a system image off the pin must fail the row, not pass it"
 },
 {
  "id": "chrome-emulator.package-env-riscv64",
  "target": "linux/Dockerfile.package",
  "find": "ARG CHROME_ON=${CHROME_ARCH/riscv64/}",
  "replace": "ARG CHROME_ON=${CHROME_ARCH}",
  "test": "bash linux/scripts/tests/test-chrome-and-emulator.sh",
  "why": "riscv64 would advertise a CHROME_EXECUTABLE that does not exist"
 },
 {
  "id": "chrome-emulator.avd-kvm-check",
  "target": "linux/scripts/04-runtime/android-avd.sh",
  "find": "if [ ! -r \"${AVD_KVM_DEVICE}\" ] || [ ! -w \"${AVD_KVM_DEVICE}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-chrome-and-emulator.sh",
  "why": "without /dev/kvm the emulator falls back to minutes of software emulation instead of saying how to pass the device"
 },
 {
  "id": "disk-guard.buildkit-keep-counts-unprunable",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "printf '%s' \"$(( ${1:-0} * 1000 + fixed ))\"",
  "replace": "printf '%s' \"$(( ${1:-0} * 1000 ))\"",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "--keep-storage bounds the whole store; without the cache mounts added, a 120G keep empties the layer cache"
 },
 {
  "id": "prune-safe.keep-counts-unprunable",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "select((.shared | not) and ((.recordType // \"\") as $t | $t != \"\" and $t != \"regular\"))",
  "replace": "select(false)",
  "test": "bash linux/scripts/tests/test-prune-safe.sh",
  "why": "a 100G keep against 150G of cache mounts prunes every layer record (CON53)"
 },
 {
  "id": "prune-safe.dup-keeps-lowest-id",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "map(select(length > 1) | sort_by(.id))",
  "replace": "map(select(length > 1) | sort_by(.id) | reverse)",
  "test": "bash linux/scripts/tests/test-prune-safe.sh",
  "why": "BuildKit reuses the lowest record id; removing it would orphan the live compile cache"
 },
 {
  "id": "prune-safe.dup-opt-in",
  "target": "linux/host-config/prune-safe.sh",
  "find": "if [ \"${PRUNE_DUP_CACHEMOUNTS:-0}\" = \"1\" ] && [ -n \"${dups}\" ]; then",
  "replace": "if [ -n \"${dups}\" ]; then",
  "test": "bash linux/scripts/tests/test-prune-safe.sh",
  "why": "a plain prune must never delete a cache-mount record"
 },
 {
  "id": "prune-safe.dup-refuses-in-use",
  "target": "linux/host-config/prune-safe.sh",
  "find": "  if [ \"${in_use}\" -gt 0 ] || ",
  "replace": "  if false || ",
  "test": "bash linux/scripts/tests/test-prune-safe.sh",
  "why": "a running build may fall back to the surplus record"
 },
 {
  "id": "prune-safe.count-expects-removed-dups",
  "target": "linux/host-config/prune-safe.sh",
  "find": "n_expected=$(( n_before - ${#dup_ids[@]} ))",
  "replace": "n_expected=$(( n_before ))",
  "test": "bash linux/scripts/tests/test-prune-safe.sh",
  "why": "a requested surplus removal is not a lost cache and must not fail the run"
 },
 {
  "id": "prune-safe.keep-value-validated",
  "target": "linux/host-config/prune-safe.sh",
  "find": "case \"${PRUNE_KEEP_GB}\" in ''|*[!0-9]*) echo",
  "replace": "case \"${PRUNE_KEEP_GB}\" in __never__) echo",
  "test": "bash linux/scripts/tests/test-prune-safe.sh",
  "why": "a garbage keep value must not reach buildctl arithmetic"
 },
 {
  "id": "linux-lane.riscv64-packaging-stays-opt-in",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "      - name: Packaging application\n        if: matrix.arch != 'riscv64' || inputs.package-emulated\n",
  "replace": "      - name: Packaging application\n        if: matrix.arch != 'riscv64'\n",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "the emulated row would lose its arch-specific wheel again, silently, because the caller's opt-in went nowhere"
 },
 {
  "id": "python.packaging.riscv64-ships-wheels-only",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "  if [ \"$(uname -m)\" = \"riscv64\" ] || [ \"${CROSS_TARGET}\" = \"riscv64\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "the app packages would run under QEMU and die at the AppImage arch mapping mid-way through the packaging step, far from the arch check that caused it"
 },
 {
  "id": "python.packaging.cross-mode-sets-the-target-tag",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "  export PYTHON_HOST_PLATFORM_TARGET=\"${plat_tag}\"",
  "replace": "  export PYTHON_HOST_PLATFORM_TARGET=\"linux_x86_64\"",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "a host-tagged wheel installs on the target and never imports; the build command is what turns this value into the tag"
 },
 {
  "id": "python.packaging.cross-headers-prefer-the-image-python",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "  for dir in usr/local/include usr/include; do",
  "replace": "  for dir in usr/include usr/local/include; do",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "the image ships PYTHON_VERSION under /usr/local; a distro python3.X header set of the same minor would build against a different interpreter"
 },
 {
  "id": "python.packaging.cross-headers-name-the-sysroot",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "      printf '%s' \"${RISCV64_SYSROOT}/${dir}/python${PYTHON_VERSION}\"",
  "replace": "      printf '%s' \"/${dir}/python${PYTHON_VERSION}\"",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "--sysroot does not reroot a plain -I, so a host path compiles the riscv64 extension against the amd64 container's own pyconfig.h"
 },
 {
  "id": "python.packaging.cross-link-takes-the-sysroot-libc",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "  export LDSHARED=\"${CC} -shared -L${RISCV64_SYSROOT}/lib/riscv64-linux-gnu -L${RISCV64_SYSROOT}/usr/lib/riscv64-linux-gnu\"",
  "replace": "  export LDSHARED=\"${CC} -shared\"",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "without the sysroot's lib dirs first, -lc finds the host LIBDIR's libc.so, whose OUTPUT_FORMAT(elf64-x86-64) makes lld refuse every riscv64 object (runs 37196119524, 37329297990)"
 },
 {
  "id": "linux-lane.riscv64-packaging-crosses",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "            ${{ matrix.arch == 'riscv64' && inputs.package-emulated && '-e PACKAGING_CROSS_TARGET=riscv64' || '' }}\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "without the cross target the riscv64 wheel is built on the emulated image again, where a Cython unit hung four hours"
 },
 {
  "id": "linux-lane.riscv64-packaging-syncs-the-limited-extras",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "            -e SYNC_EXTRAS=${{ matrix.arch == 'riscv64' && inputs.test-extras || '' }}\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "the emulated packaging leg would silently sync all extras again and time out"
 },
 {
  "id": "linux-lane.riscv64-steps-share-the-uv-cache",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "            -e SYNC_EXTRAS=${{ inputs.test-extras }}\n            ${{ matrix.arch == 'riscv64' && inputs.package-emulated && '-e UV_CACHE_DIR=/workspace/.uv-cache' || '' }}\n",
  "replace": "            -e SYNC_EXTRAS=${{ inputs.test-extras }}\n",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "the packaging leg would rebuild the test leg's source builds from a cold cache"
 },
 {
  "id": "linux-lane.packaging-honours-sync-extras",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "if [ -n \"${SYNC_EXTRAS:-}\" ]; then\n  export UV_SYNC_EXTRAS=\"${SYNC_EXTRAS}\"\nfi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "the packaging sync would ignore the lane's extras limit and build the full set under emulation"
 },
 {
  "id": "python.packaging.gil-build-asks-for-gil",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "    python_ci_cached_command uv build --python \"$(uv_python_request \"${PYTHON_VERSION}\")\"\n",
  "replace": "    python_ci_cached_command uv build\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "uv build ignores the venv, so the image's python3.14t becomes a candidate for the GIL wheel, which then ships cp314t only, as on Windows on 2026-10-01"
 },
 {
  "id": "python.packaging.free-threaded-mode-is-validated",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "  *) err \"PYTHON_FREE_THREADED_WHEEL must be auto, on or off, not '${FT_MODE}'\" ;;\n",
  "replace": "  *) ;;\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "a typo such as PYTHON_FREE_THREADED_WHEEL=no would read as auto and build the wheel its operator meant to switch off"
 },
 {
  "id": "python.packaging.free-threaded-off-skips",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "  if [ \"${FT_MODE}\" = off ]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "off would be ignored for a declared project, so the escape hatch for an image without python3.14t would not open"
 },
 {
  "id": "python.packaging.free-threaded-undeclared-skips",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "    auto:1) info \"free-threaded wheel skipped: the project does not declare support (${verdict})\"; return 1 ;;\n",
  "replace": "    auto:1) ;;\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "every project would ship a cp314t wheel, including those whose code was never tested free-threaded"
 },
 {
  "id": "python.packaging.free-threaded-never-downloads",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "  FT_PYTHON=\"$(uv python find \"${FT_VERSION}\" 2>/dev/null)\" ||\n",
  "replace": "  FT_PYTHON=\"$(uv python install \"${FT_VERSION}\" >/dev/null 2>&1; uv python find \"${FT_VERSION}\" 2>/dev/null)\" ||\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "a lane would fetch its interpreter at run time, so an image that lost python3.14t would still go green on a download"
 },
 {
  "id": "python.packaging.free-threaded-wheel-is-cp3xyt",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "    *) err \"the free-threaded build produced ${name}, not a ${FT_ABI} wheel\" ;;\n",
  "replace": "    *) mv \"${wheels[0]}\" dist/; FT_WHEEL=\"${name}\" ;;\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "a twin built on a GIL interpreter would overwrite the GIL wheel of the same name and ship no free-threaded one"
 },
 {
  "id": "python.packaging.free-threaded-wheel-is-proved",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "if [ -n \"${FT_WHEEL}\" ]; then\n  prove_free_threaded_wheel\nfi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "the cp314t wheel would ship unproved, and a Cython module without freethreading_compatible re-enables the GIL on every import"
 },
 {
  "id": "python.packaging.auditwheel-from-the-packaging-venv",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "[ -n \"${AUDITWHEEL}\" ] || [ ! -x \"${VENV_BINARIES}/bin/auditwheel\" ] || AUDITWHEEL=\"${VENV_BINARIES}/bin/auditwheel\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "the project's own auditwheel goes unused again, and every Cython wheel ships as linux_<arch>"
 },
 {
  "id": "python.free-threaded-helper.official-classifier",
  "target": "linux/scripts/02-toolchain/python/free-threaded-wheel.py",
  "find": "CLASSIFIER = \"Programming Language :: Python :: Free Threading\"\n",
  "replace": "CLASSIFIER = \"Programming Language :: Python :: 3.14t\"\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "the unofficial 3.14t classifier, which PyPI refuses, would opt a project in and the official one would not"
 },
 {
  "id": "python.free-threaded-helper.classifier-family-not-prefix",
  "target": "linux/scripts/02-toolchain/python/free-threaded-wheel.py",
  "find": "hits = [c for c in classifiers if c == CLASSIFIER or c.startswith(CLASSIFIER + \" :: \")]\n",
  "replace": "hits = [c for c in classifiers if c.startswith(CLASSIFIER)]\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "any classifier that merely begins with the family's text would opt a project in"
 },
 {
  "id": "python.free-threaded-helper.package-init-loads-as-the-package",
  "target": "linux/scripts/02-toolchain/python/free-threaded-wheel.py",
  "find": "            found.append((name.removesuffix(\".__init__\"), str(item.locate())))\n",
  "replace": "            found.append((name, str(item.locate())))\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "a compiled pkg/__init__ exports PyInit_pkg, so loading it as pkg.__init__ fails the proof of every Cython wheel with a package"
 },
 {
  "id": "python.free-threaded-helper.only-site-packages-files",
  "target": "linux/scripts/02-toolchain/python/free-threaded-wheel.py",
  "find": "        if suffix and not rel.startswith(\"../\"):\n",
  "replace": "        if suffix:\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "a file a wheel installs outside site-packages would be loaded as a module of the package"
 },
 {
  "id": "python.app-bundle.wheel-fits-the-runtime-abi",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "      *) others+=\" ${name}\" ;;\n",
  "replace": "      *) printf '%s\\n' \"${wheel}\"; return 0 ;;\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "the GIL runtime would install whichever binary sorts first, the cp314t twin included, and no GIL interpreter imports that"
 },
 {
  "id": "python.app-bundle.foreign-abi-is-no-fallback",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "      none) [ -n \"${others}\" ] || { printf '%s\\n' \"${wheel}\"; return 0; } ;;\n",
  "replace": "      none) printf '%s\\n' \"${wheel}\"; return 0 ;;\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "a bundle would quietly ship the pure wheel while the binary for its ABI was never built"
 },
 {
  "id": "linker-select.unknown-value-refused",
  "target": "linux/scripts/lib/linker-select.sh",
  "find": "    *) warn \"KATAGLYPHIS_LINKER must be default, lld or mold, not '${want}'\"; return 2 ;;",
  "replace": "    *) return 0 ;;",
  "test": "bash linux/scripts/tests/test-linker-select.sh",
  "why": "a typo such as KATAGLYPHIS_LINKER=gold must stop the build; read as default, the run measures the image's linker under the name the operator asked for"
 },
 {
  "id": "linker-select.applied-once",
  "target": "linux/scripts/lib/linker-select.sh",
  "find": "  [[ \"${_LINKER_SELECT_APPLIED:-}\" == \"${want}\" ]] && return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-linker-select.sh",
  "why": "cmake_build_prepare_env is documented safe to call twice and a lane's child script inherits LDFLAGS; without the marker each call appends -fuse-ld again"
 },
 {
  "id": "linker-select.rustflags-refused",
  "target": "linux/scripts/lib/linker-select.sh",
  "find": "  if [[ -n \"${RUSTFLAGS:-}\" || -n \"${CARGO_ENCODED_RUSTFLAGS:-}\" ]]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-linker-select.sh",
  "why": "cargo takes RUSTFLAGS over CARGO_TARGET_<host>_RUSTFLAGS without a word, so the Rust half would link with the old linker while the log claims the new one"
 },
 {
  "id": "linker-select.probe-gates-export",
  "target": "linux/scripts/lib/linker-select.sh",
  "find": "  if ! printf 'int main(void) { return 0; }\\n' | \"${cc}\" -x c - -fuse-ld=\"${want}\" -o \"${probe_dir}/probe\" >/dev/null 2>&1; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-linker-select.sh",
  "why": "the probe is what turns a missing ld.<x> into a failure at the start; without it the build dies at its first link, an hour in"
 },
 {
  "id": "linker-select.clang-plugin-for-mold",
  "target": "linux/scripts/lib/linker-select.sh",
  "find": "  if [[ \"${want}\" == mold ]] && plugin=\"$(_linker_select_clang_plugin)\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-linker-select.sh",
  "why": "mold reads clang's LTO bitcode only through LLVMgold.so; the plugin library links AccelerANTgine's bitcode archives and stops with 'the -plugin option was not provided' without it"
 },
 {
  "id": "linker-select.env-pin-wins",
  "target": "linux/scripts/lib/linker-select.sh",
  "find": "  pins=\"$(source \"${_LINKER_SELECT_CORE_DIR}/load-versions-env.sh\" \\\n    && load_versions_env \"${_LINKER_SELECT_CORE_DIR}/tool-pins.env\" && env | grep '^MOLD_LINUX_')\" || return 0",
  "replace": "  pins=\"$(grep '^MOLD_LINUX_' \"${_LINKER_SELECT_CORE_DIR}/tool-pins.env\")\" || return 0",
  "test": "bash linux/scripts/tests/test-linker-select.sh",
  "why": "an operator testing a newer mold sets MOLD_LINUX_VERSION and its SHA; versions.env overwriting them would fetch the old release under the new name"
 },
 {
  "id": "linker-select.unpinned-arch-fails",
  "target": "linux/scripts/lib/linker-select.sh",
  "find": "    *) warn \"No pinned mold release for $(uname -m).\"; return 1 ;;",
  "replace": "    *) arch=x86_64; sha=\"${MOLD_LINUX_X86_64_SHA256:-}\" ;;",
  "test": "bash linux/scripts/tests/test-linker-select.sh",
  "why": "an architecture with no pinned release must fail rather than fetch another architecture's binary"
 },
 {
  "id": "linker-select.cache-reused",
  "target": "linux/scripts/lib/linker-select.sh",
  "find": "  if [[ ! -x \"${cache_root}/${asset}/bin/ld.mold\" ]]; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-linker-select.sh",
  "why": "the version-keyed cache is what makes a second lane step free; refetching on every call puts a GitHub download in each build"
 },
 {
  "id": "linker-select.cmake-build-wired",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "  # Opt-in (KATAGLYPHIS_LINKER); unset leaves the image's linker in charge.\n  linker_select_env\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-linker-select.sh",
  "why": "cmake_build_prepare_env is where every cmake-build.sh consumer gets the switch; dropped, KATAGLYPHIS_LINKER=mold builds with the default linker and says nothing"
 },
 {
  "id": "mutations.push-base-is-remote-tip",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "_ranges+=(\"--push-range\" \"${_rsha}...${_lsha}\") ;;",
  "replace": "_ranges+=(\"--push-range\" \"origin/main...${_lsha}\") ;;",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "develop is what a push updates and main lags it by hundreds of entries; counting from origin/main made every hub push a 25-minute gate that ended in --no-verify"
 },
 {
  "id": "mutations.push-unfetched-tip-refuses",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "if ! git cat-file -e \"${_rsha}^{commit}\" 2>/dev/null; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "git rejects a push over a tip it never fetched, so proving first spends the whole run on a rejected push"
 },
 {
  "id": "mutations.push-passes-base",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "\"${_ranges[@]}\" --delegate-chrome",
  "replace": "--delegate-chrome",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "--push-range is the hook's scope; without it the gate selects nothing or the whole manifest"
 },
 {
  "id": "mutations.changed-uses-base",
  "target": "docs/scripts/mutation_push.py",
  "find": "[\"git\", \"diff\", \"--name-only\", base + \"...HEAD\"]",
  "replace": "[\"git\", \"diff\", \"--name-only\", \"origin/main...HEAD\"]",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k changed",
  "why": "--base is the pre-push hook's push scope; ignoring it re-grades everything since main"
 },
 {
  "id": "downloads.install-stages-first",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "  got=\"${stage}/${url##*/}\"",
  "replace": "  got=\"${dest}\"",
  "test": "bash linux/scripts/tests/test-download-verified-install.sh",
  "why": "a parallel lint job saw a half-written gitleaks at the final path and failed a clean scan (hub CI run 37329252097); the bytes must land in the stage"
 },
 {
  "id": "downloads.install-removes-stage",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "  rm -rf \"${stage}\"\n  return \"${rc}\"",
  "replace": "  return \"${rc}\"",
  "test": "bash linux/scripts/tests/test-download-verified-install.sh",
  "why": "every install leaves a stage behind in the shared cache otherwise, failed ones included"
 },
 {
  "id": "downloads.install-lost-race-ok",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "|| [ -x \"${dest}\" ] || rc=1",
  "replace": "|| rc=1",
  "test": "bash linux/scripts/tests/test-download-verified-install.sh",
  "why": "on Windows the winner's running .exe refuses the loser's rename; the pinned bytes are already in place, so that is a success"
 },
 {
  "id": "rust.cargo-safe-directory-added",
  "target": "linux/scripts/02-toolchain/rust/_cargo_wrapper.sh",
  "find": "  git config --global --add safe.directory \"${_cargo_safe_dir}\" || true",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-cargo-wrapper.sh",
  "why": "uid 1001 does not own the bind-mounted checkout; without the entry git refuses it as dubious ownership and a build that shells out to git fails"
 },
 {
  "id": "rust.cargo-safe-directory-opt-out",
  "target": "linux/scripts/02-toolchain/rust/_cargo_wrapper.sh",
  "find": "if [ -n \"${_cargo_safe_dir}\" ] \\\n",
  "replace": "if true \\\n",
  "test": "bash linux/scripts/tests/test-cargo-wrapper.sh",
  "why": "an empty CARGO_SAFE_DIRECTORY is the documented opt-out, as CMAKE_BUILD_SAFE_DIRECTORY's is; ignoring it adds an empty safe.directory entry"
 },
 {
  "id": "rust.cargo-install-pinned-skips",
  "target": "linux/scripts/02-toolchain/rust/_cargo_wrapper.sh",
  "find": "  if [ \"${have}\" = \"${version}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-cargo-wrapper.sh",
  "why": "the image ships cargo-audit, cargo-deny and cargo-tarpaulin at their pins (CON65); rebuilding them anyway costs every OxidANT run minutes of crates.io compiles"
 },
 {
  "id": "rust.cargo-install-pinned-locked",
  "target": "linux/scripts/02-toolchain/rust/_cargo_wrapper.sh",
  "find": "  cargo install --locked --version \"${version}\" \"${crate}\"",
  "replace": "  cargo install --version \"${version}\" \"${crate}\"",
  "test": "bash linux/scripts/tests/test-cargo-wrapper.sh",
  "why": "--version alone still resolves the crate's dependencies afresh, so a bare-host build would not be the pinned tool"
 },
 {
  "id": "rust.cargo-qa-tools-fatal",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "            || { echo \"ERROR: ${name} ${version} did not install from its pinned release binary\" >&2; return 1; }",
  "replace": "            || true",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "an image that silently lacks a cargo QA tool sends every OxidANT run back to cargo-installing it; the stage must stop instead (CON65)"
 },
 {
  "id": "rust.cargo-qa-tools-audit-glibc",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "\"${version}\" \"${target/aarch64-unknown-linux-musl/aarch64-unknown-linux-gnu}\" \"${version}\" ;;",
  "replace": "\"${version}\" \"${target}\" \"${version}\" ;;",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "rustsec publishes no aarch64 musl cargo-audit; the musl URL 404s and the arm64 package stage stops"
 },
 {
  "id": "python.free-threaded-gil-checked",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    if [ \"${report}\" != \"${version} False\" ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "a 3.14t leg on a GIL interpreter tests nothing free-threaded and still reports green (CON66)"
 },
 {
  "id": "probe.free-threaded-python-gil-off",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  elif [ \"${have}\" != \"${want}\" ]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the row must prove the shipped interpreter is PYTHON_VERSION with the GIL off, not merely present"
 },
 {
  "id": "python.free-threaded-disable-gil",
  "target": "linux/scripts/02-toolchain/python/build_python.sh",
  "find": "      PY_CONFIGURE_EXTRA=( --disable-gil \"LDFLAGS_NODIST=-Wl,-rpath,${PYTHON_FT_PREFIX}/lib\" )",
  "replace": "      PY_CONFIGURE_EXTRA=( \"LDFLAGS_NODIST=-Wl,-rpath,${PYTHON_FT_PREFIX}/lib\" )",
  "test": "bash linux/scripts/tests/test-build-python-variants.sh",
  "why": "without --disable-gil the second pass builds a GIL CPython under the twin's prefix, and every 3.14t leg tests nothing free-threaded"
 },
 {
  "id": "python.free-threaded-audit-ships-its-stdlib",
  "target": "linux/scripts/02-toolchain/python/build_python.sh",
  "find": "    _critical_exts+=(_ssl _hashlib _sqlite3 zlib _bz2 _lzma _ctypes)",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-build-python-variants.sh",
  "why": "the cross-built free-threaded tree ships as the arm64/riscv64 runtime interpreter; a _ctypes or _ssl that make -k skipped must stop the toolchain stage, not a consumer's leg"
 },
 {
  "id": "python.free-threaded-stage-keeps-gil-names",
  "target": "linux/scripts/02-toolchain/python/build_python.sh",
  "find": "  if [ \"${PY_VARIANT}\" = gil ]; then\n    if [ -x \"${prefix}/bin/python${python_mm}\" ]; then",
  "replace": "  if true; then\n    if [ -x \"${prefix}/bin/python${python_mm}\" ]; then",
  "test": "bash linux/scripts/tests/test-build-python-variants.sh",
  "why": "python3 and python3.pc mean the GIL build; a free-threaded stage that claims them hands every pkg-config python3 consumer the t ABI"
 },
 {
  "id": "python.free-threaded-native-stages-build-arch",
  "target": "linux/scripts/02-toolchain/python/build_python.sh",
  "find": "    if [ \"${PY_VARIANT}\" = freethreaded ]; then\n      rm -rf \"${PY_STAGE_ROOT}\"",
  "replace": "    if false; then\n      rm -rf \"${PY_STAGE_ROOT}\"",
  "test": "bash linux/scripts/tests/test-build-python-variants.sh",
  "why": "Dockerfile.package COPYs /opt/python-cross-ft/<arch> in both build modes; a native artifact that stages nothing fails that COPY"
 },
 {
  "id": "python.free-threaded-package-needs-the-tree",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    if [ ! -x \"${exe}\" ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "a missing toolchain tree must stop the package stage by name, never leave a dangling python3.14t link for a 3.14t leg to find"
 },
 {
  "id": "probe.free-threaded-python-source-build",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    if [ \"${build}\" != 'prefix=/opt/python-freethreaded Py_GIL_DISABLED=1' ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "only the sysconfig prefix tells the toolchain's source build from uv's python-build-standalone download it replaced, and the import line is what proves ctypes and ssl on every arch"
 },
 {
  "id": "probe.tree-arch-free-threaded-relocation",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    /opt/python-cross-ft/*/opt/python-freethreaded) printf '%s' /opt/python-freethreaded ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the manifest names the per-arch COPY source with a ${TARGET_ARCH:-...} the resolver cannot expand; without the relocation the tree-arch gate fails as UNRESOLVED or scans a path that is not in the image"
 },
 {
  "id": "python.free-threaded-toolchain-smoke-needs-pc",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "    if [ -x \"${root}/bin/python${PYTHON_MAJOR_MINOR}t\" ] && [ -f \"${root}/lib/pkgconfig/python-${PYTHON_MAJOR_MINOR}t.pc\" ]; then",
  "replace": "    if [ -x \"${root}/bin/python${PYTHON_MAJOR_MINOR}t\" ]; then",
  "test": "bash linux/scripts/tests/test-build-python-variants.sh",
  "why": "a staged tree without its python-3.14t.pc is the half-staged shape a cp314t wheel build against it fails on"
 },
 {
  "id": "rust.cargo-safe-directory-once",
  "target": "linux/scripts/02-toolchain/rust/_cargo_wrapper.sh",
  "find": "   && ! git config --global --get-all safe.directory 2>/dev/null | grep -qxF -- \"${_cargo_safe_dir}\"; then",
  "replace": "   ; then",
  "test": "bash linux/scripts/tests/test-cargo-wrapper.sh",
  "why": "every driver run would append another copy to the global gitconfig"
 },
 {
  "id": "rust.cargo-doc-workspace-default",
  "target": "linux/scripts/02-toolchain/rust/cargo_build_doc.sh",
  "find": "    printf '%s\\n' --workspace\n",
  "replace": "    return 0\n",
  "test": "bash linux/scripts/tests/test-cargo-build-doc.sh",
  "why": "without --workspace cargo doc documents the root package alone, and every member crate is missing from the site"
 },
 {
  "id": "rust.cargo-doc-caller-scope-wins",
  "target": "linux/scripts/02-toolchain/rust/cargo_build_doc.sh",
  "find": "            -p* | --package | --package=* | --workspace | --all) return 0 ;;",
  "replace": "            --no-such-flag) return 0 ;;",
  "test": "bash linux/scripts/tests/test-cargo-build-doc.sh",
  "why": "a caller that names its packages must not get the whole workspace added, or --workspace twice"
 },
 {
  "id": "rust.cargo-doc-workspace-only",
  "target": "linux/scripts/02-toolchain/rust/cargo_build_doc.sh",
  "find": "    grep -qE '^\\[workspace\\]' Cargo.toml || return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cargo-build-doc.sh",
  "why": "a single-package manifest must build exactly as before, without a --workspace it never asked for"
 },
 {
  "id": "rust.cargo-doc-nightly-toolchain",
  "target": "linux/scripts/02-toolchain/rust/cargo_build_doc.sh",
  "find": "cargo \"+${RUST_NIGHTLY_TOOLCHAIN}\" doc \"${DOC_MAP[@]}\" --no-deps",
  "replace": "cargo doc \"${DOC_MAP[@]}\" --no-deps",
  "test": "bash linux/scripts/tests/test-cargo-build-doc.sh",
  "why": "-Zrustdoc-map is a nightly cargo flag; stable cargo refuses it and the site is never built"
 },
 {
  "id": "rust.cargo-doc-rustdoc-map",
  "target": "linux/scripts/02-toolchain/rust/cargo_build_doc.sh",
  "find": "DOC_MAP=(-Zrustdoc-map --config 'doc.extern-map.registries.crates-io=\"https://docs.rs/\"')",
  "replace": "DOC_MAP=()",
  "test": "bash linux/scripts/tests/test-cargo-build-doc.sh",
  "why": "without the map rustdoc leaves every link into a dependency as raw text, a dead link on every type page"
 },
 {
  "id": "rust.cargo-doc-missing-nightly-refused",
  "target": "linux/scripts/02-toolchain/rust/cargo_build_doc.sh",
  "find": "if [ -z \"${RUST_NIGHTLY_TOOLCHAIN:-}\" ] || ! cargo \"+${RUST_NIGHTLY_TOOLCHAIN}\" --version >/dev/null 2>&1; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-cargo-build-doc.sh",
  "why": "a host without the pinned nightly must hear which toolchain to install, not a bare cargo error"
 },
 {
  "id": "rust.cargo-doc-nightly-from-versions-env",
  "target": "linux/scripts/02-toolchain/rust/cargo_build_doc.sh",
  "find": "load_raw_pin_if_empty RUST_NIGHTLY_TOOLCHAIN RUST_NIGHTLY_TOOLCHAIN \"$SCRIPT_DIR/../../01-core/versions.env\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-cargo-build-doc.sh",
  "why": "the image carries no RUST_NIGHTLY_TOOLCHAIN variable, so the pin must come from versions.env"
 },
 {
  "id": "env-knobs.tool-pins-are-owners",
  "target": "linux/scripts/lint-env-knobs.sh",
  "find": "ENV_OWNER_FILES=(\"${SCRIPTS}/01-core/versions.env\" \"${SCRIPTS}/01-core/tool-pins.env\" \"${SCRIPTS}\"/03-media/core/arch-flags-*.env)",
  "replace": "ENV_OWNER_FILES=(\"${SCRIPTS}/01-core/versions.env\" \"${SCRIPTS}\"/03-media/core/arch-flags-*.env)",
  "test": "bash linux/scripts/tests/test-env-knobs.sh",
  "why": "the host-tool pins moved to tool-pins.env (CON59); without it as an owner every lint-tool knob reads as unowned and KNOB_GATE fails a correct tree"
 },
 {
  "id": "packaging.pinned-llvm-usr-bin-names",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "            ln -sfn \"${dir}/${name}\" \"${tool}\"\n",
  "replace": "            :\n",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "a diverted /usr/bin name must point into the pinned LLVM, or clang-format & co. vanish instead of moving to 23 (CON71)"
 },
 {
  "id": "packaging.pinned-llvm-keeps-nn-aliases",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "        case \"${f##*/}\" in *-[0-9] | *-[0-9][0-9] | *-[0-9]*.py | rust-*) continue ;; esac\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "clang-tidy-21 and rustc's rust-* names ask for that LLVM by name; diverting them breaks explicit callers (CON71)"
 },
 {
  "id": "packaging.pinned-llvm-stash-off-path",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "--divert \"${stash}/${name}\"",
  "replace": "--divert \"${tool}.distro-llvm\"",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "a diverted original left in /usr/bin is still a distro LLVM on PATH (CON71)"
 },
 {
  "id": "packaging.llvm-tool-version-against-pin",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "    if [ -n \"${want}\" ] && [ \"${ver}\" = \"${want}\" ]; then\n      echo \"SMOKE OK: ${tool} ${ver} == LLVM_RELEASE\"",
  "replace": "    if [ -n \"${ver}\" ]; then\n      echo \"SMOKE OK: ${tool} ${ver} == LLVM_RELEASE\"",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "the smoke grades every LLVM tool against LLVM_RELEASE, not merely that it runs (CON71)"
 },
 {
  "id": "packaging.llvm-tool-distro-name",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "    validate_fail \"llvm-tool-distro\" \"${usr_bin}/${name} is $(readlink -f \"${usr_bin}/${name}\"), a distro LLVM under an unversioned name\"\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "a distro LLVM under an unversioned /usr/bin name is what CON71 removes; the smoke must catch one coming back"
 },
 {
  "id": "llvm-target.cross-builds-lldb",
  "target": "linux/scripts/02-toolchain/llvm-cross.sh",
  "find": "-DLLVM_ENABLE_PROJECTS=\"clang;clang-tools-extra;lld;lldb\"",
  "replace": "-DLLVM_ENABLE_PROJECTS=\"clang;clang-tools-extra;lld\"",
  "test": "bash linux/scripts/tests/test-llvm-cross-stanza.sh",
  "why": "without lldb in the pinned build the image's lldb would have to be the distro's (CON71)"
 },
 {
  "id": "llvm-target.cross-installs-utils",
  "target": "linux/scripts/02-toolchain/llvm-cross.sh",
  "find": "    -DLLVM_INSTALL_UTILS=ON \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-llvm-cross-stanza.sh",
  "why": "FileCheck, yaml2obj and llvm-tblgen ship only with LLVM_INSTALL_UTILS (CON71)"
 },
 {
  "id": "sccache.cmake-guarded-launcher",
  "target": "cmake/Cache.cmake",
  "find": "        set(_myproject_launcher \"${_myproject_guarded}\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cmake-cache-launcher.sh",
  "why": "a bare sccache launcher fails every compile once its server is gone (BeschleunigerBallett run 37509585546)"
 },
 {
  "id": "stage-graph.deepstream-default-on",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": ": \"${ENABLE_TENSORRT:=true}\" \"${ENABLE_DEEPSTREAM:=true}\" ;;",
  "replace": ": \"${ENABLE_TENSORRT:=true}\" ;;",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "every amd64 nvidia build carries DeepStream without being asked (owner 2026-10-07)"
 },
 {
  "id": "stage-graph.deepstream-default-amd64-only",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "case \"$(cross_build_platform)\" in */amd64) : \"${ENABLE_TENSORRT:=true}\" \"${ENABLE_DEEPSTREAM:=true}\" ;; esac",
  "replace": ": \"${ENABLE_DEEPSTREAM:=true}\"; case \"$(cross_build_platform)\" in */amd64) : \"${ENABLE_TENSORRT:=true}\" ;; esac",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "an arm64 nvidia build defaulting to DeepStream would die in deepstream.sh, which refuses arm64 (phase 7)"
 },
 {
  "id": "rocm-stack.versioned-names",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "    printf 'amdrocm-%s%s\\n' \"${_p}\" \"$1\"",
  "replace": "    printf 'amdrocm-%s\\n' \"${_p}\"",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "a versionless amdrocm-* name follows the rolling suite's newest ROCm (10.1 since 2026-09-30), not ROCM_VERSION"
 },
 {
  "id": "rocm-stack.migraphx-10.0-build-pinned",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "_ver=\"$2+rocm$1.*\"",
  "replace": "_ver=\"$2*\"",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "an unqualified MIGraphX version could take a build for another ROCm"
 },
 {
  "id": "rocm-stack.migraphx-renamed-with-10.1",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "10.*) _mgx=\"amdrocm${1%%.*}-migraphx\"",
  "replace": "10.*) _mgx=\"amdrocm-migraphx\"",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "from 10.1 amdrocm-migraphx is the old 10.0 build and pulls the 10.0 libraries"
 },
 {
  "id": "rocm-stack.migraphx-version-pinned",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "printf '%s\\n' \"${_mgx}=${_ver}\" \"${_mgx}-dev=${_ver}\"",
  "replace": "printf '%s\\n' \"${_mgx}\" \"${_mgx}-dev\"",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "an unpinned MIGraphX takes whatever build the rolling suite offers"
 },
 {
  "id": "rocm-stack.unknown-release-fails",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "add it to rocm_packages\" >&2; return 1 ;;",
  "replace": "add it to rocm_packages\" >&2 ;;",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "an unknown release must stop the build before any download, not install a list with no MIGraphX name"
 },
 {
  "id": "rocm-stack.malformed-release-refused",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "if ! [[ \"${_rocm_ver}\" =~ ^[0-9]+\\.[0-9]+$ ]] || [ -z \"${_migraphx_ver}\" ]; then",
  "replace": "if [ -z \"${_migraphx_ver}\" ]; then",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "a ROCM_VERSION that is not X.Y names packages that do not exist"
 },
 {
  "id": "rocm-stack.migraphx-version-required",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "if ! [[ \"${_rocm_ver}\" =~ ^[0-9]+\\.[0-9]+$ ]] || [ -z \"${_migraphx_ver}\" ]; then",
  "replace": "if ! [[ \"${_rocm_ver}\" =~ ^[0-9]+\\.[0-9]+$ ]]; then",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "a missing MIGRAPHX_VERSION reaches apt as amdrocm-migraphx=+rocm10.0.*"
 },
 {
  "id": "rocm-stack.foreign-release-detected",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "&& substr($2, RSTART, RLENGTH) != rel { print $2 }",
  "replace": "&& 0 { print $2 }",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "a second ROCm tree beside the pinned one must be reported"
 },
 {
  "id": "rocm-stack.whole-release-token",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "match($2, /[0-9]+\\.[0-9]+/)",
  "replace": "match($2, /[0-9]+\\.[0-9]/)",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "a 10.10 package must not read as 10.1"
 },
 {
  "id": "rocm-stack.only-installed-counts",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "'$1 == \"installed\" && match(",
  "replace": "'match(",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "a removed package's leftover config is no second tree"
 },
 {
  "id": "rocm-stack.second-tree-fails-build",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "  echo \"${_rocm_foreign}\" >&2\n  exit 1",
  "replace": "  echo \"${_rocm_foreign}\" >&2\n  :",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "the check must fail the build, not just print"
 },
 {
  "id": "rocm-stack.install-uses-versioned-list",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "apt-get install -y --no-install-recommends \"${_rocm_pkgs[@]}\"",
  "replace": "apt-get install -y --no-install-recommends amdrocm-core-dev amdrocm-migraphx amdrocm-migraphx-dev",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "the install must take rocm_packages' list, not versionless names"
 },
 {
  "id": "rocm-stack.asan-versioned",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "\"amdrocm-asan${_rocm_ver}\"",
  "replace": "amdrocm-asan",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "a versionless amdrocm-asan follows the suite's newest ROCm too"
 },
 {
  "id": "rocm-stack.migraphx-lib-on-loader-path",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "{ echo /opt/rocm/lib; find /opt/rocm -name 'libmigraphx_c.so*' -printf '%h\\n' 2>/dev/null; } | LC_ALL=C sort -u > /etc/ld.so.conf.d/rocm.conf",
  "replace": "echo /opt/rocm/lib > /etc/ld.so.conf.d/rocm.conf",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "since 10.1 /opt/rocm/lib is core's and MIGraphX sits in extras-10/lib, which nothing else puts on the loader path"
 },
 {
  "id": "rocm-stack.migraphx-loader-gate",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "  *) echo \"libmigraphx_c is on no loader path (/etc/ld.so.conf.d/rocm.conf)\"; exit 1 ;;",
  "replace": "  *) ;;",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "an image whose loader cannot find libmigraphx_c builds green and fails at the first MIGraphX session"
 },
 {
  "id": "rocm-stack.migraphx-header-anywhere",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "find /opt/rocm -path '*/include/migraphx/migraphx.hpp'",
  "replace": "find /opt/rocm/core -path '*/include/migraphx/migraphx.hpp'",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "the 10.1 headers are in extras-10/include; a fixed path failed the first 10.1 install (2026-10-07)"
 },
 {
  "id": "rocm-stack.runtime-migraphx-ld-path",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": " -o -name 'libmigraphx_c.so*'",
  "replace": "",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "The runtime image's MIGraphX EP needs libmigraphx_c.so.3 outside every HIP directory; preserve the independent SQLite directory selector."
 },
 {
  "id": "rocm-stack.runtime-asan-off-loader-path",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "    -path \"${rocm_image_root}/opt/rocm/core-asan-*\" -prune -o \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-rocm-packages.sh",
  "why": "core-asan-10.1/lib holds libamdhip64 too; over a real 10.1 ASAN install the find listed it (2026-10-07)"
 },
 {
  "id": "renovate.skipped-deps-are-listed",
  "target": "linux/scripts/renovate-local.sh",
  "find": "    note \"$((n + ${#APPLY_PATHS[@]})) update(s) available (manager(s): ${MANAGERS})\"\n  fi\n  report_skipped\n}",
  "replace": "    note \"$((n + ${#APPLY_PATHS[@]})) update(s) available (manager(s): ${MANAGERS})\"\n  fi\n}",
  "test": "bash linux/scripts/tests/test-renovate-local.sh",
  "why": "a skipped dependency is never behind, so without the NOT CHECKED list ROCM_VERSION=10.0 under semver read as up to date and TheRock 10.1 went unreported"
 },
 {
  "id": "renovate.by-design-skips-are-counted-not-listed",
  "target": "linux/scripts/renovate_planner.py",
  "find": "        if why in BY_DESIGN:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-renovate-local.sh",
  "why": "every path dependency in the NOT CHECKED list would bury the one invalid value that actually hides a pin"
 },
 {
  "id": "renovate.lockfile-only-skips-are-by-design",
  "target": "linux/scripts/renovate_planner.py",
  "find": "             \"contains-variable\", \"lockfile-only\"}\n",
  "replace": "             \"contains-variable\"}\n",
  "test": "bash linux/scripts/tests/test-renovate-local.sh",
  "why": "Renovate lists every package only uv.lock names as lockfile-only, so every uv consumer's report would exit 1 and its --apply refuse all of its real updates"
 },
 {
  "id": "renovate.value-pin-ignores-npm-integrity",
  "target": "linux/scripts/renovate_planner.py",
  "find": "            \"newDigest\": (up.get(\"newDigest\") or \"\") if dep.get(\"currentDigest\") else \"\",",
  "replace": "            \"newDigest\": up.get(\"newDigest\") or \"\",",
  "test": "bash linux/scripts/tests/test-renovate-local.sh",
  "why": "npm reports the tarball's sha512 integrity as newDigest on every update; preferring it wrote 'sha512-...' over RENOVATE_VERSION's 44.140.0"
 },
 {
  "id": "renovate.lock-maintenance-is-applied",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  LOCK_JOBS+=(${MAINT_JOBS[@]+\"${MAINT_JOBS[@]}\"})",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-renovate-lockmaint.sh",
  "why": "the report listed the maintained lock and --apply then said 'nothing to apply': the drift lockFileMaintenance exists for stayed, behind a green run"
 },
 {
  "id": "renovate.lock-maintenance-upgrades",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "    uv)           printf '%s\\n' uv lock --upgrade ;;",
  "replace": "    uv)           printf '%s\\n' uv lock ;;",
  "test": "bash linux/scripts/tests/test-renovate-lockmaint.sh",
  "why": "a plain `uv lock` keeps every locked version that still satisfies the manifest, so a maintenance run moved nothing: WebDavClient's uv.lock sat 41 packages behind that way"
 },
 {
  "id": "renovate.lock-maintenance-is-opt-in",
  "target": "linux/scripts/renovate_planner.py",
  "find": "    on = isinstance(top, dict) and top.get(\"enabled\") is True",
  "replace": "    on = True",
  "test": "bash linux/scripts/tests/test-renovate-lockmaint.sh",
  "why": "Renovate ships lockFileMaintenance off; reading it as on would rewrite every lock of a repo whose config never asked for it"
 },
 {
  "id": "renovate.lock-maintenance-once-per-lock",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  rl_has \"$4\" ${MAINT_SEEN[@]+\"${MAINT_SEEN[@]}\"} && return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-renovate-lockmaint.sh",
  "why": "every workspace member reports its own package file but shares the root lock; without the dedup a cargo workspace ran cargo update once per member"
 },
 {
  "id": "renovate.lock-maintenance-dry-run-puts-the-lock-back",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "    cp -p \"${keep}\" \"${dir}/${lock}\"; rm -f \"${keep}\"\n",
  "replace": "    rm -f \"${keep}\"\n",
  "test": "bash linux/scripts/tests/test-renovate-lockmaint.sh",
  "why": "the report half promises it writes no lock; a dry run that writes one anyway must be undone, or a report leaves a moved lock in the tree"
 },
 {
  "id": "renovate.lock-maintenance-dry-run-needs-its-summary",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "    uv)    grep -qE '^Resolved [0-9]+ package' <<<\"${out}\" || return 0\n",
  "replace": "    uv)\n",
  "test": "bash linux/scripts/tests/test-renovate-lockmaint.sh",
  "why": "counting change lines in output that is not uv's resolver summary reads an error, or a stub's silence, as '0 entries would move': an up-to-date claim nobody measured"
 },
 {
  "id": "renovate.lock-maintenance-dry-run-failure-is-unknown",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "  if [ \"${rc}\" -ne 0 ]; then\n    printf \"behind: unknown",
  "replace": "  if false; then\n    printf \"behind: unknown",
  "test": "bash linux/scripts/tests/test-renovate-lockmaint.sh",
  "why": "a dry run that failed half way may have printed some change lines; counting them reports a partial number as the whole drift"
 },
 {
  "id": "renovate.annotated-values-parse",
  "target": "linux/scripts/01-core/versions.env",
  "find": "extractVersion=^therock-(?<version>.*)$ versioning=loose\n",
  "replace": "extractVersion=^therock-(?<version>.*)$\n",
  "test": "bash linux/scripts/tests/test-renovate-annotations.sh",
  "why": "ROCM_VERSION=10.0 is not semver, so without versioning=loose Renovate skips it as invalid-value and TheRock 10.1 is never reported"
 },
 {
  "id": "wheels.ft-verify-gil-abi-exact",
  "target": "linux/scripts/03-media/runtime/verify-wheels.sh",
  "find": "  if [ \"${abi}\" = \"${PY_ABI}\" ]; then\n    [ \"${pyt}\" = \"${PY_TAG}\" ]\n    return\n  fi\n",
  "replace": "  if [ \"${abi%t}\" = \"${PY_ABI}\" ] || [ \"${abi}\" = \"${PY_ABI}\" ]; then\n    return 0\n  fi\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "a cp314t twin dropped into /opt/wheels would pass the GIL verify and reach the GIL venv's install"
 },
 {
  "id": "wheels.ft-verify-threading-abi-fatal",
  "target": "linux/scripts/03-media/runtime/verify-wheels.sh",
  "find": "    print((\"ABI \" if m.group(1) != want_t else \"ARCH \") + n)\n",
  "replace": "    print(\"ARCH \" + n)\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "a GIL-named wheel carrying a free-threaded module would pass as an advisory arch mismatch and fail at import"
 },
 {
  "id": "wheels.ft-verify-twin-store-strict",
  "target": "linux/scripts/03-media/runtime/verify-wheels.sh",
  "find": "_soabi_strict=\"${WHEEL_SOABI_STRICT:-${FREE_THREADED}}\"",
  "replace": "_soabi_strict=\"${WHEEL_SOABI_STRICT:-0}\"",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "a twin of another arch would be a warning, though a native twin can only be this arch's"
 },
 {
  "id": "wheels.ft-verify-no-abi3-twin",
  "target": "linux/scripts/03-media/runtime/verify-wheels.sh",
  "find": "    if free and b.endswith(\".abi3.so\"):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "an abi3 module would pass into the twin store, and 3.14t loads no stable-ABI module"
 },
 {
  "id": "wheels.ft-collect-own-store",
  "target": "linux/scripts/03-media/runtime/collect-artifacts.sh",
  "find": "  collect_component_wheels \"${ft_source_dir}\" \"${FT_WHEELS_DIR}\"\n",
  "replace": "  collect_component_wheels \"${ft_source_dir}\"\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "the twins would be collected into /opt/wheels, where the GIL venv installs them"
 },
 {
  "id": "wheels.ft-ort-manifest-own",
  "target": "linux/scripts/03-media/runtime/collect-artifacts.sh",
  "find": "write_ort_wheel_manifest /usr/local/lib/onnxruntime-cpu \"\" wheels-free-threaded ort-provenance-free-threaded.sha256\n",
  "replace": "write_ort_wheel_manifest /usr/local/lib/onnxruntime-cpu \"\" wheels-free-threaded ort-provenance.sha256\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "the twin's rows would overwrite the GIL manifest, and the GIL repair would then find no chain wheel"
 },
 {
  "id": "wheels.ft-repair-own-manifest",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "  _ORT_MANIFESTS=(/usr/local/lib/onnxruntime-*/ort-provenance-free-threaded.sha256)\n",
  "replace": "  _ORT_MANIFESTS=(/usr/local/lib/onnxruntime-*/ort-provenance.sha256)\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "the twin store's repair would check the GIL manifest, whose wheels are not there, and stop the media stage"
 },
 {
  "id": "wheels.ft-store-proved-again",
  "target": "linux/scripts/03-media/runtime/finalize-media.sh",
  "find": "    bash /opt/scripts/03-media/runtime/free-threaded-store.sh && \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "the repaired twins would ship unproved, with no record for the runtime smoke"
 },
 {
  "id": "wheels.ft-collect-tree-skips-twins",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "! -name \"*-cp3[0-9]*t-*.whl\" ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a cp314t wheel left in an ORT build tree would be collected as a GIL wheel"
 },
 {
  "id": "wheels.ft-gate-name",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "bad = [] if parts[-3:-1] == [tag, tag + \"t\"] else",
  "replace": "bad = [] if True else",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a GIL-named wheel would be stored as a twin"
 },
 {
  "id": "wheels.ft-gate-gil-module",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "and base.endswith(\".so\") and not base.endswith(want)):",
  "replace": "and base.endswith(\".so\") and False):",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a cp314t-named wheel holding GIL or foreign-arch modules would be stored"
 },
 {
  "id": "wheels.ft-proof-before-store",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "  ft_prove_wheel \"${wheel}\" \"${dist}\" || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a twin whose modules re-enable the GIL would be stored unproved"
 },
 {
  "id": "wheels.ft-cross-target",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "  if _ft_cross; then\n    ft_target_resolve || {",
  "replace": "  if false; then\n    ft_target_resolve || {",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a cross build would build its twins against the host 3.14t alone, stamped with the host SOABI, and never fail for a missing target tree"
 },
 {
  "id": "wheels.ft-venv-mirrors-gil",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "      printf 'free-threaded: the GIL build venv %s has no %s, so its twin has no version to match\\n' \"${gil}\" \"${pkg}\" >&2\n      return 1\n",
  "replace": "      reqs+=(\"${pkg}\"); continue\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a build executor missing from the GIL venv would float to PyPI's latest in the twin's"
 },
 {
  "id": "wheels.ft-table-pin-recheck",
  "target": "linux/scripts/03-media/free-threaded-twins.txt",
  "find": "av|twin|PYAV_VERSION=19.0.2|",
  "replace": "av|twin|PYAV_VERSION=19.0.0|",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a pin bump would keep a verdict read at another release, on both lanes, which read this one file"
 },
 {
  "id": "wheels.ft-store-set-missing",
  "target": "linux/scripts/03-media/runtime/free-threaded-store.sh",
  "find": "    echo \"ERROR: ${d} ships a GIL wheel in ${WHEELS_DIR} and its table verdict is twin, but ${FT_WHEELS_DIR} has no free-threaded twin of it\" >&2\n    bad=1\n",
  "replace": "    echo \"ERROR: ${d} ships a GIL wheel in ${WHEELS_DIR} and its table verdict is twin, but ${FT_WHEELS_DIR} has no free-threaded twin of it\" >&2\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "a native media stage could ship without a twin it owes"
 },
 {
  "id": "wheels.ft-store-unclassified",
  "target": "linux/scripts/03-media/runtime/free-threaded-store.sh",
  "find": "    if [ \"$(ft_wheel_verdict \"${d}\")\" = unknown ]; then\n",
  "replace": "    if false; then\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "a new wheel would ship, natively or cross, without anyone reading its free-threading support"
 },
 {
  "id": "wheels.torch-source-package-version",
  "target": "linux/scripts/05-frameworks/torch/torch-source-pins.sh",
  "find": "    PYTORCH_VERSION=\"${PYTORCH_VERSION#v}\"\n",
  "replace": "    PYTORCH_VERSION=\"${PYTORCH_VERSION}\"\n",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "a source tag with v would be passed as an invalid uv package version"
 },
 {
  "id": "wheels.torch-source-ref-drift",
  "target": "linux/scripts/05-frameworks/torch/torch-source-pins.sh",
  "find": "    if [[ \"${PYTORCH_REF}\" =~ $version_tag_re && \"${PYTORCH_REF#v}\" != \"${PYTORCH_VERSION#v}\" ]]; then\n",
  "replace": "    if false; then\n",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "numeric or v-prefixed Torch source tags must agree with the package release"
 },
 {
  "id": "wheels.torch-source-commit-needs-version",
  "target": "linux/scripts/05-frameworks/torch/torch-source-pins.sh",
  "find": "    if [ -z \"${PYTORCH_VERSION:-}\" ] && [[ ! \"${PYTORCH_REF}\" =~ $version_tag_re ]]; then\n",
  "replace": "    if false; then\n",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "a commit ref without a package version would reach uv as an invalid version"
 },
 {
  "id": "wheels.vision-source-ref-drift",
  "target": "linux/scripts/05-frameworks/torch/torch-source-pins.sh",
  "find": "    if [[ \"${TORCHVISION_REF}\" =~ $version_tag_re && -n \"${TORCHVISION_VERSION:-}\" && \"${TORCHVISION_REF#v}\" != \"${TORCHVISION_VERSION#v}\" ]]; then\n",
  "replace": "    if false; then\n",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "numeric or v-prefixed TorchVision source tags must agree with the release"
 },
 {
  "id": "wheels.ft-knob-off",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "    twin:*) knob=\"${verdict#twin:}\"; [ \"${!knob:-0}\" = 1 ] ;;\n",
  "replace": "    twin:*) return 0 ;;\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "FT_TORCH_TWIN=0 would still demand the riscv64 torch twin, so the escape hatch could never turn it off"
 },
 {
  "id": "wheels.torch-ft-args-afresh",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    local -a cmake_args=()\n    python_sysconfig_export=\"$(ft_target_env)\"\n",
  "replace": "    local -a cmake_args=()\n    python_sysconfig_export=\"$(ft_target_env)\"\n    local CROSS_PYTHON_INCLUDE_DIR=\"\" CROSS_PYTHON_LIBRARY=\"\"\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "the torch twin would compile against the target GIL headers again and ship the GIL libtorch_python.so under a cp314t name, which segfaults in dlopen"
 },
 {
  "id": "wheels.ft-proof-says-why",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "\"${3:-the proof printed nothing}\" \"$(_ft_exit_status \"$2\")\" \"${dying}\"",
  "replace": "\"${3:-}\" \"\" \"\"",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a twin that kills the target interpreter would fail its proof with an empty reason again, as the riscv64 torch twin did"
 },
 {
  "id": "wheels.ft-proof-encloses-package",
  "target": "linux/scripts/02-toolchain/python/free-threaded-wheel.py",
  "find": "                enclose(name)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "torch._C's init would import an unimportable torch, and no torch twin could ever be proved"
 },
 {
  "id": "probe.ft-store-proved",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "    if printf '%s\\n' \"${probe}\" | grep -q -e \"^FTS PROVED ${w%%-*} \"; then\n",
  "replace": "    if true; then\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "a shipped twin that re-enables the GIL on python3.14t would pass the smoke"
 },
 {
  "id": "probe.ft-store-families-exact",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "  if [ \"${fam_want}\" = \"${fam_have}\" ]; then\n",
  "replace": "  if true; then\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "a store with a twin whose GIL package left /opt/venv would pass"
 },
 {
  "id": "probe.ft-store-wants-record",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "    twin | twin:*) printf '%s\\n' \"$1\" | grep -q -x -e \"FTS RECORD want $(ft_wheel_row \"$2\" | cut -d'|' -f1)\" ;;\n",
  "replace": "    twin | twin:*) return 0 ;;\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "an index-installed package (amd64's PyPI torch, arm64's PyPI IREE compiler) would demand a twin no chain builds"
 },
 {
  "id": "wheels.ft-cross-gate-target-suffix",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "  if [ -z \"${want}\" ] && _ft_cross; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a cross twin would be gated against the host 3.14t's suffix, which no riscv64 module carries"
 },
 {
  "id": "wheels.ft-gate-platform-machine",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "if not all(p.endswith(\"_\" + machine) for p in parts[-1].split(\".\")):\n",
  "replace": "if False:\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a riscv64 twin tagged linux_x86_64 would pass the gate and install on the wrong arch"
 },
 {
  "id": "wheels.ft-cross-proof-on-target",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "  if _ft_cross; then\n    ft_prove_wheel_on_target",
  "replace": "  if false; then\n    ft_prove_wheel_on_target",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a cross twin would be \"proved\" by the host 3.14t, which cannot load a riscv64 module, instead of the target one under qemu-user"
 },
 {
  "id": "probe.ft-store-wired",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    check_free_threaded_wheels \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "the shipped store would never be graded"
 },
 {
  "id": "ort-census.ft-store-ort-only",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    /opt/wheels-free-threaded/onnxruntime*.whl!*) return 0 ;;\n",
  "replace": "    /opt/wheels-free-threaded/*.whl!*) return 0 ;;\n",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "any twin in the store could carry a chain ORT copy unnoticed"
 },
 {
  "id": "ort-census.ft-manifests-read",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": " /usr/local/lib/onnxruntime-cpu/ort-provenance-free-threaded.sha256 /usr/local/lib/onnxruntime-gpu/ort-provenance-free-threaded.sha256\"",
  "replace": "\"",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "G1 would call the shipped ORT twin's pybind module STALE"
 },
 {
  "id": "ort-census.library-path-reaches-probe",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  if [ -n \"${4:-}\" ]; then printf '%s\\n' --ld-library-path \"$4\"; fi",
  "replace": "  if false; then printf '%s\\n' --ld-library-path \"$4\"; fi",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the launcher's library path must reach the probe, or a module that may not be patched stays UNRESOLVED"
 },
 {
  "id": "ort-census.library-path-root-relative",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "      \"${base}\"/*) inside=\"${inside#\"${base}\"}\" ;;",
  "replace": "      \"${base}\"/*) ;;",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the probe joins a library path to its --root itself; a host path is searched below the bundle and finds nothing"
 },
 {
  "id": "ort-census.library-path-absolute",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "      //*) echo \"check-ort-provenance: --library-path entry '${entry}' is absolute",
  "replace": "      //NEVER*) echo \"check-ort-provenance: --library-path entry '${entry}' is absolute",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an absolute path that also names a bundle directory (/lib) would be read as the bundle's own"
 },
 {
  "id": "ort-census.library-path-dotdot",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "      */../*) echo \"check-ort-provenance: --library-path entry '${entry}' leaves the bundle",
  "replace": "      */NEVER/*) echo \"check-ort-provenance: --library-path entry '${entry}' leaves the bundle",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a '..' from the bundle root leaves the bundle or hides which of its directories is meant; it is refused by name"
 },
 {
  "id": "ort-census.library-path-exists",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "&& pwd -P)\" || inside=\"\"",
  "replace": "&& pwd -P)\" || inside=\"${base}/${entry}\"",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a directory the bundle lacks is a stale statement about its launcher, not an empty search"
 },
 {
  "id": "ort-census.library-path-physical",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "cd -- \"$1/${entry}\" 2>/dev/null && pwd -P)",
  "replace": "cd -- \"$1/${entry}\" 2>/dev/null && pwd)",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a link out of the bundle names a directory the package does not carry; only its physical path shows that"
 },
 {
  "id": "ort-census.library-path-empty",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    *::* | *$'\\n'*) echo \"check-ort-provenance: --library-path needs",
  "replace": "    NEVER) echo \"check-ort-provenance: --library-path needs",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "an empty entry is named as one; left to the next check it reads as an absolute path"
 },
 {
  "id": "ort-census.library-path-image",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    if [ \"${libset}\" = 1 ]; then\n      echo \"check-ort-provenance: --library-path describes",
  "replace": "    if false; then\n      echo \"check-ort-provenance: --library-path describes",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "--image reads the running system's LD_LIBRARY_PATH; a stated path would be dropped without a word"
 },
 {
  "id": "ort-census.library-path-label",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    label+=\" (library path ${libpath})\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the verdict line names the library path it assumed, or a green log hides the caller's statement"
 },
 {
  "id": "ort-census.probe-ldpath-before-runpath",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "        for d in rpath + self.ldpath + runpath + self.search:",
  "replace": "        for d in rpath + runpath + self.ldpath + self.search:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "ld.so searches the library path before DT_RUNPATH, so a launcher's path can shadow an importer's own $ORIGIN copy"
 },
 {
  "id": "ort-census.library-path-unproven-name-ends-search",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "            if self.stated and d in self.ldpath and os.path.lexists(host(self.root, posixpath.join(d, name))):",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "ld.so opens a link out of the bundle or a directory of the import's name and never reaches the chain core behind it; counted as absent, a foreign ONNX Runtime passes"
 },
 {
  "id": "python.free-threaded-helper.bare-so-needs-pyinit",
  "target": "linux/scripts/02-toolchain/python/free-threaded-wheel.py",
  "find": "            if suffix in BARE_SUFFIXES and not exports_init(str(item.locate()), name):\n                continue\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "a library bundled beside the modules, such as ORT's providers_shared, would be loaded as one and fail the proof"
 },
 {
  "id": "python.free-threaded-helper.pyinit-whole-name",
  "target": "linux/scripts/02-toolchain/python/free-threaded-wheel.py",
  "find": ".rsplit(\".\", 1)[-1].encode() + b\"\\0\"",
  "replace": ".rsplit(\".\", 1)[-1].encode()",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "a library whose symbols merely begin with PyInit_<its name> would count as a module"
 },
 {
  "id": "wheels-source.ft-sealed",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  _runtime_wheels_manifest \"${dir}/opt\" > \"${dir}.sha256\" || return 1\n",
  "replace": "  _runtime_wheels_manifest \"${dir}/opt/wheels\" > \"${dir}.sha256\" || return 1\n",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "a twin changed after the export would reach the wrapper"
 },
 {
  "id": "wheels-source.ft-context-exports-twins",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "tar -xpf - -C \"$2\" opt/wheels opt/wheels-free-threaded",
  "replace": "tar -xpf - -C \"$2\" opt/wheels",
  "test": "bash linux/scripts/tests/test-runtime-wheels-context.sh",
  "why": "a --no-push wrapper build would find no /opt/wheels-free-threaded to copy and fail"
 },
 {
  "id": "wheels-source.ft-wrapper-ships-store",
  "target": "linux/Dockerfile.torch",
  "find": "# Late, so a new twin re-keys no venv or Hailo layer; no GIL path reads them: docs/consumer-image-contract.md#the-free-threaded-wheels\nCOPY --link --from=wheels-source /opt/wheels-free-threaded /opt/wheels-free-threaded\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": ":latest would ship no twin at all"
 },
 {
  "id": "wheels.iree-ft-pass-called",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    _iree_package_wheels || return 1\n    _iree_package_free_threaded_wheels\n",
  "replace": "    _iree_package_wheels || return 1\n",
  "test": "bash linux/scripts/tests/test-iree-wheelhouse-stages.sh",
  "why": "IREE would ship no cp314t twin"
 },
 {
  "id": "wheels.iree-ft-proof-fails-build",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "        ft_twin_store_built \"${ft_dist}/${_proj}\" \"${APP_WHEELHOUSE_FT_DIR}\" || return 1\n",
  "replace": "        ft_twin_store_built \"${ft_dist}/${_proj}\" \"${APP_WHEELHOUSE_FT_DIR}\" || true\n",
  "test": "bash linux/scripts/tests/test-iree-wheelhouse-stages.sh",
  "why": "an unproved IREE twin would go missing without failing the required IREE build"
 },
 {
  "id": "wheels.iree-configure-settled",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    cmake \"$@\" > \"${log}\" 2>&1 || return 1\n    cmake \"$@\" >> \"${log}\" 2>&1\n",
  "replace": "    cmake \"$@\" > \"${log}\" 2>&1\n",
  "test": "bash linux/scripts/tests/test-iree-wheelhouse-stages.sh",
  "why": "the GIL tree would build unsettled, and the cp314t twin's reconfigure would recompile 1187 more objects, 757 of them compiler sources, and relink libIREECompiler.so"
 },
 {
  "id": "wheels.iree-native-configure-settled",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    _iree_target_configure \"IREE native\" \"IREE native configure failed\" -G Ninja -S \"${src_dir}\" -B \"${target_build}\"",
  "replace": "    cmake -G Ninja -S \"${src_dir}\" -B \"${target_build}\"",
  "test": "bash linux/scripts/tests/test-iree-wheelhouse-stages.sh",
  "why": "the native GIL wheels would come from an unsettled tree, which the twin's reconfigure then changes on 1187 non-Python compile lines"
 },
 {
  "id": "wheels.iree-cross-configure-settled",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    _iree_target_configure \"IREE target\" \"IREE riscv64 runtime configure failed (best-effort); continuing without it\" -G Ninja -S \"${src_dir}\" -B \"${target_build}\"",
  "replace": "    cmake -G Ninja -S \"${src_dir}\" -B \"${target_build}\"",
  "test": "bash linux/scripts/tests/test-iree-wheelhouse-stages.sh",
  "why": "the arm64 and riscv64 target trees would build unsettled, so a later reconfigure would recompile most of their runtime objects"
 },
 {
  "id": "wheels.ft-twin-leaves-tree",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "  ft_store_twin \"${wheel}\" \"$2\" || return 1\n  rm -f \"${wheel}\"\n",
  "replace": "  ft_store_twin \"${wheel}\" \"$2\" || return 1\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a stored twin left in an ORT build tree is one GIL collection away from /opt/wheels"
 },
 {
  "id": "wheels.ft-twin-start-skips",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "  if [ \"${rc}\" -ne 0 ]; then\n    return \"${rc}\"\n  fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a GIL-only or unknown package would get a twin build venv and a twin pass"
 },
 {
  "id": "wheels.ft-table-missing-fails",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "  if [ ! -f \"${_FTW_TABLE}\" ]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a RUN without the table mount must name the missing file, not fail inside sed"
 },
 {
  "id": "wheels.ft-table-missing-no-verdict",
  "target": "linux/scripts/03-media/free-threaded-wheels.sh",
  "find": "    *) return \"${rc}\" ;;\n  esac\n  row=\"${row#*|}\"\n",
  "replace": "    *) printf 'unknown\\n'; return 0 ;;\n  esac\n  row=\"${row#*|}\"\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a missing table read as unknown would let a cross store record no verdicts and pass"
 },
 {
  "id": "wheels.ft-table-one-source",
  "target": "windows/scripts/modules/WindowsPythonWheel.Common.psm1",
  "find": "function Get-FreeThreadedTwinTable {\n",
  "replace": "# 'onnxruntime|twin|ONNXRUNTIME_VERSION=v1.30.0|an inline copy'\nfunction Get-FreeThreadedTwinTable {\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "a second copy of a row in either reader is how the two lanes drifted apart before the shared file"
 },
 {
  "id": "wheels.ft-table-mounted",
  "target": "linux/Dockerfile.media",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/03-media/runtime,target=/opt/scripts/03-media/runtime,readonly \\\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-wheels.sh,target=/opt/scripts/03-media/free-threaded-wheels.sh,readonly \\\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=/opt/scripts/03-media/free-threaded-twins.txt,readonly \\\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/03-media/runtime,target=/opt/scripts/03-media/runtime,readonly \\\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-wheels.sh,target=/opt/scripts/03-media/free-threaded-wheels.sh,readonly \\\n",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "the final RUN would source the library without its table and stop the store proof"
 },
 {
  "id": "wheels.ft-store-needs-table",
  "target": "linux/scripts/03-media/runtime/free-threaded-store.sh",
  "find": "ft_wheel_table >/dev/null || exit 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "a cross build without the table would write a record with no verdicts and pass"
 },
 {
  "id": "wheels.target-sysconfigdata-in-lib-dynload",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "  dir=\"$(find \"${root}/lib\" -maxdepth 4 -name",
  "replace": "  dir=\"$(find \"${root}/lib\" -maxdepth 2 -name",
  "test": "bash linux/scripts/tests/test-wheelhouse-sysconfig-env.sh",
  "why": "a staged interpreter keeps the target sysconfigdata in lib-dynload; missed, tvm-ffi's Cython core is stamped with the host SOABI (CON114)"
 },
 {
  "id": "wheels.staged-sysconfigdata-wins",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    dir=\"$(cross_target_sysconfigdata_dir \"${target_triplet}\" \"${stage_root}\" || true)\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-wheelhouse-sysconfig-env.sh",
  "why": "the staged target's own sysconfigdata must win over the one synthesised from the pinned interpreter (CON114)"
 },
 {
  "id": "probe.ft-store-table-missing",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "  ft_wheel_table >/dev/null 2>&1 || { echo \"BAD the twin table is not at ${_FTS_HERE}/../03-media/free-threaded-twins.txt\"; return 1; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "the smoke would grade every twin against an empty table instead of naming the missing file"
 },
 {
  "id": "probe.ft-store-env",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "  if [ \"${env}\" = /opt/wheels-free-threaded ]; then\n",
  "replace": "  if true; then\n",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "an image without PYTHON_WHEELS_FREE_THREADED leaves every 3.14t venv refused by the chain-ORT reconcile"
 },
 {
  "id": "uv-chain-ort.ft-twin-store",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "      cp*t) info \"chain ORT: $3 is free-threaded, so it takes the twins in ${twins}\" >&2; printf '%s\\n' \"${twins}\"; return 0 ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "a 3.14t leg inside our images would be refused on the ABI although the image ships the ORT twin"
 },
 {
  "id": "uv-chain-ort.ft-gil-venv-keeps-gil-store",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    case \"$(_uv_chain_ort_abi \"$2\" 2>/dev/null)\" in\n",
  "replace": "    case cp314t in\n",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "a GIL venv given the twin store would get a cp3XYt wheel it cannot load"
 },
 {
  "id": "uv-chain-ort.ft-installed-flavour-only",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    if [ \"$1\" = \"$2\" ] || compgen -G \"$2/${d%%-*}-*.whl\" >/dev/null; then printf '%s\\n' \"${w}\"; fi\n",
  "replace": "    printf '%s\\n' \"${w}\"\n",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "a GPU image's twin store holds two ORT flavours, and a venv given both has two cores"
 },
 {
  "id": "uv-chain-ort.ft-torch-env",
  "target": "linux/Dockerfile.torch",
  "find": "ENV PYTHON_WHEELS_FREE_THREADED=/opt/wheels-free-threaded\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-uv-chain-ort.sh",
  "why": "without the advertisement the reconcile never finds the twins the image ships"
 },
 {
  "id": "uv-cache-seed.proof-detects-a-build",
  "target": "linux/scripts/06-packaging/uv-cache-seed.sh",
  "find": "    if grep -qE '^[[:space:]]*(Building|Built) ' \"${tmp}/proof-${i}.log\" || ! cmp -s \"${tmp}/before.txt\" \"${tmp}/after.txt\"; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "a seed that does not cover the lock would ship as proved, and the riscv64 lane would build numpy again"
 },
 {
  "id": "uv-cache-seed.stale-versions-dropped",
  "target": "linux/scripts/06-packaging/uv-cache-seed.sh",
  "find": "    grep -qxF -e \"${name} ${version}\" <<<\"${keep}\" || rm -rf \"${dir}\"",
  "replace": "    grep -qxF -e \"${name} ${version}\" <<<\"${keep}\" || true",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "the persistent work cache keeps every version it ever built, and the seed would grow with each lock bump"
 },
 {
  "id": "uv-cache-seed.verify-wants-every-listed-wheel",
  "target": "linux/scripts/06-packaging/uv-cache-seed.sh",
  "find": "  [ -z \"${misses}\" ] || die",
  "replace": "  true || die",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "a record naming wheels the cache lacks would read as a seeded image"
 },
 {
  "id": "uv-cache-seed.restore-only-its-arch",
  "target": "linux/scripts/02-toolchain/python/ci-common.sh",
  "find": "  if ! grep -qxF \"arch $(uname -m)\" \"${record}\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "another arch's built wheels would be copied into the consumer's cache"
 },
 {
  "id": "uv-cache-seed.row-riscv64-must-be-seeded",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "      *) printf 'BAD %s the riscv64 seed does not verify: %s' \"${row}\" \"${have}\" ;;",
  "replace": "      *) printf 'OK %s %s' \"${row}\" \"${have}\" ;;",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "a riscv64 image without its seed would pass the contract"
 },
 {
  "id": "uv-cache-seed.seeds-the-free-threaded-twin",
  "target": "linux/scripts/06-packaging/uv-cache-seed.sh",
  "find": "seed_requests() { printf '%s+gil\\n%st\\n' \"$1\" \"$1\"; }",
  "replace": "seed_requests() { printf '%s+gil\\n' \"$1\"; }",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "the seed would cover the GIL leg alone, and the riscv64 X.Yt leg would build every compiled dependency under QEMU again"
 },
 {
  "id": "uv-cache-seed.verify-wants-a-free-threaded-pass",
  "target": "linux/scripts/06-packaging/uv-cache-seed.sh",
  "find": "  grep -q '^python .*t$' \"${record}\" || die",
  "replace": "  true || die",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "an image whose seed lost its X.Yt pass would pass the contract row"
 },
 {
  "id": "uv-cache-seed.verify-matches-the-abi-tag",
  "target": "linux/scripts/06-packaging/uv-cache-seed.sh",
  "find": "    re=\"-${abi:-[^-]+}-[^-]+\\\\.whl\\$\"",
  "replace": "    re=\"-[^-]+-[^-]+\\\\.whl\\$\"",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "a cp314 wheel would stand in for its missing cp314t twin, since both carry the python tag cp314"
 },
 {
  "id": "uv-cache-seed.venv-refuses-the-other-build",
  "target": "linux/scripts/06-packaging/uv-cache-seed.sh",
  "find": "    *) die \"asked uv for ${request}, it gave ${got}\" ;;",
  "replace": "    *) printf '%s\\n' \"${got}\" ;;",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "a GIL venv standing in for X.Yt would seed and prove the cp314 wheels twice and no cp314t one"
 },
 {
  "id": "uv-cache-seed.never-downloads-an-interpreter",
  "target": "linux/scripts/06-packaging/uv-cache-seed.sh",
  "find": "  UV_PYTHON_DOWNLOADS=never uv venv -q",
  "replace": "  uv venv -q",
  "test": "bash linux/scripts/tests/test-uv-cache-seed.sh",
  "why": "a missing image interpreter would be downloaded, and the seed built for a Python no lane runs"
 },
 {
  "id": "python.ft-sysconfig-fix-swaps-a-missing-tool",
  "target": "linux/scripts/06-packaging/free-threaded-sysconfig-tools.py",
  "find": "            new = re.sub(re.escape(old) + r\"(?![\\w.+-])\", name, new)",
  "replace": "            new = new",
  "test": "bash linux/scripts/tests/test-free-threaded-sysconfig-tools.sh",
  "why": "the riscv64 X.Yt would keep naming an ar the image lacks, and pillow's cp314t build dies with exit 127"
 },
 {
  "id": "python.ft-sysconfig-swap-replaces-the-whole-path",
  "target": "linux/scripts/06-packaging/free-threaded-sysconfig-tools.py",
  "find": "re.escape(old) + r\"(?![\\w.+-])\"",
  "replace": "re.escape(old)",
  "test": "bash linux/scripts/tests/test-free-threaded-sysconfig-tools.sh",
  "why": "swapping a missing gcc would also rewrite the longer gcc-ar path it prefixes"
 },
 {
  "id": "python.ft-sysconfig-check-fails-a-missing-tool",
  "target": "linux/scripts/06-packaging/free-threaded-sysconfig-tools.py",
  "find": "    if bad:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-free-threaded-sysconfig-tools.sh",
  "why": "the torch stage would ship an X.Yt whose sysconfig names a tool the image lacks"
 },
 {
  "id": "lint-tools.row-compares-the-pins",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  elif [ \"${have}\" != \"${want}\" ]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-lint-tools.sh",
  "why": "an image whose shellcheck or hadolint is missing or off its pin would pass the contract"
 },
 {
  "id": "lint-tools.install-checks-the-version",
  "target": "linux/scripts/06-packaging/install-lint-tools.sh",
  "find": "[ \"${have}\" = \"${SHELLCHECK_VERSION#v}\" ] || die",
  "replace": "true || die",
  "test": "bash linux/scripts/tests/test-lint-tools.sh",
  "why": "a shellcheck that is not the pinned one would ship"
 },
 {
  "id": "lint-tools.riscv64-reports-no-hadolint",
  "target": "linux/scripts/06-packaging/install-lint-tools.sh",
  "find": "  printf 'install-lint-tools: NOTE: hadolint publishes no %s binary; none is installed\\n' \"${arch}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-lint-tools.sh",
  "why": "a riscv64 install would drop hadolint without saying so in the build log"
 },
 {
  "id": "lint-tools.gitleaks-planted-token",
  "target": "linux/scripts/06-packaging/install-lint-tools.sh",
  "find": "  [ \"${gl_rc}\" = 7 ] || die \"gitleaks did not report a planted GitHub token (exit ${gl_rc})\"",
  "replace": "  [ \"${gl_rc}\" = 7 ] || true",
  "test": "bash linux/scripts/tests/test-lint-tools.sh",
  "why": "a gitleaks that finds nothing would turn the offline secret scan into a pass (CON222)"
 },
 {
  "id": "lint-tools.contract-wants-no-hadolint-on-riscv64",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "                       [ \"${arch}\" != riscv64 ] || { _hl=''; _gl=''; }",
  "replace": "                       [ \"${arch}\" != riscv64 ] || { _gl=''; }",
  "test": "bash linux/scripts/tests/test-lint-tools.sh",
  "why": "every riscv64 image would fail the lint-tools row for a hadolint it is not meant to ship"
 },
 {
  "id": "lint-tools.contract-wants-no-gitleaks-on-riscv64",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "                       [ \"${arch}\" != riscv64 ] || { _hl=''; _gl=''; }",
  "replace": "                       [ \"${arch}\" != riscv64 ] || { _hl=''; }",
  "test": "bash linux/scripts/tests/test-lint-tools.sh",
  "why": "gitleaks publishes no riscv64 binary, so a riscv64 image must report none (CON222)"
 },
 {
  "id": "wheel-smoke.import-from-the-venv",
  "target": "linux/scripts/02-toolchain/python/wheel-smoke.py",
  "find": "        if not inside(where, prefix):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-wheel-smoke.sh",
  "why": "the source tree beside the checkout would satisfy the import, and the wheel would never be graded"
 },
 {
  "id": "wheel-smoke.compiled-modules-load",
  "target": "linux/scripts/02-toolchain/python/wheel-smoke.py",
  "find": "    failures += ftw.load_all(modules)[1]",
  "replace": "    ftw.load_all(modules)",
  "test": "bash linux/scripts/tests/test-wheel-smoke.sh",
  "why": "a compiled module built for the wrong arch would pass whenever the package body does not import it"
 },
 {
  "id": "wheel-smoke.exactly-one-wheel",
  "target": "linux/scripts/02-toolchain/python/ci-wheel-smoke.sh",
  "find": "[ \"${#wheels[@]}\" -eq 1 ] \\",
  "replace": "[ \"${#wheels[@]}\" -ge 0 ] \\",
  "test": "bash linux/scripts/tests/test-wheel-smoke.sh",
  "why": "a dist/ without the riscv64 wheel, or with two, would smoke whichever came first"
 },
 {
  "id": "packaging.host-payload-rust-native-kept",
  "target": "linux/scripts/06-packaging/prune-host-payload.sh",
  "find": "  if compgen -G \"${rustup}/toolchains/*-${triple}\" >/dev/null; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-host-payload.sh",
  "why": "amd64's copied toolchain is its own, and so is a native arm64 artifact's; without the triple check HOST_PAYLOAD=off would empty a working rustup and force a reinstall the package stage never needed"
 },
 {
  "id": "packaging.host-payload-cargo-registry-kept",
  "target": "linux/scripts/06-packaging/prune-host-payload.sh",
  "find": "  _empty_dir \"${cargo}\" registry",
  "replace": "  _empty_dir \"${cargo}\"",
  "test": "bash linux/scripts/tests/test-host-payload.sh",
  "why": "ensure_native_rust_toolchain spares the cargo registry, so the arm64 image always shipped the artifact's; the prune must leave the same bytes or it changes the image instead of only its layers"
 },
 {
  "id": "packaging.host-payload-marker-written",
  "target": "linux/scripts/06-packaging/prune-host-payload.sh",
  "find": "  } > \"${payload}/${ANDROID_PAYLOAD_OFF_MARKER}\"",
  "replace": "  } > /dev/null",
  "test": "bash linux/scripts/tests/test-host-payload.sh",
  "why": "smoke-android.sh, the emulator installer and the contract gate read the marker; an emptied /opt/android without it reads as a lost SDK, and the arm64 smoke goes red on its own pruning"
 },
 {
  "id": "packaging.host-payload-runs-before-the-copies",
  "target": "linux/Dockerfile.package",
  "find": "    HOST_PAYLOAD=\"${HOST_PAYLOAD}\" bash /tmp/prune-host-payload.sh \"${TARGET_ARCH:-${TARGETARCH}}\"",
  "replace": "    true",
  "test": "bash linux/scripts/tests/test-host-payload.sh",
  "why": "a prune that no stage runs saves nothing; it must run in artifact-source before the four COPYs, since after them the 3.4 GB are already layers of every arm64 and riscv64 image"
 },
 {
  "id": "packaging.host-payload-env-follows-the-payload",
  "target": "linux/Dockerfile.package",
  "find": "ARG ANDROID_PAYLOAD_ON=${HOST_PAYLOAD/off/}",
  "replace": "ARG ANDROID_PAYLOAD_ON=on",
  "test": "bash linux/scripts/tests/test-host-payload.sh",
  "why": "an arm64 image with an emptied /opt/android-sdk would still advertise ANDROID_HOME, the 'No Android SDK found' class the contract row exists for"
 },
 {
  "id": "packaging.host-payload-amd64-alone-by-default",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  local list=\"${HOST_PAYLOAD_ARCHES:-amd64}\" re=",
  "replace": "  local list=\"${HOST_PAYLOAD_ARCHES:-amd64,arm64,riscv64}\" re=",
  "test": "bash linux/scripts/tests/test-host-payload.sh",
  "why": "the default is the whole saving: 3.4 GB compressed per arm64 and riscv64 child, which every arm64 lane pulls"
 },
 {
  "id": "packaging.host-payload-artifact-without-sdk",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  [ \"${plat}\" = linux/amd64 ] || { printf '%s' off; return 0; }",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-host-payload.sh",
  "why": "a native arm64 artifact has no SDK (android-sdk.sh skips it off amd64); HOST_PAYLOAD=on there advertises ANDROID_HOME over an empty directory, which the contract row now fails"
 },
 {
  "id": "packaging.host-payload-contract-off-not-advertised",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    if [ -n \"${val}\" ] || [ -n \"${root}\" ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a payload-off image that still exports ANDROID_HOME sends flutter and Gradle to an empty SDK; SKIP would hide exactly that"
 },
 {
  "id": "packaging.host-payload-abi-off-marker-honest",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      elif [ \"${total}\" -gt 0 ]; then\n        fail \"/opt/android/.android-payload-off says",
  "replace": "      elif false; then\n        fail \"/opt/android/.android-payload-off says",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "the ABI gate skips a payload-off image, so a marker left over a real payload would skip the one gate that judges /opt/android"
 },
 {
  "id": "packaging.host-payload-amd64-must-carry",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      if [ \"${target_arch}\" = amd64 ]; then\n        fail \"the amd64 image carries no Android payload",
  "replace": "      if false; then\n        fail \"the amd64 image carries no Android payload",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "a HOST_PAYLOAD_ARCHES without amd64 would publish an amd64 image with every Android gate skipped, and the Android lane breaks after the publish"
 },
 {
  "id": "packaging.host-payload-chain-checks-early",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  hailo_validate_knobs || exit 2\n  runtime_host_payload_arches >/dev/null || exit 2\n",
  "replace": "  hailo_validate_knobs || exit 2\n",
  "test": "bash linux/scripts/tests/test-host-payload.sh",
  "why": "the runtime lane reads HOST_PAYLOAD_ARCHES hours after the chain starts; a typo must stop the chain before its first stage, not at the first package build"
 },
 {
  "id": "python.app-bundle.runtime-follows-the-image",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "  v=\"$(python3 -c 'import sys; print(\"%d.%d.%d\" % sys.version_info[:3])' 2>/dev/null)\" || v=\"\"\n",
  "replace": "  v=\"\"\n",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "the pin runs ahead of the published image during an upgrade (CON90: 3.15.0 against an image on 3.14.8), and a runtime the wheels were not built for installs none of them"
 },
 {
  "id": "flutter.checks-coverage-dropped",
  "target": "linux/scripts/05-frameworks/flutter/flutter_checks.sh",
  "find": "_run flutter test --coverage --coverage-path \"${COVERAGE_PATH}\"",
  "replace": "_run flutter test",
  "test": "bash linux/scripts/tests/test-flutter-checks-platform.sh",
  "why": "--coverage must reach the gate's one test run; dropped, a lane's coverage floor reads a report nobody wrote, or runs the suite a second time"
 },
 {
  "id": "flutter.checks-coverage-on-chrome",
  "target": "linux/scripts/05-frameworks/flutter/flutter_checks.sh",
  "find": "if [ -n \"${COVERAGE_PATH}\" ] && [ \"${TEST_PLATFORM}\" != vm ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-flutter-checks-platform.sh",
  "why": "flutter test collects coverage on the VM only; without the refusal, --coverage with --test-platform chrome silently writes no report"
 },
 {
  "id": "readme-length.limit-enforced",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "    problems = [] if count <= LIMIT else",
  "replace": "    problems = [] if True else",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k lines",
  "why": "a README over 100 lines must fail, not print OK"
 },
 {
  "id": "readme-length.unterminated-last-line-counts",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "    return data.count(b\"\\n\") + (1 if data and not data.endswith(b\"\\n\") else 0)",
  "replace": "    return data.count(b\"\\n\")",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k lines",
  "why": "a last line without a newline is still a line; counting newlines alone lets a 101-line README through"
 },
 {
  "id": "readme-length.missing-readme-fails",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "    if not readme.is_file():",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k lines",
  "why": "a missing README is not a short one; without the check the gate crashes or reads green over nothing"
 },
 {
  "id": "readme-length.consumer-half-grades",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  _lint_gates_hub linux/scripts/verify_readme_length.py || return 1",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k wiring",
  "why": "the consumer half must run the gate and return its verdict, or lint-gates.yml passes every consumer README"
 },
 {
  "id": "readme-length.consumer-half-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  run_gate \"README length\" _lint_gates_readme\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k wiring",
  "why": "a gate function nothing registers never runs in a consumer lane"
 },
 {
  "id": "readme-length.word-limit",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "LIMITS = {\"words\": 700,",
  "replace": "LIMITS = {\"words\": 701,",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k words",
  "why": "700 words is the owner's limit; the 701st must fail"
 },
 {
  "id": "readme-length.token-needs-letter",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "WORD = re.compile(r\"[^\\W_]\")",
  "replace": "WORD = re.compile(r\"\\S\")",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k words",
  "why": "a table pipe or a dash is no word; counting them fails a README for its markup"
 },
 {
  "id": "readme-length.limit-binds-without-row",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "            if now > LIMITS[metric]:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k words",
  "why": "a figure without a census row meets its limit, or a new README has none"
 },
 {
  "id": "readme-length.census-graded",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        problems += grade(values, census)",
  "replace": "        problems += []",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k words",
  "why": "a seeded census must be graded, or seeding turns the gate off"
 },
 {
  "id": "readme-length.width-limit",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "WIDTH = 160",
  "replace": "WIDTH = 161",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k width",
  "why": "160 characters is the owner's limit; the 161st must fail"
 },
 {
  "id": "readme-length.wide-is-over-160",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        if len(line) > WIDTH:",
  "replace": "        if len(line) >= WIDTH:",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k width",
  "why": "a line of exactly 160 characters is within the limit"
 },
 {
  "id": "readme-length.wide-lines-named",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        sys.stderr.write(\"\".join(f\"      {README}:{n}: {chars} characters\\n\" for n, chars in wide))\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k width",
  "why": "a width finding names each wide line, or the author hunts for it"
 },
 {
  "id": "readme-length.badge-exempt",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        if number in inside or BADGE_LINE.match(line) or LINK_LINE.match(line):",
  "replace": "        if number in inside or LINK_LINE.match(line):",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k width",
  "why": "a badge line is exempt from the words and the width"
 },
 {
  "id": "readme-length.link-line-exempt",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        if number in inside or BADGE_LINE.match(line) or LINK_LINE.match(line):",
  "replace": "        if number in inside or BADGE_LINE.match(line):",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k width",
  "why": "a line that is only a link is exempt from the words and the width"
 },
 {
  "id": "readme-length.list-link-exempt",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "LINK_LINE = re.compile(rf\"^\\s*(?:[-*+]\\s+)?(?:",
  "replace": "LINK_LINE = re.compile(rf\"^\\s*(?:",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k width",
  "why": "a list item that holds one link is a link-only line"
 },
 {
  "id": "readme-length.overflow-counted",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "\"overflow\": sum(n - WIDTH for _, n in wide)",
  "replace": "\"overflow\": len(wide)",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k ratchet",
  "why": "overflow counts the characters past 160, so a wide line cannot grow unseen"
 },
 {
  "id": "readme-length.grew-fails",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        elif now > was:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k ratchet",
  "why": "a figure above its row is the regression the census exists to stop"
 },
 {
  "id": "readme-length.fell-fails",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        elif now < was:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k ratchet",
  "why": "a fallen figure must be written down, or the next commit may grow back into the slack"
 },
 {
  "id": "readme-length.write-never-raises",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "    rows: Census = {key: min(was, values[key[1]]) for key",
  "replace": "    rows: Census = {key: values[key[1]] for key",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k ratchet",
  "why": "--write that raises a row turns the ratchet into a recorder"
 },
 {
  "id": "readme-length.write-drops-met-rows",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "    return {key: value for key, value in rows.items() if value > LIMITS[key[1]]}",
  "replace": "    return rows",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k ratchet",
  "why": "a row at its limit goes, so the fixed limit binds again"
 },
 {
  "id": "readme-length.stale-rows-fail",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "if page != README or was <= LIMITS[metric]]",
  "replace": "if False]",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k ratchet",
  "why": "a row of another page or at its limit holds nothing and must not sit in the census"
 },
 {
  "id": "readme-length.seed-refuses-existing",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "    if census_path.exists():\n        raise CensusError(f\"{census_path} exists;",
  "replace": "    if False:\n        raise CensusError(f\"{census_path} exists;",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k ratchet",
  "why": "--seed over a census would raise every row at once"
 },
 {
  "id": "readme-length.census-spec-read",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "parts[1] not in spec.metrics",
  "replace": "parts[1] not in PROSE.metrics",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k ratchet",
  "why": "the README census has its own metrics; the shared reader must take them from the spec"
 },
 {
  "id": "readme-length.census-counts-whole",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "int(value) if metric in spec.counts else",
  "replace": "int(value) if metric == WORDS else",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k ratchet",
  "why": "the README figures are whole counts and are written as such"
 },
 {
  "id": "readme-length.seed-only-over-limit",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "float(v) for m, v in values.items() if v > LIMITS[m]}",
  "replace": "float(v) for m, v in values.items()}",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k consumer",
  "why": "a seed writes rows only for figures over their limit"
 },
 {
  "id": "readme-length.consumer-off-until-seeded",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        if hub:\n            raise CensusError(f\"{census_path} is missing",
  "replace": "        if True:\n            raise CensusError(f\"{census_path} is missing",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k consumer",
  "why": "an unseeded consumer is reported, not failed; otherwise the next pin bump reds every consumer at once"
 },
 {
  "id": "readme-length.hub-census-required",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        if hub:\n            raise CensusError(f\"{census_path} is missing",
  "replace": "        if False:\n            raise CensusError(f\"{census_path} is missing",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k hub",
  "why": "the hub grades its own README against its census; a missing one is an error"
 },
 {
  "id": "readme-length.badge-block-exempt",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "        if number in inside or BADGE_LINE",
  "replace": "        if BADGE_LINE",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k block",
  "why": "the generated badge block counts neither words nor width"
 },
 {
  "id": "readme-length.badge-block-one-line",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "    count = folded(count_lines(readme), text)",
  "replace": "    count = count_lines(readme)",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k block",
  "why": "the badge block, markers included, is one line toward the limit"
 },
 {
  "id": "readme-length.badge-block-needs-end",
  "target": "linux/scripts/verify_readme_length.py",
  "find": "    return found\n",
  "replace": "    return found + ([range(start, len(lines) + 1)] if start else [])\n",
  "test": "bash linux/scripts/tests/test-readme-length.sh -k block",
  "why": "an unterminated start marker exempts nothing"
 },
 {
  "id": "lint-gates.readme-badges-missing-badge-fails",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "        if name not in badged and name not in exempt and name not in automatic:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k rule",
  "why": "a workflow without a badge must fail; that half is the gate"
 },
 {
  "id": "lint-gates.readme-badges-stale-badge-fails",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "for name in sorted(badged - set(files))]",
  "replace": "for name in []]",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k rule",
  "why": "a badge naming a deleted workflow shows a dead status forever; the rule is two-way"
 },
 {
  "id": "lint-gates.readme-badges-badge-needs-svg",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "actions/workflows/{FILE}/badge\\.svg\"",
  "replace": "actions/workflows/{FILE}\"",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k rule",
  "why": "a link to the workflow page is no badge; without badge.svg any such link would count"
 },
 {
  "id": "lint-gates.readme-badges-shields-form-counts",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "\n                   rf\"|img\\.shields\\.io/github/actions/workflow/status/[^/\\s]+/[^/\\s]+/{FILE}(?![^?#)\\s\\]\\\"'<>])\")",
  "replace": "\n                   rf\"|(x)(y)\")",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k rule",
  "why": "a shields.io status badge with a short label is a badge too; without it a README of shields badges fails"
 },
 {
  "id": "lint-gates.readme-badges-name-ends-the-path",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "{FILE}(?![^?#)\\s\\]\\\"'<>])\")",
  "replace": "{FILE}\")",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k rule",
  "why": "GitHub's dynamic workflows (CodeQL, the dependency graph) badge a path, not a file; read as one, every README that shows them fails"
 },
 {
  "id": "lint-gates.readme-badges-missing-readme-fails",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "    if not readme.is_file():\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k rule",
  "why": "a missing README carries no badges; without the check the gate crashes instead of naming the rule"
 },
 {
  "id": "lint-gates.readme-badges-call-only-exempt",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "    return triggers(path) == [CALL]",
  "replace": "    return False",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k call",
  "why": "a reusable workflow never runs on its own, so it needs no badge"
 },
 {
  "id": "lint-gates.readme-badges-call-beside-other-needs-badge",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "    return triggers(path) == [CALL]",
  "replace": "    return CALL in (triggers(path) or [])",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k call",
  "why": "workflow_call beside push still runs on its own and needs its badge"
 },
 {
  "id": "lint-gates.readme-badges-mapping-form-read",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "        return list(on)",
  "replace": "        return []",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k call",
  "why": "the block mapping is the common form of on:; reading none of it exempts nothing"
 },
 {
  "id": "lint-gates.readme-badges-list-form-read",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "        return [item for item in on if isinstance(item, str)]",
  "replace": "        return []",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k call",
  "why": "on: [workflow_call] is the flow-list form and must be read"
 },
 {
  "id": "lint-gates.readme-badges-opt-in",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "    if not (root / ALLOW).is_file():",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k allow",
  "why": "without readme-badges.allow the gate is off, so no family repo turns red before it opts in"
 },
 {
  "id": "lint-gates.readme-badges-allow-badged-stale",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "        elif name in badged:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k allow",
  "why": "an exemption whose workflow is badged now is stale; the freeze is two-way"
 },
 {
  "id": "lint-gates.readme-badges-allow-gone-stale",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "        if name not in files:\n            problems.append(f\"{ALLOW} lists",
  "replace": "        if False:\n            problems.append(f\"{ALLOW} lists",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k allow",
  "why": "an exemption for a deleted workflow is stale; the freeze is two-way"
 },
 {
  "id": "lint-gates.readme-badges-allow-call-only-stale",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "        elif name in automatic:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k allow",
  "why": "a row for a workflow_call-only workflow exempts nothing the trigger did not"
 },
 {
  "id": "lint-gates.readme-badges-allow-repeat-refused",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "            problems.append(f\"{ALLOW}:{num}: {name} is listed twice\")",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k allow",
  "why": "a repeated row hides a typo in its twin"
 },
 {
  "id": "lint-gates.readme-badges-consumer-half-grades",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  _lint_gates_hub linux/scripts/verify_readme_badges.py || return 1",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k wiring",
  "why": "the consumer half must run the gate and return its verdict, or lint-gates.yml passes every README"
 },
 {
  "id": "lint-gates.readme-badges-consumer-half-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  run_gate \"README badges\" _lint_gates_readme_badges\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-readme-badges.sh -k wiring",
  "why": "a gate function nothing registers never runs in a consumer lane"
 },
 {
  "id": "lint-gates.readme-badges-table-name-before-file",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "group_of(entry, name, Path(file).stem)",
  "replace": "group_of(entry, Path(file).stem, name)",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k group",
  "why": "the workflow's name decides its group; the file name only when the name says nothing"
 },
 {
  "id": "lint-gates.readme-badges-table-file-fallback",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "group_of(entry, name, Path(file).stem)",
  "replace": "group_of(entry, name, \"\")",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k group",
  "why": "a workflow without a telling name is still placed by its file name"
 },
 {
  "id": "lint-gates.readme-badges-table-call-only-skipped",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    names = [n for n in workflows(root) if not call_only(folder / n)]",
  "replace": "    names = workflows(root)",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k group",
  "why": "a reusable workflow never runs on its own; its badge would only say no status"
 },
 {
  "id": "lint-gates.readme-badges-table-allow-exempt-skipped",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    for file in (n for n in names if n not in exempt):",
  "replace": "    for file in names:",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k group",
  "why": "a workflow exempt in readme-badges.allow gets no badge, or its row goes stale"
 },
 {
  "id": "lint-gates.readme-badges-table-empty-group-dropped",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "        if cells:\n",
  "replace": "        if True:\n",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k group",
  "why": "a group with no badge has no row"
 },
 {
  "id": "lint-gates.readme-badges-table-platform-head-dropped",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    return tail[:1].upper() + tail[1:] if PLATFORM.match(head) else head",
  "replace": "    return head",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k label",
  "why": "Linux x64 \u00b7 mutation gates is labelled by what it does, not where"
 },
 {
  "id": "lint-gates.readme-badges-table-build-tail-dropped",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    if not sep or not tail or BUILD_TAIL.match(tail) or group == \"Build\":",
  "replace": "    if not sep or not tail or group == \"Build\":",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k label",
  "why": "a build-and-test lane is labelled by its platform"
 },
 {
  "id": "lint-gates.readme-badges-table-main-only-branch",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    ref = entry.get(\"branch\") or (\"main\" if main_only(doc) else branch)",
  "replace": "    ref = entry.get(\"branch\") or branch",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k label",
  "why": "a release pushed only on main reports main's status"
 },
 {
  "id": "lint-gates.readme-badges-table-pull-request-not-main-only",
  "target": "linux/scripts/readme_badge_table.py",
  "find": " and not {\"pull_request\", \"pull_request_target\"} & set(on)",
  "replace": "",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k label",
  "why": "a workflow that also runs on pull requests reports the default branch"
 },
 {
  "id": "lint-gates.readme-badges-table-label-override",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "        label = entry.get(\"label\") or default_label(name, file, group)",
  "replace": "        label = default_label(name, file, group)",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k override",
  "why": "the override file's label replaces the default"
 },
 {
  "id": "lint-gates.readme-badges-table-group-override",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    return entry.get(\"group\") or first_rule(name, file=file)[0]",
  "replace": "    return first_rule(name, file=file)[0]",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k override",
  "why": "the override file's group moves the badge"
 },
 {
  "id": "lint-gates.readme-badges-table-stale-override-refused",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "        if file not in names or file in exempt:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k override",
  "why": "an override for a workflow with no badge is stale"
 },
 {
  "id": "lint-gates.readme-badges-table-community-off",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    if config.get(\"community\") is False:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k override",
  "why": "a repository may drop the family's Community row"
 },
 {
  "id": "lint-gates.readme-badges-table-extra-no-branch",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "status(slug, path, label, entry.get(\"branch\"))",
  "replace": "status(slug, path, label, \"develop\")",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k extra",
  "why": "GitHub's dynamic workflows run on the default branch; their badge carries no branch query"
 },
 {
  "id": "lint-gates.readme-badges-table-extra-needs-label",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "        if not path or not label:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k extra",
  "why": "an extra without a path or a label is named, not a traceback"
 },
 {
  "id": "lint-gates.readme-badges-table-order-by-rule",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "key=lambda b: (b.rank, b.key))",
  "replace": "key=lambda b: (b.key,))",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k order",
  "why": "a group follows the rule table's order, so x64 precedes arm64"
 },
 {
  "id": "lint-gates.readme-badges-table-html-escaped",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "f'src=\"{html.escape(src)}\"></a>'",
  "replace": "f'src=\"{src}\"></a>'",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k override",
  "why": "a query's & is &amp; in HTML"
 },
 {
  "id": "lint-gates.readme-badges-table-check-fails-on-drift",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "        return 1 if diff else 0",
  "replace": "        return 0",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k check",
  "why": "--check exists to fail a stale block"
 },
 {
  "id": "lint-gates.readme-badges-table-branch-from-origin-head",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    return given or config.get(\"branch\") or head or \"develop\"",
  "replace": "    return given or config.get(\"branch\") or \"develop\"",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k check",
  "why": "the default branch comes from origin/HEAD when nothing names it"
 },
 {
  "id": "lint-gates.readme-badges-table-repo-from-origin",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "(f\"{match[1]}/{match[2]}\" if match else",
  "replace": "(None if match else",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k check",
  "why": "the repository comes from the origin URL when nothing names it"
 },
 {
  "id": "lint-gates.readme-badges-table-markers-required",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    if (starts, ends) != (1, 1) or text.index(START) > text.index(END):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k markers",
  "why": "without both markers --write has nowhere to write and must say where they go"
 },
 {
  "id": "lint-gates.readme-badges-table-marker-order",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    if (starts, ends) != (1, 1) or text.index(START) > text.index(END):",
  "replace": "    if (starts, ends) != (1, 1):",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k markers",
  "why": "an end marker above the start would splice the README apart"
 },
 {
  "id": "lint-gates.readme-badges-table-gate-grades-block",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "    if MARKER in text:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k gate",
  "why": "a marked block is held to the generator by the readme-badges gate"
 },
 {
  "id": "lint-gates.readme-badges-table-gate-names-error",
  "target": "linux/scripts/verify_readme_badges.py",
  "find": "        return [f\"the badge block between the readme-badges markers cannot be generated: {exc}\"]",
  "replace": "        return []",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k gate",
  "why": "a block the generator cannot write fails the gate instead of passing"
 },
 {
  "id": "lint-gates.readme-badges-table-build-keeps-platform",
  "target": "linux/scripts/readme_badge_table.py",
  "find": " or group == \"Build\":\n",
  "replace": ":\n",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k label",
  "why": "a Build lane is labelled by its platform, whatever its name says after it"
 },
 {
  "id": "lint-gates.readme-badges-table-override-ranks-by-rule",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    return rank if group == found else first_rule(label, name)[1]",
  "replace": "    return rank if group == found else len(RULES)",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k order",
  "why": "a workflow moved by an override sorts with the badges its label or name resembles"
 },
 {
  "id": "lint-gates.readme-badges-table-override-ranks-by-label",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "first_rule(label, name)[1]",
  "replace": "first_rule(name)[1]",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k order",
  "why": "the label ranks a moved workflow first, so Linux x64 moved into Build sorts with the Linux lanes"
 },
 {
  "id": "lint-gates.readme-badges-table-release-at-head",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "    (r\"^release\\b\", \"Release\"),",
  "replace": "    (r\"\\brelease\\b\", \"Release\"),",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k group",
  "why": "a name that mentions a release past its head is no release workflow"
 },
 {
  "id": "lint-gates.readme-badges-table-release-in-file",
  "target": "linux/scripts/readme_badge_table.py",
  "find": "([(file, FILE_RULES)] if file else [])",
  "replace": "([(file, {})] if file else [])",
  "test": "bash linux/scripts/tests/test-readme-badge-table.sh -k group",
  "why": "a file name says release anywhere, build-release.yml included"
 },
 {
  "id": "lint-gates.pattern-limits-limit-enforced",
  "target": "linux/scripts/verify_pattern_limits.py",
  "find": "    if len(hits) <= limit:",
  "replace": "    if True:",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "a match of a max = 0 row must fail the lint gates, or the AGENTS.md rule holds by habit only"
 },
 {
  "id": "lint-gates.pattern-limits-limit-not-off-by-one",
  "target": "linux/scripts/verify_pattern_limits.py",
  "find": "    if len(hits) <= limit:",
  "replace": "    if len(hits) <= limit + 1:",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "max is the most matches allowed; one more than max must fail"
 },
 {
  "id": "lint-gates.pattern-limits-bad-max-refused",
  "target": "linux/scripts/verify_pattern_limits.py",
  "find": "        if isinstance(limit, bool) or not isinstance(limit, int) or limit < 0:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "max = true, -1 or \"0\" is a typo, and reading it as some limit lets matches through"
 },
 {
  "id": "lint-gates.pattern-limits-consumer-half-grades",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  _lint_gates_hub linux/scripts/verify_pattern_limits.py || return 1",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "the consumer half must run the gate and return its verdict, or lint-gates.yml passes every planted match"
 },
 {
  "id": "lint-gates.pattern-limits-consumer-half-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  run_gate \"pattern limits\" _lint_gates_pattern_limits\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "a gate function nothing registers never runs in a consumer lane"
 },
 {
  "id": "lint-gates.shell-eol-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  run_gate \"shell line endings\" _lint_gates_shell_eol\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh",
  "why": "a consumer's CR-bearing script breaks bash in its container; a gate nothing registers never runs in its lane"
 },
 {
  "id": "lint-gates.shell-eol-staged-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  run_gate \"shell line endings (staged)\" _lint_gates_shell_eol --staged\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh",
  "why": "the commit hook is where a CR is cheapest to stop; without the staged gate it reaches the push"
 },
 {
  "id": "lint-gates.relative-hooks-path-named",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  elif [ \"${set_to}\" = ",
  "replace": "  elif false && [ \"${set_to}\" = ",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh",
  "why": "a relative hooks path runs no hook in a worktree without the hub, and git says nothing; only this line names it"
 },
 {
  "id": "lib.dartdoc-guides-anchor-kept",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "        path, sep, fragment = href.partition(\"#\")",
  "replace": "        path, sep, fragment = href, \"\", \"\"",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "an anchored guide link (getting-started.md#known-issues) has no .md suffix as a whole, was left as written and 404ed on the site"
 },
 {
  "id": "lib.dartdoc-guides-guide-by-path",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "        if resolved in self.guide_pages:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a link to a guide must land on its rendered page, found by the path it resolves to"
 },
 {
  "id": "lib.dartdoc-guides-other-md-to-github",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "        return f\"{self.repo_url}/{kind}/{BRANCH}/{quote(resolved)}\"",
  "replace": "        return f\"guide-{posixpath.splitext(posixpath.basename(resolved))[0]}.html\"",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a *.md that is no guide (../AGENTS.md) became guide-AGENTS.html, which nothing renders"
 },
 {
  "id": "lib.dartdoc-guides-submodule-repo",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "            if resolved.startswith(sub + \"/\"):",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "GitHub does not follow a link into a submodule; the file lives in the submodule's own repository"
 },
 {
  "id": "lib.dartdoc-guides-unknown-repo-fails",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "        if not self.repo_url:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "without a repository URL the link would point at a relative /blob/ path that 404s; the render must stop and say so"
 },
 {
  "id": "lib.dartdoc-guides-origin-drops-dot-git",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "    r\"([\\w.-]+/[\\w.-]+?)(?:\\.git)?/?$\"",
  "replace": "    r\"([\\w.-]+/[\\w.-]+?)/?$\"",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "origin is usually spelled with .git, and a blob URL under <repo>.git is not the repository's page"
 },
 {
  "id": "lib.dartdoc-guides-github-slug",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "    return re.sub(r\"[^\\w\\- ]\", \"\", value.strip().lower()).replace(\" \", \"-\") or \"section\"",
  "replace": "    return re.sub(r\"[\\s-]+\", \"-\", re.sub(r\"[^a-zA-Z0-9\\s-]\", \"\", value).strip().lower()) or \"section\"",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "anchors are written for GitHub, which keeps one hyphen per space and hyphen; collapsing them misses a heading with a dash"
 },
 {
  "id": "lib.dartdoc-guides-config-carries-source",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "    awk -F'\\t' 'NF { printf \"guide\\t%s\\t%s\\t%s\\n\", $2, $3, $1 }' >>\"${out}\"",
  "replace": "    awk -F'\\t' 'NF { printf \"guide\\t%s\\t%s\\t\\n\", $2, $3 }' >>\"${out}\"",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a relative link resolves from the guide's own directory, which only its source path says"
 },
 {
  "id": "lib.dartdoc-python-image-parser",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  if [[ -n \"${python}\" ]] && _dartdoc_build_has_parser \"${python}\" \"${pin}\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "the image's python3 already carries the pinned parser; passing it over fails CI or downloads a copy"
 },
 {
  "id": "lib.dartdoc-python-version-checked",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "sys.exit(markdown_it.__version__ != sys.argv[1])",
  "replace": "sys.exit(0)",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "the renderer is written against one parser version; any markdown_it that imports is not that version"
 },
 {
  "id": "lib.dartdoc-python-ci-never-downloads",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  elif [[ \"${CI:-}\" == \"true\" || -d \"${_DARTDOC_BUILD_IMAGE_VENV}\" ]]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "everything a lane needs is in the image: CI and the image fail on a missing parser instead of fetching it from PyPI"
 },
 {
  "id": "lib.dartdoc-python-image-without-ci",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  elif [[ \"${CI:-}\" == \"true\" || -d \"${_DARTDOC_BUILD_IMAGE_VENV}\" ]]; then",
  "replace": "  elif [[ \"${CI:-}\" == \"true\" ]]; then",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "a local lane runs the image without CI=true; it must fail like CI, not download what CI would not have"
 },
 {
  "id": "lib.dartdoc-python-host-venv",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "    _dartdoc_build_host_venv \"${requirements}\" || return 1\n",
  "replace": "    err \"no parser\"\n",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "A workstation without the pinned parser must provision the isolated host environment."
 },
 {
  "id": "lib.dartdoc-python-pin-required",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  if [[ -z \"${pin}\" ]]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "without a pin every markdown_it version would be compared against an empty string"
 },
 {
  "id": "lib.dartdoc-python-image-by-hash",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  uv pip install --python \"${VENV}/bin/python\" --require-hashes \\\n",
  "replace": "  uv pip install --python \"${VENV}/bin/python\" \\\n",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "without hash checking the image takes whatever an index serves as markdown-it-py 4.2.0, not the files the lock reviewed"
 },
 {
  "id": "lib.dartdoc-python-image-from-requirements",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "--require-hashes \\\n    -r /opt/scripts/packaging/dartdoc-guides.requirements.txt\n",
  "replace": "--require-hashes \\\n    markdown-it-py\n",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "an install not read from the requirements file drifts from the pin the renderer and the smoke read"
 },
 {
  "id": "lib.dartdoc-python-image-fails-loud",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "    -r /opt/scripts/packaging/dartdoc-guides.requirements.txt\n",
  "replace": "    -r /opt/scripts/packaging/dartdoc-guides.requirements.txt || true\n",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "a failed install would ship the image with myst-parser's markdown-it-py, and only the smoke would notice"
 },
 {
  "id": "lib.dartdoc-python-image-cross-skips",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  cross_skip \"dartdoc guide parser\" && return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "a pure cross artifact has no /opt/venv, so the install would fail its build"
 },
 {
  "id": "lib.dartdoc-python-image-installed",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  install_dartdoc_guide_parser\n  _stv_mark install_dartdoc_guide_parser\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "without the call the image keeps whichever markdown-it-py myst-parser resolved"
 },
 {
  "id": "lib.dartdoc-python-image-after-extras",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  setup_torch_app\n  _stv_mark setup_torch_app\n  install_dartdoc_guide_parser\n",
  "replace": "  install_dartdoc_guide_parser\n  setup_torch_app\n  _stv_mark setup_torch_app\n",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "the app's uv sync runs after an earlier install and replaces the pinned parser with its own"
 },
 {
  "id": "lib.dartdoc-python-image-copies-requirements",
  "target": "linux/Dockerfile.torch",
  "find": "COPY linux/scripts/lib/dartdoc-guides.requirements.txt /opt/scripts/packaging/dartdoc-guides.requirements.txt\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "the torch RUN reads the pin from the copied file; without it the install fails the image build"
 },
 {
  "id": "lib.dartdoc-python-image-requirers-checked",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  dartdoc_guide_parser_requirers_met\n}",
  "replace": "}",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "uv pip install only warns when the pin breaks myst-parser, so the image would build green and ship a broken Sphinx extension"
 },
 {
  "id": "lib.dartdoc-python-image-requirers-markdown-it",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "grep -wE 'markdown-it-py|mdurl'",
  "replace": "grep -wE 'mdurl'",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "a requirer that rejects the pinned markdown-it-py, as myst-parser does above 4.x, would pass the check"
 },
 {
  "id": "lib.dartdoc-python-image-requirers-mdurl",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "grep -wE 'markdown-it-py|mdurl'",
  "replace": "grep -wE 'markdown-it-py'",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "the requirements file pins mdurl too, and a requirer it breaks would pass the check"
 },
 {
  "id": "lib.dartdoc-python-image-requirers-unrelated-pass",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "if [ \"${rc}\" -le 1 ] && [ -z \"${broken}\" ]; then",
  "replace": "if [ \"${rc}\" -eq 0 ] && [ -z \"${broken}\" ]; then",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "an incompatibility that names neither pinned package is not the pin's doing and must not fail the image build"
 },
 {
  "id": "lib.dartdoc-python-image-requirers-uv-error",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "if [ \"${rc}\" -le 1 ] && [ -z \"${broken}\" ]; then",
  "replace": "if [ -z \"${broken}\" ]; then",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "a uv pip check that could not run reports no requirer, which is no proof that none is broken"
 },
 {
  "id": "lib.dartdoc-python-image-before-bytecompile",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  install_dartdoc_guide_parser\n  _stv_mark install_dartdoc_guide_parser\n  stage_chain_ort_wheels\n  _stv_mark stage_chain_ort_wheels\n  bytecompile_venv\n  _stv_mark bytecompile_venv\n",
  "replace": "  stage_chain_ort_wheels\n  _stv_mark stage_chain_ort_wheels\n  bytecompile_venv\n  _stv_mark bytecompile_venv\n  install_dartdoc_guide_parser\n  _stv_mark install_dartdoc_guide_parser\n",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "an install after the byte-compile ships the pinned parser without .pyc, and uid 1001 re-parses it on every start"
 },
 {
  "id": "lib.dartdoc-python-image-copy-before-run",
  "target": "linux/Dockerfile.torch",
  "find": "COPY linux/scripts/lib/dartdoc-guides.requirements.txt /opt/scripts/packaging/dartdoc-guides.requirements.txt\nCOPY --chmod=755 linux/scripts/06-packaging/package-image-wiring.sh /opt/scripts/packaging/package-image-wiring.sh\nCOPY --chmod=755 linux/scripts/01-core/wheelhouse-manifest.sh /opt/scripts/core/wheelhouse-manifest.sh\nCOPY --chmod=755 linux/scripts/01-core/native-gcc-system-paths.sh /opt/scripts/core/native-gcc-system-paths.sh\n\n# The only channel for media's optional wheels; libtvm*.so does not follow: docs/linux-cross-builds.md#tvm-cross-wheels-what-must-not-be-simplified-away\nLABEL kataglyphis.step=torch-venv\nRUN --mount=type=secret,id=asset_mirror,required=false --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=cache,target=/root/.cache/uv,id=uv-cache-${TARGETARCH} \\\n    --mount=type=bind,from=wheels-source,source=/opt/wheels,target=/opt/wheels,rw \\\n    set -euo pipefail; \\\n    echo \"[torch-run] start epoch=$(date -u +%s) arch=${TARGETARCH}\"; \\\n    export UV_LOCK_TIMEOUT=14400 UV_HTTP_TIMEOUT=1200 PIP_DEFAULT_TIMEOUT=1200; \\\n    rm -rf /root/.cache/uv/git-v0/locks/ 2>/dev/null || true; \\\n    bash /opt/scripts/packaging/setup-torch-venv.sh\n",
  "replace": "COPY --chmod=755 linux/scripts/06-packaging/package-image-wiring.sh /opt/scripts/packaging/package-image-wiring.sh\nCOPY --chmod=755 linux/scripts/01-core/wheelhouse-manifest.sh /opt/scripts/core/wheelhouse-manifest.sh\nCOPY --chmod=755 linux/scripts/01-core/native-gcc-system-paths.sh /opt/scripts/core/native-gcc-system-paths.sh\n\n# The only channel for media's optional wheels; libtvm*.so does not follow: docs/linux-cross-builds.md#tvm-cross-wheels-what-must-not-be-simplified-away\nLABEL kataglyphis.step=torch-venv\nRUN --mount=type=secret,id=asset_mirror,required=false --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=cache,target=/root/.cache/uv,id=uv-cache-${TARGETARCH} \\\n    --mount=type=bind,from=wheels-source,source=/opt/wheels,target=/opt/wheels,rw \\\n    set -euo pipefail; \\\n    echo \"[torch-run] start epoch=$(date -u +%s) arch=${TARGETARCH}\"; \\\n    export UV_LOCK_TIMEOUT=14400 UV_HTTP_TIMEOUT=1200 PIP_DEFAULT_TIMEOUT=1200; \\\n    rm -rf /root/.cache/uv/git-v0/locks/ 2>/dev/null || true; \\\n    bash /opt/scripts/packaging/setup-torch-venv.sh\nCOPY linux/scripts/lib/dartdoc-guides.requirements.txt /opt/scripts/packaging/dartdoc-guides.requirements.txt\n",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "a COPY below the torch RUN arrives after setup-torch-venv.sh read the file, so the install fails the image build"
 },
 {
  "id": "lib.dartdoc-python-smoke-in-main",
  "target": "linux/scripts/06-packaging/check-python-runtime.sh",
  "find": "  check_dartdoc_guide_parser \"$1\" \"$2\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "an image without the pinned parser would publish, and the first docs build in it would fail"
 },
 {
  "id": "lib.dartdoc-python-smoke-version-checked",
  "target": "linux/scripts/06-packaging/check-python-runtime.sh",
  "find": "*$'\\n'\"markdown_it ${pin}\"$'\\n'*",
  "replace": "*$'\\n'\"markdown_it \"*",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "any markdown_it that imports is not the version the renderer is written against"
 },
 {
  "id": "lib.dartdoc-python-smoke-exact-version",
  "target": "linux/scripts/06-packaging/check-python-runtime.sh",
  "find": "*$'\\n'\"markdown_it ${pin}\"$'\\n'*",
  "replace": "*$'\\n'\"markdown_it ${pin}\"*",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "4.2.0.post1 starts with the pin and is still another release"
 },
 {
  "id": "lib.dartdoc-python-smoke-pin-required",
  "target": "linux/scripts/06-packaging/check-python-runtime.sh",
  "find": "  if [ -z \"${pin}\" ]; then\n    fail \"DARTDOC-PARSER: no markdown-it-py pin",
  "replace": "  if false; then\n    fail \"DARTDOC-PARSER: no markdown-it-py pin",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "a smoke that cannot read the pin must say so instead of reporting a version mismatch"
 },
 {
  "id": "lib.dartdoc-python-smoke-hub-pin",
  "target": "linux/scripts/06-packaging/check-python-runtime.sh",
  "find": "_PYRT_DARTDOC_LIB=\"${_PYRT_HERE}/../lib\"",
  "replace": "_PYRT_DARTDOC_LIB=\"${_PYRT_HERE}/lib\"",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "the smoke must read the pin from the hub's own requirements file, the one dartdoc-build.sh reads"
 },
 {
  "id": "doc-dupes.badges-are-not-prose",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "        if fence or block or line.startswith((\"|\", \"#\", \"<!--\", \"-->\", \"[![\", \"![\")):",
  "replace": "        if fence or block or line.startswith((\"|\", \"#\", \"<!--\", \"-->\")):",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "every family README opens with a badge row of the same URL shape; read as prose it makes every consumer restate the hub's README"
 },
 {
  "id": "doc-dupes.hub-pairs-cross-side-only",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "        if n <= threshold or a[0].startswith(HUB_TAG) == b[0].startswith(HUB_TAG):",
  "replace": "        if n <= threshold:",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "--against-hub judges consumer <-> hub pairs only; counting two consumer pages, or two hub pages, against each other reports what the plain mode already owns"
 },
 {
  "id": "doc-dupes.hub-off-until-seeded",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "    if not seeded:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "a consumer that has not seeded doc-dupes-hub.allow is reported, not failed; without the switch the first pin bump reds every consumer at once"
 },
 {
  "id": "doc-dupes.hub-finding-fails",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "        _print_findings(findings, texts, HUB_ADVICE)\n        return 1",
  "replace": "        _print_findings(findings, texts, HUB_ADVICE)\n        return 0",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "a seeded consumer restating a hub page must fail; printing the copy and exiting 0 is a gate that cannot go red"
 },
 {
  "id": "doc-dupes.hub-budget-under-root",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "    ALLOW_FILE = REPO_ROOT / HUB_ALLOW_NAME",
  "replace": "    ALLOW_FILE = HUB_ROOT / HUB_ALLOW_NAME",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "the budget is the consumer's, in its own diff; read from the hub, no consumer could ever seed or budget the gate"
 },
 {
  "id": "doc-dupes.hub-stale-row-fails",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "    if _print_bookkeeping(sorted(set(allow) - used)):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "a budget row whose overlap is gone must fail, or it covers the next copy of the same pair"
 },
 {
  "id": "doc-dupes.hub-root-refused",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "        return gate_scope.die(gate_scope.ScopeError(\"--against-hub grades a consumer's --root; the hub is its own reference\"))",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "the hub graded against itself pairs every page with its own copy; a run without --root must stop, not report"
 },
 {
  "id": "doc-dupes.hub-consumer-half-grades",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  _lint_gates_hub docs/scripts/verify_doc_dupes.py || return 1",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "the consumer half must run the mode and return its verdict, or a seeded consumer's lint lane passes every restated passage"
 },
 {
  "id": "doc-dupes.hub-consumer-half-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  _lint_gates_doc_dupes_hub || rc=1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "a gate function the ratchet step never calls runs in no consumer"
 },
 {
  "id": "doc-dupes.hub-off-skips-the-scan",
  "target": "docs/scripts/verify_doc_dupes.py",
  "find": "    if not seeded and not args.report:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-doc-dupes.sh",
  "why": "an unseeded consumer must not need the hub's git: run-lint-gates.sh reaches this step in the git-less mutation mirror, where listing the hub's pages exits 2"
 },
 {
  "id": "site-links.missing-target",
  "target": "linux/scripts/verify_site_links.py",
  "find": "        if path is None:\n            self.note(\"missing\\t\" + rel, rel_page)",
  "replace": "        if path is None:\n            pass",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a link to a page the build never wrote is a 404 on the live site"
 },
 {
  "id": "site-links.anchor-checked",
  "target": "linux/scripts/verify_site_links.py",
  "find": "            if target is not None and not anchor_ok(target.ids, fragment):",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a dead anchor lands the reader at the top of the wrong place; the hub's own site had three"
 },
 {
  "id": "site-links.anchor-as-written",
  "target": "linux/scripts/verify_site_links.py",
  "find": "fragment == \"top\" or fragment in ids or unquote(fragment) in ids:",
  "replace": "fragment == \"top\" or unquote(fragment) in ids:",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "rustdoc writes its impl ids percent-encoded (impl-From%3CT%3E-for-T); decoding first reported every one as dead"
 },
 {
  "id": "site-links.anchor-decoded",
  "target": "linux/scripts/verify_site_links.py",
  "find": "fragment == \"top\" or fragment in ids or unquote(fragment) in ids:",
  "replace": "fragment == \"top\" or fragment in ids:",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a browser tries the decoded fragment too, so an encoded href to a plain id resolves"
 },
 {
  "id": "site-links.line-range-ends",
  "target": "linux/scripts/verify_site_links.py",
  "find": "    return bool(m) and m.group(1) in ids and m.group(2) in ids",
  "replace": "    return bool(m)",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a rustdoc source range past the file's last line points at nothing"
 },
 {
  "id": "site-links.escape-root",
  "target": "linux/scripts/verify_site_links.py",
  "find": "    if rel.startswith(\"../\"):\n        return None\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a link above the site root is not published, even when the build host has a file there"
 },
 {
  "id": "site-links.directory-index",
  "target": "linux/scripts/verify_site_links.py",
  "find": "    if os.path.isdir(path):\n        path = os.path.join(path, \"index.html\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "Apache serves a directory link from its index.html; without one it is a 403 or a listing"
 },
 {
  "id": "site-links.absolute-path",
  "target": "linux/scripts/verify_site_links.py",
  "find": "        link = SITE + link[1:]",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "every family site is served at its domain root, so /a.html is the tree's a.html"
 },
 {
  "id": "site-links.base-href",
  "target": "linux/scripts/verify_site_links.py",
  "find": "            base = urljoin(url, page.base) if page.base else url",
  "replace": "            base = url",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a <base href> moves every relative link of its page, as in a browser"
 },
 {
  "id": "site-links.base-not-a-link",
  "target": "linux/scripts/verify_site_links.py",
  "find": "            self.base = self.base or a.get(\"href\") or None\n            return\n",
  "replace": "            self.base = self.base or a.get(\"href\") or None\n",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "<base href=\"../\"> is no link: read as one it resolves against itself and climbs out of the site"
 },
 {
  "id": "site-links.fragments-not-documents",
  "target": "linux/scripts/verify_site_links.py",
  "find": "            if page is None or not page.is_document:",
  "replace": "            if page is None:",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a dartdoc sidebar fragment is injected into pages elsewhere, so its links are not relative to its own file"
 },
 {
  "id": "site-links.meta-refresh",
  "target": "linux/scripts/verify_site_links.py",
  "find": "                self.links.append(m.group(1).strip())",
  "replace": "                pass",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "rustdoc's root index.html is a meta refresh; a redirect to nothing is a dead site"
 },
 {
  "id": "site-links.root-index",
  "target": "linux/scripts/verify_site_links.py",
  "find": "            self.note(\"missing\\tindex.html\", \"(the site root)\")",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a site without index.html at its root shows a listing or a 403 at its own address"
 },
 {
  "id": "site-links.allow-read",
  "target": "linux/scripts/verify_site_links.py",
  "find": "    frozen = load_keys(args.allow) if args.allow else set()",
  "replace": "    frozen = set()",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a consumer adopts the gate by freezing what it has; an unread allow file fails every frozen site"
 },
 {
  "id": "site-links.allow-must-exist",
  "target": "linux/scripts/verify_site_links.py",
  "find": "    if args.allow and not os.path.isfile(args.allow):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a typo'd allow path would read as an empty freeze and hide that the exceptions were never applied"
 },
 {
  "id": "site-links.verdict",
  "target": "linux/scripts/verify_site_links.py",
  "find": "        print(\"OK: every internal link and anchor resolves\")\n    return rc\n",
  "replace": "        print(\"OK: every internal link and anchor resolves\")\n    return 0\n",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a gate that prints its findings and exits 0 publishes the broken site anyway"
 },
 {
  "id": "site-links.rust-path-unresolved",
  "target": "linux/scripts/verify_site_links.py",
  "find": "        if RUST_PATH.match(link):\n            self.note(\"unresolved\\t\" + link, rel_page)\n            return\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "urljoin reads super::Subscriber as a URL with the scheme super: and skips it, so the dead link passes"
 },
 {
  "id": "site-links.rust-path-not-a-scheme",
  "target": "linux/scripts/verify_site_links.py",
  "find": "RUST_PATH = re.compile(r\"^[A-Za-z_]\\w*::[A-Za-z_]\")",
  "replace": "RUST_PATH = re.compile(r\"^[A-Za-z_]\\w*:\")",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "tel:, urn: and the like are URLs; only a double colon names a Rust path"
 },
 {
  "id": "docs-site.fileinfo-only",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "ErrorDocument 404 /404.html\n",
  "replace": "ErrorDocument 404 /404.html\nOptions -Indexes\n",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "Options needs AllowOverride Options, which nothing proves the host grants; a refused directive is a 500 on every page"
 },
 {
  "id": "docs-site.https-redirect",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "every family site answered plain http with 200 (curl, 2026-10-19); the redirect is what moves a reader to https"
 },
 {
  "id": "docs-site.proxy-loop-guard",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "    RewriteCond %{HTTP:X-Forwarded-Proto} !=https\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "behind a proxy that ends TLS, HTTPS is off on every request, so the redirect would loop for ever"
 },
 {
  "id": "docs-site.hsts-year",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "max-age=31536000",
  "replace": "max-age=300",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "HSTS under a year is not preload-grade and lapses between a reader's visits"
 },
 {
  "id": "docs-site.nosniff",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "    Header always set X-Content-Type-Options \"nosniff\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "without nosniff a browser may run an uploaded text file as script"
 },
 {
  "id": "docs-site.sync-state-denied",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "    RedirectMatch 404 (^|/)\\.ftp-deploy-sync-state\\.json$\n",
  "replace": "    RedirectMatch 404 ^/\\.ftp-deploy-sync-state\\.json$\n",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "the state file lists every published file with its hash; a server-dir below the root keeps one too"
 },
 {
  "id": "docs-site.error-document",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "ErrorDocument 404 /404.html\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "without it a dead link shows Apache's bare default page instead of the site's way back"
 },
 {
  "id": "docs-site.404-home-link",
  "target": "linux/webserver/templates/docs-site-404.html",
  "find": "<a href=\"/\">",
  "replace": "<a href=\"/home.html\">",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "the 404 page is served at any depth, so its way back must be root-absolute and exist"
 },
 {
  "id": "docs-site.wasm-type",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "    AddType application/wasm .wasm\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "WebAssembly.instantiateStreaming rejects a wasm under any type but application/wasm, so the demo would not start on a host whose mime.types lacks it"
 },
 {
  "id": "docs-site.glb-type",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "    AddType model/gltf-binary .glb\n",
  "replace": "    AddType application/octet-stream .glb\n",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "a .glb typed by whatever the host's mime.types says falls outside the DEFLATE line, and the 61 MB scene goes out whole"
 },
 {
  "id": "docs-site.gltf-type",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "    AddType model/gltf+json .gltf\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "a .gltf scene needs its registered type to fall under the DEFLATE line"
 },
 {
  "id": "docs-site.glb-compressed",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": " model/gltf-binary model/gltf+json\n",
  "replace": " model/gltf+json\n",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "the host gzips text only; the 61 MB demo scene would go out at full size instead of 30 MB"
 },
 {
  "id": "docs-site.wasm-compressed",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "DEFLATE application/wasm ",
  "replace": "DEFLATE ",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "the host serves application/wasm uncompressed (curl, 2026-11-15), so the 7 MB demo binary would too"
 },
 {
  "id": "docs-site.deflate-guarded",
  "target": "linux/webserver/templates/docs-site.htaccess",
  "find": "<IfModule mod_filter.c>\n",
  "replace": "<IfModule mod_mime.c>\n",
  "test": "bash linux/scripts/tests/test-docs-site-htaccess.sh",
  "why": "without mod_filter AddOutputFilterByType is an unknown directive, and an unknown directive in .htaccess is a 500 on every page"
 },
 {
  "id": "docs-site.plan-one-source",
  "target": "linux/scripts/docs-site.sh",
  "find": "  [ \"${modes}\" -eq 1 ] || die",
  "replace": "  [ \"${modes}\" -ge 0 ] || die",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a command and a builder at once would build one site and publish whichever ran last"
 },
 {
  "id": "docs-site.plan-artifact-root",
  "target": "linux/scripts/docs-site.sh",
  "find": "    site=.docs-site\n",
  "replace": "    site=site\n",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "the artifact lands in .docs-site, which no repository builds into"
 },
 {
  "id": "docs-site.plan-builder-dir",
  "target": "linux/scripts/docs-site.sh",
  "find": "    rustdoc) printf 'target/doc\\n' ;;",
  "replace": "    rustdoc) printf 'doc\\n' ;;",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "cargo doc writes target/doc; staging another directory publishes nothing or the wrong tree"
 },
 {
  "id": "docs-site.plan-command-needs-site",
  "target": "linux/scripts/docs-site.sh",
  "find": "  [ -n \"${site}\" ] || die \"no site-dir\"",
  "replace": "  true || die \"no site-dir\"",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a command's site lives wherever the command put it; guessing would publish the checkout root"
 },
 {
  "id": "docs-site.plan-path-safety",
  "target": "linux/scripts/docs-site.sh",
  "find": "    /* | *..* | *[!A-Za-z0-9._/-]*) die",
  "replace": "    /no-such-path) die",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "hub is substituted into the container command line, so a path with shell syntax in it would run"
 },
 {
  "id": "docs-site.build-command",
  "target": "linux/scripts/docs-site.sh",
  "find": "    '') bash -lc \"${DOCS_COMMAND:?no command and no builder}\" ;;",
  "replace": "    '') true ;;",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a build that never runs leaves last run's tree, or none, for the stager"
 },
 {
  "id": "docs-site.build-rustdoc-driver",
  "target": "linux/scripts/docs-site.sh",
  "find": "  bash \"${DOCS_SITE_HUB}/linux/scripts/02-toolchain/rust/cargo_build_doc.sh\"",
  "replace": "  true",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "the builder input is a promise to run the hub's driver"
 },
 {
  "id": "docs-site.build-rustdoc-guides",
  "target": "linux/scripts/docs-site.sh",
  "find": "  DARTDOC_BUILD_GUIDES=(\"${DOCS_SITE_GUIDES[@]}\")",
  "replace": "  DARTDOC_BUILD_GUIDES=()",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "the guides input must reach the renderer on a rustdoc site too, or its guides stay on GitHub"
 },
 {
  "id": "docs-site.build-rustdoc-crate-dir",
  "target": "linux/scripts/docs-site.sh",
  "find": "DARTDOC_BUILD_SHELL=\"${crate//-/_}/index.html\"",
  "replace": "DARTDOC_BUILD_SHELL=\"${crate}/index.html\"",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "cargo doc names a crate's directory with underscores, so a hyphenated package's shell would not exist"
 },
 {
  "id": "docs-site.build-dartdoc-theme",
  "target": "linux/scripts/docs-site.sh",
  "find": "  DARTDOC_BUILD_THEME_CSS=\"${DOCS_SITE_HUB}/third_party/DocumANTation/style/dartdoc.css\"",
  "replace": "  DARTDOC_BUILD_THEME_CSS=\"${DOCS_SITE_HUB}/style/dartdoc.css\"",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "the brand sheet is DocumANTation's generated one, which only the hub's submodule carries"
 },
 {
  "id": "docs-site.build-dartdoc-packages",
  "target": "linux/scripts/docs-site.sh",
  "find": "  DARTDOC_BUILD_CLEAN_CMD=(flutter pub get)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "dart doc stops on a checkout whose packages were never resolved"
 },
 {
  "id": "docs-site.stage-htaccess",
  "target": "linux/scripts/docs-site.sh",
  "find": "    cp \"${templates}/docs-site.htaccess\" \"${site}/.htaccess\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "without it the site keeps serving plain http and the FTP state file"
 },
 {
  "id": "docs-site.stage-own-htaccess-refused",
  "target": "linux/scripts/docs-site.sh",
  "find": "    [ ! -e \"${site}/.htaccess\" ] || die \"the site ships a .htaccess\"",
  "replace": "    true || die \"the site ships a .htaccess\"",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "overwriting a site's own .htaccess silently drops what that site needed it for"
 },
 {
  "id": "docs-site.stage-own-404-kept",
  "target": "linux/scripts/docs-site.sh",
  "find": "    [ -e \"${site}/404.html\" ] || cp \"${templates}/docs-site-404.html\" \"${site}/404.html\"",
  "replace": "    cp \"${templates}/docs-site-404.html\" \"${site}/404.html\"",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a site's themed 404 page is better than the hub's plain one"
 },
 {
  "id": "docs-site.stage-link-gate",
  "target": "linux/scripts/docs-site.sh",
  "find": "  \"${PYTHON:-python3}\" \"${DOCS_SITE_HUB}/linux/scripts/verify_site_links.py\" \"${site}\" ${gate[@]+\"${gate[@]}\"}",
  "replace": "  true",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "the link gate is what keeps a site with dead links from replacing a good one"
 },
 {
  "id": "docs-site.stage-allow-passed",
  "target": "linux/scripts/docs-site.sh",
  "find": "      --allow) gate+=(--allow \"${2:?--allow needs a file}\"); shift 2 ;;",
  "replace": "      --allow) shift 2 ;;",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "link-allow is how a repository adopts the gate with its known exceptions frozen"
 },
 {
  "id": "docs-site.publish-push-only",
  "target": ".github/workflows/build-docs.yml",
  "find": "      && needs.await-green.outputs.superseded != 'true'\n      && needs.await-green.outputs.withheld != 'true'\n      && inputs.publish\n      && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main')\n      && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish-on-dispatch))",
  "replace": "      && needs.await-green.outputs.superseded != 'true'\n      && needs.await-green.outputs.withheld != 'true'\n      && inputs.publish\n      && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main')\n      && (github.event_name != 'schedule')",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a pull request, or an unasked dispatch, must never reach a live site"
 },
 {
  "id": "docs-site.publish-never-cancelled",
  "target": ".github/workflows/build-docs.yml",
  "find": "      cancel-in-progress: false",
  "replace": "      cancel-in-progress: true",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "the FTP library deletes before it uploads, so a sync cancelled half-way leaves a site with holes"
 },
 {
  "id": "docs-site.publish-no-tolerance",
  "target": ".github/workflows/build-docs.yml",
  "find": "      - name: \ud83d\udcc2 Sync files to domain\n",
  "replace": "      - name: \ud83d\udcc2 Sync files to domain\n        continue-on-error: true\n",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a publish that may fail is a site that stops updating while the lane stays green"
 },
 {
  "id": "docs-site.publish-hidden-files",
  "target": ".github/workflows/build-docs.yml",
  "find": "          include-hidden-files: true\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "upload-artifact skips dotfiles by default, and the .htaccess would never reach the server"
 },
 {
  "id": "docs-site.build-dartdoc-images",
  "target": "linux/scripts/docs-site.sh",
  "find": "  if [ -d images ]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "dart doc renders the README as index.html, and its images/logo.png was the one dead link of ANThology's site"
 },
 {
  "id": "release.collect-duplicate-fails",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "    die \"two artifacts carry $2\"\n  fi",
  "replace": "    true\n  fi",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "two uploads with one file name would ship whichever came last, silently"
 },
 {
  "id": "release.collect-zip-duplicate-fails",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "    [ ! -e \"${OUT}/${name}\" ] || die \"two artifacts carry ${name}\"",
  "replace": "    true || die \"two artifacts carry ${name}\"",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "zip adds to an existing archive, so a second folder of one name would merge into the first"
 },
 {
  "id": "release.collect-empty-fails",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  [ -n \"$(ls -A \"$OUT\")\" ] || die \"no packages under ${artifacts}\"",
  "replace": "  true || die \"no packages under ${artifacts}\"",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a release with no files is a tag with nothing to download"
 },
 {
  "id": "release.collect-skip",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  if any_match \"$upload\" \"${SKIP[@]}\" || any_match",
  "replace": "  if false || any_match",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "test bundles and reports would ship as release files"
 },
 {
  "id": "release.collect-docs-site-skipped",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "SKIP=('*-docs-site' 'docs-site-*')",
  "replace": "SKIP=()",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "build-docs.yml uploads the site in the release's run, and both of its uploads carry the same files"
 },
 {
  "id": "release.collect-strict",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  [ \"$GAVE\" = 1 ] || [ \"$STRICT\" = 0 ] || die",
  "replace": "  [ \"$GAVE\" = 1 ] || true || die",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "with --strict a new upload nobody decided about must stop the release, not vanish"
 },
 {
  "id": "release.collect-expect",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "    [ -e \"${OUT}/${name}\" ] || die \"the release would lack ${name}\"",
  "replace": "    true || die \"the release would lack ${name}\"",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a lane that uploaded nothing would publish a release without its platform"
 },
 {
  "id": "release.collect-exclude",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  if any_match \"$1\" \"${EXCLUDE[@]}\" || ! only_from_allows",
  "replace": "  if false || ! only_from_allows",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "the bundle's loose exe and dlls, the docs and the logs would ship"
 },
 {
  "id": "release.collect-only-from",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  return \"$named\"",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "the pure wheel every lane builds would arrive three times and fail the release as a duplicate"
 },
 {
  "id": "release.collect-include",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  if any_match \"$1\" \"${INCLUDE[@]}\"; then printf",
  "replace": "  if false; then printf",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "only renamed files would ship"
 },
 {
  "id": "release.collect-rename",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "      render \"${rule#*=}\" \"$2\" \"${1##*/}\"",
  "replace": "      printf '%s' \"${1##*/}\"",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "both arches' flatpaks carry one name and would collide"
 },
 {
  "id": "release.collect-flatpak-arch",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "RENAME+=('*.flatpak={stem}-{machine}.flatpak')",
  "replace": "RENAME+=('*.flatpak={stem}.flatpak')",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "the packagers name a flatpak without its arch"
 },
 {
  "id": "release.collect-machine-name",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "arm64) machine=aarch64 ;;",
  "replace": "arm64) machine=arm64 ;;",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "the released flatpak and AppImage names use the machine name, aarch64"
 },
 {
  "id": "release.collect-arch-words",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "    case \"$word\" in x64 | arm64 | riscv64) arch=\"$word\" ;; esac",
  "replace": "    case \"$word\" in x64 | arm64) arch=\"$word\" ;; esac",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "OxidANT and OrchestrANT build riscv64 too"
 },
 {
  "id": "release.collect-version-required",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "[ -n \"$VERSION\" ] || die \"${1} names {version}: pass --version\"",
  "replace": "true || die \"${1} names {version}: pass --version\"",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a name without its version, like app--x86_64.flatpak, would ship"
 },
 {
  "id": "release.collect-one-file-name",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  case \"$name\" in '' | */*) die",
  "replace": "  case \"$name\" in '') die",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a name with a slash would write outside the flat release directory"
 },
 {
  "id": "release.collect-zip-dir-missing",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "    [ -d \"$folder\" ] || die \"upload ${upload} has no ${left#*/} to zip\"",
  "replace": "    [ -d \"$folder\" ] || continue",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a Windows lane that lost its portable folder would release without the zip"
 },
 {
  "id": "release.collect-zip-subdir",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "    if [ \"$left\" != \"${left%%/*}\" ]; then folder=\"${dir}/${left#*/}\"; fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "the zip would hold the whole upload, installers included, one folder too deep"
 },
 {
  "id": "release.collect-unpack",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  if any_match \"$upload\" \"${UNPACK[@]}\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "OmniAccelerANT's APK reaches the release only inside its tarball"
 },
 {
  "id": "release.collect-out-absolute",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  OUT=\"$(cd \"${POSITIONAL[1]}\" && pwd)\"",
  "replace": "  OUT=\"${POSITIONAL[1]}\"",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "the workflow passes a relative out dir, and the zips are made from inside each folder"
 },
 {
  "id": "release.collect-rule-needs-value",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "    case \"$rule\" in ?*=?*) ;; *) die \"a rule needs GLOB=VALUE: ${rule}\" ;; esac",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a rename without a name would rename every match to its own glob"
 },
 {
  "id": "release.collect-quoted-glob",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "    case \"$rule\" in \\'* | \\\"*) die \"write ${rule} unquoted\" ;; esac",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a glob quoted in an options file keeps its quotes and matches nothing, silently"
 },
 {
  "id": "release.collect-options-crlf",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "    line=\"${line%$'\\r'}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "an options file written on Windows would end every glob in a carriage return"
 },
 {
  "id": "release.collect-options-not-option",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "*) die \"$1: '${line}' is not an option\" ;;",
  "replace": "*) continue ;;",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a line without its dashes would be dropped and the release would lack what it asked for"
 },
 {
  "id": "release.workflow-dry-run-never-publishes",
  "target": ".github/workflows/release-publish.yml",
  "find": "        if: ${{ !inputs.dry-run }}",
  "replace": "        if: always()",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a dry run on develop would tag and publish"
 },
 {
  "id": "release.workflow-main-only",
  "target": ".github/workflows/release-publish.yml",
  "find": "          [ \"${GITHUB_REF}\" = refs/heads/main ] || { echo \"::error::a release is published from main only; dispatch a dry run elsewhere\"; exit 1; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a caller that forgot dry-run on develop would release a commit main never had"
 },
 {
  "id": "release.workflow-check-fails-outside-dry-run",
  "target": ".github/workflows/release-publish.yml",
  "find": "            [ \"${DRY_RUN}\" = true ] || exit 1",
  "replace": "            true",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a released version would run every lane again and fail only at the tag"
 },
 {
  "id": "release.workflow-stage-typo-fails",
  "target": ".github/workflows/release-publish.yml",
  "find": "    if: inputs.stage != 'publish'",
  "replace": "    if: inputs.stage == 'check'",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a misspelt stage would skip both jobs and the release would read green"
 },
 {
  "id": "release.workflow-check-reads-only",
  "target": ".github/workflows/release-publish.yml",
  "find": "    timeout-minutes: 10\n    permissions:\n      contents: read",
  "replace": "    timeout-minutes: 10\n    permissions:\n      contents: write",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "the version check needs no write token, and the caller grants write for the publish job"
 },
 {
  "id": "lib.dartdoc-guides-any-repo-path",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "        return f\"{prefix}{links.target(source_rel, path)}{sep}{fragment}{suffix}\"",
  "replace": "        if not path.endswith(\".md\"):\n            return match.group(0)\n        return f\"{prefix}{links.target(source_rel, path)}{sep}{fragment}{suffix}\"",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a link to a workflow, a manifest or a hub script stayed relative and was a dead link on the site (13 on OmniAccelerANT's)"
 },
 {
  "id": "lib.dartdoc-guides-folder-is-tree",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "            return \"tree\"",
  "replace": "            return \"blob\"",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "GitHub shows a folder under /tree/; /blob/ on a folder is a redirect at best"
 },
 {
  "id": "lib.dartdoc-guides-missing-fails",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "        if not kind:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a link to a file that does not exist would ship as a GitHub 404 that no site gate sees"
 },
 {
  "id": "lib.dartdoc-guides-site-page-kept",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "            if self.site_root and pathlib.Path(self.site_root, unquote(path)).exists():",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a guide may link a page of the site itself, which is no repository file"
 },
 {
  "id": "lib.dartdoc-guides-scheme-left-alone",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "NOT_A_REPO_PATH = re.compile(r\"^(?:[A-Za-z][A-Za-z0-9+.-]*:|/|#)\")",
  "replace": "NOT_A_REPO_PATH = re.compile(r\"^(?:https?:|#)\")",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a mailto: or a site-absolute link would be read as a repository path"
 },
 {
  "id": "lib.dartdoc-guides-empty-submodule",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "            if (resolved + \"/\").startswith(sub + \"/\") and checkout.is_dir() and not any(checkout.iterdir()):",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a docs build without the submodules checked out would fail on every hub link"
 },
 {
  "id": "lib.dartdoc-guides-submodule-root",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "            if resolved == sub:\n                return f\"{url}/tree/{BRANCH}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a link to the submodule itself would land on the superproject's gitlink page"
 },
 {
  "id": "lib.dartdoc-guides-render-checks-the-tree",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "submodule_urls(project), project, str(guide_dir))",
  "replace": "submodule_urls(project))",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "without the project root the render cannot tell a file from a folder or a missing file"
 },
 {
  "id": "lib.dartdoc-guides-rustdoc-beside-shell",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "(guide_dir / f\"guide-{slug}.html\").write_text(page, encoding=\"utf-8\")",
  "replace": "(root / f\"guide-{slug}.html\").write_text(page, encoding=\"utf-8\")",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a rustdoc guide at the site root keeps its crate page's ../static.files paths and loads no stylesheet"
 },
 {
  "id": "lib.dartdoc-guides-rustdoc-sidebar-nav",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "        return text if at == -1 else text[: at + len(RUST_SIDEBAR)] + nav_html + text[at + len(RUST_SIDEBAR) :]",
  "replace": "        return text",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "a guide no page links is a page no reader finds"
 },
 {
  "id": "lib.dartdoc-guides-rustdoc-main-content",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "        page = _splice(page, RUST_MAIN_START, RUST_MAIN_END, main, f\"guide-{slug}.html (main content)\")",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "without the splice every guide page shows the crate's own documentation"
 },
 {
  "id": "lib.dartdoc-guides-rustdoc-subsections",
  "target": "linux/scripts/lib/dartdoc-guides.py",
  "find": "        elif level == 3 and sections:",
  "replace": "        elif level == 4 and sections:",
  "test": "bash linux/scripts/tests/test-dartdoc-guides.sh",
  "why": "the sidebar contents list each section's subsections, as rustdoc's own do"
 },
 {
  "id": "packaging.elf-closure-relocatable",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "    if [ \"${RELOCATABLE}\" = false ] || in_bundle \"${dir}\"; then return 0; fi",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "a plugin's RUNPATH into /opt/gstreamer resolves in the image and nowhere else, so its libraries would stay behind"
 },
 {
  "id": "packaging.elf-closure-from-or-nowhere",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "    [ -e \"${rule#*=}/${soname}\" ] || return 1",
  "replace": "    [ -e \"${rule#*=}/${soname}\" ] || continue",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "an ORT missing from the chain dir would be taken from the ld.so cache, /opt/opencv5's copy, which G6 rejects only later"
 },
 {
  "id": "packaging.elf-closure-ldconfig",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "    path=\"$(ldconfig -p 2>/dev/null | awk -v n=\"${soname}\" '$1 == n { print $NF; exit }' || true)\"",
  "replace": "    path=\"\"",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "the Flutter bundle takes every library no --search names from the ld.so cache"
 },
 {
  "id": "packaging.elf-closure-ldd-lists",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "    $2 == \"=>\" && $3 ~ /^\\// { print $1, $3; next }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "the ObservANT bundles take every library from ldd's listing; without it nothing is copied"
 },
 {
  "id": "packaging.elf-closure-ldd-not-found",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "    $2 == \"=>\" && $3 == \"not\" { print $1, \"?\"; next }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "a library ldd cannot find would be dropped silently and the bundle would fail on the target"
 },
 {
  "id": "packaging.elf-closure-ldd-inside",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "    /*) if in_bundle \"$3\"; then return 0; fi ;;",
  "replace": "    /*) ;;",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "a library already in the bundle would be copied a second time into the lib dir"
 },
 {
  "id": "packaging.elf-closure-default-system",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "if [ \"${DEFAULT_SYSTEM}\" = true ]; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "a bundle built against a newer glibc than the target's carries its C runtime, and the built-in list would keep it out"
 },
 {
  "id": "packaging.elf-closure-no-runpath",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "  if [ \"${RUNPATH}\" = true ]; then link_to_lib_dir \"${file}\" \"${soname}\"; fi",
  "replace": "  link_to_lib_dir \"${file}\" \"${soname}\"",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "the Flutter bundle sets its own RUNPATHs after the walk, and a patched glibc loader crashes"
 },
 {
  "id": "packaging.elf-closure-exclude",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "    --system | --exclude) EXTRA_SYSTEM+=(\"${2:?}\"); shift 2 ;;",
  "replace": "    --system) EXTRA_SYSTEM+=(\"${2:?}\"); shift 2 ;;",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "libcamera must stay the target's: its IPA and tuning match the target's kernel"
 },
 {
  "id": "packaging.elf-closure-from-needs-dir",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "  case \"${rule}\" in ?*=?*) ;; *) err \"--from needs SONAME-GLOB=DIR: ${rule}\" ;; esac",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "a --from without its directory would refuse every matching library"
 },
 {
  "id": "packaging.elf-closure-protect",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "  if is_protected \"${file}\"; then PRELOAD[${soname}]=1; return 0; fi",
  "replace": "  if false; then PRELOAD[${soname}]=1; return 0; fi",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "G6 grades the chain ORT byte for byte, so it must never be patched"
 },
 {
  "id": "packaging.elf-closure-check-copies-nothing",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "  if [ -z \"${found}\" ] || [ \"${CHECK_ONLY}\" = true ]; then",
  "replace": "  if [ -z \"${found}\" ]; then",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "--check grades a finished bundle and must not repair it on the way"
 },
 {
  "id": "packaging.elf-closure-origin-relative",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "  [ \"${rel}\" = \".\" ] || token=\"\\$ORIGIN/${rel}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "bin/ needs $ORIGIN/../lib; a bare $ORIGIN finds nothing there"
 },
 {
  "id": "packaging.elf-closure-allow-unresolved",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "    if [ -n \"${ALLOWED_UNRESOLVED[${soname}]:-}\" ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "oneDNN is absent image-wide and loaded only when asked for; python-app-bundle.sh allows it"
 },
 {
  "id": "packaging.elf-closure-old-name",
  "target": "linux/scripts/06-packaging/python-app-closure.sh",
  "find": "exec bash \"$(dirname \"${BASH_SOURCE[0]}\")/elf-closure.sh\" \"$@\"",
  "replace": "exec true",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "CPackCommon.cmake, python-app-bundle.sh and the consumers call the walker by this path"
 },
 {
  "id": "data-lock.download-hash-checked",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "        if got != sha:\n            raise FetchError(f\"{url}: sha256 {got}, the lock says {sha}\")",
  "replace": "        if False:\n            raise FetchError(f\"{url}: sha256 {got}, the lock says {sha}\")",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a release that served other bytes would land in the bundle as the locked model"
 },
 {
  "id": "data-lock.cache-rehashed",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "        if matches(candidate, sha):",
  "replace": "        if candidate.is_file():",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a corrupt or truncated cached copy would be served for ever"
 },
 {
  "id": "data-lock.legacy-cache-entry",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "    for candidate in (cached, cache / sha):",
  "replace": "    for candidate in (cached,):",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "fetch-models.sh and fetch_models.py cached as a bare <sha256>; an offline lane would lose its models at the switch"
 },
 {
  "id": "data-lock.target-rehashed",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "            if (up_to_date(target, sha) if archives else matches(target, sha)):",
  "replace": "            if (up_to_date(target, sha) if archives else target.is_file()):",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a model that changed on disk would stay, whatever the lock says"
 },
 {
  "id": "data-lock.readable-by-all",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "        part.chmod(0o644)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "ObservANT's service user cannot read a 0600 model"
 },
 {
  "id": "data-lock.failed-place-leaves-no-part",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "    except BaseException:\n        part.unlink(missing_ok=True)\n        raise\n",
  "replace": "    except BaseException:\n        raise\n",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a rename refused after the copy left <file>.part beside the target, which the docs promise never happens"
 },
 {
  "id": "data-lock.plain-file-name",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "        if Path(name).name != name or name in (\".\", \"..\"):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a lock line ../x would write outside the destination"
 },
 {
  "id": "data-lock.one-line-per-file",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "        if any(name == row[1] for row in rows):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "two hashes for one file name means one of them is never what lands"
 },
 {
  "id": "data-lock.sha-shape",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "        if len(sha) != 64 or any(c not in \"0123456789abcdef\" for c in sha):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a truncated hash is a lock typo, and the download would fail only after it was made"
 },
 {
  "id": "data-lock.url-scheme",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "    if not url.startswith((\"https://\", \"http://\", \"file:\")):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "urllib also opens ftp: and other schemes a lock has no business naming"
 },
 {
  "id": "data-lock.offline-hint",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "; offline, put the file at {offline_hint}",
  "replace": "",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "an offline build has one way through, and the error is the only place that says where the file goes"
 },
 {
  "id": "data-lock.only-unknown-fails",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "    if missing:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a scene renamed in the lock would leave the configure green and the scene missing"
 },
 {
  "id": "data-lock.default-cache-env",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "    if os.getenv(env):\n        return Path(os.environ[env])",
  "replace": "    if False:\n        return Path(os.environ[env])",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "the lanes point the cache at a persistent volume through these two variables"
 },
 {
  "id": "data-lock.not-an-archive",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "    raise FetchError(f\"{file} is no {', '.join(ARCHIVE_SUFFIXES)} archive\")",
  "replace": "    return file",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "--extract over a models lock would try to unpack a model"
 },
 {
  "id": "data-lock.stamp-counts-files",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "    return stamp.read_text(encoding=\"utf-8\").strip() == f\"{sha} {file_count(target)}\"",
  "replace": "    return stamp.read_text(encoding=\"utf-8\").startswith(sha)",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a rebase that deletes the scene files keeps the ignored stamp, and a hash-only check calls the empty directory up to date (2026-10-17)"
 },
 {
  "id": "data-lock.unstamped-dir-kept",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "        if target.exists():\n            raise FetchError(f\"{target} exists but was not fetched",
  "replace": "        if False:\n            raise FetchError(f\"{target} exists but was not fetched",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a scene directory someone put there by hand would be deleted by the configure"
 },
 {
  "id": "data-lock.archive-stays-in-its-dir",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "        if stray:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "an archive is a release asset; one that unpacks elsewhere is not the AssetANT layout and must not write beside the scenes"
 },
 {
  "id": "data-lock.files-touched",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "                    os.utime(path, (now, now))",
  "replace": "                    pass",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "AssetANT packs with mtime 0, and a build would take every scene file for older than its outputs"
 },
 {
  "id": "data-lock.stamp-written",
  "target": "linux/scripts/lib/fetch-data-lock.py",
  "find": "            (fresh / STAMP).write_text(f\"{sha} {file_count(fresh)}\\n\", encoding=\"utf-8\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "without its stamp a fetched scene is refused as not fetched on the next configure"
 },
 {
  "id": "data-lock.cmake-failure-stops",
  "target": "cmake/KataglyphisFetchData.cmake",
  "find": "  if(NOT\n     _rc\n     EQUAL\n     0)",
  "replace": "  if(FALSE)",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "a configure that goes on without its scenes fails later in the tests that read them, for no visible reason"
 },
 {
  "id": "data-lock.cmake-passes-the-lock",
  "target": "cmake/KataglyphisFetchData.cmake",
  "find": "  execute_process(COMMAND \"${_python}\" -I \"${_KATAGLYPHIS_FETCH_DATA}\" ${_args} RESULT_VARIABLE _rc)",
  "replace": "  execute_process(COMMAND \"${_python}\" -I \"${_KATAGLYPHIS_FETCH_DATA}\" RESULT_VARIABLE _rc)",
  "test": "bash linux/scripts/tests/test-fetch-data-lock.sh",
  "why": "the CMake twin is only as good as the arguments it hands the fetcher"
 },
 {
  "id": "gate-fixture.harness-rc-is-exact",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  if [ \"${rc}\" = \"${want}\" ]; then _t_pass; else _t_fail \"expected rc ${want}, got ${rc}: $*",
  "replace": "  if [ \"${rc}\" -ne 0 ] || [ \"${want}\" = 0 ]; then _t_pass; else _t_fail \"expected rc ${want}, got ${rc}: $*",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "a gate's usage error (2) passing for its finding (1) is the vacuous pass the consumers' expect() helpers were written against"
 },
 {
  "id": "gate-fixture.harness-grep-verdict",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  elif [ \"${rc}\" = \"${want}\" ]; then\n    _t_pass",
  "replace": "  elif true; then\n    _t_pass",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "a pattern check that passes on a miss proves nothing about the output"
 },
 {
  "id": "gate-fixture.harness-grep-unreadable",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  if [ \"${rc}\" -gt 1 ]; then\n    _t_fail \"cannot read ${file} for /${pattern}/\"",
  "replace": "  if false; then\n    _t_fail \"cannot read ${file} for /${pattern}/\"",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "a missing output file must not read as the absence of a pattern"
 },
 {
  "id": "gate-fixture.harness-grep-pattern-not-an-option",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  grep -qE -e \"${pattern}\" -- \"${file}\" 2>/dev/null || rc=$?",
  "replace": "  grep -qE \"${pattern}\" \"${file}\" 2>/dev/null || rc=$?",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "a pattern beginning with -- is read as an option and matches nothing, silently (AGENTS.md, host tool traps)"
 },
 {
  "id": "gate-fixture.harness-consumer-entry",
  "target": "linux/scripts/lib/test-harness.sh",
  "find": "source \"${_TEST_HARNESS_LIB_DIR}/../tests/test-harness.sh\"",
  "replace": "source ./test-harness.sh",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "a consumer's suite runs from its own tree, so the entry must find the harness beside itself, not in the working directory"
 },
 {
  "id": "large-files.blob-size",
  "target": "linux/scripts/verify_large_files.py",
  "find": "        kib = sizes[sha] // 1024",
  "replace": "        kib = os.path.getsize(os.path.join(root, rel)) // 1024",
  "test": "bash linux/scripts/tests/test-large-files.sh",
  "why": "a CRLF checkout grows a text scene by a byte a line, so BeschleunigerBallett's suzanne.obj read as grown from 986 to 1017 KiB on Windows"
 },
 {
  "id": "large-files.blob-sized-or-refused",
  "target": "linux/scripts/verify_large_files.py",
  "find": "    if out.returncode != 0 or lost:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-large-files.sh",
  "why": "a blob git cannot size would be graded as missing data, never as a failure"
 },
 {
  "id": "large-files.blob-sniffed",
  "target": "linux/scripts/verify_large_files.py",
  "find": "    return b\"\\0\" in out.stdout[:SNIFF]",
  "replace": "    with open(os.path.join(root, rel), \"rb\") as fh:\n        return b\"\\0\" in fh.read(SNIFF)",
  "test": "bash linux/scripts/tests/test-large-files.sh",
  "why": "the index is graded: a working-tree read stops every commit on an unstaged deletion and misses a binary staged before an edit"
 },
 {
  "id": "docs-site.hub-docs-never-pypi-in-ci",
  "target": "linux/scripts/build-docs.sh",
  "find": "  elif [ \"${CI:-}\" = true ]; then\n    err \"no ${IMAGE_VENV}: the docs build in the family image (build-docs.yml), never from PyPI in CI\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-build-docs.sh",
  "why": "a CI-side download of the Sphinx stack is what the everything-in-the-image rule forbids"
 },
 {
  "id": "docs-site.hub-docs-image-first",
  "target": "linux/scripts/build-docs.sh",
  "find": "  if [ -d \"${IMAGE_VENV}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-build-docs.sh",
  "why": "in the image the stack is already there; going to PyPI anyway downloads 35 packages per build"
 },
 {
  "id": "docs-site.hub-docs-version-checked",
  "target": "linux/scripts/build-docs.sh",
  "find": "    if not req.specifier.contains(have, prereleases=True):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-build-docs.sh",
  "why": "an image whose Sphinx is older than the theme needs would fail deep inside sphinx-build, not by name"
 },
 {
  "id": "docs-site.hub-docs-extras-skipped",
  "target": "linux/scripts/build-docs.sh",
  "find": "    if req.marker is not None and not req.marker.evaluate({\"extra\": \"\"}):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-build-docs.sh",
  "why": "a requirement only an extra asks for is no requirement of the build"
 },
 {
  "id": "docs-site.hub-docs-workstation-locked",
  "target": "linux/scripts/build-docs.sh",
  "find": "    UV_PROJECT_ENVIRONMENT=\"${VENV_DIR}\" uv sync --project \"${REPO_ROOT}/docs\" --locked",
  "replace": "    UV_PROJECT_ENVIRONMENT=\"${VENV_DIR}\" uv sync --project \"${REPO_ROOT}/docs\"",
  "test": "bash linux/scripts/tests/test-build-docs.sh",
  "why": "a workstation build must fail if its docs lock no longer matches the project instead of re-resolving dependencies"
 },
 {
  "id": "docs-site.hub-docs-project-scoped",
  "target": "linux/scripts/build-docs.sh",
  "find": "    UV_PROJECT_ENVIRONMENT=\"${VENV_DIR}\" uv sync --project \"${REPO_ROOT}/docs\" --locked",
  "replace": "    UV_PROJECT_ENVIRONMENT=\"${VENV_DIR}\" uv sync --project \"${REPO_ROOT}\" --locked",
  "test": "bash linux/scripts/tests/test-build-docs.sh",
  "why": "the docs dependency project must not become a root project that changes other uv commands"
 },
 {
  "id": "docs-site.hub-docs-lock-checked-offline",
  "target": "linux/scripts/build-docs.sh",
  "find": "  uv lock --project \"${REPO_ROOT}/docs\" --check --offline && return 0",
  "replace": "  uv lock --project \"${REPO_ROOT}/docs\" --offline && return 0",
  "test": "bash linux/scripts/tests/test-build-docs.sh",
  "why": "the image build must reject a stale docs lock without fetching from PyPI"
 },
 {
  "id": "shared-config.help-block-is-header",
  "target": "shared/config/sync-shared-config.sh",
  "find": "        if [ \"${line#<\\#}\" != \"$line\" ]; then",
  "replace": "        if false; then",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "a PowerShell runner's comment-based help names its repository, and comparing it would read every consumer as drifted"
 },
 {
  "id": "shared-config.help-block-ends-at-its-close",
  "target": "shared/config/sync-shared-config.sh",
  "find": "[ \"${SSC_LINES[$first]#*\\#>}\" = \"${SSC_LINES[$first]}\" ]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "the code after the help block is the copy under test; skipping past it compares nothing"
 },
 {
  "id": "shared-assets.coco-classes-keep-80-ids",
  "target": "shared/config/coco-classes.txt",
  "find": "hair drier\ntoothbrush\n",
  "replace": "hair drier\n",
  "test": "bash linux/scripts/tests/test-coco-classes.sh",
  "why": "every loader maps line N to class id N-1; a dropped line leaves a class id the model reports without a name"
 },
 {
  "id": "shared-assets.coco-classes-names-are-exact",
  "target": "shared/config/coco-classes.txt",
  "find": "\ncat\n",
  "replace": "\ncat \n",
  "test": "bash linux/scripts/tests/test-coco-classes.sh",
  "why": "loaders compare class names byte for byte, so a trailing blank makes 'cat' unknown"
 },
 {
  "id": "shared-assets.coco-classes-is-an-exact-asset",
  "target": "shared/config/shared-assets.manifest",
  "find": "| resources/coco-classes.txt              | exact |",
  "replace": "| resources/coco-classes.txt              | body  |",
  "test": "bash linux/scripts/tests/test-coco-classes.sh",
  "why": "the class list has no per-consumer header; body mode would let a copy drift"
 },
 {
  "id": "shared-assets.agentic-loop-runners-registered",
  "target": "shared/config/shared-assets.manifest",
  "find": "agentic-loop-ps1     | shared/agentic-loop/templates/Invoke-AgenticLoop.ps1 | scripts/agentic-loop/Invoke-AgenticLoop.ps1 | body  |\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "the runners were copied into two consumers and watched by nothing"
 },
 {
  "id": "windows-lane.build-script-prefers-the-repo-script",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "if (-not $file -and (Test-Path -LiteralPath 'scripts/windows/Build-Windows.ps1' -PathType Leaf)) {",
  "replace": "if ($false) {",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "a caller relying on the default must keep running its own Build-Windows.ps1 until it deletes it, or the hub driver runs on a repo without its python-ci.psd1"
 },
 {
  "id": "windows-lane.build-script-defaults-empty",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "          build driver).\n        required: false\n        type: string\n        default: ''",
  "replace": "          build driver).\n        required: false\n        type: string\n        default: C:\\workspace\\scripts\\windows\\Build-Windows.ps1",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "a fixed default path skips the resolution step, so a repo without its own script gets a missing-file failure instead of the hub driver"
 },
 {
  "id": "lib.pinned-clang-format-version-anchored",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "clang-format version ${want//./\\\\.}([^0-9.]|\\$)\" <<<",
  "replace": "clang-format version ${want//./\\\\.}\" <<<",
  "test": "bash linux/scripts/tests/test-pinned-clang-format.sh",
  "why": "unanchored, a clang-format 23.1.30 grades as the pinned 23.1.3, and releases format differently"
 },
 {
  "id": "lib.pinned-clang-format-reads-versions-env",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  if [[ -z \"${want}\" ]]; then\n    # shellcheck source=../01-core/load-versions-env.sh",
  "replace": "  if false; then\n    # shellcheck source=../01-core/load-versions-env.sh",
  "test": "bash linux/scripts/tests/test-pinned-clang-format.sh",
  "why": "a consumer that exports no LLVM_RELEASE must still get the hub's pin, not an error or any clang-format"
 },
 {
  "id": "lib.pinned-clang-format-check-uses-it",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "    if ! \"${CODE_QUALITY_CLANG_FORMAT:-clang-format}\" --dry-run -Werror",
  "replace": "    if ! clang-format --dry-run -Werror",
  "test": "bash linux/scripts/tests/test-pinned-clang-format.sh",
  "why": "the check would grade with PATH's clang-format after the pinned one was found, which is the drift the pin exists to stop"
 },
 {
  "id": "lib.walk-skips-node-modules",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  '*/node_modules/*' '*/.pub-cache/*'",
  "replace": "  '*/.pub-cache/*'",
  "test": "bash linux/scripts/tests/test-code-quality-walk.sh",
  "why": "a walk that enters node_modules grades a native addon's sources, which the repository neither owns nor can format"
 },
 {
  "id": "lib.cpp-walk-skips-untracked-trees",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  _code_quality_name_predicate \"${exts[@]}\"\n  _code_quality_find_sources \"$@\"",
  "replace": "  _code_quality_name_predicate \"${exts[@]}\"\n  find \"$@\" -type f \"${_CODE_QUALITY_NAME_PREDICATE[@]}\"",
  "test": "bash linux/scripts/tests/test-code-quality-walk.sh",
  "why": "the clang-format walk must apply the untracked-tree list, or a consumer passing . grades every dependency's C++"
 },
 {
  "id": "lib.tidy-walk-skips-untracked-trees",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  _code_quality_name_predicate \"${exts[@]}\"\n  _code_quality_find_sources \"$@\"",
  "replace": "  _code_quality_name_predicate \"${exts[@]}\"\n  find \"$@\" -type f \"${_CODE_QUALITY_NAME_PREDICATE[@]}\"",
  "test": "bash linux/scripts/tests/test-code-quality-walk.sh",
  "why": "the clang-tidy walk must skip the same trees as the format walk, or it tidies dependency sources no compile DB knows"
 },
 {
  "id": "lib.cmake-walk-skips-untracked-trees",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "CODE_QUALITY_CMAKE_DEFAULT_EXCLUDES=(\n  \"${CODE_QUALITY_UNTRACKED_EXCLUDES[@]}\"\n)",
  "replace": "CODE_QUALITY_CMAKE_DEFAULT_EXCLUDES=(\n  '*/.pub-cache/*'\n)",
  "test": "bash linux/scripts/tests/test-code-quality-walk.sh",
  "why": "the CMake walk's defaults must cover node_modules too, or a cmake-js addon's CMakeLists.txt fails the consumer's gate"
 },
 {
  "id": "docs-site.build-dartdoc-clears-api",
  "target": "linux/scripts/docs-site.sh",
  "find": "  rm -rf doc/api\n  _docs_site_guides\n",
  "replace": "  _docs_site_guides\n",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "dart doc writes over doc/api, so a rebuild kept the staged .htaccess and stage then failed 'the site ships a .htaccess'"
 },
 {
  "id": "docs-site.build-dartdoc-guides",
  "target": "linux/scripts/docs-site.sh",
  "find": "  DARTDOC_BUILD_GUIDES=(${DOCS_SITE_GUIDES[@]+\"${DOCS_SITE_GUIDES[@]}\"})",
  "replace": "  DARTDOC_BUILD_GUIDES=()",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "the guides input must reach dartdoc_build_main, or a Dart repository with guides needs its own build script again"
 },
 {
  "id": "docs-site.guides-absolute-source",
  "target": "linux/scripts/docs-site.sh",
  "find": "    DOCS_SITE_GUIDES+=(\"$(pwd)/${src}|${slug}|${title}\")",
  "replace": "    DOCS_SITE_GUIDES+=(\"${src}|${slug}|${title}\")",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a guide source is read from the repository root, which the renderer must not have to guess from its working directory"
 },
 {
  "id": "docs-site.plan-guides-dartdoc-only",
  "target": "linux/scripts/docs-site.sh",
  "find": "      *) die \"guides without a guide builder\"",
  "replace": "      *) true || die \"guides without a guide builder\"",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "guides beside a command or another builder would be silently ignored, and the caller would believe its guides published"
 },
 {
  "id": "docs-site.plan-guide-fields",
  "target": "linux/scripts/docs-site.sh",
  "find": "    [ -n \"${src}\" ] && [ -n \"${slug}\" ] && [ -n \"${title}\" ] || die \"bad guide\"",
  "replace": "    true || die \"bad guide\"",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a guide line without its slug or title fails deep in the renderer, after the whole dart doc run"
 },
 {
  "id": "docs-site.plan-guide-source-safety",
  "target": "linux/scripts/docs-site.sh",
  "find": "    _docs_site_relative \"guide source\" \"${src}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a guide source outside the checkout would publish a file of the build host"
 },
 {
  "id": "docs-site.plan-guide-slug-safety",
  "target": "linux/scripts/docs-site.sh",
  "find": "      *[!A-Za-z0-9_-]*) die \"bad guide slug\"",
  "replace": "      __never__) die \"bad guide slug\"",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "the slug names guide-<slug>.html, so a / or a space writes outside the site or breaks every link to the page"
 },
 {
  "id": "docs-site.workflow-guides-reach-container",
  "target": ".github/workflows/build-docs.yml",
  "find": "          extra-args: -e DOCS_COMMAND -e DOCS_BUILDER -e DOCS_GUIDES ${{ inputs.container-args }}",
  "replace": "          extra-args: -e DOCS_COMMAND -e DOCS_BUILDER ${{ inputs.container-args }}",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "plan reads DOCS_GUIDES on the runner, but the build runs in the container, where a missing -e builds a site without its guides"
 },
 {
  "id": "docs-site.sidebars-click-changes-state",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "    if (toggled.state === before.state) {",
  "replace": "    if (false) {",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k callers",
  "why": "a toggle the theme JS never bound looks fine until it is clicked: five family sites had dead toggles at every width"
 },
 {
  "id": "docs-site.sidebars-off-screen",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "    if (!before.toggle.onScreen) {",
  "replace": "    if (false) {",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k toggles",
  "why": "a sticky sidebar pushed the article's toggle to x=-242 at 850 px, where no reader can reach it"
 },
 {
  "id": "docs-site.sidebars-covered",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "    if (!before.toggle.topmost) {",
  "replace": "    if (false) {",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k toggles",
  "why": "a toggle under another element takes no click, though it is drawn"
 },
 {
  "id": "docs-site.sidebars-goes-back",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "    results.push(after.state === before.state",
  "replace": "    results.push(true",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k themes",
  "why": "a sidebar that opens but never closes again traps a phone reader under it"
 },
 {
  "id": "docs-site.sidebars-hidden-without-toggle",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "`FAIL ${where}: hidden, and no toggle opens it`",
  "replace": "`ok   ${where}: hidden`",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k toggles",
  "why": "a hidden sidebar with no toggle hides the whole navigation"
 },
 {
  "id": "docs-site.sidebars-the-visible-toggle",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "[...document.querySelectorAll(spec.toggle)].find((e) => e.getBoundingClientRect().width > 0)",
  "replace": "document.querySelector(spec.toggle)",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k toggles",
  "why": "pydata 0.20's header put a hidden toggle first in the DOM; the reader clicks the visible one"
 },
 {
  "id": "docs-site.sidebars-dialog-escape",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "    else await escape();\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k toggles",
  "why": "below 992 px the book theme's toggle opens a modal dialog, which only Escape or its backdrop closes"
 },
 {
  "id": "docs-site.sidebars-verdict",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "  if (failed) fail(",
  "replace": "  if (false) fail(",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k tree",
  "why": "a check that prints FAIL and exits 0 publishes the broken site anyway"
 },
 {
  "id": "docs-site.sidebars-runtime-events",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "  await send('Runtime.enable');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k tree",
  "why": "without Runtime.enable Chrome sends no exceptionThrown, and a page that throws looks clean"
 },
 {
  "id": "docs-site.sidebars-uncaught-fails",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "  for (const line of new Set(thrown.map(uncaught))) results.push(`FAIL ${w}x${h}: uncaught ${line}`);\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k tree",
  "why": "Exhale's applier threw `$ is not defined` on every page of two sites while every toggle passed"
 },
 {
  "id": "docs-site.sidebars-tree-applied",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "    if (!tree.applied) results.push(",
  "replace": "    if (false) results.push(",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k tree",
  "why": "a tree view whose script never ran shows every list open and folds nothing"
 },
 {
  "id": "docs-site.sidebars-tree-folds",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "      if (folded.state === tree.state) results.push(",
  "replace": "      if (false) results.push(",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k tree",
  "why": "an applied tree without its click handler draws the buttons and does nothing"
 },
 {
  "id": "docs-site.sidebars-tree-goes-back",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "        results.push(back.state === tree.state",
  "replace": "        results.push(true",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k tree",
  "why": "an item that opens but never folds again"
 },
 {
  "id": "docs-site.sidebars-tree-own-text",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "  if (text) range.selectNodeContents(text);",
  "replace": "  range.selectNodeContents(li.querySelector('a'));",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k usage",
  "why": "the reader folds an item on its own text: its link opens another page"
 },
 {
  "id": "docs-site.sidebars-tree-first-line",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "(li.querySelector(':scope > a') || li).scrollIntoView({ block: 'center' });",
  "replace": "li.scrollIntoView({ block: 'center' });",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k usage",
  "why": "BeschleunigerBallett's open first namespace is taller than the viewport: centring the whole item scrolled its text away, and the second click missed"
 },
 {
  "id": "docs-site.sidebars-waits-for-the-port",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "  for (let i = 0; i < 600 && !port; i++) {",
  "replace": "  for (let i = 0; i < 600 && !fs.existsSync(portFile); i++) {",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k usage",
  "why": "Chrome creates DevToolsActivePort before it writes the port; a loaded runner read it empty and failed 5 mutation baselines with 'opened no page' (run 39518418220)"
 },
 {
  "id": "docs-site.sidebars-tree-pages-found",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "...(kind === 'sphinx' && !isUrl(site) ? treePages(site) : [])",
  "replace": "...[]",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k tree",
  "why": "the callers pass the site alone, and Exhale's tree is on api/library_root.html, not index.html"
 },
 {
  "id": "docs-site.sidebars-asked-pages",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "[...start, ...asked, ",
  "replace": "[...start, ",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k usage",
  "why": "a published site has no file list to search: the live check names its API page"
 },
 {
  "id": "docs-site.sidebars-rustdoc-pages",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "const start = kind === 'rustdoc' && !isUrl(site) ? rustdocPages(site) : ['index.html'];",
  "replace": "const start = ['index.html'];",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k themes",
  "why": "a rustdoc site's index.html is a redirect with no sidebar, so the check would click nothing"
 },
 {
  "id": "docs-site.webgpu-readback-copy-src",
  "target": "linux/scripts/webgpu-canvas-readback.js",
  "find": "| GPUTextureUsage.COPY_SRC });",
  "replace": " });",
  "test": "bash linux/scripts/tests/test-webgpu-canvas-readback.sh",
  "why": "a canvas configured for RENDER_ATTACHMENT alone cannot be copied out"
 },
 {
  "id": "docs-site.webgpu-readback-row-padding",
  "target": "linux/scripts/webgpu-canvas-readback.js",
  "find": "Math.ceil((w * 4) / 256) * 256",
  "replace": "w * 4",
  "test": "bash linux/scripts/tests/test-webgpu-canvas-readback.sh",
  "why": "copyTextureToBuffer pads each row to 256 bytes; unpadded offsets read the wrong pixels"
 },
 {
  "id": "docs-site.webgpu-readback-bgra-order",
  "target": "linux/scripts/webgpu-canvas-readback.js",
  "find": "src[s + (bgra ? 2 : 0)]",
  "replace": "src[s]",
  "test": "bash linux/scripts/tests/test-webgpu-canvas-readback.sh",
  "why": "Chrome's preferred canvas format is BGRA on most platforms; read as RGBA, red and blue swap"
 },
 {
  "id": "docs-site.webgpu-readback-after-submit",
  "target": "linux/scripts/webgpu-canvas-readback.js",
  "find": "    if (st.want && st.texture) {",
  "replace": "    if (false) {",
  "test": "bash linux/scripts/tests/test-webgpu-canvas-readback.sh",
  "why": "the copy is taken in the frame that rendered, after its submit and before its texture is presented"
 },
 {
  "id": "docs-site.webgpu-readback-eight-bit-only",
  "target": "linux/scripts/webgpu-canvas-readback.js",
  "find": "if (!/^(rgba|bgra)8unorm/.test(format)) return",
  "replace": "if (false) return",
  "test": "bash linux/scripts/tests/test-webgpu-canvas-readback.sh",
  "why": "a half-float canvas has 8 bytes a pixel: read as 4 it is noise, not a frame"
 },
 {
  "id": "docs-site.webgpu-readback-verdict-colours",
  "target": "linux/scripts/webgpu-canvas-readback.js",
  "find": "  if (frame.colours < minColours) return",
  "replace": "  if (false) return",
  "test": "bash linux/scripts/tests/test-webgpu-canvas-readback.sh",
  "why": "a canvas that only clears has one colour and shows no scene"
 },
 {
  "id": "docs-site.webgpu-readback-no-frame-fails",
  "target": "linux/scripts/webgpu-canvas-readback.js",
  "find": "  if (why) fail(why, 1);",
  "replace": "  if (false) fail(why, 1);",
  "test": "bash linux/scripts/tests/test-webgpu-canvas-readback.sh",
  "why": "a page that never draws a frame must fail, not print an empty read-back and exit 0"
 },
 {
  "id": "docs-site.webgpu-readback-exports-flags",
  "target": "linux/scripts/webgpu-canvas-readback.js",
  "find": "else module.exports = { install, verdict, WEBGPU_FLAGS };",
  "replace": "else module.exports = { install, verdict };",
  "test": "bash linux/scripts/tests/test-webgpu-canvas-readback.sh",
  "why": "a consumer driving its own launch() copied the flags while they were private; exported, the image's one SwiftShader recipe has one home"
 },
 {
  "id": "docs-site.webgpu-readback-flags-frozen",
  "target": "linux/scripts/webgpu-canvas-readback.js",
  "find": "const WEBGPU_FLAGS = Object.freeze([",
  "replace": "const WEBGPU_FLAGS = ([",
  "test": "bash linux/scripts/tests/test-webgpu-canvas-readback.sh",
  "why": "every consumer shares the one array: a push by one would change the next launch of another"
 },
 {
  "id": "docs-site.check-runs-the-click-check",
  "target": "linux/scripts/docs-site.sh",
  "find": "  node \"${DOCS_SITE_HUB}/linux/scripts/check-docs-sidebars.js\" \"${site}\"",
  "replace": "  true",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k callers",
  "why": "the check subcommand is what build-docs.yml and both Sphinx drivers call"
 },
 {
  "id": "docs-site.check-skips-only-without-chrome",
  "target": "linux/scripts/docs-site.sh",
  "find": "      if [ -z \"${CHROME_EXECUTABLE:-}\" ]; then",
  "replace": "      if true; then",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k callers",
  "why": "--if-chrome skips riscv64, which has no Chrome for Testing build, never an image that has Chrome"
 },
 {
  "id": "docs-site.workflow-clicks-the-toggles",
  "target": ".github/workflows/build-docs.yml",
  "find": "          script: bash ${{ steps.plan.outputs.hub }}/linux/scripts/docs-site.sh build ${{ steps.plan.outputs.site-dir }}\n",
  "replace": "          script: bash ${{ steps.plan.outputs.hub }}/linux/scripts/docs-site.sh build && bash ${{ steps.plan.outputs.hub }}/linux/scripts/docs-site.sh check ${{ steps.plan.outputs.site-dir }}\n",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k callers",
  "why": "script is docker run's argv: a shell && ran the click check on the runner, with the runner's Chrome, not the image's"
 },
 {
  "id": "docs-site.build-checks-its-site",
  "target": "linux/scripts/docs-site.sh",
  "find": "  [ -n \"${1:-}\" ] || return 0\n  docs_site_check \"$1\"\n",
  "replace": "  [ -n \"${1:-}\" ] || return 0\n",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k callers",
  "why": "build-docs.yml passes the site to build so the click runs in the image's Chrome, inside the one container command"
 },
 {
  "id": "docs-site.docs-build-clicks-the-toggles",
  "target": "linux/scripts/lib/docs-build.sh",
  "find": "    [[ \"${target}\" != html ]] || docs_build_check_sidebars || return $?\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k callers",
  "why": "BeschleunigerBallett and AccelerANTgine publish an artifact; this is the one place their toggles are clicked"
 },
 {
  "id": "docs-site.ci-build-docs-clicks-the-toggles",
  "target": "linux/scripts/02-toolchain/python/ci_build_docs.sh",
  "find": "bash \"$SCRIPT_DIR/../../docs-site.sh\" check \"$WORKSPACE_ROOT/docs/build/html\" --if-chrome\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k callers",
  "why": "OrchestrANT and WebDavClient publish an artifact; this is the one place their toggles are clicked"
 },
 {
  "id": "renovate.bootstrap-installs-from-the-lock",
  "target": "linux/scripts/renovate-local.sh",
  "find": "    \"${NPM_BIN}\" ci --engine-strict",
  "replace": "    \"${NPM_BIN}\" install --engine-strict",
  "test": "bash linux/scripts/tests/test-renovate-bootstrap.sh",
  "why": "a fresh resolve takes whatever the registry holds that minute: on 2026-10-19 renovate 44.157.0 failed ETARGET for five minutes while AWS published a dependency after its dependents"
 },
 {
  "id": "renovate.bootstrap-refuses-a-lock-of-another-version",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  [ \"${locked}\" = \"${RENOVATE_VERSION}\" ] \\",
  "replace": "  true \\",
  "test": "bash linux/scripts/tests/test-renovate-bootstrap.sh",
  "why": "a lock left behind by a tool-pins.env bump would install the old Renovate under the new pin's name"
 },
 {
  "id": "renovate.bootstrap-prefix-keyed-by-lock",
  "target": "linux/scripts/renovate-local.sh",
  "find": "    NPM_PREFIX=\"${CACHE_ROOT}/renovate-${RENOVATE_VERSION}-$(sha256sum \"${RENOVATE_NPM_DIR}/package-lock.json\" | cut -c1-12)\"",
  "replace": "    NPM_PREFIX=\"${CACHE_ROOT}/renovate-${RENOVATE_VERSION}\"",
  "test": "bash linux/scripts/tests/test-renovate-bootstrap.sh",
  "why": "a regenerated lock for the same version must reinstall, not reuse the prefix the old lock filled"
 },
 {
  "id": "renovate.bootstrap-keeps-print-bin-stdout",
  "target": "linux/scripts/renovate-local.sh",
  "find": "    \"${NPM_BIN}\" ci --engine-strict --no-fund --no-audit --no-update-notifier --loglevel=error >&2)",
  "replace": "    \"${NPM_BIN}\" ci --engine-strict --no-fund --no-audit --no-update-notifier --loglevel=error)",
  "test": "bash linux/scripts/tests/test-renovate-bootstrap.sh",
  "why": "node \"$(renovate-local.sh --print-bin)\" must get the path alone, not npm's 'added N packages' line before it"
 },
 {
  "id": "renovate.bootstrap-rejects-old-same-major-node",
  "target": "linux/scripts/renovate-node.sh",
  "find": "  rb_py node-version \"${match}\" \"${version}\" \"${RENOVATE_NODE_VERSION}\" || return 1",
  "replace": "  : \"${version}\" \"${RENOVATE_NODE_VERSION}\"",
  "test": "bash linux/scripts/tests/test-renovate-bootstrap.sh",
  "why": "Node 24.0.0 has the pinned major but fails Renovate's minimum engine, so using it makes the dependency scan fail before the pinned cache is tried"
 },
 {
  "id": "renovate.bootstrap-repairs-partial-node-cache",
  "target": "linux/scripts/renovate-node.sh",
  "find": "  if node_toolchain_valid \"${NODE_BIN}\" exact; then bootstrap_cache_unlock; return 0; fi",
  "replace": "  if [ -x \"${NODE_BIN}\" ]; then bootstrap_cache_unlock; return 0; fi",
  "test": "bash linux/scripts/tests/test-renovate-bootstrap.sh",
  "why": "an interrupted extraction can leave bin/node executable with npm absent; accepting that cache prevents every later run from recovering"
 },
 {
  "id": "python.preamble-fallback-is-the-pin",
  "target": "linux/scripts/01-core/install-deps-preamble.sh",
  "find": "2>/dev/null && return 0\n",
  "replace": "2>/dev/null || echo \"3.12\"; return 0\n",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "a fallback with its own version builds against an interpreter the image does not carry"
 },
 {
  "id": "lib.cmake-format-py315-fix-runs",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "\"${venv_py}\" -I \"${_CQ_LIB_DIR}/cmakelang-py315.py\" || err",
  "replace": ": \"${venv_py}\" || err",
  "test": "bash linux/scripts/tests/test-cmake-format.sh",
  "why": "cmake-format 0.6.13 dies on Python 3.15's re.Scanner unless the bootstrap patches its lexer"
 },
 {
  "id": "lib.cmakelang-py315-replaces-the-scanner",
  "target": "linux/scripts/lib/cmakelang-py315.py",
  "find": "text.replace(\"re.Scanner(\", \"_Py314Scanner(\") + COMPAT",
  "replace": "text + COMPAT",
  "test": "bash linux/scripts/tests/test-cmake-format.sh",
  "why": "a marker without the swap reads as patched while 3.15 still refuses the lexer"
 },
 {
  "id": "develop-red.undecisive-runs-decide-nothing",
  "target": "linux/scripts/develop_red.py",
  "find": "        if run[\"event\"] in EVENTS and run[\"conclusion\"] in RED | GREEN:",
  "replace": "        if True:",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a cancelled run or a pull request's merge test would close or open a develop-red issue on evidence about something other than develop"
 },
 {
  "id": "develop-red.forks-are-not-family",
  "target": "linux/scripts/develop_red.py",
  "find": "        if not r[\"fork\"] and not r[\"archived\"] and r[\"default_branch\"] == \"develop\"",
  "replace": "        if True",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a fork or an archived repository follows none of the family's rules; watched, its red default branch files issues nobody will act on"
 },
 {
  "id": "develop-red.red-run-without-red-job",
  "target": "linux/scripts/develop_red.py",
  "find": "    if not RED & set(ran.values()):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a startup failure has no jobs, so without the whole-run key a workflow file that does not parse never opens an issue"
 },
 {
  "id": "develop-red.masked-lane",
  "target": "linux/scripts/develop_red.py",
  "find": "    return newer[:WALK]",
  "replace": "    return newer[:1]",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a later run of another lane (on-request, release) would hide an earlier red one that no run has passed since"
 },
 {
  "id": "develop-red.closed-issue-is-a-floor",
  "target": "linux/scripts/develop_red.py",
  "find": "    floor = max(state[\"seen\"], (now - LOOKBACK).strftime(ISO))",
  "replace": "    floor = (now - LOOKBACK).strftime(ISO)",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "an issue closed by hand would reopen on the same red run at the next poll"
 },
 {
  "id": "develop-red.older-rerun-never-overrides",
  "target": "linux/scripts/develop_red.py",
  "find": "            if job in decided or run[\"id\"] < red.get(job, {}).get(\"run\", 0):",
  "replace": "            if job in decided:",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a green re-run of an older commit would close the issue while the newest run of that job is still red"
 },
 {
  "id": "develop-red.green-closes",
  "target": "linux/scripts/develop_red.py",
  "find": "    if not new[\"red\"]:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "an issue that never closes is the noise that teaches everyone to ignore the label"
 },
 {
  "id": "develop-red.get-retries-5xx",
  "target": "linux/scripts/develop_red.py",
  "find": "                if method != \"GET\" or error.code < 500 or delay is None:",
  "replace": "                if True:",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "one 502 from the API turned the watch itself red on 2026-10-27, and the next push in the family was blocked on it"
 },
 {
  "id": "develop-red.writes-never-retry",
  "target": "linux/scripts/develop_red.py",
  "find": "                if method != \"GET\" or error.code < 500 or delay is None:",
  "replace": "                if error.code < 500 or delay is None:",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a write that failed after the server applied it would post the same comment or issue twice"
 },
 {
  "id": "develop-red.deleted-workflow-closes",
  "target": "linux/scripts/develop_red.py",
  "find": "        if record.get(\"state\") != ACTIVE:\n            close_issue(",
  "replace": "        if False:\n            close_issue(",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "an issue of a deleted or disabled workflow waits for a run that never comes; #110 stayed open seven weeks"
 },
 {
  "id": "develop-red.inactive-workflow-opens-nothing",
  "target": "linux/scripts/develop_red.py",
  "find": "if new[\"red\"] and workflow_state(client, repo, runs[0][\"workflow_id\"]).get(\"state\") == ACTIVE:",
  "replace": "if new[\"red\"]:",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "an issue opened for a workflow that no longer runs could never close"
 },
 {
  "id": "develop-red.open-issue-off-the-page",
  "target": "linux/scripts/develop_red.py",
  "find": "    open_ids = {wid for (name, wid), issue in issues.items() if name == repo and issue[\"state\"] == \"open\"}\n",
  "replace": "    open_ids = set()\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "an open issue whose workflow left the repo-wide page of 100 runs was never looked at again"
 },
 {
  "id": "develop-red.stale-page-confirmed",
  "target": "linux/scripts/develop_red.py",
  "find": "    if state[\"open\"] or page is None or window(page, state, now):\n",
  "replace": "    if state[\"open\"] or page is None:\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "the repo-wide page can lag a workflow's own newest run; #111 opened on a red run eleven days older than a green one"
 },
 {
  "id": "develop-red.open-issue-reads-its-workflow",
  "target": "linux/scripts/develop_red.py",
  "find": "    if state[\"open\"] or page is None or window(page, state, now):\n",
  "replace": "    if page is None or window(page, state, now):\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "an open issue whose page entry is stale sees no new run and stays open for good"
 },
 {
  "id": "develop-red.absent-job-retired",
  "target": "linux/scripts/develop_red.py",
  "find": "        if len(proof) >= 2:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a renamed or removed job never passes again, so its issue never closed by itself"
 },
 {
  "id": "develop-red.retire-needs-two-greens",
  "target": "linux/scripts/develop_red.py",
  "find": "        if len(proof) >= 2:\n",
  "replace": "        if len(proof) >= 1:\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "one green run without a job can be a partial round; retiring on it would close a real red"
 },
 {
  "id": "develop-red.skipped-caller-keeps-nested-red",
  "target": "linux/scripts/develop_red.py",
  "find": "    return any(name.startswith(prefix) and c in RED | GREEN for name, c in jobs.items())\n",
  "replace": "    return True\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a skipped caller hides every nested job; retiring them would close a lane that simply did not run"
 },
 {
  "id": "develop-red.skipped-is-not-absent",
  "target": "linux/scripts/develop_red.py",
  "find": "proof = [r[\"id\"] for r in greens if job not in jobs_of(r) and caller_ran(job, jobs_of(r))]",
  "replace": "proof = [r[\"id\"] for r in greens if jobs_of(r).get(job) in (None, \"skipped\") and caller_ran(job, jobs_of(r))]",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a job a green run skipped still exists; retiring it would close an issue whose job never passed"
 },
 {
  "id": "develop-red.retirement-is-named",
  "target": "linux/scripts/develop_red.py",
  "find": "                    + _retired_note(gone), text, \"completed\")\n",
  "replace": "                    , text, \"completed\")\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a job closed by retirement rather than a pass must say so, or a closed issue reads as a fixed one"
 },
 {
  "id": "develop-red.issues-paged",
  "target": "linux/scripts/develop_red.py",
  "find": "        if len(batch) < ISSUE_PAGE:\n            return found\n",
  "replace": "        if True:\n            return found\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "with more than 100 develop-red issues the newest open one can sit on page two, and a red lane then opened a second issue"
 },
 {
  "id": "develop-red.five-attempts",
  "target": "linux/scripts/develop_red.py",
  "find": "RETRY_DELAYS = (5, 10, 20, 40)\n",
  "replace": "RETRY_DELAYS = (5, 15)\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "watch run 41101409097 died on a 5xx burst that three attempts did not outlast"
 },
 {
  "id": "develop-red.repos-isolated",
  "target": "linux/scripts/develop_red.py",
  "find": "        except TRANSIENT as error:\n            # One repository",
  "replace": "        except TimeoutError as error:\n            # One repository",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "one repository the API cannot answer left every later repository of the family unwatched"
 },
 {
  "id": "develop-red.unanswered-fails-the-run",
  "target": "linux/scripts/develop_red.py",
  "find": "    return 1 if failed else 0\n",
  "replace": "    return 0\n",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "a watch that could not read a repository must go red, or that repository's reds go unreported in a green run"
 },
 {
  "id": "develop-red.transport-retried",
  "target": "linux/scripts/develop_red.py",
  "find": "                if method != \"GET\" or delay is None:\n                    raise\n                print(f\"retrying GET {path} after {type(error).__name__}\", file=sys.stderr)",
  "replace": "                if True:\n                    raise\n                print(f\"retrying GET {path} after {type(error).__name__}\", file=sys.stderr)",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "A connection that drops before any answer is retried like a 5xx, not turned into a red watch."
 },
 {
  "id": "develop-red.transport-family",
  "target": "linux/scripts/develop_red.py",
  "find": "TRANSIENT = (urllib.error.URLError, http.client.HTTPException, ConnectionError, TimeoutError)",
  "replace": "TRANSIENT = (urllib.error.URLError, TimeoutError)",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "RemoteDisconnected, which urlopen leaves unwrapped, counts as a transport failure."
 },
 {
  "id": "develop-red.transport-isolated",
  "target": "linux/scripts/develop_red.py",
  "find": "        except TRANSIENT as error:\n            # One repository",
  "replace": "        except (urllib.error.URLError, TimeoutError) as error:\n            # One repository",
  "test": "bash linux/scripts/tests/test-develop-red.sh",
  "why": "A repository whose connection keeps dropping is named and the others still settle, rather than a traceback."
 },
 {
  "id": "doc-links.link-roots-follow-root",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "        LINK_ROOTS = REPO_ROOT / LINK_ROOTS.name\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "a consumer's doc-link-roots.allow would never be read, so a pandoc source's root-relative link fails the gate though the build finds it (DocumANTation, CON119)"
 },
 {
  "id": "doc-links.link-roots-scoped-by-glob",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "        if fnmatch.fnmatchcase(doc.rel, glob) and (base / target).exists():\n",
  "replace": "        if (base / target).exists():\n",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "a root declared for the pandoc sources would also excuse a README link that GitHub cannot resolve"
 },
 {
  "id": "doc-links.link-roots-stale",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "        if label not in used:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "a row no link needs is cover for the next broken link from those pages"
 },
 {
  "id": "stage-graph.tensorrt-default-on",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": ": \"${ENABLE_TENSORRT:=true}\" \"${ENABLE_DEEPSTREAM:=true}\" ;;",
  "replace": ": \"${ENABLE_DEEPSTREAM:=true}\" ;;",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "every amd64 nvidia build carries TensorRT 11 without being asked (owner 2026-10-20)"
 },
 {
  "id": "stage-graph.tensorrt-default-amd64-only",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "          : \"${ENABLE_TENSORRT:=false}\"\n",
  "replace": "          : \"${ENABLE_TENSORRT:=true}\"\n",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "an arm64 nvidia build has no TensorRT route, so it must not default to one"
 },
 {
  "id": "onnx-ep-qnn.merge-copy-present",
  "target": "linux/Dockerfile.media",
  "find": "COPY --link --from=onnxruntime /usr/local/lib/onnxruntime-ep-qnn /usr/local/lib/onnxruntime-ep-qnn\n",
  "replace": "",
  "why": "the plugin is built and verified in the onnxruntime branch; only this COPY carries it into the merged media image",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-qnn.plugin-call-present",
  "target": "linux/Dockerfile.media",
  "find": "    bash /opt/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh build; \\\n",
  "replace": "",
  "why": "without the call no arch builds the plugin, and only the arm64 verify stage would notice, hours in",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-qnn.cpu-prefix-refuses-in-tree-provider",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "    refuse_in_tree_provider \"${PREFIX}\" 'libonnxruntime_providers_qnn.so*' /usr/local/lib/onnxruntime-ep-qnn\n",
  "replace": "",
  "why": "a second QNN EP in the CPU prefix would be the in-tree one coming back unnoticed",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-qnn.verify-needs-chain-lib",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "      libonnxruntime*) [ -e \"${QNNEP_ORT_DIR}/lib/${n}\" ] || {",
  "replace": "      libonnxruntime*) [ -e \"${QNNEP_ORT_DIR}/lib/${n}\" ] || true || {",
  "why": "a module needing an ONNX Runtime the chain prefix does not hold would load a foreign ORT at run time",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-qnn.ort-home-versioned-name",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  ln -s \"${real}\" \"${dest}/lib/libonnxruntime.so.${ver}\"\n",
  "replace": "",
  "why": "the fork's prebuilt step copies libonnxruntime.so.<ort_core version> out of --ort_home; without that name the build dies after configure",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-qnn.no-foreign-ort-core",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "    [ \"$(sha256sum \"${f}\" | cut -c1-64)\" = \"${chain_sha}\" ] || {",
  "replace": "    [ -f \"${f}\" ] || {",
  "why": "a build that produced or fetched an ONNX Runtime core of its own would ship a second ORT; only byte-identical copies of the chain's library may sit in the build dir",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-qnn.census-knows-the-fork-root",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": " /tmp/onnxruntime-ep-qnn/seeds/onnxruntime-qnn /tmp/onnxruntime-ep-qnn/build/Release/_deps/ort_core-src\n",
  "replace": "\n",
  "why": "the census reads the build root out of the module; without the fork's work dir among the chain roots the plugin is FOREIGN and the runtime smoke fails on arm64",
  "test": "bash linux/scripts/tests/test-ort-census.sh"
 },
 {
  "id": "onnx-ep-qnn.skip-leaves-placeholder",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "then plugin_ep_skip \"${QNNEP_OUTPUT_DIR}\" \"Skipping the QNN plugin EP",
  "replace": "then echo \"Skipping the QNN plugin EP",
  "why": "without the empty tree the media merge's COPY --from=onnxruntime fails on amd64 and riscv64",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh"
 },
 {
  "id": "gpu-runtime.qnn-plugin-root-only-on-arm64",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "    case \"${root}\" in \"\"|\"<unset>\") ;; *) echo \"BAD a non-arm64 image advertises ORT_QNN_EP_ROOT='${root}'\" ;; esac\n",
  "replace": "",
  "why": "an amd64 or riscv64 wrapper advertising a plugin it does not ship sends consumers to a missing library",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh"
 },
 {
  "id": "onnx-ep-amdgpu.census-contract-entry",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "    'amdgpu-ep|libmigraphx-ep.so|/usr/local/lib/onnxruntime-ep-amdgpu/ort-provenance/amdgpu-ep.json' \\\n",
  "replace": "",
  "why": "without its contract entry the image census reports the plugin UNREGISTERED, which stopped the fourth rocm proof chain at its runtime gate",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh"
 },
 {
  "id": "onnx-ep-amdgpu.seed-sha-stays-local",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "  local work=\"$1\" seeded=\"$2\" name vkey skey fmt url sha dir\n",
  "replace": "  local work=\"$1\" seeded=\"$2\" name vkey skey fmt url dir\n",
  "why": "a seed loop that writes the caller's sha makes provenance.txt record the last seed's hash as the source's, as the first rocm proof image did",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-amdgpu.placeholder-tree-kept",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "then plugin_ep_skip \"${MGXEP_OUTPUT_DIR}\" \"Skipping the MIGraphX plugin EP",
  "replace": "then echo \"Skipping the MIGraphX plugin EP",
  "why": "without the empty tree the media merge's COPY --from=onnxruntime fails on every chain that does not build the plugin",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-amdgpu.merge-copy-present",
  "target": "linux/Dockerfile.media",
  "find": "COPY --link --from=onnxruntime /usr/local/lib/onnxruntime-ep-amdgpu /usr/local/lib/onnxruntime-ep-amdgpu\n",
  "replace": "",
  "why": "the plugin is built and verified in the onnxruntime stage; only this COPY carries it into the merged media image (the first rocm proof image shipped without it)",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-amdgpu.seed-gate-reads-under-media-ifs",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "  while IFS=' ' read -r name source; do\n",
  "replace": "  while read -r name source; do\n",
  "why": "under the media scripts' IFS=newline-tab a plain read puts the whole line into name, and the gate compares nothing (the first rocm run after cc6ea51b fetched '' '')",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-amdgpu.drifted-seed-refused",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "    elif [ \"${seed}\" != \"${source}\" ]; then bad=\"${bad}; ${name} is declared as ${source} but the seed pins ${seed}\"; fi\n",
  "replace": "    fi\n",
  "why": "a seed at another URL than upstream declares would pin bytes the build never reads while the real fetch stays unpinned",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-amdgpu.exports-both-checked",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "  for sym in CreateEpFactories ReleaseEpFactory; do\n",
  "replace": "  for sym in CreateEpFactories; do\n",
  "why": "ORT's plugin loader calls both entry points; a module without ReleaseEpFactory registers and then leaks or crashes",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-amdgpu.one-top-level-dir",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "  [ -n \"${top}\" ] && [ \"$(find \"${dir}.x\" -mindepth 1 -maxdepth 1 | wc -l)\" -eq 1 ] || { printf 'ERROR: %s does not hold one top-level directory\\n' \"${archive}\" >&2; return 1; }\n",
  "replace": "  [ -n \"${top}\" ] || { printf 'ERROR: %s does not hold one top-level directory\\n' \"${archive}\" >&2; return 1; }\n",
  "why": "an archive with two top-level entries would seed half a dependency silently",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh"
 },
 {
  "id": "onnx-ep-amdgpu.pin-token-shape",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "    *[!A-Za-z0-9._+-]*) printf 'ERROR: %s=%s is not a plain version token\\n' \"${key}\" \"${value}\" >&2; return 1 ;;\n",
  "replace": "",
  "why": "a pin that is not a plain token would be spliced into a URL and a shell command",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh"
 },
 {
  "id": "gpu-runtime.plugin-ep-exports-read",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "  if [ \"$(_gpur \"${probe}\" \"${k}_EXPORTS\")\" = 2 ]; then echo \"OK ${so} exports CreateEpFactories and ReleaseEpFactory\"\n",
  "replace": "  if true; then echo \"OK ${so} exports CreateEpFactories and ReleaseEpFactory\"\n",
  "why": "a shipped module that lost an entry point would register nothing; the verdict must count the exports",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh"
 },
 {
  "id": "gpu-runtime.plugin-ep-root-only-on-rocm",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "  case \"$(_gpur \"${probe}\" MGXEP_ROOT)\" in \"\"|\"<unset>\") ;; *) echo \"BAD a non-rocm image advertises ORT_AMDGPU_EP_ROOT='$(_gpur \"${probe}\" MGXEP_ROOT)'\" ;; esac\n",
  "replace": "",
  "why": "a default image advertising a plugin root it does not ship would send consumers to a missing library",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh"
 },
 {
  "id": "gpu-runtime.rocm-roots-read",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "if [ \"$(_gpur \"${probe}\" \"${k}\")\" = /opt/rocm ]; then echo \"OK ${k}=/opt/rocm\"; else",
  "replace": "if true; then echo \"OK ${k}=/opt/rocm\"; else",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "the published :latest-rocm shipped without ROCM_PATH and HIP_PATH; the verdict must read them"
 },
 {
  "id": "gpu-runtime.hipcc-must-link",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "    ok) echo \"OK hipcc builds a HIP program for gfx1201\" ;;",
  "replace": "    *) echo \"OK hipcc builds a HIP program for gfx1201\" ;;",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "without the roots the venv's hipcc compiled but could not link a HIP program"
 },
 {
  "id": "gpu-runtime.hipcc-clang-root",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "    \"${root}\"/*) echo \"OK hipcc's clang is ${root}'s\" ;;",
  "replace": "    *) echo \"OK hipcc's clang is ${root}'s\" ;;",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "the venv's clang 23 is torch's ROCm 7.14, not the image's /opt/rocm"
 },
 {
  "id": "gpu-runtime.non-rocm-roots",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "    \"\"|\"<unset><unset>\") echo \"OK no ROCm root is advertised\" ;;",
  "replace": "    *) echo \"OK no ROCm root is advertised\" ;;",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "a cpu or nvidia image must advertise no ROCm root"
 },
 {
  "id": "gpu-runtime.probe-ran",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "  _gpur \"$1\" ENABLE | grep -q . || { echo \"BAD the GPU probe printed nothing; the container did not run it\"; return 0; }",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "an empty probe reads as an image without any GPU stack and would pass"
 },
 {
  "id": "gpu-runtime.trt-version",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "if [ \"${got}\" = \"$(( m * 10000 + mm * 100 + pp ))\" ]; then",
  "replace": "if [ -n \"${got}\" ]; then",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "the TensorRT the image loads must be TENSORRT_VERSION"
 },
 {
  "id": "gpu-runtime.trt-runtime-only",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "if [ -z \"${bad//[[:space:]]/}\" ]; then echo \"OK only TensorRT's runtime .so files ship",
  "replace": "if true; then echo \"OK only TensorRT's runtime .so files ship",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "the SLA names only the runtime .so files distributable; a header or dev link must fail"
 },
 {
  "id": "gpu-runtime.trt-ep-shim",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "    $1 ~ /^libtensorrt/ {print; next}",
  "replace": "    $1 ~ /^libtensorrt/ {next}",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "libtensorrt_shim.so is a dev-package file the runtime lacks; a plugin EP that needs it does not load"
 },
 {
  "id": "cuda-stack.tensorrt-copy-gate",
  "target": "linux/scripts/06-packaging/copy-media-payloads.sh",
  "find": "  [ \"${ENABLE_TENSORRT:-false}\" = \"true\" ] || return 0\n  local m=",
  "replace": "  local m=",
  "test": "bash linux/scripts/tests/test-cuda-runtime-payload.sh",
  "why": "an image that did not ask must not receive the artifact's TensorRT"
 },
 {
  "id": "cuda-stack.tensorrt-copy-runtime-only",
  "target": "linux/scripts/06-packaging/copy-media-payloads.sh",
  "find": "\"/usr/lib/${ma}/libnvinfer*.so.${m}\" \"/usr/lib/${ma}/libnvinfer*.so.${m}.*\"",
  "replace": "\"/usr/lib/${ma}/libnvinfer*\"",
  "test": "bash linux/scripts/tests/test-cuda-runtime-payload.sh",
  "why": "the dev links and the shim must stay behind: the SLA names only the runtime .so files"
 },
 {
  "id": "cuda-stack.tensorrt-copy-missing-fatal",
  "target": "linux/scripts/06-packaging/copy-media-payloads.sh",
  "find": "    printf '[ERROR] ENABLE_TENSORRT=true but the artifact has no libnvinfer.so.%s (TENSORRT_VERSION=%s)\\n' \"${m}\" \"${TENSORRT_VERSION:-}\" >&2\n    return 1",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-cuda-runtime-payload.sh",
  "why": "an EP built against TensorRT must not ship without it"
 },
 {
  "id": "cuda-stack.tensorrt-install-pin-checked",
  "target": "linux/scripts/01-core/install-tensorrt.sh",
  "find": "[ \"${got[${pkg}]:-<none>}\" = \"${ver}\" ] ||",
  "replace": "true ||",
  "test": "bash linux/scripts/tests/test-tensorrt-install.sh",
  "why": "an install off the pin must be named, never shipped unpinned"
 },
 {
  "id": "cuda-stack.tensorrt-install-no-metapackage",
  "target": "linux/scripts/01-core/install-tensorrt.sh",
  "find": "libnvinfer-plugin-dev libnvinfer-headers-plugin-dev libnvonnxparsers-dev; do",
  "replace": "libnvinfer-plugin-dev libnvinfer-headers-plugin-dev libnvonnxparsers-dev tensorrt-libs; do",
  "test": "bash linux/scripts/tests/test-tensorrt-install.sh",
  "why": "the metapackages pull the 1.9 GB Windows builder resource"
 },
 {
  "id": "deepstream.verify-foreign-trt",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "find": "    $2 !~ /\\.so\\.10$/ {print \"FOREIGN-TRT\", $1, \"->\", $2, \"=>\", $3; next}",
  "replace": "    $2 !~ /\\.so\\.10$/ {next}",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "DeepStream 9.1 is a TensorRT 10 build; linking the image's TensorRT 11 is the wrong ABI"
 },
 {
  "id": "cuda-stack.genai-no-trt-rtx",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "  _genai_gpu_args=(--use_cuda --cuda_home \"${CUDA_HOME:-/usr/local/cuda}\")",
  "replace": "  _genai_gpu_args=(--use_cuda --cuda_home \"${CUDA_HOME:-/usr/local/cuda}\" --use_trt_rtx)",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "--use_trt_rtx makes a wheel that requires onnxruntime-trt-rtx, which the chain never builds"
 },
 {
  "id": "rocm-stack.gpu-node-hint",
  "target": "linux/scripts/04-runtime/entrypoint.sh",
  "find": "add --group-add %s to the run\\n' \"$1\" \"$(id -u)\" \"$2\"",
  "replace": "add the render group\\n' \"$1\" \"$(id -u)\"",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "uid 1001 opens a 0660 GPU node only with the host group's number, which the warning must name"
 },
 {
  "id": "rocm-stack.wrapper-roots",
  "target": "linux/Dockerfile.package",
  "find": "ENV ROCM_PATH=${ROCM_ON:+/opt/rocm} \\",
  "replace": "ENV ROCM_PATH= \\",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "without ROCM_PATH the published hipcc could not link a HIP program"
 },
 {
  "id": "deepstream.trt-headers-build-only",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  cp -a \"${tmp}/trt-dev/usr/include/$(ds_multiarch)/.\" \"${sdk}/include/\"\n",
  "replace": "  cp -a \"${tmp}/trt-dev/usr/include/$(ds_multiarch)/.\" \"${sdk}/include/\"\n  mkdir -p \"${prefix}/include\"; cp -a \"${sdk}/include/.\" \"${prefix}/include/\"\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "TensorRT 10's headers serve the component build only; the SLA names only the runtime .so files distributable (owner 2026-10-21)"
 },
 {
  "id": "deepstream.trt-dev-links-build-only",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "    ln -sfn \"${prefix}/lib/${lib}.so.10\" \"${sdk}/lib/${lib}.so\"",
  "replace": "    ln -sfn \"${lib}.so.10\" \"${prefix}/lib/${lib}.so\"",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the published :latest-nvidia shipped three dev links in DeepStream's TensorRT prefix; they belong in the build's tmp"
 },
 {
  "id": "deepstream.verify-trt-runtime-only",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "find": "{next} {print \"NOT-RUNTIME\", $0}'",
  "replace": "{next} {next}'",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a header, dev link, tool or archive in the TensorRT prefix must fail the DeepStream gates"
 },
 {
  "id": "deepstream.verify-runs-trt-runtime-only",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "find": "  dsv_check_trt_builder_resources\n  dsv_check_trt_runtime_only\n",
  "replace": "  dsv_check_trt_builder_resources\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the runtime-only check gates the build, the package and the smoke only through dsv_main"
 },
 {
  "id": "gpu-runtime.trt-sdk-every-image",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "  gpu_tensorrt_verdict \"$1\" \"$2\"\n  gpu_tensorrt_sdk_verdict \"$1\"\n",
  "replace": "  gpu_tensorrt_verdict \"$1\" \"$2\"\n",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "the published :latest-nvidia has no ENABLE_TENSORRT and still shipped DeepStream's TensorRT headers; the SDK rule holds for every image"
 },
 {
  "id": "gpu-runtime.trt-sdk-deepstream-dev-links",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": " /opt/nvidia/deepstream/tensorrt-*/lib/*.so; do",
  "replace": "; do",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "DeepStream's TensorRT 10 prefix is where the published image carried its dev links"
 },
 {
  "id": "gpu-runtime.trt-sdk-deepstream-headers",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "/usr/local/tensorrt /opt/nvidia \\( -name",
  "replace": "/usr/local/tensorrt \\( -name",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "DeepStream's TensorRT 10 headers sat under /opt/nvidia, outside the dirs CON31's probe searched"
 },
 {
  "id": "gpu-runtime.trt-sdk-tools-and-bindings",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "bad=\"$(_gpur \"$1\" TRTHDR; _gpur \"$1\" TRTDEV; _gpur \"$1\" TRTBIN; _gpur \"$1\" TRTPY)\"",
  "replace": "bad=\"$(_gpur \"$1\" TRTHDR; _gpur \"$1\" TRTDEV)\"",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "trtexec and the Python binding are SDK parts the SLA does not name distributable"
 },
 {
  "id": "dart-coverage.floor-compare",
  "target": "linux/scripts/05-frameworks/flutter/check-dart-coverage.sh",
  "find": "    if (pct < min) {",
  "replace": "    if (pct < min - 1) {",
  "test": "bash linux/scripts/tests/test-check-dart-coverage.sh",
  "why": "one point under the floor must fail"
 },
 {
  "id": "dart-coverage.exclude-ignored",
  "target": "linux/scripts/05-frameworks/flutter/check-dart-coverage.sh",
  "find": "if (skip[i] != \"\" && index(file, skip[i]) == 1) own = 0",
  "replace": "if (0) own = 0",
  "test": "bash linux/scripts/tests/test-check-dart-coverage.sh",
  "why": "generated trees must stay out of the count"
 },
 {
  "id": "web-artefacts.icon-depth",
  "target": "linux/scripts/05-frameworks/flutter/check-web-artefacts.py",
  "find": "header[24] != 8",
  "replace": "header[24] > 16",
  "test": "bash linux/scripts/tests/test-check-web-artefacts.sh",
  "why": "a 16-bit icon must fail"
 },
 {
  "id": "web-artefacts.title-match",
  "target": "linux/scripts/05-frameworks/flutter/check-web-artefacts.py",
  "find": "    if title.group(1).strip() != name:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-check-web-artefacts.sh",
  "why": "a tab title the manifest does not share must fail"
 },
 {
  "id": "web-artefacts.lock-version",
  "target": "linux/scripts/05-frameworks/flutter/check-web-artefacts.py",
  "find": "if m and m.group(1) != pinned.get(\"SQLITE3_WASM_VERSION\"):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-check-web-artefacts.sh",
  "why": "a lock on another sqlite3 than the wasm's must fail"
 },
 {
  "id": "nginx-harness.always-stops",
  "target": "linux/webserver/scripts/flutter-nginx-integration-test.sh",
  "find": "trap stop_nginx EXIT",
  "replace": ": trap stop_nginx EXIT",
  "test": "bash linux/scripts/tests/test-flutter-nginx-integration.sh",
  "why": "nginx that never answers must still be removed"
 },
 {
  "id": "perf-report.gate-history",
  "target": "linux/scripts/05-frameworks/flutter/frontend-perf-report.py",
  "find": "len(earlier) >= MIN_HISTORY_TO_FAIL",
  "replace": "len(earlier) >= 0",
  "test": "bash linux/scripts/tests/test-perf-reports.sh",
  "why": "too few earlier runs must only warn"
 },
 {
  "id": "stage-repo.nvidia-private",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "  [ \"${v}\" != \"nvidia\" ] || repo=\"${repo}-stages\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "nvidia's stages carry TensorRT's SDK and must push to the private package, never the public one (owner 2026-10-21)"
 },
 {
  "id": "stage-repo.gpu-tag-follows",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "cross_gpu_tag()               { printf '%s' \"$(cross_stage_repo):",
  "replace": "cross_gpu_tag()               { printf '%s' \"${IMAGE_REPO:-${IMAGE_REGISTRY_PREFIX}}:",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "the gpu stage installs TensorRT's headers and dev links; its tag is the first that must go private"
 },
 {
  "id": "stage-repo.media-tag-follows",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "cross_media_tag()             { printf '%s' \"$(cross_stage_repo):",
  "replace": "cross_media_tag()             { printf '%s' \"${IMAGE_REPO:-${IMAGE_REGISTRY_PREFIX}}:",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "media inherits the gpu stage's TensorRT SDK, so its push, registry cache and pins must stay private"
 },
 {
  "id": "stage-repo.android-tag-follows",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "cross_android_tag_prefix()    { printf '%s' \"$(cross_stage_repo):",
  "replace": "cross_android_tag_prefix()    { printf '%s' \"${IMAGE_REPO:-${IMAGE_REGISTRY_PREFIX}}:",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "android inherits it too, and the runtime lane reads its payload through this prefix"
 },
 {
  "id": "stage-repo.rocm-stays-public",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "[ \"${v}\" != \"nvidia\" ] ||",
  "replace": "[ -z \"${v}\" ] ||",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "rocm's stages carry no NVIDIA file, so only nvidia's move"
 },
 {
  "id": "stage-repo.final-stays-public",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "cross_final_image_tag()       { printf '%s' \"${IMAGE_REPO:-${IMAGE_REGISTRY_PREFIX}}:",
  "replace": "cross_final_image_tag()       { printf '%s' \"$(cross_stage_repo):",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": ":latest-nvidia is runtime-only and must stay in the public package"
 },
 {
  "id": "stage-repo.shared-sdk-stays-public",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "cross_sdk_tag()               { printf '%s' \"${IMAGE_REPO:-${IMAGE_REGISTRY_PREFIX}}:",
  "replace": "cross_sdk_tag()               { printf '%s' \"$(cross_stage_repo):",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "the sdk stage is shared with the default chain, which reads it from the public package"
 },
 {
  "id": "web-smoke.no-default-csp-hosts",
  "target": "linux/webserver/scripts/flutter_integration_smoke_test.sh",
  "find": "REQUIRED_CSP_HOSTS=\"${REQUIRED_CSP_HOSTS:-}\"",
  "replace": "REQUIRED_CSP_HOSTS=\"${REQUIRED_CSP_HOSTS:-www.gstatic.com}\"",
  "test": "bash linux/scripts/tests/test-flutter-smoke-test.sh",
  "why": "the family's builds serve their own engine and fonts, so no CDN host is required by default"
 },
 {
  "id": "web-smoke.local-engine",
  "target": "linux/webserver/scripts/flutter_integration_smoke_test.sh",
  "find": "  if curl -s \"$BASE_URL/flutter_bootstrap.js\" | grep -q '\"useLocalCanvasKit\":true'; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-flutter-smoke-test.sh",
  "why": "a build that loads its engine from Google's CDN must fail"
 },
 {
  "id": "web-smoke.engine-files",
  "target": "linux/webserver/scripts/flutter_integration_smoke_test.sh",
  "find": "  for engine in canvaskit/canvaskit.wasm canvaskit/skwasm.wasm; do",
  "replace": "  for engine in canvaskit/canvaskit.wasm; do",
  "test": "bash linux/scripts/tests/test-flutter-smoke-test.sh",
  "why": "a build without its skwasm engine must fail"
 },
 {
  "id": "runtime-push.async-default",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "runtime_switch_mode RUNTIME_ASYNC_PUSH 1 ",
  "replace": "runtime_switch_mode RUNTIME_ASYNC_PUSH 0 ",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k knob",
  "why": "the background pusher is the default; RUNTIME_ASYNC_PUSH=0 is the switch back to inline"
 },
 {
  "id": "runtime-push.unknown-value-refuses",
  "target": "linux/scripts/lib-runtime-switch.sh",
  "find": "      return 2\n",
  "replace": "      return 0\n",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k knob",
  "why": "a typo in the knob stops the lane at its start instead of silently picking a mode"
 },
 {
  "id": "runtime-push.fifo-oldest-first",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "[[ \"${f}\" < \"${oldest}\" ]]",
  "replace": "[[ \"${f}\" > \"${oldest}\" ]]",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k queue",
  "why": "the first arch built uploads first, so its upload ends earliest"
 },
 {
  "id": "runtime-push.reread-after-closed",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "      [ -n \"$(_runtime_push_next \"${dir}\")\" ] || return 0\n      continue",
  "replace": "      return 0",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k queue",
  "why": "an item queued between the pusher's empty read and the close would never be pushed"
 },
 {
  "id": "runtime-push.rc-survives-errexit",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "{ rc=0; runtime_push_tag \"${tag}\" 2>&1 || rc=$?;",
  "replace": "{ rc=0; runtime_push_tag \"${tag}\" 2>&1; rc=$?;",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k queue",
  "why": "under errexit a failed push would end the pusher and strand every arch queued behind it"
 },
 {
  "id": "runtime-push.enqueue-returns",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "  item=\"q.$(date +%s%N).${arch}\"",
  "replace": "  runtime_push_tag \"${tag}\"\n  item=\"q.$(date +%s%N).${arch}\"",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k lane",
  "why": "the whole point: the arch's lane hands its upload off and the next arch builds at once"
 },
 {
  "id": "runtime-push.interrupt-stops",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "    chain_terminate_descendants TERM \"${RUNTIME_PUSHER_PID}\"\n    kill -TERM \"${RUNTIME_PUSHER_PID}\" 2>/dev/null || true",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k lane",
  "why": "an interrupted lane must stop uploading, not wait out an hour-long push"
 },
 {
  "id": "runtime-push.failure-fails-drain",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "    [ \"${rc}\" = 0 ] || failed=\"${failed:+${failed} }${arch}(rc=${rc:-none})\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k lane",
  "why": "a wrapper that never reached the registry must fail the lane before the index lists it"
 },
 {
  "id": "runtime-push.exit-drains",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "  trap_push 'runtime_push_queue_finish exit'",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k lane",
  "why": "a lane that fails after a build still uploads that wrapper, as the inline push did"
 },
 {
  "id": "runtime-push.owner-gone",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "    kill -0 \"${owner}\" 2>/dev/null || return 0\n    sleep",
  "replace": "    sleep",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k lane",
  "why": "a pusher whose lane was killed hard would poll forever"
 },
 {
  "id": "runtime-push.wrapper-image-hook",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "_runtime_ship_image() {\n  local mode=\"$1\" tag=\"$2\" arch=\"$3\"\n  if [ \"${mode}\" = dry ]; then\n    log \"[DRY RUN] would push wrapper image ${tag}\"\n    return 0\n  fi\n  if runtime_pushes_wrapper_images; then\n    _runtime_push_wrapper_tag \"${tag}\" \"${arch}\" || return 1\n  fi\n}",
  "replace": "_runtime_ship_image() {\n  local mode=\"$1\" tag=\"$2\" arch=\"$3\"\n  if [ \"${mode}\" = dry ]; then\n    log \"[DRY RUN] would push wrapper image ${tag}\"\n    return 0\n  fi\n  if runtime_pushes_wrapper_images; then\n    runtime_push_tag \"${tag}\" || return 1\n  fi\n}",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k wiring",
  "why": "a wrapper build that pushes past the queue blocks its arch for the whole upload again"
 },
 {
  "id": "runtime-push.manifest-queues",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  runtime_push_queue_start || return $?\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k wiring",
  "why": "without the pusher every wrapper push is inline and serial again"
 },
 {
  "id": "runtime-push.manifest-drains",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  # The index lists every arch, so it waits for the last upload.\n  runtime_step_phase push-wait runtime_push_queue_finish\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k wiring",
  "why": "the index would be created over wrappers still uploading, or never uploaded"
 },
 {
  "id": "runtime-push.chain-checks-knob",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  runtime_push_mode >/dev/null || exit 2\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k wiring",
  "why": "the chain reaches the runtime lane hours in; a typo must stop it at its start"
 },
 {
  "id": "runtime-gates.no-bare-wait",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  for rc in \"${pids[@]}\"; do wait \"${rc}\" 2>/dev/null || true; done",
  "replace": "  wait",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k gates",
  "why": "a bare wait also waits for the background pusher, so the gates would hang until every upload ends"
 },
 {
  "id": "runtime-gates.side-by-side",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "\"${dir}/${arch}.rc\" ) &",
  "replace": "\"${dir}/${arch}.rc\" )",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k gates",
  "why": "the arches' content gates and smokes run at once, not one after another"
 },
 {
  "id": "runtime-gates.prints-each-arch",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    cat \"${dir}/${arch}.log\" 2>/dev/null || true",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k gates",
  "why": "a parallel gate's output reaches the lane log whole, per arch"
 },
 {
  "id": "runtime-gates.failure-named",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    [ \"${rc}\" = 0 ] || failed=\"${failed:+${failed} }${arch}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k gates",
  "why": "one red arch fails the phase, so a broken wrapper never reaches the index"
 },
 {
  "id": "runtime-gates.jobs-zero-refused",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    ''|*[!0-9]*|0)",
  "replace": "    ''|*[!0-9]*)",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k gates",
  "why": "RUNTIME_GATE_JOBS=0 is a typo, not a request to gate in turn"
 },
 {
  "id": "runtime-gates.serial-stops-first",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    _manifest_gate_arch \"${label}\" \"${script}\" \"${arch}\" || return 1",
  "replace": "    _manifest_gate_arch \"${label}\" \"${script}\" \"${arch}\" || true",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k gates",
  "why": "RUNTIME_GATE_JOBS=1 is the old path, which stopped at the first failing arch"
 },
 {
  "id": "runtime-gates.preflight-on-by-default",
  "target": "linux/scripts/lib-runtime-preflight.sh",
  "find": "runtime_switch_mode RUNTIME_INPUT_PREFLIGHT 1 ",
  "replace": "runtime_switch_mode RUNTIME_INPUT_PREFLIGHT 0 ",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "the input preflight is the default; RUNTIME_INPUT_PREFLIGHT=0 is the switch back"
 },
 {
  "id": "runtime-gates.preflight-typo-refuses",
  "target": "linux/scripts/lib-runtime-switch.sh",
  "find": "      return 2\n",
  "replace": "      return 0\n",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "a typo in the knob stops the lane at its start instead of silently picking a mode"
 },
 {
  "id": "runtime-gates.preflight-installer-mismatch-fails",
  "target": "linux/scripts/lib-runtime-preflight.sh",
  "find": "      rc=1\n",
  "replace": "      :\n",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "a rotated pinned installer must refuse the lane, not only print"
 },
 {
  "id": "runtime-gates.preflight-apt-failure-fails",
  "target": "linux/scripts/lib-runtime-preflight.sh",
  "find": "\"${#preflight_arches[@]}\" \"${preflight_arches[@]}\" || failed=1",
  "replace": "\"${#preflight_arches[@]}\" \"${preflight_arches[@]}\" || true",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "an arch whose apt set does not resolve must refuse the lane"
 },
 {
  "id": "runtime-gates.preflight-worker-status",
  "target": "linux/scripts/lib-runtime-preflight.sh",
  "find": "  return \"${PIPESTATUS[0]}\"",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "the arch prefix pipe must not swallow the container's failure"
 },
 {
  "id": "runtime-gates.preflight-per-arch-platform",
  "target": "linux/scripts/lib-runtime-preflight.sh",
  "find": "--platform \"linux/${arch}\"",
  "replace": "--platform \"linux/amd64\"",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "each arch's plan resolves against that arch's archive, under QEMU for a foreign one"
 },
 {
  "id": "runtime-gates.preflight-simulate-fails",
  "target": "linux/scripts/06-packaging/package-apt-plan.sh",
  "find": "\"${rc}\" \"${lines}\" >&2\n    return 1",
  "replace": "\"${rc}\" \"${lines}\" >&2\n    return 0",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "a simulate that apt rejects must fail the plan"
 },
 {
  "id": "runtime-gates.preflight-names-depends",
  "target": "linux/scripts/06-packaging/package-apt-plan.sh",
  "find": "-e ': (Pre)?Depends:' ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "apt's Depends line is what names the skew; the refusal must print it"
 },
 {
  "id": "runtime-gates.preflight-no-recommends",
  "target": "linux/scripts/06-packaging/package-apt-plan.sh",
  "find": "install --simulate --no-install-recommends",
  "replace": "install --simulate",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "the plan must resolve the same set the package stage installs, without recommends"
 },
 {
  "id": "runtime-gates.preflight-before-build",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  runtime_step_phase input-preflight runtime_input_preflight || return $?\n",
  "replace": "  runtime_step_phase input-preflight runtime_input_preflight || true\n",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "a refused preflight must stop the lane before any arch builds"
 },
 {
  "id": "runtime-push.start-refuses-bad-knob",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "  mode=\"$(runtime_push_mode)\" || return 2",
  "replace": "  mode=\"$(runtime_push_mode)\" || mode=async",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k knob",
  "why": "the runtime lanes learn of a bad RUNTIME_ASYNC_PUSH here, before their first build"
 },
 {
  "id": "ordered-jobs.side-by-side",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "    _oj_launch \"${i}\"\n    launched=$((launched + 1))",
  "replace": "    _oj_launch \"${i}\"; _oj_join \"${i}\"\n    launched=$((launched + 1))",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "the suites run side by side; one at a time cost 754 s in :latest on 2026-10-21"
 },
 {
  "id": "ordered-jobs.cap-holds",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "    while [ $((launched - $(_oj_ended))) -ge \"${jobs}\" ]; do",
  "replace": "    while false; do",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "a job count of 1 is the serial path a debugging session or a small host asks for"
 },
 {
  "id": "ordered-jobs.default-one-per-cpu",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  [ -n \"${value}\" ] || value=\"$(nproc 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)\"",
  "replace": "  [ -n \"${value}\" ] || value=1",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "the parallel run is the default, not an opt-in"
 },
 {
  "id": "ordered-jobs.zero-refused",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "    ''|*[!0-9]*|0)",
  "replace": "    ''|*[!0-9]*)",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "a job count of 0 never launches anything; it is a typo, refused before the first command"
 },
 {
  "id": "ordered-jobs.in-order",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  while [ \"${OJ_NEXT}\" -lt \"${#OJ_CMDS[@]}\" ] && [ -f \"${OJ_DIR}/${OJ_NEXT}.rc\" ]; do",
  "replace": "  while [ \"${OJ_NEXT}\" -lt \"${#OJ_CMDS[@]}\" ]; do",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "a report waits for its command to end; one read early is a half-written log and a missing verdict"
 },
 {
  "id": "ordered-jobs.waits-for-all",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  while [ \"$(_oj_ended)\" -lt \"${launched}\" ]; do",
  "replace": "  while false; do",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "the runner returns only when every command has ended and been reported"
 },
 {
  "id": "script-tests.jobs-from-the-knob",
  "target": "linux/scripts/tests/run-tests.sh",
  "find": "JOBS=\"$(oj_count RUN_TESTS_JOBS)\" || exit 2",
  "replace": "JOBS=1",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "run-tests.sh takes RUN_TESTS_JOBS, default one per CPU"
 },
 {
  "id": "cmake-format.runs-first-alone",
  "target": "linux/scripts/preflight.sh",
  "find": "PREFLIGHT_FIRST=\"cmake-format\"",
  "replace": "PREFLIGHT_FIRST=\"\"",
  "test": "bash linux/scripts/tests/test-preflight-parallel.sh",
  "why": "cmake-format builds its venv in the tree, so it runs alone, before the walkers start"
 },
 {
  "id": "mutations.runs-last-alone",
  "target": "linux/scripts/preflight.sh",
  "find": "PREFLIGHT_LAST=\"mutations\"",
  "replace": "PREFLIGHT_LAST=\"\"",
  "test": "bash linux/scripts/tests/test-preflight-parallel.sh",
  "why": "the mutation gate copies the tree, so it starts only once every other slug has stopped writing"
 },
 {
  "id": "shellcheck.parallel-files",
  "target": "linux/scripts/lint-shell.sh",
  "find": "    | xargs -0 -r -n 1 -P \"${LINT_JOBS}\" bash -c \\",
  "replace": "    | xargs -0 -r -n 1 -P 1 bash -c \\",
  "test": "bash linux/scripts/tests/test-lint-shell-parallel.sh",
  "why": "the 547 files are checked side by side, one process each"
 },
 {
  "id": "shellcheck.incomplete-run-refused",
  "target": "linux/scripts/lint-shell.sh",
  "find": "  [ \"${n}\" -eq \"${#CHECK[@]}\" ] || err",
  "replace": "  true || err",
  "test": "bash linux/scripts/tests/test-lint-shell-parallel.sh",
  "why": "a runner that dies early leaves files unchecked, which must not read as clean"
 },
 {
  "id": "shellcheck.failing-files-named",
  "target": "linux/scripts/lint-shell.sh",
  "find": "  mapfile -t _sff_out < <(printf '%s\\n' \"${verdicts}\" | sed -n 's/^fail //p' | LC_ALL=C sort)",
  "replace": "  mapfile -t _sff_out < <(printf '%s\\n' \"${verdicts}\" | sed -n 's/^failed //p' | LC_ALL=C sort)",
  "test": "bash linux/scripts/tests/test-lint-shell-parallel.sh",
  "why": "the gate fails on exactly the files shellcheck failed"
 },
 {
  "id": "runtime-smoke.overlap-default",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  if [ \"${RUNTIME_SMOKE_OVERLAP:-1}\" = \"0\" ] || is_dry_run; then",
  "replace": "  if [ \"${RUNTIME_SMOKE_OVERLAP:-0}\" = \"0\" ] || is_dry_run; then",
  "test": "bash linux/scripts/tests/test-runtime-smoke-overlap.sh",
  "why": "the gate beside the wrapper build is the default; it took 821-1265 s an arch in turn"
 },
 {
  "id": "runtime-smoke.started-in-background",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "    exit \"${PIPESTATUS[0]}\" ) &",
  "replace": "    exit \"${PIPESTATUS[0]}\" )",
  "test": "bash linux/scripts/tests/test-runtime-smoke-overlap.sh",
  "why": "the gate and the wrapper build overlap, or the arch pays both in turn"
 },
 {
  "id": "runtime-smoke.verdict-kept",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "    exit \"${PIPESTATUS[0]}\" ) &",
  "replace": "    exit 0 ) &",
  "test": "bash linux/scripts/tests/test-runtime-smoke-overlap.sh",
  "why": "the background gate's failure must reach the arch, through the prefixing pipe"
 },
 {
  "id": "runtime-smoke.wait-before-push",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  # Nothing ships past a red wrapper-smoke gate.\n  _runtime_smoke_wait \"${arch}\" || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-smoke-overlap.sh",
  "why": "a wrapper whose package failed its smoke would be pushed"
 },
 {
  "id": "runtime-smoke.wait-before-export",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  _runtime_smoke_wait \"${arch}\" || return 1\n  \"${ship}\" ship \"${tag}\" \"${arch}\" \"$@\"",
  "replace": "  \"${ship}\" ship \"${tag}\" \"${arch}\" \"$@\"",
  "test": "bash linux/scripts/tests/test-runtime-smoke-overlap.sh",
  "why": "the rootfs path would export a wrapper whose package failed its smoke"
 },
 {
  "id": "runtime-smoke.reaped-on-wrapper-failure",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  _runtime_timed wrapper-build \"${arch}\" _runtime_build_wrapper \"${arch}\" tag parent_image build_args || { _runtime_smoke_wait \"${arch}\" || true; return 1; }",
  "replace": "  _runtime_timed wrapper-build \"${arch}\" _runtime_build_wrapper \"${arch}\" tag parent_image build_args || return 1",
  "test": "bash linux/scripts/tests/test-runtime-smoke-overlap.sh",
  "why": "a failed wrapper build would leave its gate running into the next arch's lane"
 },
 {
  "id": "mutations.work-queue",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        return run_shard(args, _drain(todo), root, report, baselines, f\"[{n + 1}/{jobs}] \", costs)",
  "replace": "        return run_shard(args, entries[n::jobs], root, report, baselines, f\"[{n + 1}/{jobs}] \", costs)",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "dealt round-robin, two slow entries can land on one mirror while the others idle"
 },
 {
  "id": "mutations.extra-mirrors-copied",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        if n:\n            mirror_tree(src, root)\n",
  "replace": "        if n:\n",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "each extra shard copies its own mirror, now inside the pool rather than before it"
 },
 {
  "id": "mutations.parse-unparsable-mutant-refused",
  "target": "docs/scripts/mutation_parse.py",
  "find": "            if err and (edit.target, edit.original) not in broken:\n",
  "replace": "            if False:\n",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "a mutant that no longer parses would bite for its syntax error alone, and the removed guarantee would pass as proven"
 },
 {
  "id": "mutations.parse-broken-target-not-refused",
  "target": "docs/scripts/mutation_parse.py",
  "find": "            if err and (edit.target, edit.original) not in broken:\n",
  "replace": "            if err:\n",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "a target that already fails to parse makes every mutant fail too; refusing those blames the recipe for the file"
 },
 {
  "id": "mutations.parse-crlf-stripped",
  "target": "docs/scripts/mutation_parse.py",
  "find": "input=text.replace(\"\\r\", \"\")",
  "replace": "input=text",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "bash -n rejects every CRLF file, so a Windows checkout's target would count as unparsed and its broken mutant would pass"
 },
 {
  "id": "mutations.parse-shebang-is-shell",
  "target": "docs/scripts/mutation_parse.py",
  "find": "if name.endswith(\".sh\") or _SHELL_SHEBANG.match(text.split(\"\\n\", 1)[0]):",
  "replace": "if name.endswith(\".sh\"):",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "hooks and entry points without an extension are shell too; their broken mutants would go unchecked"
 },
 {
  "id": "mutations.parse-python-compiled",
  "target": "docs/scripts/mutation_parse.py",
  "find": "            return f\"compile(): line {exc.lineno}: {exc.msg}\"\n",
  "replace": "            return None\n",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "a Python mutant that no longer compiles would bite on the SyntaxError its import raises"
 },
 {
  "id": "mutations.parse-pwsh-missing-fails",
  "target": "docs/scripts/mutation_parse.py",
  "find": "    if pwsh is None:\n        raise MissingParser(",
  "replace": "    if pwsh is None:\n        return [None] * len(texts)\n        raise MissingParser(",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "a host without pwsh would wave every PowerShell mutant through as parsed"
 },
 {
  "id": "mutations.parse-pwsh-once",
  "target": "docs/scripts/mutation_parse.py",
  "find": "        answers = _errors(kind, originals + [(e.target, e.mutated) for e in group])\n",
  "replace": "        answers = _errors(kind, originals) + _errors(kind, [(e.target, e.mutated) for e in group])\n",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "pwsh takes about a second to start; a second process per call doubles that cost in every shard and pre-commit run"
 },
 {
  "id": "mutations.gate-refuses-unparsable",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        (runnable, refused_rc), delegated = refuse_unparsable(entries, args.root, report), []\n",
  "replace": "        (runnable, refused_rc), delegated = (entries, 0), []\n",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "the proving run, not only --parse-check, must refuse a mutant that does not parse, or CI keeps counting syntax errors as bites"
 },
 {
  "id": "mutations.cost-line-per-command",
  "target": "docs/scripts/verify_mutations.py",
  "find": "            if self._left[cmd]:\n                return\n",
  "replace": "            if True:\n                return\n",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "the shard plan is built from these lines; without them no per-command time reaches a CI log"
 },
 {
  "id": "mutations.unbuilt-mutant-refused",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        if rc == UNBUILT_RC:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-mutation-parse.sh",
  "why": "a C++ recipe's test exits 3 when its mutant does not compile; graded as a bite, the gate passes a recipe that proves only the build break"
 },
 {
  "id": "mutations.plan-partitions",
  "target": "docs/scripts/mutation_shards.py",
  "find": "    return [[entries[i] for i in _interleave(pieces)] for pieces in shards]\n",
  "replace": "    return [[entries[i] for i in _interleave(pieces)[1:]] for pieces in shards]\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "a plan that drops an entry leaves it proven by no job, and a hub round stays green over it"
 },
 {
  "id": "mutations.plan-groups-commands",
  "target": "docs/scripts/mutation_shards.py",
  "find": "        k = min(len(idx), max(1, math.ceil(total / cap))) if total > cap else 1\n",
  "replace": "        k = min(len(idx), max(1, math.ceil(total / cap))) if total > cap else len(idx)\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "a command spread over shards pays its baseline once per shard, the round-robin cost the plan exists to remove"
 },
 {
  "id": "mutations.plan-splits-heavy",
  "target": "docs/scripts/mutation_shards.py",
  "find": "        k = min(len(idx), max(1, math.ceil(total / cap))) if total > cap else 1\n",
  "replace": "        k = 1\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "a command heavier than a whole shard kept on one job carries that job alone into its timeout"
 },
 {
  "id": "mutations.plan-lightest-shard",
  "target": "docs/scripts/mutation_shards.py",
  "find": "        k = loads.index(min(loads))\n",
  "replace": "        k = 0\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "pieces stacked onto one shard leave the other jobs idle and that one past the timeout"
 },
 {
  "id": "mutations.plan-interleaves",
  "target": "docs/scripts/mutation_shards.py",
  "find": "    while queues:\n        order.extend(q.pop(0) for q in queues)\n        queues = [q for q in queues if q]\n    return order\n",
  "replace": "    return [i for q in queues for i in q]\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "a queue that lists one command's entries together makes the free mirrors wait on that command's baseline lock"
 },
 {
  "id": "mutations.plan-default-is-median",
  "target": "docs/scripts/mutation_shards.py",
  "find": "    return Cost(statistics.median(c.baseline for c in costs.values()),\n",
  "replace": "    return Cost(max(c.baseline for c in costs.values()),\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "an unknown suite weighted as the slowest one skews the balance; weighted as free, it lands anywhere"
 },
 {
  "id": "mutations.plan-counts-unknown",
  "target": "docs/scripts/mutation_shards.py",
  "find": "    unknown = {str(e[\"test\"]) for e in entries} - set(costs)\n",
  "replace": "    unknown = set()\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "a stale table hides behind the median; the plan line must say how many commands it guessed"
 },
 {
  "id": "mutations.cost-table-net-of-baseline",
  "target": "docs/scripts/mutation_shards.py",
  "find": "            seen.setdefault(m[\"test\"], []).append(Cost(base, max(wall - base, 0.0) / max(n, 1)))\n",
  "replace": "            seen.setdefault(m[\"test\"], []).append(Cost(base, wall / max(n, 1)))\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "the wall a cost line reports includes the baseline; counting it per entry overweights small commands"
 },
 {
  "id": "mutations.cost-table-keeps-manifest-commands",
  "target": "docs/scripts/mutation_shards.py",
  "find": "            for cmd in sorted(set(commands)) if cmd in seen}\n",
  "replace": "            for cmd in sorted(seen)}\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "a table that keeps retired commands grows without bound and still describes suites nobody runs"
 },
 {
  "id": "mutations.shard-costs-select-the-plan",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if costs is None:\n        return entries[k::n]\n",
  "replace": "    if True:\n        return entries[k::n]\n",
  "test": "bash linux/scripts/tests/test-mutation-shards.sh",
  "why": "with the table ignored every job falls back to the round-robin slice and pays a baseline per command per shard"
 },
 {
  "id": "mutations.default-jobs-all-cpus",
  "target": "docs/scripts/verify_mutations.py",
  "find": "DEFAULT_JOBS = (getattr(os, \"process_cpu_count\", None) or os.cpu_count)() or 1",
  "replace": "DEFAULT_JOBS = min(8, (getattr(os, \"process_cpu_count\", None) or os.cpu_count)() or 1)",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "the default is every CPU the process may use; a fixed 8 left 24 of 32 cores idle"
 },
 {
  "id": "mutations.mirror-budget",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    return max(1, free_bytes // 4 // max(mirror_bytes, 1))",
  "replace": "    return max(1, free_bytes // max(mirror_bytes, 1))",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k parallel",
  "why": "the mirrors may take a quarter of the temp filesystem, which on tmpfs is RAM a build may need"
 },
 {
  "id": "mutations.prepush-gate-default",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "${PREPUSH_MUTATION_JOBS:+--jobs \"${PREPUSH_MUTATION_JOBS}\"}",
  "replace": "--jobs \"${PREPUSH_MUTATION_JOBS:-4}\"",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "the push gate takes the gate's own default, one per CPU; PREPUSH_MUTATION_JOBS only caps it"
 },
 {
  "id": "live-site.csp-blocked",
  "target": "linux/scripts/check-live-site.js",
  "find": "    ...csp.map((c) => `csp-blocked: ${c}`),\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a fallback font the CSP blocks never reaches the network: only the page's securitypolicyviolation names its URL"
 },
 {
  "id": "live-site.csp-probe-installed",
  "target": "linux/scripts/check-live-site.js",
  "find": "    await browser.send('Page.addScriptToEvaluateOnNewDocument', { source: `(${cspProbe})()` });\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "the probe must run before the page's scripts, or the violations of the boot are lost"
 },
 {
  "id": "live-site.third-party-hosts",
  "target": "linux/scripts/check-live-site.js",
  "find": "const third = [...events.hosts].filter((x) => x !== base && !opts.allow.includes(x));",
  "replace": "const third = [];",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "the owner's rule: no visitor request leaves the site"
 },
 {
  "id": "live-site.fresh-boot-per-route",
  "target": "linux/scripts/check-live-site.js",
  "find": "  await send('Page.navigate', { url: 'about:blank' });\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a hash route is a same-document navigation: without about:blank only the first route boots the app"
 },
 {
  "id": "live-site.scrolls",
  "target": "linux/scripts/check-live-site.js",
  "find": "  for (let i = 0; i < opts.scrolls; i++) {",
  "replace": "  for (let i = 0; i < 0; i++) {",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "Flutter lays out, and fetches fonts for, only what is on screen: the emoji on /books sat below the fold"
 },
 {
  "id": "live-site.network-events",
  "target": "linux/scripts/check-live-site.js",
  "find": "    await browser.send('Network.enable');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "without Network.enable no 404 reaches the check, and /icons/Icon-192.png looked served"
 },
 {
  "id": "live-site.log-events",
  "target": "linux/scripts/check-live-site.js",
  "find": "    await browser.send('Log.enable');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "the browser's own console lines (a failed load, a CSP refusal) come through the Log domain only"
 },
 {
  "id": "live-site.files-served",
  "target": "linux/scripts/check-live-site.js",
  "find": "      if (got !== 200) bad.push(",
  "replace": "      if (false) bad.push(",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "the FTP sync state listed /icons/Icon-192.png as uploaded while Apache answered 404"
 },
 {
  "id": "live-site.dotfiles-skipped",
  "target": "linux/scripts/check-live-site.js",
  "find": "      if (e.name.startsWith('.')) continue;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "Apache never serves .htaccess, so sweeping it would fail every Apache site"
 },
 {
  "id": "live-site.version-matches",
  "target": "linux/scripts/check-live-site.js",
  "find": "    return got === want ? null :",
  "replace": "    return true ? null :",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a deploy that never replaced the site still serves the old version.json"
 },
 {
  "id": "live-site.verdict",
  "target": "linux/scripts/check-live-site.js",
  "find": "  if (failed) fail(",
  "replace": "  if (false) fail(",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a check that prints FAIL and exits 0 leaves the job green over a broken site"
 },
 {
  "id": "fallback-fonts.locked-file-requested",
  "target": "linux/scripts/05-frameworks/flutter/fetch-fallback-fonts.py",
  "find": "        elif rel not in requested:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-fetch-fallback-fonts.sh",
  "why": "after a Flutter bump the engine asks for another version path, and every locked file would 404"
 },
 {
  "id": "fallback-fonts.family-complete",
  "target": "linux/scripts/05-frameworks/flutter/fetch-fallback-fonts.py",
  "find": "    missing = [rel for rel in requested if rel.split(\"/\")[0] in families and rel not in locked]",
  "replace": "    missing = []",
  "test": "bash linux/scripts/tests/test-fetch-fallback-fonts.sh",
  "why": "new content picks another chunk of a family: one missing chunk is an empty box again"
 },
 {
  "id": "fallback-fonts.engine-layout",
  "target": "linux/scripts/05-frameworks/flutter/fetch-fallback-fonts.py",
  "find": "        target = dest / rel",
  "replace": "        target = dest / name",
  "test": "bash linux/scripts/tests/test-fetch-fallback-fonts.sh",
  "why": "the engine requests <base><family>/<version>/<file>; a flat directory 404s every font"
 },
 {
  "id": "fallback-fonts.problems-stop-the-fetch",
  "target": "linux/scripts/05-frameworks/flutter/fetch-fallback-fonts.py",
  "find": "    if problems or args.check:",
  "replace": "    if args.check:",
  "test": "bash linux/scripts/tests/test-fetch-fallback-fonts.sh",
  "why": "a lock the engine disagrees with must stop the build, not ship fonts nobody requests"
 },
 {
  "id": "web-artefacts.apache-icons",
  "target": "linux/scripts/05-frameworks/flutter/check-web-artefacts.py",
  "find": "    if (root / \"web/.htaccess\").is_file():",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-check-web-artefacts.sh",
  "why": "Apache's default Alias /icons/ made jonasheinle.de's app icons 404 for two releases"
 },
 {
  "id": "web-artefacts.icon-on-disk",
  "target": "linux/scripts/05-frameworks/flutter/check-web-artefacts.py",
  "find": "        if \"://\" not in value and not value.startswith(\"data:\") and not (root / \"web\" / site.lstrip(\"/\")).is_file():",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-check-web-artefacts.sh",
  "why": "a half-done icon move leaves the manifest naming a file the build lacks"
 },
 {
  "id": "web-artefacts.icons-dir",
  "target": "linux/scripts/05-frameworks/flutter/check-web-artefacts.py",
  "find": "        if where == \"web/manifest.json\" and not site.startswith(f\"/{icons_dir}/\"):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-check-web-artefacts.sh",
  "why": "--icons-dir is where the app keeps its icons; a manifest icon elsewhere is a stray copy"
 },
 {
  "id": "web-artefacts.og-image",
  "target": "linux/scripts/05-frameworks/flutter/check-web-artefacts.py",
  "find": "for m in re.finditer(r'<meta\\b[^>]*\\bproperty=\"og:image\"",
  "replace": "for m in re.finditer(r'<nometa\\b[^>]*\\bproperty=\"og:image\"",
  "test": "bash linux/scripts/tests/test-check-web-artefacts.sh",
  "why": "the og:image is an absolute URL to /icons/ and 404ed on Apache like the manifest's"
 },
 {
  "id": "web-smoke.fallback-font-base",
  "target": "linux/webserver/scripts/flutter_integration_smoke_test.sh",
  "find": "    \"\" | *://* | //*)",
  "replace": "    \"\")",
  "test": "bash linux/scripts/tests/test-flutter-smoke-test.sh",
  "why": "a fontFallbackBaseUrl on fonts.gstatic.com is the CSP block again"
 },
 {
  "id": "web-smoke.fallback-fonts-served",
  "target": "linux/webserver/scripts/flutter_integration_smoke_test.sh",
  "find": "    [ \"$status\" = 200 ] || FONT_FAILS+=\"FAIL: ${font#/} returned HTTP $status\"$'\\n'",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-flutter-smoke-test.sh",
  "why": "a build without its fonts 404s every emoji the engine falls back for"
 },
 {
  "id": "web-smoke.fallback-fonts-whole-set",
  "target": "linux/webserver/scripts/flutter_integration_smoke_test.sh",
  "find": "  if [ -n \"$FONT_FAILS\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-flutter-smoke-test.sh",
  "why": "a partial set is an empty box for every emoji its missing chunks hold"
 },
 {
  "id": "web-smoke.fallback-fonts-names-each",
  "target": "linux/webserver/scripts/flutter_integration_smoke_test.sh",
  "find": " || FONT_FAILS+=\"FAIL:",
  "replace": " || FONT_FAILS=\"FAIL:",
  "test": "bash linux/scripts/tests/test-flutter-smoke-test.sh",
  "why": "the log names every font the site lacks, so one deploy fixes them all"
 },
 {
  "id": "fallback-fonts.generations-paths",
  "target": "linux/scripts/05-frameworks/flutter/fetch-fallback-fonts.py",
  "find": "url.removeprefix(GSTATIC)}",
  "replace": "url}",
  "test": "bash linux/scripts/tests/test-fetch-fallback-fonts.sh",
  "why": "the smoke test asks the site for <base><family>/<version>/<file>, so a full gstatic URL there 404s every font"
 },
 {
  "id": "docs-site.sidebars-browsers-side-by-side",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "for (let i = 0; i < Math.min(Number(askedJobs), jobs.length); i++)",
  "replace": "for (let i = 0; i < 1; i++)",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k browsers",
  "why": "a site's pages and widths in one Chrome are checked in turn, which is what the knob exists to undo"
 },
 {
  "id": "docs-site.sidebars-jobs-checked",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "  if (!/^[1-9]\\d*$/.test(askedJobs)) fail(",
  "replace": "  if (false) fail(",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k browsers",
  "why": "a count of 0 launches no Chrome and dies on browsers[0] with a stack trace instead of naming the knob"
 },
 {
  "id": "docs-site.sidebars-every-job-reported",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "  const lines = found.flat();",
  "replace": "  const lines = found.slice(0, 1).flat();",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k tree",
  "why": "a verdict read from the first page alone passes a site whose other pages fail"
 },
 {
  "id": "docs-site.sidebars-page-headers",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "[...(j % viewports.length ? [] : [`  ${job.page}`]), ",
  "replace": "[",
  "test": "bash linux/scripts/tests/test-docs-sidebars.sh -k tree",
  "why": "a FAIL line without its page header names no page to fix"
 },
 {
  "id": "ordered-jobs.meet-can-say-alone",
  "target": "linux/scripts/tests/meet.sh",
  "find": "    [ \"${i}\" -lt \"${ticks}\" ] || { echo alone; return 1; }\n",
  "replace": "    break\n",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "a rendezvous that says met without its peers proves every serial run parallel"
 },
 {
  "id": "live-site.retry-once",
  "target": "linux/scripts/check-live-site.js",
  "find": "  const second = await checkRoute(browser, events, opts, route, vp);",
  "replace": "  const second = firstRun;",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a route that fails once must pass on its fresh retry: a retry that reruns nothing turns one flaky console error into a red deploy"
 },
 {
  "id": "live-site.retry-verdict",
  "target": "linux/scripts/check-live-site.js",
  "find": "  return { label: firstRun.label, problems: second.problems, first: firstRun.problems };",
  "replace": "  return { label: firstRun.label, problems: [], first: firstRun.problems };",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a failure that repeats on the retry must fail the run: a verdict from the first attempt alone hides every real error"
 },
 {
  "id": "live-site.flaky-logged",
  "target": "linux/scripts/check-live-site.js",
  "find": "        for (const p of first) process.stdout.write(`flaky: ${label}: ${p}\n`);",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a first-attempt failure that passes on retry stays visible in the log, or the gate hides a flaky route for good"
 },
 {
  "id": "lint-tools.bootstrap-path-pin",
  "target": "linux/scripts/01-core/lint-tool-release.sh",
  "find": "[ \"$(\"${path_bin}\" --version 2>/dev/null | sed -n 's/^version: //p')\" = \"${!pin_name#v}\" ]",
  "replace": "[ -n \"${path_bin}\" ]",
  "test": "bash linux/scripts/tests/test-lint-tool-release.sh",
  "why": "a PATH shellcheck at any other version counts different warnings than the frozen baseline (CI's apt 0.9.0)"
 },
 {
  "id": "lint-tools.bootstrap-version-required",
  "target": "linux/scripts/01-core/lint-tool-release.sh",
  "find": "  [ -n \"${version}\" ] || err \"${pin_name} is not set (tool-pins.env not found?).\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-lint-tool-release.sh",
  "why": "without the pin the bootstrap builds a URL for version '', and a lint verdict nobody can reproduce is not a gate"
 },
 {
  "id": "lint-tools.bootstrap-checksum-required",
  "target": "linux/scripts/01-core/lint-tool-release.sh",
  "find": "  [ -n \"${expected_sha}\" ] || err \"No pinned ${tool} SHA256 for ${asset}; add one to tool-pins.env.\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-lint-tool-release.sh",
  "why": "downloading a release nobody checksummed is how a lint gate starts running a binary the repo never chose"
 },
 {
  "id": "shared-assets.help-body-is-canonical",
  "target": "shared/config/shared-assets.manifest",
  "find": "| scripts/agentic-loop/Run-AgenticLoop.sh     | body  |\n",
  "replace": "| scripts/agentic-loop/Run-AgenticLoop.sh     | body  | #\n",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "the explicit help body is shared code; masking its prose as a consumer knob must be caught"
 },
 {
  "id": "probe.venv-build-pin-wins",
  "target": "linux/scripts/06-packaging/venv-version-probe.py",
  "find": "allowed = pin_set(build_pin) if build_pin else set(from_lock)",
  "replace": "allowed = pin_set(build_pin) | set(from_lock)",
  "test": "bash linux/scripts/tests/test-python-probes.sh",
  "why": "a lock-matching installed version must still fail when the chain build pin differs"
 },
 {
  "id": "probe.venv-media-runs",
  "target": "linux/scripts/06-packaging/venv-version-probe.py",
  "find": "if os.environ.get(\"STV_MEDIA_FUNCTIONAL\", \"1\") == \"1\":",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-python-probes.sh",
  "why": "advertised backends must deliver frames and open their writer rather than passing on build strings alone"
 },
 {
  "id": "probe.venv-ty-dockerfile-invocation",
  "target": "linux/Dockerfile.torch",
  "find": "      amd64) bash /tmp/venv-probe-ty/check.sh /opt/venv /opt/scripts/packaging/venv-version-probe.py /tmp/venv-probe-ty/tool-pins.env && \\",
  "replace": "      amd64) true && \\",
  "test": "bash linux/scripts/tests/test-venv-probe-types.sh",
  "why": "the built x64 venv must actually run the pinned type gate against its copied probe"
 },
 {
  "id": "probe.venv-ty-loader-mount",
  "target": "linux/Dockerfile.torch",
  "find": "source=linux/scripts/01-core/load-ty-tool.sh,target=/tmp/venv-probe-ty/load-ty-tool.sh,ro",
  "replace": "source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/venv-probe-ty/load-ty-tool.sh,ro",
  "test": "bash linux/scripts/tests/test-venv-probe-types.sh",
  "why": "the image build must mount the shared pinned ty loader beside the checker"
 },
 {
  "id": "probe.gst-python-headers-required",
  "target": "linux/scripts/03-media/build/gstreamer/common/gst-python-build-config.py",
  "find": "if not include_dir.is_dir():",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-python-probes.sh",
  "why": "cross-Python metadata must refuse an include directory that does not exist"
 },
 {
  "id": "ort-chain.tf-metadata-failure-not-stamped",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "        '-L${libdir} -ltensorflow' || return 1",
  "replace": "        '-L${libdir} -ltensorflow'",
  "test": "bash linux/scripts/tests/test-ffmpeg-dnn-contract.sh",
  "why": "a failed pkg-config write must not leave a completion stamp that makes later builds trust an unusable TensorFlow SDK"
 },
 {
  "id": "disk-guard.force-bypass-before-trim",
  "target": "linux/scripts/01-core/chain-storage.sh",
  "find": "if [ \"${FORCE_LOW_DISK:-0}\" = \"1\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-storage-sdk-refactors.sh",
  "why": "forced admission must return before removing cache exports"
 },
 {
  "id": "vulkan.failed-verification-rejects-stale-archive",
  "target": "linux/scripts/02-toolchain/vulkan-install.sh",
  "find": "download_verified_file \"$url\" \"${VULKAN_SDK_SHA256}\" \"$tarball\" || die \"Failed to download/verify Vulkan SDK\"",
  "replace": "download_verified_file \"$url\" \"${VULKAN_SDK_SHA256}\" \"$tarball\"",
  "test": "bash linux/scripts/tests/test-storage-sdk-refactors.sh",
  "why": "a failed verification must not install an older archive left at the download path"
 },
 {
  "id": "probe.native-nonok-zero-fails",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "\"${tag} OK:\"*) pass",
  "replace": "\"${tag} \"*) pass",
  "test": "bash linux/scripts/tests/test-runtime-probe-verdicts.sh",
  "why": "a zero process status cannot turn FAIL, SKIP or ABSENT into a successful native probe"
 },
 {
  "id": "probe.gst-scan-marker-pipefail",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    if ! grep -q '^GST_SCAN_DONE$' <<< \"${scan}\"; then",
  "replace": "    if ! printf '%s\\n' \"${scan}\" | grep -q '^GST_SCAN_DONE$'; then",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "a large trailing scanner transcript must not turn a completed scan into UNKNOWN under pipefail"
 },
 {
  "id": "probe.gst-scan-absent-pipefail",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "      if grep -q '^GST_SCAN_ABSENT$' <<< \"${scan}\"; then",
  "replace": "      if printf '%s\\n' \"${scan}\" | grep -q '^GST_SCAN_ABSENT$'; then",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "a large trailing scanner transcript must not hide the absent-tool marker under pipefail"
 },
 {
  "id": "probe.native-absence-policy",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "genai) echo \"  SKIP: onnxruntime_genai",
  "replace": "genai) fail \"  SKIP: onnxruntime_genai",
  "test": "bash linux/scripts/tests/test-runtime-probe-verdicts.sh",
  "why": "GenAI absence remains owned by architecture parity rather than the functional probe"
 },
 {
  "id": "probe.shared-python-payload-guard",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "smoke_python_probe_command() {\n  printf 'if [ -z \"${%s:-}\" ]; then",
  "replace": "smoke_python_probe_command() {\n  printf 'if [ -z \"${%s:-}\" ] && false; then",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "an empty environment crossing must exit with the ABSENT sentinel before Python runs"
 },
 {
  "id": "tvm-llvm.sdk-target-priority",
  "target": "linux/scripts/05-frameworks/tvm-detect.sh",
  "find": "  [ -z \"${arch}\" ] || _tvm_append_sdk_libraries candidates \"${root}\" \"${arch}\" \"${libraries[@]}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-tvm-sdk-lookup.sh",
  "why": "a target shared library outranks a generic host static library"
 },
 {
  "id": "tvm-llvm.shared-wheel-module-flag",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "    --python-module \"$2\"",
  "replace": "    --python-module OFF",
  "test": "bash linux/scripts/tests/test-tvm-cmake-args.sh",
  "why": "the common option builder must still enable the Python module for wheel builds"
 },
 {
  "id": "runtime-smoke.package-artifact-pin",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "    [ -z \"${android_pin}\" ] || _runtime_artifact_result=\"${android_pin}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-duplicate-build-helpers.sh",
  "why": "registry artifacts must prefer their immutable android pin over a mutable tag"
 },
 {
  "id": "gpu-runtime.ort-cache-rejects-ccache",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "    *sccache*)\n      info \"sccache: wrapping ${compiler",
  "replace": "    *cache*)\n      info \"sccache: wrapping ${compiler",
  "test": "bash linux/scripts/tests/test-duplicate-build-helpers.sh",
  "why": "CUDA and HIP cannot use ccache as their compiler launcher"
 },
 {
  "id": "gpu-runtime.ort-install-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "\"${apt[@]}\" install \"${install[@]}\" libgcc-s1 || return \"$?\"",
  "replace": "\"${apt[@]}\" install \"${install[@]}\" libgcc-s1",
  "test": "bash linux/scripts/tests/test-duplicate-build-helpers.sh",
  "why": "dependency installation failures retain their nonzero status even inside a conditional caller"
 },
 {
  "id": "python.bundle-package-option-boundary",
  "target": "linux/scripts/06-packaging/python-app-cli.sh",
  "find": "[ \"${mode}\" = package ] || { usage >&2; exit 2; }",
  "replace": "true || { usage >&2; exit 2; }",
  "test": "bash linux/scripts/tests/test-python-app-cli.sh",
  "why": "the bundle driver must reject the package-only no-test switch"
 },
 {
  "id": "probe.compiler-signature-sample-bound",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "depth=1; cap=5; pattern=",
  "replace": "depth=1; cap=50; pattern=",
  "test": "bash linux/scripts/tests/test-compiler-signatures.sh",
  "why": "GCC signature sampling must retain its per-directory five-file bound"
 },
 {
  "id": "gpu-runtime.ort-cache-parent-environment",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  compiler_cache_launcher_env 2>/dev/null || true",
  "replace": "  ( compiler_cache_launcher_env 2>/dev/null || true )",
  "test": "bash linux/scripts/tests/test-duplicate-build-helpers.sh",
  "why": "launcher resolution must retain cache setup exports in the caller and keep diagnostics out of the path"
 },
 {
  "id": "android-env.sdk-install-exit-status",
  "target": "linux/scripts/02-toolchain/android-sdk.sh",
  "find": "out=\"$(\"${sdkmanager_bin}\" --sdk_root=\"${ANDROID_HOME}\" \"$@\" 2>&1)\" || status=$?",
  "replace": "out=\"$(\"${sdkmanager_bin}\" --sdk_root=\"${ANDROID_HOME}\" \"$@\" 2>&1)\" || true",
  "test": "bash linux/scripts/tests/test-android-sdk-retry.sh",
  "why": "a per-package Done message must never mask a failed installation"
 },
 {
  "id": "android-env.sdk-license-confirmation",
  "target": "linux/scripts/02-toolchain/android-sdk.sh",
  "find": "grep -q \"All SDK package licenses accepted\"",
  "replace": "grep -q \"Done.\"",
  "test": "bash linux/scripts/tests/test-android-sdk-retry.sh",
  "why": "a successful exit without license confirmation must exhaust the license retries"
 },
 {
  "id": "android-env.sdk-install-retry-bound",
  "target": "linux/scripts/02-toolchain/android-sdk.sh",
  "find": "max_attempts=4; sleep_sec=5",
  "replace": "max_attempts=1; sleep_sec=5",
  "test": "bash linux/scripts/tests/test-android-sdk-retry.sh",
  "why": "transient install failures retain four attempts and five-second waits"
 },
 {
  "id": "probe.gstreamer-shared-helper-required",
  "target": "linux/scripts/04-runtime/gstreamer-env.sh",
  "find": "source \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)/../01-core/path-helpers.sh\" || return $?",
  "replace": "return 0",
  "test": "bash linux/scripts/tests/test-gstreamer-env.sh",
  "why": "a missing companion module must not claim successful environment initialization"
 },
 {
  "id": "lint-tools.release-archive-member",
  "target": "linux/scripts/01-core/lint-tool-release.sh",
  "find": "member=\"shellcheck-${version}/${binary}\"",
  "replace": "member=\"${binary}\"",
  "test": "bash linux/scripts/tests/test-lint-tool-release.sh",
  "why": "ShellCheck tar archives nest the executable under their version directory"
 },
 {
  "id": "probe.ffmpeg-compile-only",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-probe-framework.sh",
  "find": "cmd+=(\"${cflags[@]}\" -c \"${source_file}\" -o \"${output_file}\")",
  "replace": "cmd+=(\"${cflags[@]}\" \"${source_file}\" -o \"${output_file}\")",
  "test": "bash linux/scripts/tests/test-ffmpeg-probes.sh",
  "why": "a preprocessor probe must compile without requiring a main or linker dependencies"
 },
 {
  "id": "probe.ffmpeg-compiler-verdict",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-probe-framework.sh",
  "find": "\"${cmd[@]}\" >/dev/null 2>&1 || status=1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ffmpeg-probes.sh",
  "why": "a failed compiler must return a failed feature probe after cleanup"
 },
 {
  "id": "probe.ffmpeg-cross-search",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-probe-framework.sh",
  "find": "ffmpeg_append_cross_search_flags cmd",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ffmpeg-probes.sh",
  "why": "cross feature probes must carry the target include and library search paths"
 },
 {
  "id": "probe.vulkan-sdk-path-order",
  "target": "linux/scripts/06-packaging/smoke-vulkan.sh",
  "find": "for root in \"${ACTIVE_LINK}\" \"${VULKAN_SDK_ROOT}/x86_64\" \"${VULKAN_SDK_ROOT}/aarch64\" \"${VULKAN_SDK_ROOT}/riscv64\"; do",
  "replace": "for root in \"${VULKAN_SDK_ROOT}/x86_64\" \"${VULKAN_SDK_ROOT}/aarch64\" \"${VULKAN_SDK_ROOT}/riscv64\"; do",
  "test": "bash linux/scripts/tests/test-vulkan-sdk-smoke-paths.sh",
  "why": "the selected active SDK must take precedence over architecture fallback directories"
 },
 {
  "id": "lib.value-option-requires-argument",
  "target": "linux/scripts/lib/cli-value-options.sh",
  "find": "[ \"${_cvo_count}\" -ge 2 ] || err \"${_cvo_flag} expects a value\"",
  "replace": "[ \"${_cvo_count}\" -ge 0 ] || err \"${_cvo_flag} expects a value\"",
  "test": "bash linux/scripts/tests/test-cli-value-options.sh",
  "why": "a missing value must exit promptly rather than repeat the same unconsumed flag"
 },
 {
  "id": "lib.value-option-delimiter",
  "target": "linux/scripts/lib/cli-value-options.sh",
  "find": "3) shift; break ;;",
  "replace": "3) break ;;",
  "test": "bash linux/scripts/tests/test-cli-value-options.sh",
  "why": "the delimiter ends option parsing without becoming an argument of the launched app or ctest"
 },
 {
  "id": "probe.compiler-smoke-object-mode",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "cc1-smoke 'cc1 compile-to-object smoke failed' -c",
  "replace": "cc1-smoke 'cc1 compile-to-object smoke failed'",
  "test": "bash linux/scripts/tests/test-compiler-smoke-command.sh",
  "why": "compile-to-object must retain -c so the ELF check grades an object rather than a linked executable"
 },
 {
  "id": "probe.compiler-smoke-command-cleanup",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  rm -rf \"${directory}\"\n}",
  "replace": "  :\n}",
  "test": "bash linux/scripts/tests/test-compiler-smoke-command.sh",
  "why": "successful and advisory compiler probes must remove their temporary output tree"
 },
 {
  "id": "gate-fixture.harness-capture-stub-status",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "2>&1)\" || _tcc_status=$?",
  "replace": "2>&1)\" || _tcc_status=0",
  "test": "bash linux/scripts/tests/test-bind-mount-ownership.sh",
  "why": "a failing library call must retain its exit status for the fatal-path assertions"
 },
 {
  "id": "gate-fixture.harness-capture-stub-environment",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "env \"${_tcs_environment[@]}\"",
  "replace": "env",
  "test": "bash linux/scripts/tests/test-bind-mount-ownership.sh",
  "why": "per-case environment overrides must reach the stubbed subject"
 },
 {
  "id": "probe.ffmpeg-host-language",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-probe-framework.sh",
  "find": "    resolve_host_compiler_for_lang c\n",
  "replace": "    resolve_host_compiler_for_lang cxx\n",
  "test": "bash linux/scripts/tests/test-ffmpeg-probes.sh",
  "why": "FFmpeg host generators need the C resolver and must retain its failure status"
 },
 {
  "id": "probe.elf-strip-nul-arguments",
  "target": "linux/scripts/01-core/elf-strip.sh",
  "find": "printf '%s\\0' \"$@\" | xargs -0",
  "replace": "printf '%s\\n' \"$@\" | xargs",
  "test": "bash linux/scripts/tests/test-elf-strip.sh",
  "why": "strip invocations must preserve spaces inside each filename"
 },
 {
  "id": "probe.elf-strip-empty-selection",
  "target": "linux/scripts/01-core/elf-strip.sh",
  "find": "  [ \"$#\" -gt 0 ] || return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-elf-strip.sh",
  "why": "an empty selection must not become a single empty filename passed to strip"
 },
 {
  "id": "probe.gcc-strip-target-pass",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "for strip_bin in strip ${TARGET_TRIPLET:+\"${TARGET_TRIPLET}-strip\"}; do",
  "replace": "for strip_bin in strip; do",
  "test": "bash linux/scripts/tests/test-elf-strip.sh",
  "why": "GCC must retain the target strip pass as well as the host strip pass"
 },
 {
  "id": "probe.elf-strip-parallelism",
  "target": "linux/scripts/01-core/elf-strip.sh",
  "find": "xargs -0 -r -P\"${jobs}\"",
  "replace": "xargs -0 -r -P1",
  "test": "bash linux/scripts/tests/test-elf-strip.sh",
  "why": "the caller-selected strip parallelism must reach xargs instead of serializing every tree"
 },
 {
  "id": "probe.renovate-local-dry-run",
  "target": "linux/scripts/renovate-cli.sh",
  "find": "local:--dry-run) assign_renovate_options DRY_RUN 1 ;;",
  "replace": "local:--dry-run) assign_renovate_options DRY_RUN 1 MODE apply ;;",
  "test": "bash linux/scripts/tests/test-renovate-cli.sh",
  "why": "local dry-run must preserve report mode"
 },
 {
  "id": "probe.renovate-fleet-dry-run",
  "target": "linux/scripts/renovate-cli.sh",
  "find": "fleet:--dry-run) assign_renovate_options DRY_RUN 1 MODE apply ;;",
  "replace": "fleet:--dry-run) assign_renovate_options DRY_RUN 1 ;;",
  "test": "bash linux/scripts/tests/test-renovate-cli.sh",
  "why": "fleet dry-run must select the apply plan"
 },
 {
  "id": "probe.renovate-cli-missing-value",
  "target": "linux/scripts/renovate-cli.sh",
  "find": "[ \"$#\" -gt 1 ] || err \"${option} needs a value\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-renovate-cli.sh",
  "why": "missing values must fail with the option diagnostic"
 },
 {
  "id": "probe.renovate-submodule-empty-path",
  "target": "linux/scripts/renovate-git.sh",
  "find": "[ -n \"${path}\" ] || continue",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-renovate-git.sh",
  "why": "empty submodule paths must not reach callbacks"
 },
 {
  "id": "probe.renovate-submodule-context",
  "target": "linux/scripts/renovate-git.sh",
  "find": "\"${callback}\" \"${directory}\" \"${name}\" \"${path}\" \"$@\"",
  "replace": "\"${callback}\" \"${directory}\" \"${name}\" \"${path}\" dropped",
  "test": "bash linux/scripts/tests/test-renovate-git.sh",
  "why": "callback context must survive shared iteration"
 },
 {
  "id": "probe.gstreamer-required-cross-guard",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "    return 1\n  fi\n\n  local host_arch=",
  "replace": "    :\n  fi\n\n  local host_arch=",
  "test": "bash linux/scripts/tests/test-gstreamer-meson-flags.sh",
  "why": "monorepo setup must refuse an incomplete module closure instead of inventing a private cross-mode guard"
 },
 {
  "id": "lib.project-env-active-link",
  "target": "linux/scripts/lib/project-env.sh",
  "find": "    vulkan_env_source_script \"${VULKAN_SETUP_SCRIPT}\"",
  "replace": "    . \"${VULKAN_SETUP_SCRIPT}\"",
  "test": "bash linux/scripts/tests/test-vulkan-env-active-link.sh",
  "why": "the shared launcher path must restore the active SDK link"
 },
 {
  "id": "lib.project-env-git-failure",
  "target": "linux/scripts/lib/project-env.sh",
  "find": "git config --global --add safe.directory \"$1\" || true",
  "replace": "git config --global --add safe.directory \"$1\"",
  "test": "bash linux/scripts/tests/test-project-env.sh",
  "why": "Git setup is advisory in a read-only configuration"
 },
 {
  "id": "lib.project-env-hook-precedence",
  "target": "linux/scripts/lib/project-env.sh",
  "find": "    source_vulkan_env\n",
  "replace": "    vulkan_env_source_script \"${VULKAN_SETUP_SCRIPT}\"\n",
  "test": "bash linux/scripts/tests/test-project-env.sh",
  "why": "the project hook wins over the explicit SDK script and retains its failure status"
 },
 {
  "id": "probe.core-cross-native-alias",
  "target": "linux/scripts/01-core/common.sh",
  "find": "[ -n \"${target}\" ] && [ \"${target}\" != \"${build}\" ]",
  "replace": "[ -n \"${target}\" ] && [ \"${target}\" = \"${build}\" ]",
  "test": "bash linux/scripts/tests/test-cross-fallback-parity.sh",
  "why": "core-only cross detection must normalize OCI and uname spellings before comparing"
 },
 {
  "id": "lib.project-env-standalone-logging",
  "target": "linux/scripts/lib/project-env.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/log-bootstrap.sh\" || return 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "the project environment library must load shared logging when sourced without a launcher; a failing unmutated library invalidates every library mutation baseline"
 },
 {
  "id": "probe.runtime-dry-run-no-heartbeat",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  if ! is_dry_run; then\n    parallel_require_child_stop || return $?\n    _runtime_heartbeat",
  "replace": "  if true; then\n    parallel_require_child_stop || return $?\n    _runtime_heartbeat",
  "test": "bash linux/scripts/tests/test-runtime-heartbeat.sh",
  "why": "a dry-run timer must preserve command status without creating or cleaning up a background heartbeat"
 },
 {
  "id": "probe.runtime-heartbeat-child-pid",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  trap 'kill -KILL \"${!:-}\" 2>/dev/null || true; wait \"${!:-}\" 2>/dev/null || true; exit 0' TERM INT\n  sleep \"${RUNTIME_HEARTBEAT_FIRST_SECS:-900}\" & wait \"$!\" || exit 0",
  "replace": "  trap 'kill \"${s:-}\" 2>/dev/null; exit 0' TERM INT\n  sleep \"${RUNTIME_HEARTBEAT_FIRST_SECS:-900}\" & s=$!; wait \"${s}\" || exit 0",
  "test": "bash linux/scripts/tests/test-runtime-heartbeat.sh",
  "why": "termination between spawning sleep and assigning a PID must not leave an inherited output pipe open"
 },
 {
  "id": "probe.runtime-heartbeat-force-reap",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  trap 'kill -KILL \"${!:-}\" 2>/dev/null || true; wait \"${!:-}\" 2>/dev/null || true; exit 0' TERM INT",
  "replace": "  trap 'kill \"${!:-}\" 2>/dev/null || true; wait \"${!:-}\" 2>/dev/null || true; exit 0' TERM INT",
  "test": "bash linux/scripts/tests/test-runtime-heartbeat.sh",
  "why": "a timer child that misses TERM during startup must be reaped before the heartbeat exits"
 },
 {
  "id": "gate-fixture.gpu-variant-context-isolated",
  "target": "linux/scripts/tests/test-gpu-variant.sh",
  "find": "export RUNTIME_CONTEXT_ROOT=\"${_VARIANT_WORK}/runtime-contexts\"",
  "replace": "export RUNTIME_CONTEXT_ROOT=\"${_VARIANT_WORK}/wrong-context\"",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "graph fixtures must use their disposable runtime context rather than a runner cache"
 },
 {
  "id": "gate-fixture.gpu-variant-cli-refusal",
  "target": "linux/scripts/tests/test-gpu-variant.sh",
  "find": "t_assert_eq '' \"$(cat \"${VARIANT_CONTAINER_CALLS}\")\"",
  "replace": "nerdctl forbidden-call >/dev/null 2>&1 || true\nt_assert_eq '' \"$(cat \"${VARIANT_CONTAINER_CALLS}\")\"",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "a container command hidden by an advisory exit status must still fail the dry-run fixture"
 },
 {
  "id": "probe.clang-embedded-metadata-first",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    _ver=\"$( strings \"${_bin}\" 2>/dev/null \\\n        | grep -o",
  "replace": "    _ver=\"$( printf '' \\\n        | grep -o",
  "test": "bash linux/scripts/tests/test-clang-embedded-version.sh",
  "why": "embedded metadata must beat a different runtime-library version without executing the compiler"
 },
 {
  "id": "probe.clang-embedded-epoch",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "| cut -d: -f3 | cut -d~ -f1",
  "replace": "| cut -d: -f2 | cut -d~ -f1",
  "test": "bash linux/scripts/tests/test-clang-embedded-version.sh",
  "why": "the Debian epoch is removed before comparing the pinned compiler version"
 },
 {
  "id": "probe.clang-validator-nonfatal",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  clang_embedded_deb_version \"$1\" || true",
  "replace": "  clang_embedded_deb_version \"$1\"",
  "test": "bash linux/scripts/tests/test-clang-embedded-version.sh",
  "why": "validator probes retain their nonfatal empty-version verdict under errexit"
 },
 {
  "id": "probe.pinned-clone-filter-fallback",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "    || git clone --quiet --no-checkout \"${url}\" \"${destination}\" || return 1",
  "replace": "    || return 1",
  "test": "bash linux/scripts/tests/test-pinned-repository.sh",
  "why": "servers rejecting partial-clone filters must retain the existing unfiltered fallback"
 },
 {
  "id": "probe.pinned-clone-checkout-fatal",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "  git -C \"${destination}\" checkout --quiet \"${commit}\" || return 1",
  "replace": "  git -C \"${destination}\" checkout --quiet \"${commit}\" || true",
  "test": "bash linux/scripts/tests/test-pinned-repository.sh",
  "why": "checkout failure must propagate even when a surrounding conditional disables errexit"
 },
 {
  "id": "probe.pinned-clone-head-checked",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "  actual=\"$(git -C \"${destination}\" rev-parse HEAD)\" || return 1",
  "replace": "  actual=\"${commit}\"",
  "test": "bash linux/scripts/tests/test-pinned-repository.sh",
  "why": "a checkout that did not land the exact commit must never be accepted"
 },
 {
  "id": "probe.verified-download-failure-fatal",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "  download_file \"$url\" \"$dest\" || return 1",
  "replace": "  download_file \"$url\" \"$dest\" || true",
  "test": "bash linux/scripts/tests/test-hailo-source-staging.sh",
  "why": "a failed fetch cannot silently reuse a previously cached archive through conditional-call errexit suppression"
 },
 {
  "id": "probe.hailo-archive-verified",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  download_verified_file \"${url}\" \"${sha}\" \"${archive}\" || return 1",
  "replace": "  download_file \"${url}\" \"${archive}\" || return 1",
  "test": "bash linux/scripts/tests/test-hailo-source-staging.sh",
  "why": "all shared archive extraction must verify the supplied source hash"
 },
 {
  "id": "probe.hailo-archive-strip",
  "target": "linux/scripts/03-media/build/hailo/hailo-build-lib.sh",
  "find": "  if [ -n \"${strip}\" ]; then args+=(--strip-components=\"${strip}\"); fi",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-hailo-source-staging.sh",
  "why": "flat protobuf and libzmq sources retain their requested strip-components layout"
 },
 {
  "id": "probe.llvm-source-cache-head",
  "target": "linux/scripts/01-core/common.sh",
  "find": "git -C \"${source_dir}\" rev-parse -q --verify HEAD >/dev/null 2>&1",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-llvm-source-cache.sh",
  "why": "an interrupted git init without HEAD must not be reused"
 },
 {
  "id": "probe.llvm-source-cache-tree",
  "target": "linux/scripts/01-core/common.sh",
  "find": "[ -f \"${source_dir}/llvm/CMakeLists.txt\" ]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-llvm-source-cache.sh",
  "why": "a checkout without the LLVM build entry point must be rebuilt"
 },
 {
  "id": "probe.llvm-source-cache-eviction",
  "target": "linux/scripts/01-core/common.sh",
  "find": "rm -rf \"${old_source}\" || return 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-llvm-source-cache.sh",
  "why": "superseded LLVM generations must not accumulate on the shared mount"
 },
 {
  "id": "probe.llvm-source-cache-eviction-failure",
  "target": "linux/scripts/01-core/common.sh",
  "find": "rm -rf \"${old_source}\" || return 1",
  "replace": "rm -rf \"${old_source}\" || true",
  "test": "bash linux/scripts/tests/test-llvm-source-cache.sh",
  "why": "failed eviction must not be hidden by conditional caller errexit semantics"
 },
 {
  "id": "probe.android-cmake-target-toolchain",
  "target": "linux/scripts/03-media/android-build-preamble.sh",
  "find": "\"-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake\"",
  "replace": "\"-DCMAKE_TOOLCHAIN_FILE=/wrong/android.toolchain.cmake\"",
  "test": "bash linux/scripts/tests/test-android-cmake-target.sh",
  "why": "every Android target must use the selected NDK toolchain, including paths with spaces"
 },
 {
  "id": "probe.android-cmake-target-abi",
  "target": "linux/scripts/03-media/android-build-preamble.sh",
  "find": "\"-DANDROID_ABI=${ANDROID_ABI}\"",
  "replace": "\"-DANDROID_ABI=armeabi-v7a\"",
  "test": "bash linux/scripts/tests/test-android-cmake-target.sh",
  "why": "the common target array must retain the selected target ABI"
 },
 {
  "id": "probe.android-cmake-target-api",
  "target": "linux/scripts/03-media/android-build-preamble.sh",
  "find": "\"-DANDROID_PLATFORM=android-${ANDROID_API_LEVEL}\"",
  "replace": "\"-DANDROID_PLATFORM=android-21\"",
  "test": "bash linux/scripts/tests/test-android-cmake-target.sh",
  "why": "the target array must retain the resolved API level"
 },
 {
  "id": "probe.android-cmake-target-quoted",
  "target": "linux/scripts/03-media/android-build-preamble.sh",
  "find": "\"-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake\"",
  "replace": "-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake",
  "test": "bash linux/scripts/tests/test-android-cmake-target.sh",
  "why": "an NDK directory containing spaces must occupy one CMake argument"
 },
 {
  "id": "probe.python-ci-fixture-copy",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "cp \"${fixture_scripts}/${relative}\" \"${TREE}/${relative}\" || return 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "fixture scripts must retain their source bytes rather than silently testing absent copies"
 },
 {
  "id": "probe.python-ci-fixture-copy-failure",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "cp \"${fixture_scripts}/${relative}\" \"${TREE}/${relative}\" || return 1",
  "replace": "cp \"${fixture_scripts}/${relative}\" \"${TREE}/${relative}\" || true",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "missing requested fixture inputs must fail even in a conditional caller"
 },
 {
  "id": "probe.python-ci-fixture-workspace",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "mkdir -p \"${WS}\" \"${BIN}\" \"${TREE}/02-toolchain/python\" || return 1",
  "replace": "mkdir -p \"${TREE}/02-toolchain/python\" || return 1",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "the shared fixture must create its isolated workspace and executable directory"
 },
 {
  "id": "probe.python-ci-fixture-detection",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "detect_workspace() { export WORKSPACE_ROOT=\"${FIXTURE_WS}\"; }",
  "replace": "detect_workspace() { :; }",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "stubbed workspace detection must bind the caller fixture, never the real checkout"
 },
 {
  "id": "probe.cli-common-global",
  "target": "linux/scripts/01-core/cli-parsers.sh",
  "find": "_parse_global_flags \"$5\" \"$6\" || _pcbf_rc=$?",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-cli-parsers.sh",
  "why": "both public parsers must preserve dry-run and parallelism flags and their consumed argument counts"
 },
 {
  "id": "probe.cli-common-mirror",
  "target": "linux/scripts/01-core/cli-parsers.sh",
  "find": "_parse_mirror_flags \"$2\" \"$3\" \"$4\" \"$5\" \"$6\" || _pcbf_rc=$?",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-cli-parsers.sh",
  "why": "mirror enablement and the selected URL must reach both parser callers without changing the other URL"
 },
 {
  "id": "probe.cli-common-arches",
  "target": "linux/scripts/01-core/cli-parsers.sh",
  "find": "--target-arches|--architectures) _pcbf_arches=\"$6\"; return 2 ;;",
  "replace": "--target-arches|--architectures) _pcbf_arches=\"$6\"; return 1 ;;",
  "test": "bash linux/scripts/tests/test-cli-parsers.sh",
  "why": "architecture aliases consume a value so the dispatcher can reject missing or swallowed values"
 },
 {
  "id": "probe.cli-common-help",
  "target": "linux/scripts/01-core/cli-parsers.sh",
  "find": "-h|--help) return 255 ;;",
  "replace": "-h|--help) return 0 ;;",
  "test": "bash linux/scripts/tests/test-cli-parsers.sh",
  "why": "help must propagate the special return code instead of looking like an unknown flag"
 },
 {
  "id": "critical-fixes.source-pattern-probe-runs",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "_critical_source_verdict \"$1\" \"$2\" quiet grep \"${@:3}\"",
  "replace": "_critical_source_verdict \"$1\" \"$2\" quiet true \"${@:3}\"",
  "test": "bash linux/scripts/tests/test-critical-source-pattern.sh",
  "why": "a missing match, missing file and invalid expression must not produce a success verdict"
 },
 {
  "id": "critical-fixes.source-pattern-failure-recorded",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    fail \"${failure}\"",
  "replace": "    pass \"${failure}\"",
  "test": "bash linux/scripts/tests/test-critical-source-pattern.sh",
  "why": "a failed source assertion must contribute to the shared failure count and a nonzero final summary"
 },
 {
  "id": "critical-fixes.source-pattern-arguments",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "_critical_source_verdict \"$1\" \"$2\" quiet grep \"${@:3}\"",
  "replace": "_critical_source_verdict \"$1\" \"$2\" quiet grep \"${@:3:2}\"",
  "test": "bash linux/scripts/tests/test-critical-source-pattern.sh",
  "why": "the selected grep mode, literal pattern and source path including spaces must reach the probe intact"
 },
 {
  "id": "probe.gcc-cross-host",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "if [ -n \"${host}\" ]; then args+=(--host \"${host}\"); fi",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-gcc-cross-launch.sh",
  "why": "Canadian cross must retain its explicit host triplet while the ordinary cross compiler omits it"
 },
 {
  "id": "probe.gcc-cross-sysroot",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "--languages 'c,c++' --sysroot /",
  "replace": "--languages 'c,c++' --sysroot /wrong",
  "test": "bash linux/scripts/tests/test-gcc-cross-launch.sh",
  "why": "both builders retain the existing root sysroot and target include directory"
 },
 {
  "id": "probe.gcc-cross-cache",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "--disable-bootstrap --ccache --skip-system-registration",
  "replace": "--disable-bootstrap --skip-system-registration",
  "test": "bash linux/scripts/tests/test-gcc-cross-launch.sh",
  "why": "both non-bootstrap compiler builds must retain compiler caching"
 },
 {
  "id": "probe.gcc-cross-fatal",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "|| die \"Source cross GCC build FAILED for ${triplet}\"",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-gcc-cross-launch.sh",
  "why": "a failed cross builder must not pass by inspecting stale executable tools under a conditional caller"
 },
 {
  "id": "probe.gcc-cross-canadian-fatal",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "|| die \"Canadian native GCC build FAILED for ${normalized_target}\"",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-gcc-cross-launch.sh",
  "why": "Canadian builder failure must be diagnosed before installed-tool checks hide its actual cause"
 },
 {
  "id": "probe.gcc-cross-jobs",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "PREFIX=\"${prefix}\" BUILD_DIR=\"${build_dir}\" JOBS=\"${JOBS:-$(nproc)}\"",
  "replace": "PREFIX=\"${prefix}\" BUILD_DIR=\"${build_dir}\" JOBS=1",
  "test": "bash linux/scripts/tests/test-gcc-cross-launch.sh",
  "why": "explicit parallelism and detected fallback parallelism must reach the shared build command"
 },
 {
  "id": "probe.gcc-cross-status",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "bash \"${GCC_CROSS_BUILDER}\" \"${args[@]}\"",
  "replace": "bash \"${GCC_CROSS_BUILDER}\" \"${args[@]}\"; return 0",
  "test": "bash linux/scripts/tests/test-gcc-cross-launch.sh",
  "why": "the shared launcher must propagate the underlying builder exit status even in a conditional context"
 },
 {
  "id": "lib.agentic-phase-dry-run",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "if [[ \"${DRY_RUN:-false}\" == \"true\" ]]; then\n        log \"[DRY RUN] skipped $noun\"",
  "replace": "if false; then\n        log \"[DRY RUN] skipped $noun\"",
  "test": "bash linux/scripts/tests/test-agentic-phases.sh",
  "why": "Dry-run must leave commands unexecuted."
 },
 {
  "id": "lib.agentic-phase-strict-failure",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "    log \"$verdict FAILED\" \"ERROR\"\n    return 1",
  "replace": "    log \"$verdict FAILED\" \"ERROR\"\n    return 0",
  "test": "bash linux/scripts/tests/test-agentic-phases.sh",
  "why": "Build and test failures must propagate."
 },
 {
  "id": "lib.agentic-phase-quality-advisory",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "if [[ \"$verdict\" == \"advisory\" ]]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-agentic-phases.sh",
  "why": "Quality checks retain the existing advisory policy."
 },
 {
  "id": "lib.agentic-phase-task-pattern",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "n=$(grep -c \"$pattern\" \"$backlog\" 2>/dev/null)",
  "replace": "n=$(grep -c '^- \\[[xX]\\]' \"$backlog\" 2>/dev/null)",
  "test": "bash linux/scripts/tests/test-agentic-phases.sh",
  "why": "Pending and blocked counts must select the requested task state."
 },
 {
  "id": "ort-chain.web-retry",
  "target": "linux/scripts/03-media/build/onnxruntime/build/50-build-js.sh",
  "find": "sleep 5; npm ci;",
  "replace": "sleep 5; true;",
  "test": "bash linux/scripts/tests/test-onnx-web-build.sh",
  "why": "The one retry must actually invoke npm ci and succeed before continuing."
 },
 {
  "id": "ort-chain.web-failed-lock-fatal",
  "target": "linux/scripts/03-media/build/onnxruntime/build/50-build-js.sh",
  "find": "|| err \"npm ci failed twice in ${label} (lockfile-exact install is mandatory)\"",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-onnx-web-build.sh",
  "why": "Two failed lockfile installs must stop the build in each package directory."
 },
 {
  "id": "ort-chain.web-mjs-only",
  "target": "linux/scripts/03-media/build/onnxruntime/build/50-build-js.sh",
  "find": "&& ! ls \"${directory}\"/*.mjs >/dev/null 2>&1",
  "replace": "&& true",
  "test": "bash linux/scripts/tests/test-onnx-web-build.sh",
  "why": "An mjs-only bundle is valid even when no js files were produced."
 },
 {
  "id": "ort-chain.web-source-artifacts",
  "target": "linux/scripts/03-media/build/onnxruntime/build/50-build-js.sh",
  "find": "require_onnx_web_js \"${ORT_SRC_DIR}/js/web/dist\" \"No .js or .mjs files found in js/web/dist/ after build\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-onnx-web-build.sh",
  "why": "Missing build artifacts must fail at the source verdict, before any success cleanup."
 },
 {
  "id": "ort-chain.web-copied-artifacts",
  "target": "linux/scripts/03-media/build/onnxruntime/build/50-build-js.sh",
  "find": "require_onnx_web_js \"${WASM_OUTPUT_DIR}\" \"JS artifacts copy failed: no .js/.mjs in ${WASM_OUTPUT_DIR} despite dist/ containing them\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-onnx-web-build.sh",
  "why": "An unsuccessful copy must fail even after a successful build and source verdict."
 },
 {
  "id": "gate-fixture.codec-map-difference-direction",
  "target": "linux/scripts/tests/test-codec-so-map-convergence.sh",
  "find": "LC_ALL=C comm -23 \\",
  "replace": "LC_ALL=C comm -13 \\",
  "test": "bash linux/scripts/tests/test-codec-so-map-convergence.sh",
  "why": "Both codec ratchets depend on selecting left-only members, including empty inputs."
 },
 {
  "id": "package.bundle-renderer-failure",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "    appimage) _app_packaging_bundle_appimage ;;",
  "replace": "    appimage) _app_packaging_bundle_appimage || true ;;",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "Renderer failures must propagate without suppressing errexit inside the renderer."
 },
 {
  "id": "package.bundle-artifact-verdict",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  app_packaging_assert_artifact \"$artifact\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "All three format entry points must reject missing or empty artifacts."
 },
 {
  "id": "package.bundle-facts-scope",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  local bundle_dir version package_name binary_name app_id icon_file icon_name out_dir artifact",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "Shared bundle facts must remain local to each packaging invocation."
 },
 {
  "id": "package.bundle-supported-architecture",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "    amd64|arm64) \"$mapper\" \"$raw\" ;;",
  "replace": "    amd64|arm64|riscv64) \"$mapper\" \"$raw\" ;;",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "Shared architecture mapping must retain the supported-format architecture set."
 },
 {
  "id": "package.bundle-desktop-icon",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  cp \"$icon\" \"$7\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "Packaged icon must preserve source bytes."
 },
 {
  "id": "package.bundle-hidden-files",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  cp -a \"$source/.\" \"$destination/\"",
  "replace": "  cp -a \"$source/\"* \"$destination/\"",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "Shared bundle staging must retain hidden files as well as symlinks and executable payloads."
 },
 {
  "id": "tvm-llvm.compiler-c-priority",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "  cc_name=\"gcc-${GCC_WANTED}\"",
  "replace": "  cc_name=gcc",
  "test": "bash linux/scripts/tests/test-tvm-compiler-selection.sh",
  "why": "The pinned C compiler must precede the generic fallback."
 },
 {
  "id": "tvm-llvm.compiler-cxx-fallback",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "|| cxx_name=g++",
  "replace": "|| cxx_name=gcc",
  "test": "bash linux/scripts/tests/test-tvm-compiler-selection.sh",
  "why": "The C++ fallback must remain g++, independently of the C compiler."
 },
 {
  "id": "tvm-llvm.compiler-override-validation",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "command -v \"${CC}\" >/dev/null 2>&1 || die \"CC=${CC} is set but not available\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-tvm-compiler-selection.sh",
  "why": "An unavailable explicit C override must fail validation."
 },
 {
  "id": "tvm-llvm.compiler-wrapper-input",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "\"$llvm_config\" \"$build_dir\" \"$desired_cc\" \"$desired_cxx\"",
  "replace": "\"$llvm_config\" \"$build_dir\" \"$desired_cxx\" \"$desired_cc\"",
  "test": "bash linux/scripts/tests/test-tvm-compiler-selection.sh",
  "why": "The wrapper must receive resolved C and C++ compilers in the original order."
 },
 {
  "id": "lib.logging-prefix-severity",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "    WARN) color=';33' ;;",
  "replace": "    WARN) color=';31' ;;",
  "test": "bash linux/scripts/tests/test-logging-format.sh",
  "why": "Warning colors must retain their exact ANSI sequence."
 },
 {
  "id": "lib.logging-prefix-unknown",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "    *) label=LOG ;;",
  "replace": "    *) label=INFO ;;",
  "test": "bash linux/scripts/tests/test-logging-format.sh",
  "why": "Unrecognized levels retain the LOG label in both formats."
 },
 {
  "id": "lib.logging-prefix-plain",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "_log_prefix_plain() { _log_prefix \"$1\" plain; }",
  "replace": "_log_prefix_plain() { _log_prefix \"$1\" color; }",
  "test": "bash linux/scripts/tests/test-logging-format.sh",
  "why": "Plain output must never acquire ANSI escapes."
 },
 {
  "id": "lib.logging-prefix-no-color",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "  if [ -n \"${NO_COLOR:-}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-logging-format.sh",
  "why": "NO_COLOR must override LOG_COLOR=always."
 },
 {
  "id": "vulkan.shared-attempt-count",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  _vk_attempted=$((_vk_attempted + 1))",
  "replace": "  _vk_attempted=$((_vk_attempted + 0))",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "Each attempted target component must retain its count, including glslang two-pass builds."
 },
 {
  "id": "vulkan.shared-success-count",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  _vk_ok=$((_vk_ok + 1))",
  "replace": "  _vk_ok=$((_vk_ok + 0))",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "Successful required and optional components must contribute to the final SDK verdict."
 },
 {
  "id": "vulkan.shared-install-prefix",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "      -DCMAKE_INSTALL_PREFIX=\"$archdir\" \"$@\"",
  "replace": "      -DCMAKE_INSTALL_PREFIX=/wrong \"$@\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "The shared component launcher must retain each target architecture install prefix and argument order."
 },
 {
  "id": "vulkan.shared-build-failure",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "      -DCMAKE_INSTALL_PREFIX=\"$archdir\" \"$@\"",
  "replace": "      -DCMAKE_INSTALL_PREFIX=\"$archdir\" \"$@\"; return 0",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "A failed component launcher must remain a failure for required-component verdicts."
 },
 {
  "id": "cross-build.python-pkgconfig-suffix",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "cross_target_python_pkgconfig_dir() { _cross_target_python_lib_subdir /pkgconfig \"$@\"; }",
  "replace": "cross_target_python_pkgconfig_dir() { _cross_target_python_lib_subdir '' \"$@\"; }",
  "test": "bash linux/scripts/tests/test-cross-python-paths.sh",
  "why": "The pkg-config directory must retain its suffix while sharing library-directory precedence."
 },
 {
  "id": "cross-build.python-context-version",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "_cross_target_python_build_context() {\n  python_mm=\"$(cross_target_python_major_minor)\" || return 1",
  "replace": "_cross_target_python_build_context() {\n  python_mm=\"$(cross_target_python_major_minor)\" || true",
  "test": "bash linux/scripts/tests/test-cross-python-paths.sh",
  "why": "Failed version resolution must stop before triplet and root probes."
 },
 {
  "id": "cross-build.python-context-scope",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "cross_target_python_arch_include_dir() {\n  local python_mm triplet python_root",
  "replace": "cross_target_python_arch_include_dir() {\n  :",
  "test": "bash linux/scripts/tests/test-cross-python-paths.sh",
  "why": "Shared context assignments must remain in caller-owned locals."
 },
 {
  "id": "cross-build.python-pc-suffix",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "cross_target_python_embed_pc() { _cross_target_python_pc_path -embed; }",
  "replace": "cross_target_python_embed_pc() { _cross_target_python_pc_path ''; }",
  "test": "bash linux/scripts/tests/test-cross-python-paths.sh",
  "why": "The embed pkg-config file must keep its distinct suffix."
 },
 {
  "id": "cross-build.python-pc-directory-failure",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "  pkgconfig_dir=\"$(cross_target_python_pkgconfig_dir)\" || return 1",
  "replace": "  pkgconfig_dir=\"$(cross_target_python_pkgconfig_dir)\" || true",
  "test": "bash linux/scripts/tests/test-cross-python-paths.sh",
  "why": "Unresolved pkg-config directories must fail rather than yield a fabricated path."
 },
 {
  "id": "cross-build.compiler-foreign-nonempty",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "_compiler_target_is_foreign() {\n  [ -n \"$1\" ] || return 1",
  "replace": "_compiler_target_is_foreign() {\n  :",
  "test": "bash linux/scripts/tests/test-compiler-foreign-target.sh",
  "why": "An empty target must skip host and triplet probes."
 },
 {
  "id": "cross-build.compiler-foreign-comparison",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if [ \"$1\" != \"$(build_arch_oci 2>/dev/null || echo amd64)\" ]; then return 0; fi",
  "replace": "  if [ \"$1\" = \"$(build_arch_oci 2>/dev/null || echo amd64)\" ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-compiler-foreign-target.sh",
  "why": "Native targets must skip library repair while foreign targets reach their own triplet policy."
 },
 {
  "id": "cross-build.compiler-foreign-fallback",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if [ \"$1\" != \"$(build_arch_oci 2>/dev/null || echo amd64)\" ]; then return 0; fi",
  "replace": "  if [ \"$1\" != \"$(build_arch_oci 2>/dev/null || echo arm64)\" ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-compiler-foreign-target.sh",
  "why": "A failed build-architecture probe retains the existing amd64 fallback."
 },
 {
  "id": "cross-build.compiler-foreign-raw-target",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if [ \"$1\" != \"$(build_arch_oci 2>/dev/null || echo amd64)\" ]; then return 0; fi",
  "replace": "  if [ \"$(arch_normalize \"$1\")\" != \"$(build_arch_oci 2>/dev/null || echo amd64)\" ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-compiler-foreign-target.sh",
  "why": "The existing guard compares raw target spelling rather than normalizing aliases."
 },
 {
  "id": "wheels.torch-vision-clone-options",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "_wheelhouse_prepare_torch_source PyTorch https://github.com/pytorch/pytorch.git \"${PYTORCH_REF}\" --recursive --shallow-submodules",
  "replace": "_wheelhouse_prepare_torch_source PyTorch https://github.com/pytorch/pytorch.git \"${PYTORCH_REF}\"",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Torch must retain recursive shallow-submodule cloning while vision does not gain those options."
 },
 {
  "id": "wheels.torch-vision-vision-ref",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "_wheelhouse_prepare_torch_source torchvision https://github.com/pytorch/vision.git \"${TORCHVISION_REF}\"",
  "replace": "_wheelhouse_prepare_torch_source torchvision https://github.com/pytorch/vision.git \"${PYTORCH_REF}\"",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Vision must clone its own ref rather than the torch source ref."
 },
 {
  "id": "wheels.torch-vision-vision-host",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    if ! install_host_torch_for_vision; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Vision host installation remains before platform resolution and is a fatal precondition."
 },
 {
  "id": "wheels.torch-vision-vision-patch",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    patch_torchvision_setup \"${src_dir}/setup.py\" || {",
  "replace": "    true || {",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Vision must patch its own source before resetting dist or running setup."
 },
 {
  "id": "wheels.torch-vision-repair-order",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    _torch_ensure_c_extension \"${dist_dir}\" || return 1\n    _wheelhouse_collect_component torch PyTorch built_wheels",
  "replace": "    :\n    _wheelhouse_collect_component torch PyTorch built_wheels",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Torch C-extension repair must precede retagging and collection."
 },
 {
  "id": "wheels.torch-vision-retag-failure",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    retag_directory_wheels \"${dist_dir}\" \"$component\" \"${wheel_platform}\" \"${BUILD_PYTHON}\" || return 1",
  "replace": "    retag_directory_wheels \"${dist_dir}\" \"$component\" \"${wheel_platform}\" \"${BUILD_PYTHON}\" || true",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Retagging failures must stop before copying a wheel with the wrong platform tag."
 },
 {
  "id": "wheels.torch-vision-copy-failure",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    cp -a \"${collected_wheels[@]}\" \"${APP_WHEELHOUSE_DIR}/\" || return 1",
  "replace": "    cp -a \"${collected_wheels[@]}\" \"${APP_WHEELHOUSE_DIR}/\" || true",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Collection must not announce or extract a wheel after copying failed."
 },
 {
  "id": "wheels.torch-vision-first-wheel",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    TARGET_TORCH_WHEEL=\"${APP_WHEELHOUSE_DIR}/$(basename \"${built_wheels[0]}\")\"",
  "replace": "    TARGET_TORCH_WHEEL=\"${APP_WHEELHOUSE_DIR}/$(basename \"${built_wheels[1]}\")\"",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Torch globals retain selection of the first wheel in collection order."
 },
 {
  "id": "wheels.torch-vision-sysconfig-failure",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    [ \"$sysconfig_rc\" -eq 0 ] || return \"$sysconfig_rc\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Failed target sysconfig resolution must not proceed to clone and build."
 },
 {
  "id": "wheels.torch-vision-scope",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    local wheel_platform=\"\" src_dir=\"${APP_WHEELHOUSE_BUILD_ROOT}/$2\" dist_dir=\"${APP_WHEELHOUSE_BUILD_ROOT}/$3\"",
  "replace": "    wheel_platform=\"\" src_dir=\"${APP_WHEELHOUSE_BUILD_ROOT}/$2\" dist_dir=\"${APP_WHEELHOUSE_BUILD_ROOT}/$3\"",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "Shared component state must remain local rather than overwrite the caller."
 },
 {
  "id": "wheels.torch-vision-free-threaded-pass",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    _collect_torch_wheel || return 1\n    _torch_build_free_threaded_wheel",
  "replace": "    _collect_torch_wheel || return 1\n    :",
  "test": "bash linux/scripts/tests/test-torch-wheelhouse.sh",
  "why": "The free-threaded pass still follows successful torch collection and propagates its failure."
 },
 {
  "id": "gst.cross-prepare-native-guard",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "  if [ \"${BUILD_MODE:-native}\" = cross ] && { [ -z \"${CC:-}\" ] || [ -z \"${CXX:-}\" ]; }; then",
  "replace": "  if [ \"${BUILD_MODE:-native}\" != cross ] && { [ -z \"${CC:-}\" ] || [ -z \"${CXX:-}\" ]; }; then",
  "test": "bash linux/scripts/tests/test-gstreamer-cross-prepare.sh",
  "why": "Native mode must not invoke the optional cross compiler resolver."
 },
 {
  "id": "gst.cross-prepare-one-missing-compiler",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "{ [ -z \"${CC:-}\" ] || [ -z \"${CXX:-}\" ]; }",
  "replace": "{ [ -z \"${CC:-}\" ] && [ -z \"${CXX:-}\" ]; }",
  "test": "bash linux/scripts/tests/test-gstreamer-cross-prepare.sh",
  "why": "Either missing compiler export is sufficient to require cross-compiler repair."
 },
 {
  "id": "gst.cross-prepare-optional-resolver",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "    if command -v resolve_cross_cc_cxx_for_arch >/dev/null 2>&1; then",
  "replace": "    if true; then",
  "test": "bash linux/scripts/tests/test-gstreamer-cross-prepare.sh",
  "why": "Older SDKs without the resolver must remain quiet and successful under errexit."
 },
 {
  "id": "gst.cross-prepare-resolver-failure",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "      resolve_cross_cc_cxx_for_arch || true",
  "replace": "      resolve_cross_cc_cxx_for_arch",
  "test": "bash linux/scripts/tests/test-gstreamer-cross-prepare.sh",
  "why": "Resolver failure remains advisory for the stage, including strict callers."
 },
 {
  "id": "gst.cross-prepare-stage-wiring",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-stage.sh",
  "find": "\nmedia_prepare_cross_compilers\n",
  "replace": "\n:\n",
  "test": "bash linux/scripts/tests/test-gstreamer-cross-prepare.sh",
  "why": "The stage must invoke shared compiler repair before its distinct runtime repairs."
 },
 {
  "id": "gst.cross-prepare-monorepo-wiring",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "  media_prepare_cross_compilers\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-gstreamer-meson-flags.sh",
  "why": "The monorepo must retain compiler repair between Python configuration and Meson cross flags."
 },
 {
  "id": "gst.cross-prepare-legacy-fallback",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-stage.sh",
  "find": "  if command -v fix_libstdcxx_symlink >/dev/null 2>&1; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-gstreamer-cross-prepare.sh",
  "why": "An absent SDK repair helper must still reach the existing guarded libstdc++ fallback."
 },
 {
  "id": "gst.cross-prepare-runtime-pin",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-stage.sh",
  "find": "_gst_pin_target_libstdcxx() {\n  pin_target_libstdcxx \"${TARGET_ARCH:-${TARGETARCH:-}}\"\n}",
  "replace": "_gst_pin_target_libstdcxx() {\n  :\n}",
  "test": "bash linux/scripts/tests/test-gstreamer-cross-prepare.sh",
  "why": "The existing stage-only runtime pin remains after compiler and link repair."
 },
 {
  "id": "lib.harness-lifted-module-arguments",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "-ArgumentList $ArgumentList\n        try",
  "replace": "-ArgumentList @()\n        try",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','Harness.Fixtures.Tests.ps1','-ResultFile','logs/code-quality/harness-lifted-module-arguments.json'],check=True); d=json.load(open('logs/code-quality/harness-lifted-module-arguments.json',encoding='utf-8-sig')); assert d['Total']>=9 and d['Total']==d['Passed'] and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "Lifted module fixtures preserve constructor arguments, body arguments and module cleanup."
 },
 {
  "id": "lib.harness-lifted-body-arguments",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "& $mutantBody @BodyArgumentList",
  "replace": "& $mutantBody",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','Harness.Fixtures.Tests.ps1','-ResultFile','logs/code-quality/harness-lifted-body-arguments.json'],check=True); d=json.load(open('logs/code-quality/harness-lifted-body-arguments.json',encoding='utf-8-sig')); assert d['Total']>=9 and d['Total']==d['Passed'] and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "Lifted module fixtures preserve constructor arguments, body arguments and module cleanup."
 },
 {
  "id": "lib.harness-lifted-cleanup",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "finally { Remove-Module $m -Force }",
  "replace": "finally { }",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','Harness.Fixtures.Tests.ps1','-ResultFile','logs/code-quality/harness-lifted-cleanup.json'],check=True); d=json.load(open('logs/code-quality/harness-lifted-cleanup.json',encoding='utf-8-sig')); assert d['Total']>=9 and d['Total']==d['Passed'] and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "Lifted module fixtures preserve constructor arguments, body arguments and module cleanup."
 },
 {
  "id": "lib.parallel-loop-fixture-child-source",
  "target": "linux/scripts/tests/test-parallel-loop.sh",
  "find": "  printf 'source %q\\n' \"${CORE_DIR}/platform.sh\" \"${CORE_DIR}/parallel-loop.sh\"",
  "replace": "  printf 'source %q\\n' \"${CORE_DIR}/platform.sh\"",
  "test": "bash linux/scripts/tests/test-parallel-loop.sh",
  "why": "Caller and fail-fast fixtures must execute the real loop library in their child shell."
 },
 {
  "id": "lib.parallel-loop-fixture-child-truthy",
  "target": "linux/scripts/tests/test-parallel-loop.sh",
  "find": "  t_fn_src \"${CORE_DIR}/build-helpers.sh\" _bool_truthy || return 1",
  "replace": "  printf '_bool_truthy() { return 1; }\\n'",
  "test": "bash linux/scripts/tests/test-parallel-loop.sh",
  "why": "The shared child predicate must preserve fail-fast selection instead of running every architecture."
 },
 {
  "id": "lib.repository-refresh-tags-fallback",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "|| git -C \"$1\" fetch --depth 1 --tags 2>/dev/null || true",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-repository-refresh.sh",
  "why": "An unavailable shallow ref must still attempt the existing tag-fetch fallback."
 },
 {
  "id": "lib.repository-refresh-best-effort",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "|| git -C \"$1\" fetch --depth 1 --tags 2>/dev/null || true",
  "replace": "|| git -C \"$1\" fetch --depth 1 --tags 2>/dev/null || return 1",
  "test": "bash linux/scripts/tests/test-repository-refresh.sh",
  "why": "Both callers tolerate failed fetch attempts and retain their distinct checkout policies."
 },
 {
  "id": "probe.cli-named-assignment",
  "target": "linux/scripts/01-core/cli-parsers.sh",
  "find": "    _pnbf_value=\"$6\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-cli-parsers.sh",
  "why": "every named project flag writes its designated caller variable, including raw empty and option-shaped values"
 },
 {
  "id": "probe.cli-named-consumption",
  "target": "linux/scripts/01-core/cli-parsers.sh",
  "find": "    _pnbf_value=\"$6\"\n    return 2",
  "replace": "    _pnbf_value=\"$6\"\n    return 1",
  "test": "bash linux/scripts/tests/test-cli-parsers.sh",
  "why": "named value options consume two arguments so dispatcher validation rejects empty and swallowed values"
 },
 {
  "id": "probe.cli-empty-unknown",
  "target": "linux/scripts/01-core/cli-parsers.sh",
  "find": "  [ -n \"$5\" ] || return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-cli-parsers.sh",
  "why": "empty arguments remain quiet unknown inputs rather than becoming invalid associative subscripts"
 },
 {
  "id": "probe.cli-runtime-wrapper-alias",
  "target": "linux/scripts/01-core/cli-parsers.sh",
  "find": "[--torch-dockerfile]=\"$6\"",
  "replace": "[--torch-dockerfile]=\"$5\"",
  "test": "bash linux/scripts/tests/test-cli-parsers.sh",
  "why": "the legacy torch Dockerfile alias writes the wrapper destination and leaves the package destination alone"
 },
 {
  "id": "lib.compiler-target-fatal-verdict",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "    echo \"ERROR: ${fatal_message}\" >&2\n    exit 1",
  "replace": "    echo \"ERROR: ${fatal_message}\" >&2\n    return 0",
  "test": "bash linux/scripts/tests/test-compiler-target-verdicts.sh",
  "why": "mandatory target mismatches must exit nonzero"
 },
 {
  "id": "lib.compiler-target-advisory-accounting",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  validate_fail \"${gate}\" \"${message}\"",
  "replace": "  : \"${gate}\" \"${message}\"",
  "test": "bash linux/scripts/tests/test-compiler-target-verdicts.sh",
  "why": "advisory target mismatches must increment aggregate compiler errors"
 },
 {
  "id": "lib.compiler-target-artifact-elf",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "if [ -n \"${expected_machine}\" ] && _vc_elf_header_matches \"${machine}\" \"${expected_machine}\"; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-compiler-target-verdicts.sh",
  "why": "version fallback must reject a wrong target-native GCC or LLVM ELF machine"
 },
 {
  "id": "lib.tvm-argv-fixture-vulkan-include-order",
  "target": "linux/scripts/05-frameworks/tvm-config.sh",
  "find": "-DVulkan_INCLUDE_DIR=\"${4}\"",
  "replace": "-DVulkan_INCLUDE_DIR=\"${3}\"",
  "test": "bash linux/scripts/tests/test-tvm-cmake-args.sh",
  "why": "Shared fixtures retain complete ordered argv and global state assertions, including independent opt-outs and ambient precedence."
 },
 {
  "id": "lib.tvm-argv-fixture-cuda-independent-optout",
  "target": "linux/scripts/05-frameworks/tvm-config.sh",
  "find": "${TVM_USE_CUBLAS:-1}",
  "replace": "${TVM_USE_CUDNN:-1}",
  "test": "bash linux/scripts/tests/test-tvm-cmake-args.sh",
  "why": "Shared fixtures retain complete ordered argv and global state assertions, including independent opt-outs and ambient precedence."
 },
 {
  "id": "lib.tvm-argv-fixture-ambient-llvm-order",
  "target": "linux/scripts/05-frameworks/tvm-config.sh",
  "find": "${3}${CMAKE_IGNORE_PATH:+;${CMAKE_IGNORE_PATH}}",
  "replace": "${CMAKE_IGNORE_PATH:+${CMAKE_IGNORE_PATH};}${3}",
  "test": "bash linux/scripts/tests/test-tvm-cmake-args.sh",
  "why": "Shared fixtures retain complete ordered argv and global state assertions, including independent opt-outs and ambient precedence."
 },
 {
  "id": "lib.tvm-argv-fixture-qnn-global-export",
  "target": "linux/scripts/05-frameworks/tvm-config.sh",
  "find": "TVM_QNN_HOME=\"$(resolve_qnn_sdk)\"",
  "replace": "local TVM_QNN_HOME=\"$(resolve_qnn_sdk)\"",
  "test": "bash linux/scripts/tests/test-tvm-cmake-args.sh",
  "why": "Shared fixtures retain complete ordered argv and global state assertions, including independent opt-outs and ambient precedence."
 },
 {
  "id": "lib.smoke-object-cleanup",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  rm -rf \"${temporary}\" || cleanup_status=$?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-smoke-object-lifecycle.sh",
  "why": "Compiler and verifier failures must not leave their temporary object directories behind."
 },
 {
  "id": "lib.smoke-object-compile-failure",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    status=1\n  fi\n  rm -rf \"${temporary}\" || cleanup_status=$?",
  "replace": "    status=0\n  fi\n  rm -rf \"${temporary}\" || cleanup_status=$?",
  "test": "bash linux/scripts/tests/test-smoke-object-lifecycle.sh",
  "why": "A compiler failure must fail its object probe and retain caller-owned diagnostic accounting."
 },
 {
  "id": "lib.smoke-object-verifier-status",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "\"${verifier}\" \"${temporary}/${name}\" \"$@\" || status=$?",
  "replace": "\"${verifier}\" \"${temporary}/${name}\" \"$@\" || true",
  "test": "bash linux/scripts/tests/test-smoke-object-lifecycle.sh",
  "why": "A failed verifier must return its actual status after cleanup."
 },
 {
  "id": "lib.smoke-object-cleanup-status",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  [ \"${status}\" -ne 0 ] || status=\"${cleanup_status}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-smoke-object-lifecycle.sh",
  "why": "Failed object-directory cleanup must not report a successful probe or leave its caller green."
 },
 {
  "id": "lib.smoke-media-cross-import-skip",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "if cross_build_is_active 2>/dev/null; then\n    mode=cross",
  "replace": "if false; then\n    mode=cross",
  "test": "bash linux/scripts/tests/test-media-onnx-policy.sh",
  "why": "cross media probes must not execute foreign Python modules"
 },
 {
  "id": "lib.smoke-media-library-presence",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "if _smoke_query_matches _smoke_python_files _smoke_python_match \"$@\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-media-onnx-policy.sh",
  "why": "native import failures defer only when a real library exists; cross required ORT needs presence"
 },
 {
  "id": "lib.smoke-media-required-ort-missing",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "cross:missing) fail \"onnxruntime library not found at $3\"",
  "replace": "cross:missing) echo \"onnxruntime library not found at $3\"",
  "test": "bash linux/scripts/tests/test-media-onnx-policy.sh",
  "why": "missing required cross ORT must increment smoke failures while GenAI stays optional"
 },
 {
  "id": "lib.fixture-sharing-disk-oldest-first",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "ls -1tr \"${bc_dir}\"",
  "replace": "ls -1t \"${bc_dir}\"",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "Shared fixtures retain oldest-first and in-flight safety checks and parser refusal and rollback assertions."
 },
 {
  "id": "lib.fixture-sharing-disk-in-flight",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "if [ \"${in_flight}\" = \"1\" ]; then",
  "replace": "if [ \"${in_flight}\" = \"9\" ]; then",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "Shared fixtures retain oldest-first and in-flight safety checks and parser refusal and rollback assertions."
 },
 {
  "id": "lib.fixture-sharing-audit-json-duplicates",
  "target": "linux/scripts/renovate_audit.py",
  "find": "raise Unreadable(_duplicate(\"object\", key))",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-renovate-audit.sh",
  "why": "Shared fixtures retain oldest-first and in-flight safety checks and parser refusal and rollback assertions."
 },
 {
  "id": "lib.fixture-sharing-audit-rollback-mtime",
  "target": "linux/scripts/renovate_planner.py",
  "find": "os.utime(target[\"path\"], ns=(was.st_atime_ns, was.st_mtime_ns))",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-renovate-audit.sh",
  "why": "Shared fixtures retain oldest-first and in-flight safety checks and parser refusal and rollback assertions."
 },
 {
  "id": "arg-consistency.shared-declaration-callback",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "      \"$checker\" \"$df\" \"$df_path\" \"$var\" \"$val_raw\" \"${_version_values[$var]}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "both defaulted and defaultless declaration traversals must execute the requested verifier"
 },
 {
  "id": "arg-consistency.shared-empty-pins-skipped",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "      [ -n \"${_version_values[$var]:-}\" ] || continue",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "unrecognized and empty versions.env pins remain outside all declaration checks"
 },
 {
  "id": "arg-consistency.defaultless-per-file-unique",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "grep -oP \"$pattern\" \"$df_path\" | sort -u || true",
  "replace": "grep -oP \"$pattern\" \"$df_path\" || true",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "repeated defaultless declarations count once within each Dockerfile"
 },
 {
  "id": "arg-consistency.forwarding-warning-count",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "    MISSING=$((MISSING + 1))",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "every unforwarded literal declaration contributes to the advisory summary count"
 },
 {
  "id": "arg-consistency.default-drift-count",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "    VALUE_ERRORS=$((VALUE_ERRORS + 1))",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "all literal drifts contribute to the fatal total including repeated declarations and separate Dockerfiles"
 },
 {
  "id": "arg-consistency.defaultless-error-count",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "    DEFAULTLESS_ERRORS=$((DEFAULTLESS_ERRORS + 1))",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "missing safety-net defaults increment the fatal count while Android guarded consumers remain exempt"
 },
 {
  "id": "arg-consistency.fatal-summary-exits",
  "target": "linux/scripts/01-core/verify-arg-consistency.sh",
  "find": "_fail_arg_consistency() {\n  printf '%s\\n' \"$@\"\n  exit 1",
  "replace": "_fail_arg_consistency() {\n  printf '%s\\n' \"$@\"\n  return 0",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "fatal default, GCC-literal and hand-forward verdicts must terminate before subsequent sections"
 },
 {
  "id": "lib.host-arch-argument-first",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "  _platform_arch_or_host \"${1:-${TARGETARCH:-}}\"",
  "replace": "  _platform_arch_or_host \"${TARGETARCH:-${1:-}}\"",
  "test": "bash linux/scripts/tests/test-host-arch-resolution.sh",
  "why": "An explicit target argument must take precedence over the environment architecture."
 },
 {
  "id": "lib.host-arch-build-platform",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    raw=\"${BUILDPLATFORM##*/}\"",
  "replace": "    raw=\"${TARGETARCH:-}\"",
  "test": "bash linux/scripts/tests/test-host-arch-resolution.sh",
  "why": "Build architecture follows BUILDPLATFORM independently of the target architecture."
 },
 {
  "id": "lib.host-arch-uname-fallback",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    raw=\"$(uname -m 2>/dev/null || echo unknown)\"",
  "replace": "    raw=unknown",
  "test": "bash linux/scripts/tests/test-host-arch-resolution.sh",
  "why": "Missing or failed dpkg must fall back to uname while preserving empty and partial probe output."
 },
 {
  "id": "lib.cross-python-version-delegation",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "  host_python_major_minor\n}",
  "replace": "  host_python_bin\n}",
  "test": "bash linux/scripts/tests/test-cross-python-version.sh",
  "why": "The target Python version must delegate shared pin handling and host-version probing to the existing host-version owner."
 },
 {
  "id": "lib.code-quality-extension-config",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "local -n configured=\"$configured_name\"",
  "replace": "local -n configured=CODE_QUALITY_CPP_FORMAT_EXTENSIONS",
  "test": "bash linux/scripts/tests/test-code-quality-walk.sh",
  "why": "Shared fixtures retain configured extension isolation, all roots, caller arrays, guarded launchers and parent-shell address exports."
 },
 {
  "id": "lib.code-quality-extension-roots",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  _code_quality_find_sources \"$@\"",
  "replace": "  _code_quality_find_sources \"$1\"",
  "test": "bash linux/scripts/tests/test-code-quality-walk.sh",
  "why": "Shared fixtures retain configured extension isolation, all roots, caller arrays, guarded launchers and parent-shell address exports."
 },
 {
  "id": "lib.code-quality-extension-empty-root",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  shift 2\n  [[ $# -gt 0 ]] || return 0",
  "replace": "  shift 2",
  "test": "bash linux/scripts/tests/test-code-quality-walk.sh",
  "why": "Shared fixtures retain configured extension isolation, all roots, caller arrays, guarded launchers and parent-shell address exports."
 },
 {
  "id": "lib.code-quality-extension-caller-array",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "local exts=(\"${configured[@]:-}\")",
  "replace": "local -n exts=\"$configured_name\"",
  "test": "bash linux/scripts/tests/test-code-quality-walk.sh",
  "why": "Shared fixtures retain configured extension isolation, all roots, caller arrays, guarded launchers and parent-shell address exports."
 },
 {
  "id": "lib.compiler-cache-guarded-fixture",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "      printf '%s' \"${_scl}\"",
  "replace": "      printf '%s' sccache",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "Shared fixtures retain configured extension isolation, all roots, caller arrays, guarded launchers and parent-shell address exports."
 },
 {
  "id": "lib.compiler-cache-caller-address-fixture",
  "target": "linux/scripts/01-core/compiler-cache.sh",
  "find": "mkdir -p \"${SCCACHE_DIR}\" 2>/dev/null || true\n  sccache_export_server_address || return 1",
  "replace": "mkdir -p \"${SCCACHE_DIR}\" 2>/dev/null || true\n  (sccache_export_server_address) || return 1",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "Shared fixtures retain configured extension isolation, all roots, caller arrays, guarded launchers and parent-shell address exports."
 },
 {
  "id": "lib.runtime-probe-environment",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_rt_run -e \"${variable}=${program}\" bash -lc \"${command}\"",
  "replace": "_rt_run -e \"${variable}=\" bash -lc \"${command}\"",
  "test": "bash linux/scripts/tests/test-runtime-probe-transport.sh",
  "why": "probe scripts must cross the image environment boundary unchanged"
 },
 {
  "id": "lib.runtime-probe-empty-marker",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "then echo \"%s\"; exit 4; fi",
  "replace": "then echo \"mutated-%s\"; exit 4; fi",
  "test": "bash linux/scripts/tests/test-runtime-probe-transport.sh",
  "why": "empty probe transport preserves discriminating per-probe markers instead of silent stdin success"
 },
 {
  "id": "lib.runtime-config-property",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": ".get('$1','')",
  "replace": ".get('WorkingDir','')",
  "test": "bash linux/scripts/tests/test-runtime-probe-transport.sh",
  "why": "metadata reads must use the requested Config field; entrypoint and image USER are required independently of WORKDIR"
 },
 {
  "id": "lib.llvm-builder-priority",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "\"${script_dir}/build-clang.sh\" /opt/scripts/toolchain/build-clang.sh",
  "replace": "/opt/scripts/toolchain/build-clang.sh \"${script_dir}/build-clang.sh\"",
  "test": "bash linux/scripts/tests/test-llvm-builder-path.sh",
  "why": "LLVM builder discovery must prefer its sibling script over the installed container fallback."
 },
 {
  "id": "critical-fixes.all-patterns-probed",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    grep \"$1\" -- \"$2\" \"$3\" || return $?",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-critical-source-pattern.sh",
  "why": "compound success requires every grep clause to execute and match"
 },
 {
  "id": "critical-fixes.all-patterns-short-circuit",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    grep \"$1\" -- \"$2\" \"$3\" || return $?",
  "replace": "    grep \"$1\" -- \"$2\" \"$3\" || :",
  "test": "bash linux/scripts/tests/test-critical-source-pattern.sh",
  "why": "a missing earlier clause must fail the compound and stop later probes"
 },
 {
  "id": "critical-fixes.batch-retains-later-verdicts",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    shift 5",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-critical-source-pattern.sh",
  "why": "batched positive checks keep later verdicts observable after an earlier failure"
 },
 {
  "id": "critical-fixes.quiet-probe-diagnostics",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    \"$@\" 2>/dev/null || result=$?",
  "replace": "    \"$@\" || result=$?",
  "test": "bash linux/scripts/tests/test-critical-source-pattern.sh",
  "why": "quiet source probes retain their stderr suppression while still recording the failure"
 },
 {
  "id": "critical-fixes.corpus-record-path",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    p = substr(line, 1, index(line, \":\") - 1)",
  "replace": "    p = \"\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "both corpus consumers preserve the source path while sharing record parsing"
 },
 {
  "id": "critical-fixes.corpus-record-case",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    t = tolower(substr(rest, index(rest, \":\") + 1))",
  "replace": "    t = substr(rest, index(rest, \":\") + 1)",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "both the rule judge and environment-write reader normalize source text before case-insensitive matching"
 },
 {
  "id": "lib.ghcr-version-tag-lookup",
  "target": "linux/host-config/ghcr_metadata.py",
  "find": "    return version.get(\"metadata\", {}).get(\"container\", {}).get(\"tags\", [])",
  "replace": "    return []",
  "test": "bash linux/scripts/tests/test-ghcr-prune-keepset.sh",
  "why": "tagged inventory versions must remain visible to the keep-set and minimum-tag sanity gate"
 },
 {
  "id": "lib.ghcr-inventory-tag-column",
  "target": "linux/host-config/ghcr_metadata.py",
  "find": "            tags = \",\".join(version_tags(version))",
  "replace": "            tags = \"\"",
  "test": "bash linux/scripts/tests/test-ghcr-prune-keepset.sh",
  "why": "the shared inventory renderer preserves every tag and alias in the TSV column"
 },
 {
  "id": "lib.ghcr-current-tag-count",
  "target": "linux/host-config/ghcr_metadata.py",
  "find": "        print(len(version_tags(payload)))",
  "replace": "        print(0)",
  "test": "bash linux/scripts/tests/test-ghcr-prune-keepset.sh",
  "why": "the immediate pre-delete reread must skip a version that gained a tag after inventory"
 },
 {
  "id": "lib.ghcr-delete-metadata-companion",
  "target": "linux/host-config/ghcr-delete-tags.sh",
  "find": "[ -r \"${_GHCR_SH_DIR}/ghcr_metadata.py\" ] || err \"missing companion ghcr_metadata.py\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ghcr-delete-tags.sh",
  "why": "a copied delete tool missing its metadata companion refuses before credential exchange or registry requests"
 },
 {
  "id": "lib.ghcr-prune-metadata-companion",
  "target": "linux/host-config/ghcr-prune-package.sh",
  "find": "[ -r \"${_GHCR_SH_DIR}/ghcr_metadata.py\" ] || err \"missing companion ghcr_metadata.py\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ghcr-delete-tags.sh",
  "why": "a copied prune tool missing its metadata companion refuses before credential exchange or registry requests"
 },
 {
  "id": "lib.runtime-config-missing-verdict",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  else\n    \"$3\" \"$4\"\n  fi\n  echo \"\"\n}",
  "replace": "  else\n    echo \"$4\"\n  fi\n  echo \"\"\n}",
  "test": "bash linux/scripts/tests/test-runtime-probe-transport.sh",
  "why": "missing ENTRYPOINT must increment failures while missing WORKDIR and VOLUME remain informational"
 },
 {
  "id": "web-smoke.size-strict-boundary",
  "target": "linux/webserver/scripts/flutter_integration_smoke_test.sh",
  "find": "if [ \"$result\" -gt \"$2\" ]; then",
  "replace": "if [ \"$result\" -ge \"$2\" ]; then",
  "test": "bash linux/scripts/tests/test-flutter-smoke-test.sh",
  "why": "JavaScript artifacts exactly at their distinct minimum sizes remain too small."
 },
 {
  "id": "web-smoke.size-download-failure",
  "target": "linux/webserver/scripts/flutter_integration_smoke_test.sh",
  "find": "result=\"$(curl -s -o /dev/null -w \"%{size_download}\" \"$BASE_URL/$1\")\" || exit \"$?\"",
  "replace": "result=\"$(curl -s -o /dev/null -w \"%{size_download}\" \"$BASE_URL/$1\")\" || true",
  "test": "bash linux/scripts/tests/test-flutter-smoke-test.sh",
  "why": "A failed curl must preserve its exit status even when it emits a plausible byte count."
 },
 {
  "id": "lib.bootstrap-adjacent-companion",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  [ \"$priority\" = core-paths-only ] || candidates=(\"${script_dir}/${leaf}\")",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-toolchain-bootstrap.sh",
  "why": "Shared toolchain bootstrap preserves adjacent and caller-specific companion precedence, required ELF fallback and normal errexit behavior."
 },
 {
  "id": "lib.bootstrap-common-precedence",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "\"$script_dir\" common.sh mounted-first",
  "replace": "\"$script_dir\" common.sh",
  "test": "bash linux/scripts/tests/test-toolchain-bootstrap.sh",
  "why": "Shared toolchain bootstrap preserves adjacent and caller-specific companion precedence, required ELF fallback and normal errexit behavior."
 },
 {
  "id": "lib.bootstrap-build-helper-precedence",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "\"$script_dir\" build-helpers.sh",
  "replace": "\"$script_dir\" build-helpers.sh mounted-first",
  "test": "bash linux/scripts/tests/test-toolchain-bootstrap.sh",
  "why": "Shared toolchain bootstrap preserves adjacent and caller-specific companion precedence, required ELF fallback and normal errexit behavior."
 },
 {
  "id": "lib.bootstrap-elf-fallback",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  source_toolchain_elf_strip \"${script_dir}\"",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-toolchain-bootstrap.sh",
  "why": "Shared toolchain bootstrap preserves adjacent and caller-specific companion precedence, required ELF fallback and normal errexit behavior."
 },
 {
  "id": "lib.bootstrap-source-failure",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "    source \"$candidate\"",
  "replace": "    source \"$candidate\" || true",
  "test": "bash linux/scripts/tests/test-toolchain-bootstrap.sh",
  "why": "Shared toolchain bootstrap preserves adjacent and caller-specific companion precedence, required ELF fallback and normal errexit behavior."
 },
 {
  "id": "lib.required-platform-symbol",
  "target": "linux/scripts/01-core/module-bootstrap.sh",
  "find": "  command -v \"${symbol}\" >/dev/null 2>&1 \\",
  "replace": "  true \\",
  "test": "bash linux/scripts/tests/test-media-platform-bootstrap.sh",
  "why": "selected platform candidates missing elf_unresolved_needed must fail closed without trying another platform"
 },
 {
  "id": "lib.torch-bootstrap-copy",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --chmod=755 linux/scripts/01-core/module-bootstrap.sh linux/scripts/01-core/logging.sh",
  "replace": "COPY --chmod=755 linux/scripts/01-core/logging.sh",
  "test": "bash linux/scripts/tests/test-media-platform-bootstrap.sh",
  "why": "Torch must ship the bootstrap companion its venv gate sources before requiring the ELF walker"
 },
 {
  "id": "lib.module-bootstrap-source-runs",
  "target": "linux/scripts/01-core/module-bootstrap.sh",
  "find": "      source \"${_bsf_candidate}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-module-bootstrap.sh",
  "why": "the first existing module is sourced before framework or required-symbol validation"
 },
 {
  "id": "lib.module-bootstrap-first-existing-wins",
  "target": "linux/scripts/01-core/module-bootstrap.sh",
  "find": "      break",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-module-bootstrap.sh",
  "why": "later candidates must not hide the selected installed module or replace its framework"
 },
 {
  "id": "lib.module-bootstrap-framework-initializes",
  "target": "linux/scripts/01-core/module-bootstrap.sh",
  "find": "  source_modules_framework \"${caller_dir}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-module-bootstrap.sh",
  "why": "module bootstrap initializes exactly the selected framework with the original caller directory"
 },
 {
  "id": "lib.module-bootstrap-missing-module-fatal",
  "target": "linux/scripts/01-core/module-bootstrap.sh",
  "find": "  [ \"${_bsm_found}\" -eq 1 ]",
  "replace": "  true",
  "test": "bash linux/scripts/tests/test-module-bootstrap.sh",
  "why": "no existing module must retain the exact fatal diagnostic instead of continuing into imports"
 },
 {
  "id": "lib.module-bootstrap-selected-flag",
  "target": "linux/scripts/01-core/module-bootstrap.sh",
  "find": "      _bsf_found=1",
  "replace": "      _bsf_found=0",
  "test": "bash linux/scripts/tests/test-module-bootstrap.sh",
  "why": "successful selection must be reported through the output flag without making source conditional"
 },
 {
  "id": "lib.module-bootstrap-sdk-companion-copy",
  "target": "linux/scripts/script-closures/core-common.txt",
  "find": "01-core/module-bootstrap.sh|core/module-bootstrap.sh\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-module-bootstrap.sh",
  "why": "the SDK must ship the bootstrap companion used before setup-dependencies loads its modules"
 },
 {
  "id": "lib.cross-verification-override",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    _rcvt_targets=\"$(cross_effective_targets_raw)\"",
  "replace": "    _rcvt_targets=\"$3\"",
  "test": "bash linux/scripts/tests/test-cross-verification-targets.sh",
  "why": "An available resolver overrides legacy fallback arguments, including an explicitly empty resolved list."
 },
 {
  "id": "lib.cross-verification-normalize",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "if _rcvt_targets=\"$(arch_list_csv_normalize \"${_rcvt_targets}\")\"; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-cross-verification-targets.sh",
  "why": "Verification dispatch must normalize aliases and reject unsupported lists before invoking per-target checks."
 },
 {
  "id": "lib.cross-verification-resolver-status",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    _rcvt_targets=\"$(cross_effective_targets_raw)\"",
  "replace": "    _rcvt_targets=\"$(cross_effective_targets_raw || true)\"",
  "test": "bash linux/scripts/tests/test-cross-verification-targets.sh",
  "why": "Resolver failures must preserve ordinary errexit even when they produce a partial target list."
 },
 {
  "id": "lib.onnx-native-build-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "cmake --build \"${build_dir}/${config}\" --config \"${config}\" --parallel 1 --verbose || true\n    fi\n    exit 1",
  "replace": "cmake --build \"${build_dir}/${config}\" --config \"${config}\" --parallel 1 --verbose || true\n    fi\n    return 0",
  "test": "bash linux/scripts/tests/test-onnx-native-lifecycle.sh",
  "why": "native CPU and AMD build failures remain fatal after advisory cross diagnostics"
 },
 {
  "id": "lib.onnx-native-collect-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  collect_wheels_from_tree \"${build_dir}\" \"${output_dir}\" \"${wheel_label}\"",
  "replace": "  collect_wheels_from_tree \"${build_dir}\" \"${output_dir}\" \"${wheel_label}\" || true",
  "test": "bash linux/scripts/tests/test-onnx-native-lifecycle.sh",
  "why": "wheel collection failures must not silently continue to source fallback"
 },
 {
  "id": "lib.onnx-native-cross-no-source-wheel",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "if [ -z \"$(ls -A \"${output_dir}/wheels\" 2>/dev/null || true)\" ] && { ! cross_build_is_active; }; then",
  "replace": "if [ -z \"$(ls -A \"${output_dir}/wheels\" 2>/dev/null || true)\" ]; then",
  "test": "bash linux/scripts/tests/test-onnx-native-lifecycle.sh",
  "why": "source wheel fallback is native-only even when a cross build produced no wheel"
 },
 {
  "id": "lib.litert-web-core-subdir",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "\"${output}${subdir:+/${subdir}}\"",
  "replace": "\"${output}\"",
  "test": "bash linux/scripts/tests/test-litert-web-vendor.sh",
  "why": "Shared vendoring retains required and optional package policy, clean destinations, independent output layouts and actionable wasm diagnostics."
 },
 {
  "id": "lib.litert-web-clears-stale",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "  rm -rf \"$output\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-litert-web-vendor.sh",
  "why": "Shared vendoring retains required and optional package policy, clean destinations, independent output layouts and actionable wasm diagnostics."
 },
 {
  "id": "lib.litert-web-wasm-required",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "find \"$output\" -name '*.wasm'",
  "replace": "find \"$output\" -name '*.js'",
  "test": "bash linux/scripts/tests/test-litert-web-vendor.sh",
  "why": "Shared vendoring retains required and optional package policy, clean destinations, independent output layouts and actionable wasm diagnostics."
 },
 {
  "id": "lib.litert-web-required-fetch",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "\"${LITERT_WEB_OUTPUT_DIR}\" core || return 1",
  "replace": "\"${LITERT_WEB_OUTPUT_DIR}\" core || true",
  "test": "bash linux/scripts/tests/test-litert-web-vendor.sh",
  "why": "Shared vendoring retains required and optional package policy, clean destinations, independent output layouts and actionable wasm diagnostics."
 },
 {
  "id": "lib.litert-web-optional-companion",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "warn \"tfjs-interop ${LITERTJS_VERSION} unavailable; continuing (core is sufficient to serve)\"",
  "replace": "return 1",
  "test": "bash linux/scripts/tests/test-litert-web-vendor.sh",
  "why": "Shared vendoring retains required and optional package policy, clean destinations, independent output layouts and actionable wasm diagnostics."
 },
 {
  "id": "lib.litert-web-genai-diagnostic",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "_require_vendored_wasm \"${LITERT_LM_WEB_OUTPUT_DIR}\" ' (genai wasm expected)'",
  "replace": "_require_vendored_wasm \"${LITERT_LM_WEB_OUTPUT_DIR}\"",
  "test": "bash linux/scripts/tests/test-litert-web-vendor.sh",
  "why": "Shared vendoring retains required and optional package policy, clean destinations, independent output layouts and actionable wasm diagnostics."
 },
 {
  "id": "lib.lint-consumer-docker-gitlink",
  "target": "linux/scripts/tests/lint-consumer-fixture.sh",
  "find": "t_consumer_fixture \"${_work}\" _lint_consumer_plant \"$@\"",
  "replace": "t_consumer_fixture \"${_work}\" _lint_consumer_plant \"$1\"",
  "test": "bash linux/scripts/tests/test-dockerfile-env-order.sh",
  "why": "The shared consumer fixture must actually plant its requested broken vendored checkout before asserting that lint scope excludes it."
 },
 {
  "id": "lib.lint-consumer-python-gitlink",
  "target": "linux/scripts/tests/lint-consumer-fixture.sh",
  "find": "t_consumer_fixture \"${_work}\" _lint_consumer_plant \"$@\"",
  "replace": "t_consumer_fixture \"${_work}\" _lint_consumer_plant \"$1\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "The shared consumer fixture must actually plant its requested broken vendored checkout before asserting that lint scope excludes it."
 },
 {
  "id": "lib.native-builder-release-https",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "wget -c --https-only --retry-connrefused",
  "replace": "wget -c --retry-connrefused",
  "test": "bash linux/scripts/tests/test-gcc-release-downloads.sh",
  "why": "every GCC tarball and proof transfer retains HTTPS-only transport"
 },
 {
  "id": "lib.native-builder-release-timeouts",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "--read-timeout=20 --timeout=20 -t \"${attempts}\"",
  "replace": "--read-timeout=1 --timeout=1 -t \"${attempts}\"",
  "test": "bash linux/scripts/tests/test-gcc-release-downloads.sh",
  "why": "shared release transfers retain both bounded twenty-second timeout flags"
 },
 {
  "id": "lib.native-builder-release-attempts",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "-t \"${attempts}\" \"${url}\"",
  "replace": "-t 99 \"${url}\"",
  "test": "bash linux/scripts/tests/test-gcc-release-downloads.sh",
  "why": "mirror transfers retain three attempts while canonical tarballs and proofs retain five"
 },
 {
  "id": "lib.native-builder-release-extra-args",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "\"${url}\" \"$@\"",
  "replace": "\"${url}\"",
  "test": "bash linux/scripts/tests/test-gcc-release-downloads.sh",
  "why": "the output destination arguments follow the original URL without splitting paths or dropping -O"
 },
 {
  "id": "lib.native-builder-release-failure-status",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "  wget -c --https-only --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=20 -t \"${attempts}\" \"${url}\" \"$@\"",
  "replace": "  wget -c --https-only --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=20 -t \"${attempts}\" \"${url}\" \"$@\" || true",
  "test": "bash linux/scripts/tests/test-gcc-release-downloads.sh",
  "why": "download failure must trigger mirror fallback or remain fatal for proofs and the canonical transfer"
 },
 {
  "id": "lib.native-builder-cache-help-alias",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "'DEPRECATED alias for --compiler-cache'",
  "replace": "'cache alias'",
  "test": "bash linux/scripts/tests/test-native-builder-cache-cli.sh",
  "why": "both builders retain their exact public deprecated-cache-alias help contract"
 },
 {
  "id": "lib.native-builder-unknown-option-fatal",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "toolchain_unknown_option() {\n  warn \"Unknown option: $1\"\n  usage >&2\n  exit 1",
  "replace": "toolchain_unknown_option() {\n  warn \"Unknown option: $1\"\n  usage >&2\n  exit 0",
  "test": "bash linux/scripts/tests/test-native-builder-cache-cli.sh",
  "why": "unknown options retain nonzero status instead of silently permitting an incorrect build invocation"
 },
 {
  "id": "lib.native-builder-unknown-option-stderr",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  usage >&2\n  exit 1",
  "replace": "  usage\n  exit 1",
  "test": "bash linux/scripts/tests/test-native-builder-cache-cli.sh",
  "why": "unknown-option usage remains on stderr with the warning and does not pollute stdout"
 },
 {
  "id": "lib.fixture-portability-compiler-helper",
  "target": "linux/scripts/tests/test-compiler-target-verdicts.sh",
  "find": "if grep -Eq \"^${helper}\\(\\)\"",
  "replace": "if rg -q \"^${helper}\\(\\)\"",
  "test": "bash linux/scripts/tests/test-fixture-tool-portability.sh",
  "why": "Every fixture assertion must run on a CI host without optional ripgrep; a missing search tool must not masquerade as a successful negative assertion."
 },
 {
  "id": "lib.fixture-portability-runtime-helper",
  "target": "linux/scripts/tests/test-runtime-probe-transport.sh",
  "find": "if grep -Eq \"^${helper}\\(\\)\"",
  "replace": "if rg -q \"^${helper}\\(\\)\"",
  "test": "bash linux/scripts/tests/test-fixture-tool-portability.sh",
  "why": "Every fixture assertion must run on a CI host without optional ripgrep; a missing search tool must not masquerade as a successful negative assertion."
 },
 {
  "id": "lib.fixture-portability-onnx-negative",
  "target": "linux/scripts/tests/test-onnx-native-lifecycle.sh",
  "find": "t_assert_rc 1 grep -Eq '^collect|^fallback'",
  "replace": "t_assert_rc 1 rg -q '^collect|^fallback'",
  "test": "bash linux/scripts/tests/test-fixture-tool-portability.sh",
  "why": "Every fixture assertion must run on a CI host without optional ripgrep; a missing search tool must not masquerade as a successful negative assertion."
 },
 {
  "id": "lib.fixture-portability-smoke-negative",
  "target": "linux/scripts/tests/test-compiler-smoke-command.sh",
  "find": "t_assert_rc 1 grep -Eq '^-c$'",
  "replace": "t_assert_rc 1 rg -q '^-c$'",
  "test": "bash linux/scripts/tests/test-fixture-tool-portability.sh",
  "why": "Every fixture assertion must run on a CI host without optional ripgrep; a missing search tool must not masquerade as a successful negative assertion."
 },
 {
  "id": "lib.fixture-portability-media-negative",
  "target": "linux/scripts/tests/test-media-platform-bootstrap.sh",
  "find": "t_assert_rc 1 grep -Eq '^POISON$'",
  "replace": "t_assert_rc 1 rg -q '^POISON$'",
  "test": "bash linux/scripts/tests/test-fixture-tool-portability.sh",
  "why": "Every fixture assertion must run on a CI host without optional ripgrep; a missing search tool must not masquerade as a successful negative assertion."
 },
 {
  "id": "lib.fixture-portability-ffmpeg-negative",
  "target": "linux/scripts/tests/test-ffmpeg-probes.sh",
  "find": "t_assert_rc 1 grep -Fq -- '-fuse-ld=lld'",
  "replace": "t_assert_rc 1 rg -q -- '-fuse-ld=lld'",
  "test": "bash linux/scripts/tests/test-fixture-tool-portability.sh",
  "why": "Every fixture assertion must run on a CI host without optional ripgrep; a missing search tool must not masquerade as a successful negative assertion."
 },
 {
  "id": "lib.android-patch-dispatch",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "    android_apply_patch cerbero/001-drop-m4-dependency.patch",
  "replace": "    : cerbero/001-drop-m4-dependency.patch",
  "test": "bash linux/scripts/tests/test-android-patch-dispatch.sh",
  "why": "Cerbero patch dispatch must invoke the shared patch owner after both recipe guards pass."
 },
 {
  "id": "lib.android-patch-caller-root",
  "target": "linux/scripts/03-media/android-build-preamble.sh",
  "find": "$(dirname \"${BASH_SOURCE[1]}\")/../../../..",
  "replace": "$(dirname \"${BASH_SOURCE[0]}\")/../../../..",
  "test": "bash linux/scripts/tests/test-android-patch-dispatch.sh",
  "why": "Repository patch paths derive from the caller script depth, not the shared preamble location."
 },
 {
  "id": "lib.parallel-fixture-truthy-owner",
  "target": "linux/scripts/tests/test-parallel-loop.sh",
  "find": "source \"${CORE_DIR}/platform.sh\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-parallel-loop.sh",
  "why": "Parallel loop fixtures must use the production truthiness predicate, so parallel selection and fail-fast behavior remain covered without copied boolean tables."
 },
 {
  "id": "lib.media-payload-observation",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "/usr/local/include/tflite|observe",
  "replace": "/usr/local/include/tflite|copy",
  "test": "bash linux/scripts/tests/test-media-payload-inventory.sh",
  "why": "the compiler smoke keeps its original five optional observations independently of the fourteen copied payloads"
 },
 {
  "id": "lib.media-payload-copy-companion",
  "target": "linux/Dockerfile.package",
  "find": "linux/scripts/06-packaging/media-payloads.sh linux/scripts/lib/log-bootstrap.sh /tmp/",
  "replace": "linux/scripts/lib/log-bootstrap.sh /tmp/",
  "test": "bash linux/scripts/tests/test-media-payload-inventory.sh",
  "why": "the isolated payload copier must ship the shared inventory it sources"
 },
 {
  "id": "lib.media-payload-validator-companion",
  "target": "linux/Dockerfile.package",
  "find": "COPY --chmod=755 linux/scripts/06-packaging/validate-compilers.sh linux/scripts/06-packaging/media-payloads.sh /opt/scripts/packaging/",
  "replace": "COPY --chmod=755 linux/scripts/06-packaging/validate-compilers.sh /opt/scripts/packaging/",
  "test": "bash linux/scripts/tests/test-media-payload-inventory.sh",
  "why": "the final compiler validator needs its inventory beside the script"
 },
 {
  "id": "lib.media-payload-artifact-bind",
  "target": "linux/Dockerfile.package",
  "find": " --mount=type=bind,source=linux/scripts/06-packaging/media-payloads.sh,target=/tmp/media-payloads.sh,ro",
  "replace": "",
  "test": "bash linux/scripts/tests/test-media-payload-inventory.sh",
  "why": "the artifact-source compiler check must carry the new inventory in its narrow bind closure"
 },
 {
  "id": "lib.media-install-strip-optional-function",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "declare -F strip_media_prefixes",
  "replace": "command -v strip_media_prefixes",
  "test": "bash linux/scripts/tests/test-media-install-strip.sh",
  "why": "Installed media prefixes keep optional function-only strip dispatch, quiet missing helpers, advisory strip status, exact paths and install/provenance/listing order."
 },
 {
  "id": "lib.media-install-strip-advisory-status",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "strip_media_prefixes \"$@\" || true",
  "replace": "strip_media_prefixes \"$@\"",
  "test": "bash linux/scripts/tests/test-media-install-strip.sh",
  "why": "Installed media prefixes keep optional function-only strip dispatch, quiet missing helpers, advisory strip status, exact paths and install/provenance/listing order."
 },
 {
  "id": "lib.media-install-strip-argument-boundaries",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "strip_media_prefixes \"$@\" || true",
  "replace": "strip_media_prefixes $* || true",
  "test": "bash linux/scripts/tests/test-media-install-strip.sh",
  "why": "Installed media prefixes keep optional function-only strip dispatch, quiet missing helpers, advisory strip status, exact paths and install/provenance/listing order."
 },
 {
  "id": "lib.media-install-strip-armnn-wiring",
  "target": "linux/scripts/03-media/build/armnn/build-armnn.sh",
  "find": "media_strip_prefixes_if_available \"${ARMNN_INSTALL_DIR}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-media-install-strip.sh",
  "why": "Installed media prefixes keep optional function-only strip dispatch, quiet missing helpers, advisory strip status, exact paths and install/provenance/listing order."
 },
 {
  "id": "lib.media-install-strip-opencv-wiring",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "media_strip_prefixes_if_available \"${OPENCV_PREFIX}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-media-install-strip.sh",
  "why": "Installed media prefixes keep optional function-only strip dispatch, quiet missing helpers, advisory strip status, exact paths and install/provenance/listing order."
 },
 {
  "id": "lib.cache-utils-off-spellings",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "    False) [ \"${2:-}\" != tool ] ;;\n    0|false|FALSE|no|NO|off|OFF) return 0 ;;",
  "replace": "    false) return 0 ;;",
  "test": "bash linux/scripts/tests/test-compiler-cache-policy.sh",
  "why": "all previous off spellings disable cache and linker configuration while empty and unknown values retain their enabled policy"
 },
 {
  "id": "lib.cache-utils-guarded-launcher",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "    *sccache*)",
  "replace": "    sccache)",
  "test": "bash linux/scripts/tests/test-compiler-cache-policy.sh",
  "why": "a guarded sccache launcher path must select sccache statistics rather than ccache output"
 },
 {
  "id": "lib.cache-utils-filter-argument",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "grep -E \"$2\"",
  "replace": "cat",
  "test": "bash linux/scripts/tests/test-compiler-cache-policy.sh",
  "why": "media and GCC retain their distinct statistic row filters"
 },
 {
  "id": "lib.cache-utils-best-effort-status",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "    *sccache*) sccache --show-stats 2>/dev/null | grep -E \"$2\" || true ;;",
  "replace": "    *sccache*) sccache --show-stats 2>/dev/null | grep -E \"$2\" ;;",
  "test": "bash linux/scripts/tests/test-compiler-cache-policy.sh",
  "why": "phase statistics remain advisory when a cache command fails under pipefail"
 },
 {
  "id": "lib.cache-utils-tool-diagnostics",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "sccache --show-stats 2>/dev/null |",
  "replace": "sccache --show-stats |",
  "test": "bash linux/scripts/tests/test-compiler-cache-policy.sh",
  "why": "raw cache diagnostics remain suppressed while selected human statistics retain the caller stream"
 },
 {
  "id": "lib.cache-utils-side-effect-free",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "_flag_disabled() {",
  "replace": "export CCACHE_DIR=/unexpected-cache-default\n_flag_disabled() {",
  "test": "bash linux/scripts/tests/test-compiler-cache-policy.sh",
  "why": "sourcing shared predicates into the CMake leaf must not initialize or export cache defaults"
 },
 {
  "id": "lib.cache-utils-compiler-module-required",
  "target": "linux/scripts/01-core/compiler-cache.sh",
  "find": "source \"${_CC_SH_DIR}/compiler-cache-utils.sh\" || return 1",
  "replace": "source \"${_CC_SH_DIR}/compiler-cache-utils.sh\" || true",
  "test": "bash linux/scripts/tests/test-compiler-cache-companions.sh",
  "why": "a missing utility cannot make the compiler-cache module report successful loading even inside if"
 },
 {
  "id": "lib.cache-utils-cmake-module-required",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/compiler-cache-utils.sh\" || return 1",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/compiler-cache-utils.sh\" || true",
  "test": "bash linux/scripts/tests/test-compiler-cache-companions.sh",
  "why": "a missing utility cannot make the CMake module report successful loading or latch its loaded guard"
 },
 {
  "id": "lib.cache-utils-gcc-required",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "source_toolchain_required \"${_SCRIPT_DIR}\" compiler-cache-utils.sh exit",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-compiler-cache-companions.sh",
  "why": "native GCC must reject a missing utility before error-trap initialization or any build action"
 },
 {
  "id": "lib.cache-utils-toolchain-mount",
  "target": "linux/Dockerfile.toolchain",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n",
  "replace": "    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n",
  "test": "bash linux/scripts/tests/test-compiler-cache-companions.sh",
  "why": "the LLVM build RUN must carry the cache utility used by its native GCC builder without relying on a stale ancestor"
 },
 {
  "id": "lib.cache-utils-media-copy",
  "target": "linux/Dockerfile.media",
  "find": " linux/scripts/01-core/compiler-cache-utils.sh",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-cache-companions.sh",
  "why": "the copied CMake helper carries its cache utility in a media-only rebuild"
 },
 {
  "id": "lib.tvm-wheel-fixture-builder-status",
  "target": "linux/scripts/tests/test-tvm-wheel-diagnostics.sh",
  "find": "|| _rc=$?",
  "replace": "|| _rc=0",
  "test": "bash linux/scripts/tests/test-tvm-wheel-diagnostics.sh",
  "why": "Shared fixtures preserve builder and reader statuses, selected pipefail mode, staged runtime bytes and explicit provenance requests."
 },
 {
  "id": "lib.tvm-wheel-fixture-pipefail-mode",
  "target": "linux/scripts/tests/test-tvm-wheel-diagnostics.sh",
  "find": "set \"$pipefail_option\" pipefail",
  "replace": "set -o pipefail",
  "test": "bash linux/scripts/tests/test-tvm-wheel-diagnostics.sh",
  "why": "Shared fixtures preserve builder and reader statuses, selected pipefail mode, staged runtime bytes and explicit provenance requests."
 },
 {
  "id": "lib.tvm-wheel-fixture-runtime-bytes",
  "target": "linux/scripts/tests/test-tvm-wheel-diagnostics.sh",
  "find": ": > \"${prefix}/$2/$3\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-tvm-wheel-diagnostics.sh",
  "why": "Shared fixtures preserve builder and reader statuses, selected pipefail mode, staged runtime bytes and explicit provenance requests."
 },
 {
  "id": "lib.ancestry-fixture-reader-status",
  "target": "linux/scripts/tests/test-ancestry.sh",
  "find": "return \"$reader_status\"",
  "replace": "return 0",
  "test": "bash linux/scripts/tests/test-ancestry.sh",
  "why": "Shared fixtures preserve builder and reader statuses, selected pipefail mode, staged runtime bytes and explicit provenance requests."
 },
 {
  "id": "lib.ancestry-fixture-requested-run",
  "target": "linux/scripts/tests/test-ancestry.sh",
  "find": "CROSS_RUN_ID=\"$requested\" runtime_assert_provenance_stamped",
  "replace": "CROSS_RUN_ID=\"\" runtime_assert_provenance_stamped",
  "test": "bash linux/scripts/tests/test-ancestry.sh",
  "why": "Shared fixtures preserve builder and reader statuses, selected pipefail mode, staged runtime bytes and explicit provenance requests."
 },
 {
  "id": "mirror-consistency.shared-error-count",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "  errors=$((errors + 1))",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "every ordinary and detailed failure must contribute to the aggregate count and nonzero final verdict"
 },
 {
  "id": "mirror-consistency.shared-error-stderr",
  "target": "linux/scripts/01-core/verify-ubuntu-mirror-consistency.sh",
  "find": "printf 'ERROR: %s\\n' \"$1\" >&2",
  "replace": "printf 'ERROR: %s\\n' \"$1\"",
  "test": "bash linux/scripts/tests/test-mirror-consistency.sh",
  "why": "shared error diagnostics stay on stderr while progress headers remain on stdout"
 },
 {
  "id": "lib.ort-chain-digest-boundaries",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "*\" $(_ortg_sha \"${path}\") \"*)",
  "replace": "*\"$(_ortg_sha \"${path}\")\"*)",
  "test": "bash linux/scripts/tests/test-ort-chain-digests.sh",
  "why": "chain hash membership requires complete space-delimited tokens and preserves each consumer delimiter policy"
 },
 {
  "id": "lib.ort-chain-digest-counter",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "_ORTG_COMPARED=$((_ORTG_COMPARED + 1))",
  "replace": "_ORTG_COMPARED=$((_ORTG_COMPARED + 0))",
  "test": "bash linux/scripts/tests/test-ort-chain-digests.sh",
  "why": "G2 counts each chain-named comparison while GenAI and archive exemptions leave that counter unchanged"
 },
 {
  "id": "lib.renovate-staged-rollback-head",
  "target": "linux/scripts/renovate-tree.sh",
  "find": "checkout --quiet HEAD -- \"${pth}\"",
  "replace": "checkout --quiet -- \"${pth}\"",
  "test": "bash linux/scripts/tests/test-renovate-collateral.sh",
  "why": "Both staged deletion and staged modification must restore original HEAD bytes and clear the index, rather than restore tool output from the index."
 },
 {
  "id": "lib.logging-trap-bare-action",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "local action=\"${3:-${_LOG_TRAP_ACTION:-err}}\"",
  "replace": "local action=\"${3:-warn}\"",
  "test": "bash linux/scripts/tests/test-logging-err-trap.sh",
  "why": "A bare re-armed trap must retain the installed error action, severity and failing status after its installer returns."
 },
 {
  "id": "lib.module-shadow-fixture-dispatch",
  "target": "linux/scripts/tests/test-module-resolution.sh",
  "find": "  source_module armnn-support.sh",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-module-resolution.sh",
  "why": "Both shadowing fixtures must execute production module resolution before asserting the selected module marker."
 },
 {
  "id": "lib.bind-ownership-fixture-user",
  "target": "linux/scripts/tests/test-bind-mount-ownership.sh",
  "find": "STUB_UID=\"$1\"",
  "replace": "STUB_UID=1001",
  "test": "bash linux/scripts/tests/test-bind-mount-ownership.sh",
  "why": "Failed-chown fixtures must distinguish root from non-root; silently fixing the stub uid would miss the fatal root failure."
 },
 {
  "id": "lib.onnx-wasm-collector-extra-pattern",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "for pattern in \"$@\"; do names+=(-o -name \"$pattern\"); done",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.onnx-wasm-collector-null-boundaries",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "'(' \"${names[@]}\" ')' -print0",
  "replace": "'(' \"${names[@]}\" ')' -print",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.onnx-wasm-collector-copy-advisory",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "if [ \"${status}\" -ne 0 ] && [ \"${ORT_WEB_REQUIRED:-0}\" = 1 ]; then return \"${status}\"; fi",
  "replace": "if [ \"${status}\" -ne 0 ]; then return \"${status}\"; fi",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.onnx-wasm-mandatory-fatal",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "\"${BUILD_SH}\" \"${COMMON_ARGS[@]}\" --enable_wasm_simd --enable_wasm_threads\n",
  "replace": "\"${BUILD_SH}\" \"${COMMON_ARGS[@]}\" --enable_wasm_simd --enable_wasm_threads || true\n",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.onnx-wasm-optional-fatal-optin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "[ \"${ORT_WEB_REQUIRED:-0}\" = \"1\" ]",
  "replace": "[ \"${ORT_WEB_REQUIRED:-0}\" = \"0\" ]",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.onnx-wasm-jspi-exception-policy",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "[ \"${_arg}\" = \"--disable_wasm_exception_catching\" ] || JSPI_COMMON_ARGS+=(\"${_arg}\")",
  "replace": "JSPI_COMMON_ARGS+=(\"${_arg}\")",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.iree-android-runtime-profile",
  "target": "linux/scripts/03-media/build/iree/android/build-android.sh",
  "find": "  -DIREE_BUILD_COMPILER=OFF",
  "replace": "  -DIREE_BUILD_COMPILER=ON",
  "test": "bash linux/scripts/tests/test-iree-android-profile.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.iree-android-target-profile",
  "target": "linux/scripts/03-media/build/iree/android/build-android.sh",
  "find": "    -DIREE_HOST_BIN_DIR=\"${HOST_INSTALL}/bin\" \\\n    \"${_iree_runtime_cmake_args[@]}\" \\\n",
  "replace": "    -DIREE_HOST_BIN_DIR=\"${HOST_INSTALL}/bin\" \\\n",
  "test": "bash linux/scripts/tests/test-iree-android-profile.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.iree-android-host-profile",
  "target": "linux/scripts/03-media/build/iree/android/build-android.sh",
  "find": "    -DCMAKE_BUILD_TYPE=Release \\\n    \"${_iree_runtime_cmake_args[@]}\" \\\n",
  "replace": "    -DCMAKE_BUILD_TYPE=Release \\\n",
  "test": "bash linux/scripts/tests/test-iree-android-profile.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.iree-android-host-tool-prefix",
  "target": "linux/scripts/03-media/build/iree/android/build-android.sh",
  "find": "-DIREE_HOST_BIN_DIR=\"${HOST_INSTALL}/bin\"",
  "replace": "-DIREE_HOST_BIN_DIR=\"${INSTALL_DIR}/bin\"",
  "test": "bash linux/scripts/tests/test-iree-android-profile.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.iree-android-advisory-configure",
  "target": "linux/scripts/03-media/build/iree/android/build-android.sh",
  "find": "warn \"Android IREE: host-tools configure failed; skipping (non-gating)\"; exit 0",
  "replace": "warn \"Android IREE: host-tools configure failed; skipping (non-gating)\"; exit 9",
  "test": "bash linux/scripts/tests/test-iree-android-profile.sh",
  "why": "Offline characterization preserves ordered host/target profiles, mandatory versus optional builds and exact best-effort WASM artifact collection."
 },
 {
  "id": "lib.media-artifact-empty-verdict",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "if [ ! -s \"$1\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-verifier-artifact-parity.sh",
  "why": "empty files and admitted dangling symlinks must fail once with the existing empty-artifact diagnostic"
 },
 {
  "id": "lib.genai-artifact-c-header",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "verify_file_exists \"${PREFIX}/include/ort_genai_c.h\" \"GenAI C header\" || true",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-genai-artifact-gate.sh",
  "why": "a GenAI tree without its C header ships, and the Rust binding fails at its first build in a consumer"
 },
 {
  "id": "lib.genai-artifact-cpp-header",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "verify_file_exists \"${PREFIX}/include/ort_genai.h\" \"GenAI C++ header\" || true",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-genai-artifact-gate.sh",
  "why": "a GenAI tree without its C++ header ships, and the C++ binding fails at its first build in a consumer"
 },
 {
  "id": "lib.genai-artifact-wheel-not-library",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "\"${PREFIX}/lib:libonnxruntime_genai*.so*\" || true",
  "replace": "\"${PREFIX}/lib:libonnxruntime_genai*.so*\" \"${PREFIX}/wheels:*.whl\" || true",
  "test": "bash linux/scripts/tests/test-genai-artifact-gate.sh",
  "why": "a wheel serves Python only; accepting it as the GenAI artifact passes a tree no native binding can link"
 },
 {
  "id": "lib.genai-producer-header-fatal",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "[ -s \"$1/src/${hdr}\" ] || err \"GenAI header ${hdr} not found in $1/src\"",
  "replace": "[ -s \"$1/src/${hdr}\" ] || continue",
  "test": "bash linux/scripts/tests/test-genai-artifact-gate.sh",
  "why": "a missing header used to warn and the stage shipped without it; the producer must stop the build"
 },
 {
  "id": "lib.genai-producer-copy-fatal",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "cp \"$1/src/${hdr}\" \"$2/include/\" || err \"cannot copy GenAI header ${hdr} to $2/include\"",
  "replace": "cp \"$1/src/${hdr}\" \"$2/include/\" 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-genai-artifact-gate.sh",
  "why": "the old copy swallowed its own failure with || true, so an install tree without the C header looked complete"
 },
 {
  "id": "lib.tiny-genai-successor",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "return min(token + 1, EOS_ID)",
  "replace": "return min(token + 2, EOS_ID)",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "the oracle every binding test reads must follow the weights; a drifted rule turns a correct decoder red everywhere"
 },
 {
  "id": "lib.tiny-genai-present-value",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "_len(12, _value_info(\"present.0.value\", FLOAT, present)),",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "GenAI feeds every present output back as the next past input; a graph missing one fails only inside a consumer"
 },
 {
  "id": "lib.tiny-genai-byte-symbols",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "printable = [*range(0x21, 0x7F), *range(0xA1, 0xAD), *range(0xAE, 0x100)]",
  "replace": "printable = [*range(0x21, 0x7F), *range(0xA1, 0x100)]",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "byte-level BPE needs GPT-2's exact byte symbols, or the tokenizer encodes another byte than the oracle names"
 },
 {
  "id": "lib.tiny-genai-no-wheel-status",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "        return 2",
  "replace": "        return 0",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "a host without the GenAI wheel must not report a checked model; exit 2 keeps the missing proof visible"
 },
 {
  "id": "lib.tiny-genai-context",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "CONTEXT = 512",
  "replace": "CONTEXT = 64",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "a binding test decodes from the highest UTF-8 continuation byte to the end token, 65 tokens after a two-token prompt"
 },
 {
  "id": "lib.tiny-genai-hidden-row",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "return [float((token >> shift & 3) + 1) for shift in range(2 * (HEAD_SIZE - 1), -2, -2)]",
  "replace": "return [float(token + 1)] * HEAD_SIZE",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "rows that all point the same way normalise to one vector, so every text would embed alike and a binding's pooling could not fail"
 },
 {
  "id": "lib.tiny-genai-hidden-output",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "_len(12, _value_info(\"hidden_states\", FLOAT, [\"batch\", \"sequence\", HEAD_SIZE])),",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "without the declared graph output GenAI answers that hidden_states was not found, and every embedding test of a consumer goes red"
 },
 {
  "id": "lib.tiny-genai-hidden-check",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "            problems.append(f\"hidden_states pooled to {embedding}, expected {oracle['embedding']}\")",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "the check mode must grade the pooled output against the oracle, not merely read it"
 },
 {
  "id": "lib.tiny-genai-schema-case",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "              \"eos_token_id\": EOS_ID, \"schema_case\": SCHEMA_CASE, \"cases\": cases(),\n",
  "replace": "              \"eos_token_id\": EOS_ID, \"cases\": cases(),\n",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "the schema case is typed once, in fixture.json; without it the image smoke and five consumer tests retype it"
 },
 {
  "id": "lib.tiny-genai-tool-cases",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "              \"tool_cases\": tool_cases()}",
  "replace": "              }",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "the forced call is typed once, in fixture.json; OxidANT's GenAI replays it (TP-W6.2)"
 },
 {
  "id": "lib.tiny-genai-tool-auto-forces",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "         \"expect\": {\"text\": CONTINUATION, \"tool_calls\": [], \"finish\": \"length\"}},",
  "replace": "         \"expect\": {\"text\": \"\", \"tool_calls\": [{\"name\": \"pick\", \"arguments\": {\"n\": 7}}], \"finish\": \"tool_calls\"}},",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "auto leaves the model its text: a backend that forces every call would pass a fixture that asked for one"
 },
 {
  "id": "lib.tiny-genai-cases-error-kinds",
  "target": "linux/scripts/lib/tiny-genai-model.py",
  "find": "         \"options\": {\"max_new_tokens\": 1, \"json_schema\": REFUSED_SCHEMA}, \"expect\": {\"error\": \"generation_failed\"}},",
  "replace": "         \"options\": {\"max_new_tokens\": 1, \"json_schema\": REFUSED_SCHEMA}, \"expect\": {\"error\": \"invalid_options\"}},",
  "test": "bash linux/scripts/tests/test-tiny-genai-model.sh",
  "why": "a refused schema object is the generator's failure (owner, 2026-11-13); three bindings replay this kind"
 },
 {
  "id": "lib.genai-smoke-tiny-mismatch",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "        fails.extend(f\"tiny model: {problem}\" for problem in tiny_problems)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "a binding that decodes the tiny model wrongly must fail tier 4, not merely miss its proof line"
 },
 {
  "id": "lib.genai-smoke-tiny-proven",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "            proven.append(\"generate() decoded the tiny test model token for token: 'abc' -> 'defg'\")",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "an exact decode is the only generate() proof the image smoke has; it must be reported"
 },
 {
  "id": "lib.genai-smoke-tiny-not-skipped",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "if not MODEL_DIR and not TINY_MODEL_PY:",
  "replace": "if not MODEL_DIR:",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "a run that decoded the tiny model must not also claim that no generation was attempted"
 },
 {
  "id": "lib.genai-smoke-tiny-handed-in",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "\"$(smoke_genai_py)\" -e \"GENAI_TINY_MODEL_PY=${tiny_src}\" \\",
  "replace": "\"$(smoke_genai_py)\" \\",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "without the generator in the container tier 4 falls back to UNPROVEN on every arch"
 },
 {
  "id": "lib.genai-smoke-tiny-missing-fails",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "else fail \"no tiny GenAI model generator at ${tiny_py}\"; fi\n    out=\"$(",
  "replace": "else :; fi\n    out=\"$(",
  "test": "bash linux/scripts/tests/test-runtime-probe-verdicts.sh",
  "why": "a checkout without the generator would hand tier 4 nothing and report generate() as merely unproven"
 },
 {
  "id": "lib.parity-import-status",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": ")\" || _pair_status=$?",
  "replace": ")\" || _pair_status=0",
  "test": "bash linux/scripts/tests/test-verifier-artifact-parity.sh",
  "why": "full-output import probes retain each image exit status while version probes remain advisory about command status"
 },
 {
  "id": "lib.parity-result-failure",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "  fail \"$3\"\n  return 1",
  "replace": "  pass \"$3\"\n  return 0",
  "test": "bash linux/scripts/tests/test-verifier-artifact-parity.sh",
  "why": "a nonzero aggregate mismatch count must produce a failed parity verdict"
 },
 {
  "id": "lib.parity-empty-version-probes",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "if [ \"${compared}\" -eq 0 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-verifier-artifact-parity.sh",
  "why": "two empty version outputs must remain a vacuous failure rather than equal successful images"
 },
 {
  "id": "lib.genai-stub-binding-overrides",
  "target": "linux/scripts/tests/test-genai-smoke-payload.sh",
  "find": "STUB_GENAI_EXT=\"${STUB}/onnxruntime_genai/ext_x86_64.so\" \"$@\"",
  "replace": "STUB_GENAI_EXT=\"${STUB}/onnxruntime_genai/ext_x86_64.so\"",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "shared healthy-binding fixtures must forward per-case version, architecture, extension and API-failure overrides"
 },
 {
  "id": "lib.ubuntu-mirror-source-files-nullglob-enable",
  "target": "linux/scripts/01-core/ubuntu-mirror.sh",
  "find": "  shopt -s nullglob\n  _umsf_output=(",
  "replace": "  _umsf_output=(",
  "test": "bash linux/scripts/tests/test-ubuntu-mirror-source-files.sh",
  "why": "Missing glob groups must disappear rather than become literal filenames."
 },
 {
  "id": "lib.ubuntu-mirror-source-files-nullglob-clear",
  "target": "linux/scripts/01-core/ubuntu-mirror.sh",
  "find": "  shopt -u nullglob\n}\n\nubuntu_archive_regex",
  "replace": "  :\n}\n\nubuntu_archive_regex",
  "test": "bash linux/scripts/tests/test-ubuntu-mirror-source-files.sh",
  "why": "Enumeration must clear nullglob even when it was enabled by the caller."
 },
 {
  "id": "lib.ubuntu-mirror-source-files-literal-main",
  "target": "linux/scripts/01-core/ubuntu-mirror.sh",
  "find": "    \"${_umsf_root%/}/etc/apt/sources.list\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ubuntu-mirror-source-files.sh",
  "why": "The literal main source path remains in the result even when missing."
 },
 {
  "id": "lib.ubuntu-mirror-source-files-group-order",
  "target": "linux/scripts/01-core/ubuntu-mirror.sh",
  "find": "    \"${_umsf_root%/}/etc/apt/sources.list.d/\"*.list\n    \"${_umsf_root%/}/etc/apt/sources.list.d/\"*.sources",
  "replace": "    \"${_umsf_root%/}/etc/apt/sources.list.d/\"*.sources\n    \"${_umsf_root%/}/etc/apt/sources.list.d/\"*.list",
  "test": "bash linux/scripts/tests/test-ubuntu-mirror-source-files.sh",
  "why": "List files precede deb822 source files independently of filename sorting."
 },
 {
  "id": "lib.ubuntu-mirror-source-files-quoted-root",
  "target": "linux/scripts/01-core/ubuntu-mirror.sh",
  "find": "    \"${_umsf_root%/}/etc/apt/sources.list.d/\"*.list",
  "replace": "    ${_umsf_root%/}/etc/apt/sources.list.d/*.list",
  "test": "bash linux/scripts/tests/test-ubuntu-mirror-source-files.sh",
  "why": "A root containing spaces must remain one path."
 },
 {
  "id": "lib.ubuntu-mirror-source-files-base-wiring",
  "target": "linux/scripts/01-core/base-image.sh",
  "find": "  ubuntu_mirror_source_files source_files \"${sources_root}\"",
  "replace": "  source_files=()",
  "test": "bash linux/scripts/tests/test-ubuntu-mirror-source-files.sh",
  "why": "Both callers must use the shared enumeration with their own root."
 },
 {
  "id": "lib.ubuntu-mirror-source-files-fast-wiring",
  "target": "linux/scripts/01-core/use-fast-ubuntu-mirror.sh",
  "find": "  ubuntu_mirror_source_files source_files \"${sources_root}\"",
  "replace": "  source_files=()",
  "test": "bash linux/scripts/tests/test-ubuntu-mirror-source-files.sh",
  "why": "Both callers must use the shared enumeration with their own root."
 },
 {
  "id": "lib.bump-offline-fixture-argv",
  "target": "linux/scripts/tests/bump-versions-fixture.sh",
  "find": "| python3 - \"${REPO}\" \"$@\"",
  "replace": "| python3 - \"${REPO}\"",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "Shared offline snippets must execute the real bump module with every fixture argument while preserving all pin and error assertions."
 },
 {
  "id": "lib.bump-offline-fixture-module",
  "target": "linux/scripts/tests/bump-versions-fixture.sh",
  "find": "import bump_versions as bv\\n'; cat;",
  "replace": "import bump_versions as absent_module\\n'; cat;",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "Shared offline snippets must execute the real bump module with every fixture argument while preserving all pin and error assertions."
 },
 {
  "id": "lib.bump-offline-tag-fixture",
  "target": "linux/scripts/tests/bump-versions-fixture.sh",
  "find": "printf 'bv.ls_remote_tags = lambda repo: %s\\n' \"$tags\"",
  "replace": "printf 'bv.ls_remote_tags = lambda repo: %s\\n' '[]'",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "Shared release-tag fixtures must expose the exact candidate sets before each asset and write-policy assertion."
 },
 {
  "id": "lib.optional-function-fixture-emission",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "then declare -f \"${name}\"; fi",
  "replace": "then :; fi",
  "test": "bash linux/scripts/tests/test-optional-function-fixtures.sh",
  "why": "optional worker fixtures emit present functions in order, skip absent middle and last names, and retain usable bodies and statuses"
 },
 {
  "id": "lib.g2-fixture-shell-body",
  "target": "linux/scripts/tests/test-ort-provenance-build.sh",
  "find": "body=\"$2\"; shift 2; eval \"${body}\"",
  "replace": "body=\"$2\"; shift 2; : \"${body}\"",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "shared isolated gate shells must execute both bare and same-session retry bodies with the original arguments"
 },
 {
  "id": "lib.lint-fixture-tracked-files",
  "target": "linux/scripts/tests/test-lint-gates.sh",
  "find": "  git -C \"$1\" add -A >/dev/null 2>&1",
  "replace": "  : \"$1\"",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "consumer fixture files must be tracked before lint scope and shared-config declarations are judged"
 },
 {
  "id": "lib.flatpak-install-fixture-overrides",
  "target": "linux/scripts/tests/test-app-packaging-flatpak.sh",
  "find": "  _call \"$@\" -- app_packaging_package_cmake_install_flatpak",
  "replace": "  _call -- app_packaging_package_cmake_install_flatpak",
  "test": "bash linux/scripts/tests/test-app-packaging-flatpak.sh",
  "why": "Shared CMake-install Flatpak fixtures must forward each failing tool or missing-payload override, keeping committed-ref and executable verdicts independent."
 },
 {
  "id": "lib.workflow-fixture-runner",
  "target": "linux/scripts/tests/test-workflow-lint.sh",
  "find": "\"$1\" \"${3:-}\"",
  "replace": "\"ubuntu-24.04\" \"${3:-}\"",
  "test": "bash linux/scripts/tests/test-workflow-lint.sh",
  "why": "Generated workflows must retain array runners and malformed flow collections so parser fixtures still exercise their stated inputs."
 },
 {
  "id": "lib.workflow-fixture-job-count",
  "target": "linux/scripts/tests/test-workflow-lint.sh",
  "find": "  for job in \"$@\"; do",
  "replace": "  for job in \"$1\"; do",
  "test": "bash linux/scripts/tests/test-workflow-lint.sh",
  "why": "A two-job fixture must preserve both missing-timeout findings before testing the census growth verdict."
 },
 {
  "id": "lib.core-owner-host-default",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "  [ \"${a}\" = \"amd64\" ] && return 0",
  "replace": "  [ \"${a}\" = \"arm64\" ] && return 0",
  "test": "bash linux/scripts/tests/test-core-owner-behavior.sh",
  "why": "Only amd64 omits shared and host suffixes."
 },
 {
  "id": "lib.core-owner-host-format",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "  printf -- \"${format}\" \"${a}\"",
  "replace": "  printf -- '-%s' \"${a}\"",
  "test": "bash linux/scripts/tests/test-core-owner-behavior.sh",
  "why": "Artifact host infixes retain their host marker distinct from base suffixes."
 },
 {
  "id": "lib.core-owner-caller-frame",
  "target": "linux/scripts/01-core/modules.sh",
  "find": "${BASH_SOURCE[2]}",
  "replace": "${BASH_SOURCE[1]}",
  "test": "bash linux/scripts/tests/test-core-owner-behavior.sh",
  "why": "The shared resolver must retain the actual caller path rather than its owning module path."
 },
 {
  "id": "lib.core-owner-caller-override",
  "target": "linux/scripts/01-core/modules.sh",
  "find": "  _mcd_output=\"$2\"",
  "replace": "  _mcd_output=\"\"",
  "test": "bash linux/scripts/tests/test-core-owner-behavior.sh",
  "why": "Explicit script directory continues to take precedence over call-stack discovery."
 },
 {
  "id": "lib.core-owner-disk-invalid-target",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  case \"${2:-}\" in ''|*[!0-9]*) return 1 ;; esac\n  local measured",
  "replace": "  local measured",
  "test": "bash linux/scripts/tests/test-core-owner-behavior.sh",
  "why": "Malformed targets must skip disk probes and reclaim decisions."
 },
 {
  "id": "lib.core-owner-disk-unknown",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  [ -n \"${measured}\" ] || return 1",
  "replace": "  [ -n \"${measured}\" ] || measured=0",
  "test": "bash linux/scripts/tests/test-core-owner-behavior.sh",
  "why": "Unknown disk measurements must not initiate reclaim."
 },
 {
  "id": "lib.core-owner-built-map",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "    _csmb_built_flag[\"${arch}\"]=1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-core-owner-behavior.sh",
  "why": "Built state must reach the caller-owned map."
 },
 {
  "id": "lib.core-owner-built-marker",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "    : > \"${PARALLEL_LOOP_FLAGDIR}/built.${stage}.${arch}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-core-owner-behavior.sh",
  "why": "Parallel workers publish built-state markers for harvest."
 },
 {
  "id": "lib.core-owner-pin-marker",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "      printf '%s' \"$3\" > \"${PARALLEL_LOOP_FLAGDIR}/pin.${stage}.${arch}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-core-owner-behavior.sh",
  "why": "Parallel capture preserves the digest pin file alongside its built marker."
 },
 {
  "id": "lib.core-owner-disk-zero-disabled",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  local status=0\n  command [ \"$1\" -gt 0 ] || status=$?\n  return \"${status}\"",
  "replace": "  if [ \"$1\" -ge 0 ]; then return 0; else return $?; fi",
  "test": "bash linux/scripts/tests/test-disk-threshold-policies.sh",
  "why": "Zero disables positive disk policies before any probe or watcher."
 },
 {
  "id": "lib.core-owner-disk-invalid-disabled",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "_disk_guard_positive_integer() {\n  case \"${1:-}\" in ''|*[!0-9]*) return 1 ;; esac",
  "replace": "_disk_guard_positive_integer() {\n  case \"${1:-}\" in ''|*[!0-9]*) return 0 ;; esac",
  "test": "bash linux/scripts/tests/test-disk-threshold-policies.sh",
  "why": "Malformed thresholds must not trigger probes or watchers."
 },
 {
  "id": "lib.workflow-query-interpreter",
  "target": "linux/scripts/tests/workflow-lane-fixture.sh",
  "find": "read -r -a _WORKFLOW_PYTHON <<< \"${4//$'\\n'/ }\"",
  "replace": "_WORKFLOW_PYTHON=(python3)",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "The shared query driver preserves multiword interpreter selection rather than silently using a different Python."
 },
 {
  "id": "lib.workflow-query-build-role",
  "target": "linux/scripts/tests/workflow-lane-query.py",
  "find": "build = V.value(jobs, sys.argv[2])",
  "replace": "build = V.value(jobs, \"missing-build\")",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "Queries must inspect the lane-specific build job while the Linux plan remains separately selected."
 },
 {
  "id": "lib.workflow-query-focus-role",
  "target": "linux/scripts/tests/workflow-lane-query.py",
  "find": "job = V.value(jobs, sys.argv[3])",
  "replace": "job = None",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "The lint focus and Python build job remain independently selected in the shared metadata reader."
 },
 {
  "id": "lib.workflow-query-run-blocks",
  "target": "linux/scripts/tests/workflow-lane-query.py",
  "find": "out.append(lines[i])",
  "replace": "out.append(\"\")",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "Opaque run blocks must remain available to the existing environment and staged-device contract assertions."
 },
 {
  "id": "lib.workflow-input-field-completeness",
  "target": "linux/scripts/tests/workflow-lane-fixture.sh",
  "find": "    shift 2",
  "replace": "    shift \"$#\"",
  "test": "python3 docs/scripts/verify_mutations.py --only windows-lane.powershell-lint-defaults-off --jobs 1",
  "why": "A weak field loop must be caught by the existing default-off mutation rather than silently omitting later assertions."
 },
 {
  "id": "lib.mutation-fixture-copy-listing",
  "target": "linux/scripts/tests/test-mutation-gate.sh",
  "find": "  _copied=\"$(cat \"${_tmp}/copied\")\"",
  "replace": "  _copied=",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k heavy",
  "why": "Copy exclusion fixtures retain the real copied-file listing and its positive ordinary-file controls."
 },
 {
  "id": "lib.mutation-fixture-copy-source-files",
  "target": "linux/scripts/tests/test-mutation-gate.sh",
  "find": "  printf '%s' \"$2\" > \"$path\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k heavy",
  "why": "A source preparer must plant both the excluded inputs and the ordinary file that proves the copy was real."
 },
 {
  "id": "lib.mutation-fixture-exclusion-assertion",
  "target": "linux/scripts/tests/test-mutation-gate.sh",
  "find": "case \"${_copied}\" in *\"$needle\"*) found=1 ;; esac",
  "replace": "case \"${_copied}\" in *\"$needle\"*) found=0 ;; esac",
  "test": "python3 docs/scripts/verify_mutations.py --only mutations.ignored-not-copied --jobs 1",
  "why": "Weakening the shared absence assertion must make the existing ignored-file mutation survive and fail the outer proof."
 },
 {
  "id": "lib.cli-nonempty-arguments",
  "target": "linux/scripts/lib/cli-value-options.sh",
  "find": "[[ -n \"${_cna_value}\" ]] || continue",
  "replace": ": \"${_cna_value}\"",
  "test": "bash linux/scripts/tests/test-quality-cli-arguments.sh",
  "why": "quality and coverage argv skip empty configured elements without changing their arrays"
 },
 {
  "id": "lib.cli-prefixed-arguments",
  "target": "linux/scripts/lib/cli-value-options.sh",
  "find": "_cna_args+=(\"${_cna_prefix}\")",
  "replace": ": \"${_cna_prefix}\"",
  "test": "bash linux/scripts/tests/test-quality-cli-arguments.sh",
  "why": "each nonempty coverage exclusion retains its own --exclude flag before all extra arguments"
 },
 {
  "id": "lib.quality-cli-companion-required",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": " || { unset _CODE_QUALITY_SH_LOADED; return 1; }",
  "replace": "",
  "test": "bash linux/scripts/tests/test-quality-cli-companions.sh",
  "why": "a copied quality library missing its CLI companion fails cold import and can retry after restoration"
 },
 {
  "id": "lib.coverage-cli-companion-required",
  "target": "linux/scripts/lib/coverage.sh",
  "find": " || { unset _COVERAGE_SH_LOADED; return 1; }",
  "replace": "",
  "test": "bash linux/scripts/tests/test-quality-cli-companions.sh",
  "why": "a copied coverage library missing its CLI companion fails cold import and can retry after restoration"
 },
 {
  "id": "lib.lint-scope-preserves-rest",
  "target": "linux/scripts/01-core/lint-root.sh",
  "find": "  lint_root_begin \"$@\" || return 1",
  "replace": "  lint_root_begin \"$1\" || return 1",
  "test": "bash linux/scripts/tests/test-lint-scope-handshake.sh",
  "why": "scope publication consumes only root options and preserves every other argument in order"
 },
 {
  "id": "shellcheck.fatal-replay-arguments",
  "target": "linux/scripts/lint-shell.sh",
  "find": "\"${SHELLCHECK_BIN}\" \"$@\" \"${f}\" 2>&1 | sed",
  "replace": "\"${SHELLCHECK_BIN}\" \"${f}\" 2>&1 | sed",
  "test": "bash linux/scripts/tests/test-lint-shell-verdicts.sh",
  "why": "fatal diagnostic replays retain the error or SC2215 flag policy and quoted file path"
 },
 {
  "id": "shellcheck.fatal-report-exit",
  "target": "linux/scripts/lint-shell.sh",
  "find": "    done\n    exit 1\n  fi\n}\n\n# The gate:",
  "replace": "    done\n    exit 0\n  fi\n}\n\n# The gate:",
  "test": "bash linux/scripts/tests/test-lint-shell-verdicts.sh",
  "why": "error and SC2215 findings remain fatal even when diagnostic replay commands fail"
 },
 {
  "id": "lib.harness-batch-byte-verdict",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "    Assert-Equal ([Convert]::ToHexString([Text.Encoding]::ASCII.GetBytes($Expected))) ([Convert]::ToHexString([IO.File]::ReadAllBytes($Path)))",
  "replace": "    $null = $Path",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','Harness.Fixtures.Tests.ps1','-ResultFile','logs/code-quality/harness-batch-byte-verdict.json'],check=True); d=json.load(open('logs/code-quality/harness-batch-byte-verdict.json',encoding='utf-8-sig')); assert d['Total']==46 and d['Passed']==46 and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "The byte verdict must reject changed caller lines and requested exit codes rather than let writer mutants survive."
 },
 {
  "id": "code-dupes.explain-reversed-files",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "if a_file != b_file or x < y:",
  "replace": "if x < y:",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "Diagnostic overlap counts must remain visible when the caller supplies the two files in reverse lexical order."
 },
 {
  "id": "code-dupes.explain-self-once",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "if a_file != b_file or x < y:",
  "replace": "if True:",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "Same-file diagnostics must report each distinct unit pair once and must not compare a function with itself."
 },
 {
  "id": "code-dupes.shell-quoted-brace-boundaries",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "return _brace_units(lines, SHELL_FUNC, code_lines(lines))",
  "replace": "return _brace_units(lines, SHELL_FUNC)",
  "test": "SKIP_REAL_TREE=1 bash linux/scripts/tests/test-code-dupes.sh",
  "why": "Quoted braces must not merge later shell functions and hide real duplication pairs."
 },
 {
  "id": "lib.deb-control-empty-homepage",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "if [ \"$#\" -gt 8 ]; then",
  "replace": "if [ -n \"${9:-}\" ]; then",
  "test": "bash linux/scripts/tests/test-deb-control-rendering.sh",
  "why": "Python bundles retain an explicitly empty Homepage field while native bundles omit the optional field entirely."
 },
 {
  "id": "lib.deb-control-required-fields",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "\\nPriority: optional\\n",
  "replace": "\\n",
  "test": "bash linux/scripts/tests/test-deb-control-rendering.sh",
  "why": "Both Debian control renderers must retain every required metadata line and exact control bytes."
 },
 {
  "id": "lib.fixture-command-status",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "_tcc_status=$?",
  "replace": "_tcc_status=0",
  "test": "bash linux/scripts/tests/test-deb-control-rendering.sh",
  "why": "Merged-output fixture capture must preserve both raw builder failures and caller-normalized errors rather than report every worker as successful."
 },
 {
  "id": "lib.cache-readiness-health-required",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "  sccache --show-stats >/dev/null 2>&1\n}",
  "replace": "  return 0\n}",
  "test": "bash linux/scripts/tests/test-cache-readiness.sh",
  "why": "A started or stale server must answer stats before the compiler launcher is selected."
 },
 {
  "id": "lib.cache-readiness-stats-quiet",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "  sccache --show-stats >/dev/null 2>&1\n}",
  "replace": "  sccache --show-stats\n}",
  "test": "bash linux/scripts/tests/test-cache-readiness.sh",
  "why": "Health-probe output must not contaminate launcher stdout or diagnostics."
 },
 {
  "id": "lib.cache-readiness-hook-policy",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "  if [ \"$1\" = hook ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-cache-readiness.sh",
  "why": "Compiler cache initialization retains its configured S3 startup hook."
 },
 {
  "id": "lib.cache-readiness-start-best-effort",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "  else\n    sccache --start-server >/dev/null 2>&1 || true",
  "replace": "  else\n    sccache --start-server >/dev/null 2>&1 || return $?",
  "test": "bash linux/scripts/tests/test-cache-readiness.sh",
  "why": "A failed start request may still have a healthy running server and must reach the health check."
 },
 {
  "id": "lib.cache-readiness-probe-direct",
  "target": "linux/scripts/02-toolchain/probe-sccache.sh",
  "find": "if ! compiler_cache_sccache_ready direct; then",
  "replace": "if ! compiler_cache_sccache_ready hook; then",
  "test": "bash linux/scripts/tests/test-cache-readiness.sh",
  "why": "The standalone diagnostic must retain direct startup rather than invoke the build S3 hook."
 },
 {
  "id": "lib.cache-readiness-common-companion",
  "target": "linux/scripts/01-core/common.sh",
  "find": "source \"${_COMMON_SH_DIR}/compiler-cache-utils.sh\" || return 1",
  "replace": "source \"${_COMMON_SH_DIR}/compiler-cache-utils.sh\" || true",
  "test": "bash linux/scripts/tests/test-compiler-cache-companions.sh",
  "why": "Common initialization cannot succeed without the utility it now requires, including repeated conditional sourcing."
 },
 {
  "id": "lib.cache-readiness-base-companion",
  "target": "linux/Dockerfile.base",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    /bin/bash /tmp/scripts/01-core/base-image.sh bootstrap-ca\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    /bin/bash /tmp/scripts/01-core/base-image.sh bootstrap-ca\n",
  "test": "bash linux/scripts/tests/test-compiler-cache-companions.sh",
  "why": "Every narrow common RUN closure must carry its side-effect-free utility."
 },
 {
  "id": "lib.media-deps-python-ready",
  "target": "linux/scripts/01-core/install-deps-preamble.sh",
  "find": "&& cross_target_python_dev_ready; then",
  "replace": "; then",
  "test": "bash linux/scripts/tests/test-media-python-dependencies.sh",
  "why": "A present readiness helper that rejects missing staged headers must select the unavailable diagnostic."
 },
 {
  "id": "lib.media-deps-python-explicit-empty",
  "target": "linux/scripts/01-core/install-deps-preamble.sh",
  "find": "if [ \"$#\" -ge 4 ]; then",
  "replace": "if [ \"$#\" -ge 4 ] && [ -n \"$4\" ]; then",
  "test": "bash linux/scripts/tests/test-media-python-dependencies.sh",
  "why": "An explicitly empty OpenCV version must not trigger the GST/LiteRT lazy fallback."
 },
 {
  "id": "lib.media-deps-pkgconfig-library",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "-l${library}",
  "replace": "-lwrong",
  "test": "bash linux/scripts/tests/test-media-python-dependencies.sh",
  "why": "Both metadata records must retain their own library names and exact bytes."
 },
 {
  "id": "lib.media-deps-sdk-source-side-effect",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "    source_vulkan_sdk_env \"${prefix}\" sanitize-libs >/dev/null 2>&1 || true",
  "replace": "    : \"${prefix}\"",
  "test": "bash linux/scripts/tests/test-media-python-dependencies.sh",
  "why": "SDK selection must inspect the environment after attempting SDK setup, including an advisory failed setup."
 },
 {
  "id": "lib.media-deps-vulkan-import",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "    source /opt/scripts/toolchain/vulkan.sh",
  "replace": "    : /opt/scripts/toolchain/vulkan.sh",
  "test": "bash linux/scripts/tests/test-media-python-dependencies.sh",
  "why": "Optional toolchain imports must publish environment state and propagate a present module failure."
 },
 {
  "id": "lib.fixture-module-setup-before-import",
  "target": "linux/scripts/tests/sourced-module-fixture.sh",
  "find": "    printf '%s\\n' \"$setup\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "the setup must initialize values before the sourced module reads them"
 },
 {
  "id": "lib.fixture-module-import-failure",
  "target": "linux/scripts/tests/sourced-module-fixture.sh",
  "find": "printf 'set -euo pipefail\\n'",
  "replace": "printf 'set -uo pipefail\\n'",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "a failing import must stop the body and retain its failing status"
 },
 {
  "id": "lib.fixture-module-pipeline-failure",
  "target": "linux/scripts/tests/sourced-module-fixture.sh",
  "find": "set -euo pipefail",
  "replace": "set -eu",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "setup pipelines must fail when an earlier command fails"
 },
 {
  "id": "lib.fixture-preflight-selected-function",
  "target": "linux/scripts/tests/preflight-gate-fixture.sh",
  "find": "source \"$1\"; \"$2\"",
  "replace": "source \"$1\"; true",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "the extracted gate must execute rather than only define its function"
 },
 {
  "id": "lib.fixture-preflight-consumer-directory",
  "target": "linux/scripts/tests/preflight-gate-fixture.sh",
  "find": "cd \"$directory\"",
  "replace": "cd \"${_PREFLIGHT_FIXTURE_WORK}\"",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "the extracted gate must inspect its consumer tree rather than the helper workspace"
 },
 {
  "id": "lib.fixture-preflight-failing-status",
  "target": "linux/scripts/tests/preflight-gate-fixture.sh",
  "find": "  status=$?",
  "replace": "  status=0",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "captured gate failures must remain visible to their assertions"
 },
 {
  "id": "lib.fixture-preflight-stderr-capture",
  "target": "linux/scripts/tests/preflight-gate-fixture.sh",
  "find": "\"${_PREFLIGHT_FIXTURE_FUNCTION}\" 2>&1",
  "replace": "\"${_PREFLIGHT_FIXTURE_FUNCTION}\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "captured diagnostics must retain stderr alongside stdout"
 },
 {
  "id": "lib.fixture-cmake-parent-template",
  "target": "linux/scripts/tests/cmake-project-fixture.sh",
  "find": "mktemp -d \"$2\"",
  "replace": "mktemp -d",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "caller-owned project templates keep generated trees inside their cleanup scope"
 },
 {
  "id": "lib.fixture-cmake-project-body",
  "target": "linux/scripts/tests/cmake-project-fixture.sh",
  "find": "\"$1\" > \"${dir}/CMakeLists.txt\"",
  "replace": "'' > \"${dir}/CMakeLists.txt\"",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "the generated CMake project must retain the caller module invocation"
 },
 {
  "id": "lib.fixture-cmake-no-compilers",
  "target": "linux/scripts/tests/cmake-project-fixture.sh",
  "find": "project(p NONE)",
  "replace": "project(p)",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "module policy fixtures must avoid discovering compilers or building code"
 },
 {
  "id": "lib.fixture-field-empty-boundaries",
  "target": "linux/scripts/tests/sourced-module-fixture.sh",
  "find": "    separator='|'",
  "replace": "    separator=''",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "field receipts must preserve empty leading and trailing fields and embedded spaces"
 },
 {
  "id": "lib.fixture-named-value-order",
  "target": "linux/scripts/tests/sourced-module-fixture.sh",
  "find": "values+=(\"${!name}\")",
  "replace": "values=(\"${!name}\" \"${values[@]}\")",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "named field snapshots preserve caller ordering after importing the module"
 },
 {
  "id": "lib.fixture-module-caller-stdin",
  "target": "linux/scripts/tests/sourced-module-fixture.sh",
  "find": "  )\"",
  "replace": "  )\" </dev/null",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "isolated imports retain the input stream available to the original bash child"
 },
 {
  "id": "lib.fixture-workspace-exit-cleanup",
  "target": "linux/scripts/tests/test-workspace-fixture.sh",
  "find": "    trap 'rm -rf \"${_TEST_FIXTURE_WORKSPACE}\"' EXIT",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "disposable suite inputs must be removed when the child shell exits"
 },
 {
  "id": "lib.fixture-preflight-caller-shell-options",
  "target": "linux/scripts/tests/preflight-gate-fixture.sh",
  "find": "${4:-set -u}",
  "replace": "set -u",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "the CRLF gate must execute under actual preflight options, including pipefail"
 },
 {
  "id": "lib.fixture-function-installation",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "    eval \"${function_source}\" || return $?",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "named fixture functions must be installed without executing unrelated module top-level code"
 },
 {
  "id": "lib.fixture-missing-function-is-fatal",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "function_source=\"$(t_fn_src \"${source_file}\" \"${function_name}\")\" || return $?",
  "replace": "function_source=\"$(t_fn_src \"${source_file}\" \"${function_name}\")\" || true",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "a missing extracted fixture definition must fail initialization rather than leave a vacuous suite"
 },
 {
  "id": "lib.fixture-explicit-repository-root",
  "target": "linux/scripts/tests/test-workspace-fixture.sh",
  "find": "${BASH_SOURCE[0]%/*}/../../..",
  "replace": "${BASH_SOURCE[0]%/*}/../..",
  "test": "bash linux/scripts/tests/test-fixture-drivers.sh",
  "why": "explicit repository-root outputs must resolve the hub rather than its Linux subtree"
 },
 {
  "id": "critical-fixes.cache-contract-invoked",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "quiet _critical_cache_launcher_contract \\\n        \"${ccsh}\"",
  "replace": "quiet true \\\n        \"${ccsh}\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "The cross-build guard must invoke shared launcher verification and aggregate its failures."
 },
 {
  "id": "critical-fixes.cache-companion-required",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "  grep -qE '^source .*compiler-cache-utils\\.sh.*\\|\\| return 1$' \"${module}\" || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "The shared selector dependency must remain required by the compiler module."
 },
 {
  "id": "critical-fixes.cache-delegation-required",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "  grep -qE '^[[:space:]]*compiler_cache_guarded_launcher[[:space:]]' \"${module}\" || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "The compiler module must delegate selection to its shared owner."
 },
 {
  "id": "critical-fixes.cache-selector-behavior",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "    [ \"$(compiler_cache_guarded_launcher \"${fixture}/local\")\" = \"${expected}\" ] || return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "The extracted selector must reject unusable candidates, prefer its local executable and retain bare fallback."
 },
 {
  "id": "critical-fixes.cache-rust-fallback",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "      [ \"${RUSTC_WRAPPER}\" = \"${expected}\" ] || return 1",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "Rust must retain the guarded choice or sccache when the resolver yields ccache or an empty value."
 },
 {
  "id": "lib.layer-order-cache-utility-classified",
  "target": "linux/scripts/tests/test-layer-order.sh",
  "find": "compiler-cache-utils.sh ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-layer-order.sh",
  "why": "The cache companion must remain classified as a pure leaf while common keeps its lower-layer dependency."
 },
 {
  "id": "lib.layer-order-cache-utility-leaf",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "# shellcheck shell=bash",
  "replace": "# shellcheck shell=bash\nsource /opt/scripts/core/common.sh",
  "test": "bash linux/scripts/tests/test-layer-order.sh",
  "why": "Classifying the utility as L0 must reject a future higher-layer dependency instead of exempting the utility from source-graph checks."
 },
 {
  "id": "lib.renovate-listing-prefix",
  "target": "linux/scripts/renovate-say.sh",
  "find": "printf '%s%s\\n' \"${prefix}\" \"${item}\"",
  "replace": "printf '%s%s\\n' '' \"${item}\"",
  "test": "bash linux/scripts/tests/test-renovate-reporting.sh",
  "why": "Shared listings must retain caller indentation and literal percent signs."
 },
 {
  "id": "lib.renovate-listing-advice-conditional",
  "target": "linux/scripts/renovate-say.sh",
  "find": "if note_listing \"$@\"; then note \"${advice}\"; fi",
  "replace": "note_listing \"$@\" || true; note \"${advice}\"",
  "test": "bash linux/scripts/tests/test-renovate-reporting.sh",
  "why": "An empty report must not emit advice or blank lines."
 },
 {
  "id": "lib.renovate-listing-advice-content",
  "target": "linux/scripts/renovate-say.sh",
  "find": "then note \"${advice}\"; fi",
  "replace": "then :; fi",
  "test": "bash linux/scripts/tests/test-renovate-reporting.sh",
  "why": "Populated refusal and collateral reports must retain their final advice."
 },
 {
  "id": "lib.renovate-listing-empty-status",
  "target": "linux/scripts/renovate-say.sh",
  "find": "[ $# -gt 0 ] || return 1",
  "replace": "[ $# -gt 0 ] || return 0",
  "test": "bash linux/scripts/tests/test-renovate-reporting.sh",
  "why": "Empty listing status must remain distinguishable from a populated report."
 },
 {
  "id": "lib.renovate-lock-report-prefix",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "note_listing_prefix ''",
  "replace": "note_listing_prefix '  '",
  "test": "bash linux/scripts/tests/test-renovate-reporting.sh",
  "why": "Unreadable lock diagnostics retain their unindented bytes before rollback dispatch."
 },
 {
  "id": "lib.onnx-cross-toolchain-argv",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "    CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER",
  "replace": "    CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=ONLY",
  "test": "bash linux/scripts/tests/test-onnx-cross-staging.sh",
  "why": "Runtime and GenAI must keep host tools executable while target libraries and headers stay root-only."
 },
 {
  "id": "lib.onnx-cross-library-type",
  "target": "linux/scripts/01-core/elf-strip.sh",
  "find": "\"${depth_args[@]}\" -type f",
  "replace": "\"${depth_args[@]}\"",
  "test": "bash linux/scripts/tests/test-onnx-cross-staging.sh",
  "why": "Library actions must exclude symlinks and nested directories instead of copying link targets or stripping through links."
 },
 {
  "id": "lib.onnx-cross-advisory-action",
  "target": "linux/scripts/01-core/elf-strip.sh",
  "find": "-exec \"$@\" {} + 2>/dev/null || true",
  "replace": "-exec \"$@\" {} + 2>/dev/null",
  "test": "bash linux/scripts/tests/test-onnx-cross-staging.sh",
  "why": "Both library staging and strip retain advisory find/action failure policies."
 },
 {
  "id": "lib.onnx-cross-native-strip-depth",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native.sh",
  "find": "apply_shared_library_action \"${NATIVE_CPU_OUTPUT_DIR}/lib\" 2 2",
  "replace": "apply_shared_library_action \"${NATIVE_CPU_OUTPUT_DIR}/lib\" 1 2",
  "test": "bash linux/scripts/tests/test-onnx-cross-staging.sh",
  "why": "Native strip must include nested regular libraries at its original depth2."
 },
 {
  "id": "lib.onnx-cross-genai-selector",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "'libonnxruntime-genai*.so*' '*.so'",
  "replace": "'libonnxruntime*.so*' '*.so'",
  "test": "bash linux/scripts/tests/test-onnx-cross-staging.sh",
  "why": "GenAI may stage all unversioned shared objects but only its own versioned libraries."
 },
 {
  "id": "lib.elf-library-pattern-list",
  "target": "linux/scripts/01-core/elf-strip.sh",
  "find": "while [ \"${patterns}\" -gt 0 ]; do",
  "replace": "while [ \"${patterns}\" -gt 1 ]; do",
  "test": "bash linux/scripts/tests/test-onnx-cross-staging.sh",
  "why": "Shared-prefix strips retain every supplied filename pattern, independently of batched action arguments."
 },
 {
  "id": "lib.onnx-library-companion-required",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "stage_qnn_runtime apply_shared_library_action cmake_assert_configured_entries;",
  "replace": "stage_qnn_runtime cmake_assert_configured_entries;",
  "test": "bash linux/scripts/tests/test-onnx-library-companion.sh",
  "why": "ORT bootstrap must reject a missing shared library traversal helper before a step can execute."
 },
 {
  "id": "lib.copied-gate-freeze-truncates",
  "target": "linux/scripts/tests/gate-tree.sh",
  "find": "> \"$allow_file\"",
  "replace": ">> \"$allow_file\"",
  "test": "bash linux/scripts/tests/test-copied-gate-fixture.sh",
  "why": "rewriting fixture freezes must drop old rows rather than retain stale exceptions"
 },
 {
  "id": "lib.copied-gate-freeze-retains-all-rows",
  "target": "linux/scripts/tests/gate-tree.sh",
  "find": "printf '%s\\n' \"$@\" > \"$allow_file\"",
  "replace": "printf '%s\\n' \"$1\" > \"$allow_file\"",
  "test": "bash linux/scripts/tests/test-copied-gate-fixture.sh",
  "why": "the shared freeze writer must preserve every requested row and its separators"
 },
 {
  "id": "lib.copied-gate-argv-boundaries",
  "target": "linux/scripts/tests/gate-tree.sh",
  "find": "\"$tree/$relative_gate\" \"$@\"",
  "replace": "\"$tree/$relative_gate\" $*",
  "test": "bash linux/scripts/tests/test-copied-gate-fixture.sh",
  "why": "copied-gate execution must retain whitespace inside one argument"
 },
 {
  "id": "lib.copied-gate-stderr-capture",
  "target": "linux/scripts/tests/gate-tree.sh",
  "find": "  t_out \"$interpreter\" \"$tree/$relative_gate\" \"$@\"",
  "replace": "  \"$interpreter\" \"$tree/$relative_gate\" \"$@\"",
  "test": "bash linux/scripts/tests/test-copied-gate-fixture.sh",
  "why": "gate diagnostics on stderr must stay in captured output"
 },
 {
  "id": "lib.copied-gate-failure-verdict",
  "target": "linux/scripts/tests/gate-tree.sh",
  "find": "  t_out \"$interpreter\" \"$tree/$relative_gate\" \"$@\"",
  "replace": "  t_out \"$interpreter\" \"$tree/$relative_gate\" \"$@\" || true",
  "test": "bash linux/scripts/tests/test-copied-gate-fixture.sh",
  "why": "a copied gate failure must propagate rather than produce an advisory pass"
 },
 {
  "id": "doc-links.fixture-retains-subject-type",
  "target": "linux/scripts/tests/test-doc-links.sh",
  "find": "\"${d}/linux/scripts/${2:-subject.sh}\"",
  "replace": "\"${d}/linux/scripts/subject.sh\"",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "the non-source pointer fixture must retain its Makefile extension rather than enter the source header rule"
 },
 {
  "id": "lib.vulkan-fixture-host-header",
  "target": "linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "find": "  : > \"${SDK}/x86_64/include/vulkan/vulkan.h\"\n  local component",
  "replace": "  :\n  local component",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "component fixtures must retain the host SDK header copied into target prefixes"
 },
 {
  "id": "lib.vulkan-fixture-all-sources",
  "target": "linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "find": "for component in \"$@\"; do mkdir",
  "replace": "for component in \"${@:1:1}\"; do mkdir",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "multi-component fixtures must exercise every ordered source row rather than only their first dependency"
 },
 {
  "id": "lib.vulkan-fixture-glslang-install-name",
  "target": "linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "find": "  t_write_exec_stub \"${SDK}/aarch64/bin/$1\"",
  "replace": "  t_write_exec_stub \"${SDK}/aarch64/bin/glslang\"",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "forward and reverse alias cases must start with their different installed tool names"
 },
 {
  "id": "lib.uv-conflict-fixture-layout-selection",
  "target": "linux/scripts/tests/test-uv-conflict-extras.sh",
  "find": "_p=\"$(\"$1\" \"ml-ai ml-ai-cuda\"",
  "replace": "_p=\"$( _pyproject \"ml-ai ml-ai-cuda\"",
  "test": "bash linux/scripts/tests/test-uv-conflict-extras.sh",
  "why": "the inline layout case must actually construct an inline group, independently of parser verdicts"
 },
 {
  "id": "lib.uv-conflict-fixture-independent-families",
  "target": "linux/scripts/tests/test-uv-conflict-extras.sh",
  "find": "\"$1\" \"ml-ai ml-ai-cuda\" \"pytorch-cpu pytorch-cu130\"",
  "replace": "\"$1\" \"ml-ai ml-ai-cuda\" \"pytorch-cpu pytorch-cpu\"",
  "test": "bash linux/scripts/tests/test-uv-conflict-extras.sh",
  "why": "each layout fixture must retain the same two independent conflict families being asserted"
 },
 {
  "id": "lib.ort-fetchcontent-src",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "for _ofdn_name in \"$@\" onnxruntime-src onnxruntime-subbuild onnxruntime-build; do",
  "replace": "for _ofdn_name in \"$@\" onnxruntime-subbuild onnxruntime-build; do",
  "test": "bash linux/scripts/tests/test-ort-fetchcontent-directories.sh",
  "why": "Both consumers must retain the exact fetched ONNX Runtime src directory name."
 },
 {
  "id": "lib.ort-fetchcontent-subbuild",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "for _ofdn_name in \"$@\" onnxruntime-src onnxruntime-subbuild onnxruntime-build; do",
  "replace": "for _ofdn_name in \"$@\" onnxruntime-src onnxruntime-build; do",
  "test": "bash linux/scripts/tests/test-ort-fetchcontent-directories.sh",
  "why": "Both consumers must retain the exact fetched ONNX Runtime subbuild directory name."
 },
 {
  "id": "lib.ort-fetchcontent-build",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "for _ofdn_name in \"$@\" onnxruntime-src onnxruntime-subbuild onnxruntime-build; do",
  "replace": "for _ofdn_name in \"$@\" onnxruntime-src onnxruntime-subbuild; do",
  "test": "bash linux/scripts/tests/test-ort-fetchcontent-directories.sh",
  "why": "Both consumers must retain the exact fetched ONNX Runtime build directory name."
 },
 {
  "id": "lib.ort-fetchcontent-case-sensitive",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "    _ofdn_names+=(-name \"${_ofdn_name}\")",
  "replace": "    _ofdn_names+=(-iname \"${_ofdn_name}\")",
  "test": "bash linux/scripts/tests/test-ort-fetchcontent-directories.sh",
  "why": "FetchContent names stay case-sensitive independently of release package matching."
 },
 {
  "id": "lib.ort-fetchcontent-disjunction",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "then _ofdn_names+=(-o); fi",
  "replace": "then :; fi",
  "test": "bash linux/scripts/tests/test-ort-fetchcontent-directories.sh",
  "why": "The shared predicate accepts each fetched name rather than requiring mutually exclusive names simultaneously."
 },
 {
  "id": "lib.ort-fetchcontent-g2-exact-ortlib",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "_ortg_fetchcontent_directory_names fetched_directory_names ortlib-src ortlib-subbuild ortlib-build",
  "replace": "_ortg_fetchcontent_directory_names fetched_directory_names ortlib-src ortlib-subbuild",
  "test": "bash linux/scripts/tests/test-ort-fetchcontent-directories.sh",
  "why": "Provenance retains all three exact ortlib fetched directory categories."
 },
 {
  "id": "lib.ort-fetchcontent-genai-wildcard",
  "target": "linux/scripts/03-media/verify-genai-ort.sh",
  "find": "_ortg_fetchcontent_directory_names fetched_directory_names 'ortlib-*'",
  "replace": "_ortg_fetchcontent_directory_names fetched_directory_names ortlib-src",
  "test": "bash linux/scripts/tests/test-ort-fetchcontent-directories.sh",
  "why": "GenAI retains its broader ortlib wildcard beneath _deps while provenance remains exact."
 },
 {
  "id": "lib.log-fallback-function-priority",
  "target": "linux/scripts/lib/log-bootstrap.sh",
  "find": "function) probe=(declare -F)",
  "replace": "function) probe=(command -v)",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "Library fallbacks test for functions, so an external tool must not replace the library logger."
 },
 {
  "id": "lib.log-fallback-command-priority",
  "target": "linux/scripts/lib/log-bootstrap.sh",
  "find": "command) probe=(command -v)",
  "replace": "command) probe=(declare -F)",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "Standalone fallbacks preserve external logger commands as well as prebound functions."
 },
 {
  "id": "lib.log-fallback-style",
  "target": "linux/scripts/lib/log-bootstrap.sh",
  "find": "[ \"${style}\" = color ]",
  "replace": "[ \"${style}\" = plain ]",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "Colored library fallback bytes remain distinct from plain build-script logs."
 },
 {
  "id": "lib.log-fallback-stderr",
  "target": "linux/scripts/lib/log-bootstrap.sh",
  "find": "warn) label=WARN; color=33; redirect=' >&2'",
  "replace": "warn) label=WARN; color=33; redirect=''",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "Warnings must keep their stderr channel."
 },
 {
  "id": "lib.log-fallback-fatal",
  "target": "linux/scripts/lib/log-bootstrap.sh",
  "find": "fatal=' exit 1;'",
  "replace": "fatal=''",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "The fallback error logger remains fatal with exit1."
 },
 {
  "id": "lib.log-fallback-registrar-mode",
  "target": "linux/scripts/lib/log-bootstrap.sh",
  "find": "\"${_LOG_BOOTSTRAP_REGISTRAR_ONLY:-0}\" = 1",
  "replace": "\"${_LOG_BOOTSTRAP_REGISTRAR_ONLY:-0}\" = 0",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "Registrar-only imports must not load real logging or set the bootstrap guard."
 },
 {
  "id": "lib.log-fallback-mode-is-scoped",
  "target": "linux/scripts/01-core/abseil-headers.sh",
  "find": "_LOG_BOOTSTRAP_REGISTRAR_ONLY=1 source",
  "replace": "_LOG_BOOTSTRAP_REGISTRAR_ONLY=1; source",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "The private import selector must not leak into the caller."
 },
 {
  "id": "lib.log-fallback-toolchain-copy",
  "target": "linux/Dockerfile.toolchain",
  "find": "COPY --chmod=755 linux/scripts/lib/log-bootstrap.sh /opt/scripts/lib/log-bootstrap.sh",
  "replace": "",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "The shipped core tree must carry its actual logger companion."
 },
 {
  "id": "lib.log-fallback-package-copy",
  "target": "linux/Dockerfile.package",
  "find": "linux/scripts/lib/log-bootstrap.sh /tmp/",
  "replace": "/tmp/",
  "test": "bash linux/scripts/tests/test-media-payload-inventory.sh",
  "why": "The isolated payload entrypoint COPY carries the registrar alongside its inventory."
 },
 {
  "id": "lib.log-fallback-definition-quoting",
  "target": "linux/scripts/lib/log-bootstrap.sh",
  "find": "'%s() { printf %q \"$*\"%s;%s }' ",
  "replace": "'%s() { printf %s \"$*\"%s;%s }' ",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "Generated logger functions quote their literal format before evaluating the definition."
 },
 {
  "id": "lib.smoke-compiler-elf-owner-loaded",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    smoke_load_platform\n    command -v elf_machine_name",
  "replace": "    :\n    command -v elf_machine_name",
  "test": "bash linux/scripts/tests/test-smoke-elf-owner.sh",
  "why": "Absent preloaded ELF helpers must resolve the canonical platform parser."
 },
 {
  "id": "lib.smoke-compiler-elf-owner-isolated",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  (\n    smoke_load_platform\n    command -v elf_machine_name >/dev/null 2>&1 || exit 1\n    elf_machine_name \"$1\"\n  )",
  "replace": "  smoke_load_platform\n  command -v elf_machine_name >/dev/null 2>&1 || return 1\n  elf_machine_name \"$1\"",
  "test": "bash linux/scripts/tests/test-smoke-elf-owner.sh",
  "why": "Loading the canonical parser must not leak platform functions or guard state into standalone smoke callers."
 },
 {
  "id": "lib.smoke-compiler-elf-override-status",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    elf_machine_name \"$1\"\n    return",
  "replace": "    elf_machine_name \"$1\"\n    return 0",
  "test": "bash linux/scripts/tests/test-smoke-elf-owner.sh",
  "why": "Preloaded helper output, side effects and failure status retain their existing direct-call policy."
 },
 {
  "id": "lib.smoke-compiler-elf-missing-owner-fails",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "command -v elf_machine_name >/dev/null 2>&1 || exit 1",
  "replace": "command -v elf_machine_name >/dev/null 2>&1 || return 0",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "A missing parser companion must not report a successful empty inspection."
 },
 {
  "id": "lib.smoke-compiler-elf-copy",
  "target": "linux/Dockerfile.toolchain",
  "find": "COPY --chmod=755 linux/scripts/01-core/ /opt/scripts/core/\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-smoke-elf-owner.sh",
  "why": "The first toolchain smoke image must ship its shared parser owner."
 },
 {
  "id": "lib.smoke-compiler-elf-header-status",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  LC_ALL=C readelf -h \"$1\" 2>/dev/null | grep 'Machine:' | head -1",
  "replace": "  LC_ALL=C readelf -h \"$1\" 2>/dev/null | grep 'Machine:' | head -1 || true",
  "test": "bash linux/scripts/tests/test-compiler-elf-policy.sh",
  "why": "Host GCC retains readelf failures while target and swapped callers explicitly keep best-effort output."
 },
 {
  "id": "lib.smoke-compiler-elf-header-label",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  LC_ALL=C readelf -h \"$1\" 2>/dev/null | grep 'Machine:' | head -1",
  "replace": "  LC_ALL=C readelf -h \"$1\" 2>/dev/null | grep 'Machine:' | head -1 | sed 's/.*Machine: *//' ",
  "test": "bash linux/scripts/tests/test-compiler-elf-policy.sh",
  "why": "Compiler verdicts retain complete readelf header labels and indentation."
 },
 {
  "id": "lib.smoke-compiler-elf-case-insensitive",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  echo \"$1\" | grep -qi \"$2\"",
  "replace": "  echo \"$1\" | grep -q \"$2\"",
  "test": "bash linux/scripts/tests/test-compiler-elf-policy.sh",
  "why": "The shared compiler header predicate retains case-insensitive regex matching."
 },
 {
  "id": "lib.media-probe-python-order",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  target_python_include=\"$(\n    _gst_python_provider() { cross_target_python_include_dir; }\n    cross_capture_python_dev_path include_dir \"${target_python_include}\" _gst_python_provider\n  )\"\n  target_python_library=\"$(\n    _gst_python_provider() { cross_target_python_library; }\n    cross_capture_python_dev_path library \"${target_python_library}\" _gst_python_provider\n  )\"\n",
  "replace": "  target_python_library=\"$(\n    _gst_python_provider() { cross_target_python_library; }\n    cross_capture_python_dev_path library \"${target_python_library}\" _gst_python_provider\n  )\"\n  target_python_include=\"$(\n    _gst_python_provider() { cross_target_python_include_dir; }\n    cross_capture_python_dev_path include_dir \"${target_python_include}\" _gst_python_provider\n  )\"\n",
  "test": "bash linux/scripts/tests/test-media-python-probes.sh",
  "why": "The actual GStreamer caller keeps include before library and its optional pkg-config probe rather than imposing a shared library-first field order."
 },
 {
  "id": "lib.media-probe-python-best-effort",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "\"$3\" \"${@:4}\" 2>/dev/null || true",
  "replace": "\"$3\" \"${@:4}\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-media-python-probes.sh",
  "why": "A failed optional probe retains its partial stdout without aborting an unconditional build caller."
 },
 {
  "id": "lib.media-probe-rust-field",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "if command -v \"cross_target_${_cctre_field}_rust\" >/dev/null 2>&1; then\n      printf -v \"${_cctre_output}[${_cctre_field}]\" '%s' \"$(\n        case \"${_cctre_field}\" in",
  "replace": "if command -v \"cross_target_upper_rust\" >/dev/null 2>&1; then\n      printf -v \"${_cctre_output}[${_cctre_field}]\" '%s' \"$(\n        case upper in",
  "test": "bash linux/scripts/tests/test-gstreamer-cargo-bindings.sh",
  "why": "Upper and lower target Rust environment names remain independent ordered probes."
 },
 {
  "id": "lib.media-probe-host-scope",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "[ \"${scope}\" != host ] || export HOST_CC=\"${compiler}\"",
  "replace": "export HOST_CC=\"${compiler}\"",
  "test": "bash linux/scripts/tests/test-gstreamer-cargo-bindings.sh",
  "why": "Standalone target-style bindings must not overwrite the host compiler override."
 },
 {
  "id": "lib.media-probe-empty-wrapper",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "    c)\n      export \"CARGO_TARGET_${rust_env}_LINKER=${compiler}\"",
  "replace": "    c)\n      [ -n \"${compiler}\" ] || return 0\n      export \"CARGO_TARGET_${rust_env}_LINKER=${compiler}\"",
  "test": "bash linux/scripts/tests/test-gstreamer-cargo-bindings.sh",
  "why": "Existing empty host-wrapper outputs remain observable as explicitly empty bindings."
 },
 {
  "id": "lib.media-probe-hidden-symbols",
  "target": "linux/scripts/tests/media-probe-fixture.sh",
  "find": "[ \"${2:-}\" != \"$hidden\" ] || return 1",
  "replace": ": \"$hidden\"",
  "test": "bash linux/scripts/tests/test-media-python-probes.sh && bash linux/scripts/tests/test-gstreamer-cargo-bindings.sh",
  "why": "Unavailable optional helper scenarios must hide the actual requested commands rather than exercising ready helpers."
 },
 {
  "id": "lib.media-probe-partial-failure",
  "target": "linux/scripts/tests/media-probe-fixture.sh",
  "find": "[ \"$scenario\" != partial ] || return 8",
  "replace": ": \"$scenario\"",
  "test": "bash linux/scripts/tests/test-media-python-probes.sh",
  "why": "Optional-probe fixtures must actually produce a nonzero status with partial stdout, so active-errexit protection is exercised."
 },
 {
  "id": "lib.renovate-fixture-apply-verdict",
  "target": "linux/scripts/tests/renovate-fixtures.sh",
  "find": "t_assert_eq \"$expected\" \"${RC}\" \"$reason\"",
  "replace": "t_assert_eq 0 \"${RC}\" \"$reason\"",
  "test": "bash linux/scripts/tests/test-renovate-audit.sh",
  "why": "refusal cases must retain the expected nonzero apply result instead of treating only success as valid"
 },
 {
  "id": "lib.renovate-fixture-refusal-reason",
  "target": "linux/scripts/tests/renovate-fixtures.sh",
  "find": "t_assert_contains \"${OUT}\" \"$4\"",
  "replace": "t_assert_contains \"${OUT}\" \"missing parser verdict\"",
  "test": "bash linux/scripts/tests/test-renovate-audit.sh",
  "why": "shared refusal drivers must assert the actual parser diagnosis"
 },
 {
  "id": "lib.renovate-fixture-temporary-mode",
  "target": "linux/scripts/tests/renovate-fixtures.sh",
  "find": "chmod \"$temporary_mode\" \"$path\"",
  "replace": "chmod \"$restore_mode\" \"$path\"",
  "test": "bash linux/scripts/tests/test-renovate-fixture-protocols.sh",
  "why": "the isolated apply must observe the deliberately unwritable fixture mode"
 },
 {
  "id": "lib.renovate-fixture-restores-mode",
  "target": "linux/scripts/tests/renovate-fixtures.sh",
  "find": "  chmod \"$restore_mode\" \"$path\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-renovate-fixture-protocols.sh",
  "why": "cleanup must restore permissions after a failed run without overwriting its verdict"
 },
 {
  "id": "lib.renovate-fixture-argv",
  "target": "linux/scripts/tests/renovate-fixtures.sh",
  "find": "  _run \"$repo\" \"$report\" \"$@\"",
  "replace": "  _run \"$repo\" \"$report\" $*",
  "test": "bash linux/scripts/tests/test-renovate-fixture-protocols.sh",
  "why": "fixture command arguments containing spaces must stay separate from action flags"
 },
 {
  "id": "lib.prevention-fixture-renders-lines",
  "target": "linux/scripts/tests/test-prevention-gates.sh",
  "find": "printf '%b' \"$escaped_subject\"",
  "replace": "printf '%s' \"$escaped_subject\"",
  "test": "bash linux/scripts/tests/test-prevention-gates.sh",
  "why": "each language fixture must contain real lines rather than escaped backslash-n text"
 },
 {
  "id": "lib.prevention-fixture-language-path",
  "target": "linux/scripts/tests/test-prevention-gates.sh",
  "find": "_size_at \"$path\"",
  "replace": "_size_at linux/scripts/subject.sh",
  "test": "bash linux/scripts/tests/test-prevention-gates.sh",
  "why": "string and comment semantics must be tested using each caller-selected file language"
 },
 {
  "id": "lib.chain-stage-fixture-preserves-no-export",
  "target": "linux/scripts/tests/test-chain-lifecycle.sh",
  "find": "t_assert_eq \"0\" \"$(grep -c -e 'CROSS_NO_LOCAL_CACHE_EXPORT' \"${workdir}/sg.txt\" || true)\" \"${1:-}\"",
  "replace": "t_assert_eq \"1\" \"$(grep -c -e 'CROSS_NO_LOCAL_CACHE_EXPORT' \"${workdir}/sg.txt\" || true)\" \"${1:-}\"",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "both rescue levers must retain cache exports after recovering disk space"
 },
 {
  "id": "lib.log-fallback-media-copy",
  "target": "linux/Dockerfile.media",
  "find": "COPY --chmod=755 linux/scripts/lib/log-bootstrap.sh /opt/scripts/lib/log-bootstrap.sh",
  "replace": "",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "A partial media rebuild must carry the actual logger companion independently of the pinned SDK parent."
 },
 {
  "id": "lib.log-fallback-registrar-public-names",
  "target": "linux/scripts/lib/log-bootstrap.sh",
  "find": "if [ \"${_LOG_BOOTSTRAP_REGISTRAR_ONLY:-0}\" = 1 ]; then return 0; fi",
  "replace": "if [ \"${_LOG_BOOTSTRAP_REGISTRAR_ONLY:-0}\" = 1 ]; then err() { :; }; return 0; fi",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "Registrar-only imports must not install public loggers the caller did not request."
 },
 {
  "id": "lib.venv-probe-bin-precedes-scripts",
  "target": "linux/scripts/01-core/python-probe.sh",
  "find": "\"$venv/bin/python\" \"$venv/Scripts/python.exe\"",
  "replace": "\"$venv/Scripts/python.exe\" \"$venv/bin/python\"",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "the POSIX interpreter wins when both executable layouts exist"
 },
 {
  "id": "lib.venv-probe-requires-executable",
  "target": "linux/scripts/01-core/python-probe.sh",
  "find": "if [ -x \"$candidate\" ]",
  "replace": "if [ -f \"$candidate\" ]",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "a regular nonexecutable interpreter must fall through rather than reach uv"
 },
 {
  "id": "lib.venv-probe-broken-status",
  "target": "linux/scripts/01-core/python-probe.sh",
  "find": "  done\n  return 1\n}",
  "replace": "  done\n  return 0\n}",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "a missing interpreter must return failure without handing callers a broken path"
 },
 {
  "id": "lib.uv-probe-companion-required",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "source \"$_MODULE_DIR/python-probe.sh\" || return 1",
  "replace": "source \"$_MODULE_DIR/python-probe.sh\" || true",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "copied uv modules must fail loading when their shared interpreter resolver is missing"
 },
 {
  "id": "lib.webdav-probe-companion-required",
  "target": "linux/scripts/01-core/webdav-download.sh",
  "find": "source \"${_webdav_core_dir}/python-probe.sh\" || return 1",
  "replace": "source \"${_webdav_core_dir}/python-probe.sh\" || true",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "copied WebDAV modules must fail loading when their shared resolver is missing"
 },
 {
  "id": "lib.python-workspace-pyproject-required",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "[ -d \"$mount\" ] && [ -f \"$mount/pyproject.toml\" ]",
  "replace": "[ -d \"$mount\" ]",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "a directory that is not the mounted Python project must not override the caller workspace"
 },
 {
  "id": "lib.python-workspace-marker-is-file",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "[ -f \"$mount/pyproject.toml\" ]",
  "replace": "[ -e \"$mount/pyproject.toml\" ]",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "a directory named pyproject.toml must not qualify as a Python workspace"
 },
 {
  "id": "lib.python-detect-prefers-bind-mount",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  python_workspace_prefer_mount\n  export WORKSPACE_ROOT",
  "replace": "  :\n  export WORKSPACE_ROOT",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "workspace detection applies the container bind mount after its ordinary caller fallback"
 },
 {
  "id": "lib.python-ci-prefers-bind-mount",
  "target": "linux/scripts/02-toolchain/python/ci-common.sh",
  "find": "prepare_ci_workspace() {\n  python_workspace_prefer_mount",
  "replace": "prepare_ci_workspace() {\n  :",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "CI must select the bind mount before changing directory and configuring Flutter and git"
 },
 {
  "id": "lib.webdav-install-failure-is-fatal",
  "target": "linux/scripts/01-core/webdav-download.sh",
  "find": "${WEBDAVCLIENT_REF}.tar.gz\" || return 1",
  "replace": "${WEBDAVCLIENT_REF}.tar.gz\" || true",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "a failed client installation must not execute the downloader using an incomplete environment"
 },
 {
  "id": "lib.webdav-credentials-precede-venv",
  "target": "linux/scripts/01-core/webdav-download.sh",
  "find": "  : \"${WEBDAV_HOSTNAME:?WEBDAV_HOSTNAME is not set}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "missing credentials must fail by their original name before any venv or package operation"
 },
 {
  "id": "lib.python-ci-fixture-carries-probe",
  "target": "linux/scripts/tests/python-ci-fixture.sh",
  "find": " 01-core/python-probe.sh ",
  "replace": " ",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "the canonical copied CI fixture must include the mandatory uv companion instead of producing missing-module failures"
 },
 {
  "id": "lib.uv-venv-validation-before-requirements",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  local venv_python\n  if ! venv_python=\"$(python_venv_executable \"$venv_path\")\"; then\n    die \"No usable venv at $venv_path (neither bin/python nor Scripts/python.exe) - create it first with uv_venv_create\"\n  fi\n  if [ ! -f \"$requirements_file\" ]; then\n    die \"Requirements file not found: $requirements_file\"\n  fi",
  "replace": "  if [ ! -f \"$requirements_file\" ]; then\n    die \"Requirements file not found: $requirements_file\"\n  fi\n  local venv_python\n  if ! venv_python=\"$(python_venv_executable \"$venv_path\")\"; then\n    die \"No usable venv at $venv_path (neither bin/python nor Scripts/python.exe) - create it first with uv_venv_create\"\n  fi",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "a missing venv must retain priority over a missing requirements file and its named error"
 },
 {
  "id": "lib.python-ci-companion-import-status",
  "target": "linux/scripts/02-toolchain/python/ci-common.sh",
  "find": "source \"$_CI_COMMON_DIR/../../01-core/python_uv.sh\" || return $?",
  "replace": "source \"$_CI_COMMON_DIR/../../01-core/python_uv.sh\"",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "a conditional CI import must propagate its missing uv companion rather than continue defining unrelated functions and return success"
 },
 {
  "id": "lib.gpu-repo-signed-stanza",
  "target": "linux/scripts/01-core/setup-rocm-repo.sh",
  "find": "Architectures: amd64\\nSigned-By: /etc/apt/keyrings/rocm.gpg",
  "replace": "Architectures: arm64\\nSigned-By: /etc/apt/keyrings/rocm.gpg",
  "test": "bash linux/scripts/tests/test-gpu-repo-setup.sh",
  "why": "All AMD repository records retain their independent literal amd64/signed-by golden bytes, including ASAN."
 },
 {
  "id": "lib.gpu-repo-missing-pin-warning",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "echo \"${warning}\" >&2",
  "replace": "echo \"${warning}\"",
  "test": "bash linux/scripts/tests/test-gpu-repo-setup.sh",
  "why": "A missing trust-anchor pin warns on stderr while forwarding complete download stdout unchanged."
 },
 {
  "id": "lib.gpu-repo-unverified-retries",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "download_file \"${url}\" \"${destination}\" 3",
  "replace": "download_file \"${url}\" \"${destination}\" 1",
  "test": "bash linux/scripts/tests/test-gpu-repo-setup.sh",
  "why": "Both missing-pin callers retain exactly three download retries."
 },
 {
  "id": "lib.gpu-repo-verified-status",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "download_verified_file \"${url}\" \"${sha}\" \"${destination}\"",
  "replace": "download_verified_file \"${url}\" \"${sha}\" \"${destination}\" || true",
  "test": "bash linux/scripts/tests/test-gpu-repo-setup.sh",
  "why": "Failed verified trust-anchor fetches must stop install and preserve their status in direct and conditional calls."
 },
 {
  "id": "lib.gpu-repo-unverified-status",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "    return $?\n  fi\n  download_verified_file \"${url}\" \"${sha}\" \"${destination}\"",
  "replace": "    return 0\n  fi\n  download_verified_file \"${url}\" \"${sha}\" \"${destination}\"",
  "test": "bash linux/scripts/tests/test-gpu-repo-setup.sh",
  "why": "Missing-pin fetch failures must retain their exact status when a caller disables errexit conditionally."
 },
 {
  "id": "lib.media-dev-symlink-live-destination",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "if [ ! -e \"${destination}\" ] && [ -e \"${source_file}\" ]; then",
  "replace": "if [ -e \"${source_file}\" ]; then",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Existing files and live development links must not be replaced."
 },
 {
  "id": "lib.media-dev-symlink-source-required",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "if [ ! -e \"${destination}\" ] && [ -e \"${source_file}\" ]; then",
  "replace": "if [ ! -e \"${destination}\" ]; then",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "A missing or dangling runtime library must not create a development symlink."
 },
 {
  "id": "lib.media-dev-symlink-dangling-destination",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "if [ ! -e \"${destination}\" ] && [ -e \"${source_file}\" ]; then",
  "replace": "if [ ! -L \"${destination}\" ] && [ ! -e \"${destination}\" ] && [ -e \"${source_file}\" ]; then",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "A dangling development link remains missing under the original -e policy and must be repaired."
 },
 {
  "id": "lib.media-dev-symlink-relative-source",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "*) source_file=\"${destination%/*}/${source_file}\" ;;",
  "replace": "*) : ;;",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Relative runtime libraries are checked beside the destination, while original relative ln arguments stay intact."
 },
 {
  "id": "lib.media-dev-symlink-build-delegation",
  "target": "linux/scripts/03-media/build/armnn/build-armnn.sh",
  "find": "media_missing_dev_symlink \"${destination}\" \"${source}\"",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Every caller must retain the shared eligibility check without losing its own link operation."
 },
 {
  "id": "lib.media-dev-symlink-arm-install-delegation",
  "target": "linux/scripts/03-media/build/armnn/install-deps.sh",
  "find": "media_missing_dev_symlink \"${_libdir}/libgomp.so\" libgomp.so.1",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Every caller must retain the shared eligibility check without losing its own link operation."
 },
 {
  "id": "lib.media-dev-symlink-ffmpeg-delegation",
  "target": "linux/scripts/03-media/build/ffmpeg/install-deps.sh",
  "find": "media_missing_dev_symlink \"${_libdir}/libgomp.so\" libgomp.so.1",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Every caller must retain the shared eligibility check without losing its own link operation."
 },
 {
  "id": "lib.media-dev-symlink-build-message-order",
  "target": "linux/scripts/03-media/build/armnn/build-armnn.sh",
  "find": "    ln -sf \"${source}\" \"${destination}\"\n    info \"${message}\"",
  "replace": "    info \"${message}\"\n    ln -sf \"${source}\" \"${destination}\"",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Build diagnostics follow ln and must not run when a strict direct link operation fails."
 },
 {
  "id": "lib.media-dev-symlink-arm-install-message-order",
  "target": "linux/scripts/03-media/build/armnn/install-deps.sh",
  "find": "    echo \"Creating ${_libdir}/libgomp.so -> libgomp.so.1 (libgomp1 ships no dev symlink)\"\n    ln -sf libgomp.so.1 \"${_libdir}/libgomp.so\"",
  "replace": "    ln -sf libgomp.so.1 \"${_libdir}/libgomp.so\"\n    echo \"Creating ${_libdir}/libgomp.so -> libgomp.so.1 (libgomp1 ships no dev symlink)\"",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Installer diagnostics precede ln even when the link operation subsequently fails."
 },
 {
  "id": "lib.media-dev-symlink-ffmpeg-message-order",
  "target": "linux/scripts/03-media/build/ffmpeg/install-deps.sh",
  "find": "        echo \"Creating ${_libdir}/libgomp.so -> libgomp.so.1 (libgomp1 ships no dev symlink; the cross toolchain has no target libgomp)\"\n        ln -sf libgomp.so.1 \"${_libdir}/libgomp.so\"",
  "replace": "        ln -sf libgomp.so.1 \"${_libdir}/libgomp.so\"\n        echo \"Creating ${_libdir}/libgomp.so -> libgomp.so.1 (libgomp1 ships no dev symlink; the cross toolchain has no target libgomp)\"",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Installer diagnostics precede ln even when the link operation subsequently fails."
 },
 {
  "id": "lib.shell-context-conditional-status",
  "target": "linux/scripts/tests/shell-context-fixture.sh",
  "find": "conditional) if \"$@\"; then _sfrc_status=0; else _sfrc_status=$?; fi ;;",
  "replace": "conditional) if \"$@\"; then _sfrc_status=0; else _sfrc_status=0; fi ;;",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Conditional fixtures must retain the raw operation failure for caller verdicts."
 },
 {
  "id": "lib.shell-context-direct-errexit",
  "target": "linux/scripts/tests/shell-context-fixture.sh",
  "find": "direct) \"$@\"; _sfrc_status=$? ;;",
  "replace": "direct) if \"$@\"; then _sfrc_status=0; else _sfrc_status=$?; fi ;;",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Direct strict fixtures must not suppress errexit by moving the operation under if."
 },
 {
  "id": "lib.shell-context-direct-relaxed-status",
  "target": "linux/scripts/tests/shell-context-fixture.sh",
  "find": "direct) \"$@\"; _sfrc_status=$? ;;",
  "replace": "direct) \"$@\"; _sfrc_status=0 ;;",
  "test": "bash linux/scripts/tests/test-media-dev-symlinks.sh",
  "why": "Relaxed direct fixtures continue after an operation while retaining its failure status."
 },
 {
  "id": "lib.runtime-prep-artifacts-delegates",
  "target": "linux/scripts/build-runtime-artifacts.sh",
  "find": "  runtime_prepare_flow \"${IMAGE_PREFIX}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "Artifacts must execute the preparation lifecycle before resolving and building."
 },
 {
  "id": "lib.runtime-prep-manifest-delegates",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  runtime_prepare_flow \"${IMAGE_NAME}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "Manifest preparation must retain its own prefix and all validation steps."
 },
 {
  "id": "lib.runtime-prep-artifacts-errexit",
  "target": "linux/scripts/build-runtime-artifacts.sh",
  "find": "  runtime_prepare_flow \"${IMAGE_PREFIX}\"",
  "replace": "  if runtime_prepare_flow \"${IMAGE_PREFIX}\"; then :; fi",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "Wrapping preparation in a condition must not disable the original direct-call errexit behavior."
 },
 {
  "id": "lib.runtime-prep-manifest-errexit",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  runtime_prepare_flow \"${IMAGE_NAME}\"",
  "replace": "  if runtime_prepare_flow \"${IMAGE_NAME}\"; then :; fi",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "Manifest post-parse failures must still abort under direct active errexit."
 },
 {
  "id": "lib.runtime-prep-dry-export",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "  export DRY_RUN\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "DRY_RUN is exported before the first preparation operation, including unset and empty values."
 },
 {
  "id": "lib.runtime-prep-prefix-quoted",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "runtime_post_parse_setup TARGET_ARCHES \"$1\"",
  "replace": "runtime_post_parse_setup TARGET_ARCHES $1",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "The caller prefix is a single raw argument even when it contains spaces."
 },
 {
  "id": "lib.runtime-prep-target-binding",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "runtime_post_parse_setup TARGET_ARCHES \"$1\"",
  "replace": "runtime_post_parse_setup \"${TARGET_ARCHES}\" \"$1\"",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "Post-parse setup receives the target variable name and mutates the caller binding."
 },
 {
  "id": "lib.runtime-prep-wheels-status",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "runtime_wheels_setup || exit $?",
  "replace": "runtime_wheels_setup || exit 2",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "Wheel setup retains its raw failure code rather than the validation code."
 },
 {
  "id": "lib.runtime-prep-hailo-fatal",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "hailo_validate_knobs || exit 2",
  "replace": "hailo_validate_knobs || true",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "Hailo validation still stops before payload validation and provenance resolution."
 },
 {
  "id": "lib.runtime-prep-payload-fatal",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "runtime_host_payload_arches >/dev/null || exit 2",
  "replace": "runtime_host_payload_arches >/dev/null || true",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "Payload validation failure remains fatal with code2 in both error contexts."
 },
 {
  "id": "lib.runtime-prep-payload-quiet",
  "target": "linux/scripts/01-core/runtime-flow-common.sh",
  "find": "runtime_host_payload_arches >/dev/null || exit 2",
  "replace": "runtime_host_payload_arches || exit 2",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "Payload validation stdout stays out of the orchestrator output."
 },
 {
  "id": "lib.runtime-prep-fixture-verdict",
  "target": "linux/scripts/tests/runtime-flow-fixtures.sh",
  "find": "    t_assert_eq \"${expected}\" \"$(grep -F -A1 \"${anchor}\" \"${scripts}/01-core/runtime-flow-common.sh\" | sed -n 2p)\" \"${entry} preparation order\"",
  "replace": "    t_assert_eq \"${expected}\" \"${expected}\" \"${entry} preparation order\"",
  "test": "bash linux/scripts/tests/test-runtime-flow-preparation.sh",
  "why": "The shared wiring assertion rejects a missing step rather than merely counting assertions."
 },
 {
  "id": "lib.onnx-fetch-existing-checkout",
  "target": "linux/scripts/03-media/build/onnxruntime/build/20-fetch.sh",
  "find": "if [ -d \"$directory\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-onnx-fetch-receipts.sh",
  "why": "existing source trees must not be cloned over and only GenAI reports that it already exists"
 },
 {
  "id": "lib.onnx-fetch-clone-ref",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "--branch \"$tag\" \"$primary\" \"$dir\"",
  "replace": "--branch main \"$primary\" \"$dir\"",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k primary",
  "why": "each caller must retain its distinct requested source ref"
 },
 {
  "id": "lib.onnx-fetch-clone-repository",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "git clone -q --depth 1 --branch \"$tag\" \"$primary\" \"$dir\" && fetched=1",
  "replace": "git clone -q --depth 1 --branch \"$tag\" \"file:///nonexistent\" \"$dir\" && fetched=1",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k primary",
  "why": "the clone repository and destination must retain their argument positions"
 },
 {
  "id": "lib.onnx-fetch-retry-policy",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "for attempt in 1 2 3; do",
  "replace": "for attempt in 1; do",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k fallback",
  "why": "both clone operations retain three attempts, ten seconds and caller-specific diagnostics"
 },
 {
  "id": "lib.onnx-fetch-optional-genai",
  "target": "linux/scripts/03-media/build/onnxruntime/build/20-fetch.sh",
  "find": "if [[ \"${BUILD_GENAI}\" == \"true\" ]]; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-onnx-fetch-receipts.sh",
  "why": "disabled GenAI must not clone, synchronize or update a checkout"
 },
 {
  "id": "lib.onnx-fetch-ort-sync-advisory",
  "target": "linux/scripts/03-media/build/onnxruntime/build/20-fetch.sh",
  "find": "retry 3 10 \"ONNX Runtime submodule sync\" git submodule sync --recursive || true",
  "replace": "retry 3 10 \"ONNX Runtime submodule sync\" git submodule sync --recursive",
  "test": "bash linux/scripts/tests/test-onnx-fetch-receipts.sh",
  "why": "an ORT sync failure must not abort its required submodule update"
 },
 {
  "id": "lib.onnx-fetch-genai-sync-advisory",
  "target": "linux/scripts/03-media/build/onnxruntime/build/20-fetch.sh",
  "find": "  git submodule sync --recursive || true",
  "replace": "  git submodule sync --recursive",
  "test": "bash linux/scripts/tests/test-onnx-fetch-receipts.sh",
  "why": "GenAI sync failure remains advisory independently of ORT retry behavior"
 },
 {
  "id": "lib.onnx-fetch-genai-update-fatal",
  "target": "linux/scripts/03-media/build/onnxruntime/build/20-fetch.sh",
  "find": "  git submodule update --init --recursive",
  "replace": "  git submodule update --init --recursive || true",
  "test": "bash linux/scripts/tests/test-onnx-fetch-receipts.sh",
  "why": "a failed required GenAI submodule update must stop before returning to ORT"
 },
 {
  "id": "lib.onnx-fetch-return-to-ort",
  "target": "linux/scripts/03-media/build/onnxruntime/build/20-fetch.sh",
  "find": "  cd \"${ORT_SRC_DIR}\"\nfi",
  "replace": "  :\nfi",
  "test": "bash linux/scripts/tests/test-onnx-fetch-receipts.sh",
  "why": "post-GenAI requirements must execute from the ORT checkout"
 },
 {
  "id": "lib.onnx-fetch-clone-failure-fatal",
  "target": "linux/scripts/03-media/build/onnxruntime/build/20-fetch.sh",
  "find": "|| err \"$label source fetch failed\"",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-onnx-fetch-receipts.sh",
  "why": "a failed source fetch must stop before any checkout-specific operation runs"
 },
 {
  "id": "lib.runtime-needed-empty-lines",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "    [ -n \"${so_name}\" ] || continue\n    if [ \"${diagnostics}\"",
  "replace": "    : \"${so_name}\"\n    if [ \"${diagnostics}\"",
  "test": "bash linux/scripts/tests/test-runtime-needed-verdicts.sh",
  "why": "Only nonempty complete SONAME records contribute, while duplicates and whitespace remain intact."
 },
 {
  "id": "lib.runtime-needed-diagnostics",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "if [ \"${diagnostics}\" = yes ]; then echo \"  MISSING:",
  "replace": "if [ \"${diagnostics}\" = no ]; then echo \"  MISSING:",
  "test": "bash linux/scripts/tests/test-runtime-needed-verdicts.sh",
  "why": "Binary scans retain individual missing-name stderr and plugin scans retain their aggregate-only diagnostics."
 },
 {
  "id": "lib.runtime-needed-resolver-arguments",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "done < <(elf_unresolved_needed \"${binary}\" \"${LIB_DIRS[@]}\")",
  "replace": "done < <(elf_unresolved_needed \"${binary}\")",
  "test": "bash linux/scripts/tests/test-runtime-needed-verdicts.sh",
  "why": "Every selected binary retains all ordered search roots, including spaces and duplicates."
 },
 {
  "id": "lib.runtime-needed-complete-lines",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "  while IFS= read -r so_name; do\n    [ -n \"${so_name}\" ] || continue\n    if [ \"${diagnostics}\"",
  "replace": "  while IFS= read -r so_name || [ -n \"${so_name}\" ]; do\n    [ -n \"${so_name}\" ] || continue\n    if [ \"${diagnostics}\"",
  "test": "bash linux/scripts/tests/test-runtime-needed-verdicts.sh",
  "why": "The shared collector preserves the original complete-line-only read contract."
 },
 {
  "id": "lib.runtime-needed-advisory-resolver",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "  done < <(elf_unresolved_needed \"${binary}\" \"${LIB_DIRS[@]}\")\n}",
  "replace": "  done < <(elf_unresolved_needed \"${binary}\" \"${LIB_DIRS[@]}\")\n  elf_unresolved_needed \"${binary}\" \"${LIB_DIRS[@]}\" >/dev/null\n}",
  "test": "bash linux/scripts/tests/test-runtime-needed-verdicts.sh",
  "why": "A failing NEEDED resolver remains advisory after emitting useful partial records, even under active errexit."
 },
 {
  "id": "lib.runtime-needed-summary-count",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "echo \"=== ${severity}: $# ${description} ===\"",
  "replace": "echo \"=== ${severity}: $(( $# + 1 )) ${description} ===\"",
  "test": "bash linux/scripts/tests/test-runtime-needed-verdicts.sh",
  "why": "Each summary count equals its complete emitted name list without changing duplicate-name semantics."
 },
 {
  "id": "lib.runtime-needed-denied-severity",
  "target": "linux/scripts/03-media/runtime/validate-media-runtime.sh",
  "find": "_vmr_report_missing FAIL 'source-built dependencies unresolved (apt repair denied)'",
  "replace": "_vmr_report_missing WARNING 'source-built dependencies unresolved (apt repair denied)'",
  "test": "bash linux/scripts/tests/test-runtime-needed-verdicts.sh",
  "why": "Source-built unresolved dependencies keep their distinct failing summary before the final denial gate."
 },
 {
  "id": "lib.consumer-required-facts-missing-evidence",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "then _ccrf_missing=1; fi",
  "replace": "then :; fi",
  "test": "bash linux/scripts/tests/test-consumer-required-facts.sh",
  "why": "Missing required evidence must produce NOFACT before tool-specific BAD/OK verdicts."
 },
 {
  "id": "lib.consumer-required-facts-value-binding",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    printf -v \"${_ccrf_destination}\" '%s' \"${_ccrf_value}\"",
  "replace": "    printf -v \"${_ccrf_destination}\" '%s' '' ",
  "test": "bash linux/scripts/tests/test-consumer-required-facts.sh",
  "why": "Ordered collection must retain exact fact bytes in the caller-owned values."
 },
 {
  "id": "lib.consumer-required-facts-print-status",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "    _ccrf_verdict=$?",
  "replace": "    _ccrf_verdict=0",
  "test": "bash linux/scripts/tests/test-consumer-required-facts.sh",
  "why": "Failed NOFACT output preserves its status except the original Android early-return policy."
 },
 {
  "id": "lib.consumer-required-facts-continue-result",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  _ccrf_verdict=\"continue\"",
  "replace": "  _ccrf_verdict=0",
  "test": "bash linux/scripts/tests/test-consumer-required-facts.sh",
  "why": "Complete evidence must continue to the actual consumer verdict rather than return silently."
 },
 {
  "id": "lib.consumer-required-facts-optional-environment",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "path ENV appimagetool optional readable FACT appimagetool-readable required",
  "replace": "path ENV appimagetool required readable FACT appimagetool-readable required",
  "test": "bash linux/scripts/tests/test-consumer-required-facts.sh",
  "why": "An absent executable location is BAD; optional environment absence must not become missing probe evidence."
 },
 {
  "id": "lib.consumer-required-facts-android-lazy-evidence",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  _consumer_required_facts_continue \"${required_verdict}\" || return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-consumer-required-facts.sh",
  "why": "Missing payload-off evidence stops Android before any ENV or payload lookup."
 },
 {
  "id": "lib.consumer-required-facts-jdk-complete-evidence",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "onpath FACT java-on-path required javac FACT javac required",
  "replace": "onpath FACT java-on-path required",
  "test": "bash linux/scripts/tests/test-consumer-required-facts.sh",
  "why": "Both JDK facts are mandatory and retain their ordered lookups before any verdict."
 },
 {
  "id": "lib.consumer-required-facts-first-match",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  printf '%s\\n' \"$1\" | sed -n \"s/^$2 $3 //p\" | head -1",
  "replace": "  printf '%s\\n' \"$1\" | sed -n \"s/^$2 $3 //p\" | tail -1",
  "test": "bash linux/scripts/tests/test-consumer-required-facts.sh",
  "why": "The first matching report line wins, including an empty first fact followed by a later value."
 },
 {
  "id": "lib.consumer-required-facts-unconditional-collection",
  "target": "linux/scripts/06-packaging/runtime-consumer-contract.sh",
  "find": "  _consumer_collect_required_facts \"${probe}\" required_verdict \"${row}\" \"${missing}\" \"${facts[@]}\"",
  "replace": "  if _consumer_collect_required_facts \"${probe}\" required_verdict \"${row}\" \"${missing}\" \"${facts[@]}\"; then :; fi",
  "test": "bash linux/scripts/tests/test-consumer-required-facts.sh",
  "why": "Collection remains unconditional so direct strict lookup failures are not suppressed by if."
 },
 {
  "id": "lib.runtime-sdk-rendered-knob-collection",
  "target": "linux/scripts/tests/test-env-contract.sh",
  "find": "| tr -d ' ' | sort -u)",
  "replace": "| tr -d ' ' | sort -u | grep -v '^DOC_ONLY_KNOB$')",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "knobs emitted through the catalog must enter the independent runtime consumption verdict"
 },
 {
  "id": "lib.runtime-sdk-catalog-is-not-consumption",
  "target": "linux/scripts/tests/test-env-contract.sh",
  "find": "runtime_shared_usage_env_overrides|runtime_usage_row|runtime_usage_description",
  "replace": "runtime_shared_usage_env_overrides|runtime_usage_row",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "documentation catalog references must not count as genuine runtime knob use"
 },
 {
  "id": "lib.runtime-sdk-sdk-is-not-runtime-consumption",
  "target": "linux/scripts/tests/test-env-contract.sh",
  "find": "  cat \"${SCRIPTS}/lib-runtime-wheels.sh\"",
  "replace": "  cat \"${SCRIPTS}/lib-runtime-wheels.sh\"\n  cat \"${SCRIPTS}/build-sdk-artifacts.sh\" 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "SDK-only use must not rescue an unconsumed runtime override"
 },
 {
  "id": "lib.runtime-sdk-exact-help-padding",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "padding=$((column - 2 - ${#key}))",
  "replace": "padding=$((column - 1 - ${#key}))",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "shared help keeps the exact original caller-specific columns"
 },
 {
  "id": "lib.runtime-sdk-sdk-specific-wording",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "description='Max concurrent arch builds (default: nproc)'",
  "replace": "description='Max concurrent arch builds (default: nproc, 4 if unknown)'",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "SDK help retains its own documented default wording instead of adopting runtime text"
 },
 {
  "id": "lib.runtime-sdk-sdk-shared-delegation",
  "target": "linux/scripts/build-sdk-artifacts.sh",
  "find": "runtime_usage_row --parallel-archs 25 sdk",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "SDK help must actually render its shared parallel option"
 },
 {
  "id": "lib.runtime-sdk-runtime-env-delegation",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "runtime_usage_row NERDCTL_BIN 31 runtime",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "runtime help must retain every shared environment row after catalog extraction"
 },
 {
  "id": "lib.runtime-sdk-unknown-help-row-status",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "return 1 ;;\n  esac\n  printf '%s' \"$description\"",
  "replace": "return 0 ;;\n  esac\n  printf '%s' \"$description\"",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "unknown catalog keys must fail rather than render an invented successful help row"
 },
 {
  "id": "lib.torch-setup-marker-write-advisory",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "printf '%s: %s\\n' \"${arch}\" \"${reason}\" > \"${VENV}/.torch-missing\" 2>/dev/null || true",
  "replace": "printf '%s: %s\\n' \"${arch}\" \"${reason}\" > \"${VENV}/.torch-missing\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-torch-setup-lifecycle.sh",
  "why": "Marker writes retain their best-effort status for both absent-wheel and explicitly allowed import failures."
 },
 {
  "id": "lib.torch-setup-marker-mkdir-advisory",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "  mkdir -p \"${VENV}\" 2>/dev/null || true\n  printf '%s: %s\\n' ",
  "replace": "  mkdir -p \"${VENV}\" 2>/dev/null\n  printf '%s: %s\\n' ",
  "test": "bash linux/scripts/tests/test-torch-setup-lifecycle.sh",
  "why": "An existing venv still receives the marker when mkdir returns a best-effort error."
 },
 {
  "id": "lib.torch-setup-mounted-lists-preserved",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "mountpoint -q /var/lib/apt || rm -rf /var/lib/apt/lists/*",
  "replace": "mountpoint -q /var/lib/apt && rm -rf /var/lib/apt/lists/*",
  "test": "bash linux/scripts/tests/test-torch-setup-lifecycle.sh",
  "why": "Shared apt cache mounts retain lists and unmounted lists are cleaned in both setup paths."
 },
 {
  "id": "lib.torch-setup-cleanup-status",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "mountpoint -q /var/lib/apt || rm -rf /var/lib/apt/lists/*",
  "replace": "mountpoint -q /var/lib/apt || rm -rf /var/lib/apt/lists/* || true",
  "test": "bash linux/scripts/tests/test-torch-setup-lifecycle.sh",
  "why": "Cleanup errors retain the existing fatal status under active errexit."
 },
 {
  "id": "lib.torch-setup-marker-bytes",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "printf '%s: %s\\n' \"${arch}\" \"${reason}\"",
  "replace": "printf '%s %s\\n' \"${arch}\" \"${reason}\"",
  "test": "bash linux/scripts/tests/test-torch-setup-lifecycle.sh",
  "why": "The shared marker writer retains each caller exact architecture/reason payload and newline."
 },
 {
  "id": "ordered-jobs.returning-signal-policy",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  eval \"${policy}\"",
  "replace": "  exit \"${pending}\"",
  "test": "bash linux/scripts/tests/test-ordered-jobs-lifecycle.sh",
  "timeout": 90,
  "why": "Owned scheduler lifecycle must preserve signal policy and fail closed after supervisor or cleanup failures."
 },
 {
  "id": "ordered-jobs.restore-caller-traps",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  if [ -n \"${original}\" ]; then eval \"${original}\"; else trap - \"${signal}\"; fi",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ordered-jobs-lifecycle.sh",
  "timeout": 90,
  "why": "Owned scheduler lifecycle must preserve signal policy and fail closed after supervisor or cleanup failures."
 },
 {
  "id": "ordered-jobs.cleanup-failure-reaches-report",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  if ! _oj_worker_reap; then verdict=1; supervisor_status=1; fi",
  "replace": "  _oj_worker_reap || true",
  "test": "bash linux/scripts/tests/test-ordered-jobs-lifecycle.sh",
  "timeout": 90,
  "why": "Owned scheduler lifecycle must preserve signal policy and fail closed after supervisor or cleanup failures."
 },
 {
  "id": "ordered-jobs.missing-completion-fails",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "    _oj_recover_worker \"${index}\" || return 1\n    return 1",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-ordered-jobs-lifecycle.sh",
  "timeout": 90,
  "why": "Owned scheduler lifecycle must preserve signal policy and fail closed after supervisor or cleanup failures."
 },
 {
  "id": "ordered-jobs.groupless-timeout-policy",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  if [ \"${OJ_GROUPS}\" -ne 0 ] && [ -n \"${OJ_TIMEOUT:-}\" ]; then _oj_start_watchdog \"${index}\"; fi",
  "replace": "  if [ -n \"${OJ_TIMEOUT:-}\" ]; then _oj_start_watchdog \"${index}\"; fi",
  "test": "bash linux/scripts/tests/test-ordered-jobs-lifecycle.sh",
  "timeout": 90,
  "why": "Owned scheduler lifecycle must preserve signal policy and fail closed after supervisor or cleanup failures."
 },
 {
  "id": "ordered-jobs.supervisor-ignores-group-interrupt",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  _oj_child_int_trap ':'\n  [ -z \"${OJ_INT_POLICY}\" ] || trap '_OJ_WAIT_INTERRUPTED=1' INT\n  trap '_oj_signal 124' USR1",
  "replace": "  trap '_oj_signal 130' INT\n  trap '_oj_signal 124' USR1",
  "test": "bash linux/scripts/tests/test-ordered-jobs-lifecycle.sh",
  "timeout": 90,
  "why": "Owned scheduler lifecycle must preserve signal policy and fail closed after supervisor or cleanup failures."
 },
 {
  "id": "ordered-jobs.watchdog-owns-output",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  ) </dev/null >> \"${OJ_DIR}/${index}.out\" 2>&1 &",
  "replace": "  ) &",
  "test": "bash linux/scripts/tests/test-ordered-jobs-watchdog-fds.sh",
  "why": "a watchdog that inherits captured stdout or stderr can hold the test's pipe open after its owner exits"
 },
 {
  "id": "ordered-jobs.supervisor-owns-output",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  ( trap - TERM USR1 EXIT; trap ':' QUIT; _oj_child_int_trap ':'; _oj_start \"${index}\" ) </dev/null >> \"${OJ_DIR}/${index}.out\" 2>&1 &",
  "replace": "  ( trap - TERM USR1 EXIT; trap ':' QUIT; _oj_child_int_trap ':'; _oj_start \"${index}\" ) &",
  "test": "bash linux/scripts/tests/test-ordered-jobs-watchdog-fds.sh",
  "why": "a supervisor that inherits captured stdout or stderr can hold the mutation baseline pipe open after its owner exits"
 },
 {
  "id": "ordered-jobs.command-appends-output",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  ) >> \"${OJ_DIR}/${index}.out\" 2>&1 < /dev/null &",
  "replace": "  ) > \"${OJ_DIR}/${index}.out\" 2>&1 < /dev/null &",
  "test": "bash linux/scripts/tests/test-ordered-jobs-watchdog-fds.sh",
  "why": "a command truncation could erase a supervisor diagnostic already written to the shared job report"
 },
 {
  "id": "ordered-jobs.bounded-runner-join",
  "target": "linux/scripts/tests/test-run-tests-reaping.sh",
  "find": "  return 1\n}\n_require_join() {",
  "replace": "  return 0\n}\n_require_join() {",
  "test": "bash linux/scripts/tests/test-run-tests-reaping.sh",
  "why": "a stuck runner must fail the suite after its process group is killed, not silently pass"
 },
 {
  "id": "ordered-jobs.no-trapped-wait",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "  # A wait here can reenter the interrupted wait when cleanup runs from a trap.",
  "replace": "  wait \"${pid}\" 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-ordered-jobs-watchdog-fds.sh",
  "why": "a wait inside the watchdog's trapped cleanup can reenter Bash's interrupted wait and hang the supervisor after timeout"
 },
 {
  "id": "ordered-jobs.publication-barrier-required",
  "target": "linux/scripts/tests/test-run-tests-reaping.sh",
  "find": "      builtin printf ready > \"$REAP_FIXTURE_ROOT/publication.ready\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-run-tests-reaping.sh",
  "timeout": 90,
  "why": "Owned scheduler lifecycle must preserve signal policy and fail closed after supervisor or cleanup failures."
 },
 {
  "id": "lib.genai-exception-records-failure",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "def record_exception(operation, exc):\n    fails.append(f\"{operation} raised {type(exc).__name__}: {exc!s}\")",
  "replace": "def record_exception(operation, exc):\n    pass",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "Every native or generation exception must reach the failing aggregate summary."
 },
 {
  "id": "lib.genai-exception-native-delegates",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "        record_exception(\"og.Tensor round-trip\", exc)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "Tensor execution errors remain fatal and retain their operation-specific diagnostic."
 },
 {
  "id": "lib.genai-exception-generation-delegates",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "        record_exception(\"generate()\", exc)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "Generation errors remain fatal even when all native binding checks passed."
 },
 {
  "id": "lib.genai-exception-str-format",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "def record_exception(operation, exc):\n    fails.append(f\"{operation} raised {type(exc).__name__}: {exc!s}\")",
  "replace": "def record_exception(operation, exc):\n    fails.append(f\"{operation} raised {type(exc).__name__}: {exc}\")",
  "test": "bash linux/scripts/tests/test-genai-smoke-payload.sh",
  "why": "Exception diagnostics preserve str conversion without invoking custom exception __format__."
 },
 {
  "id": "lib.apt-cleanup-mandatory-companion-import",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "source_required_symbol clear_unmounted_apt_lists 'FATAL: package-image-wiring.sh (clear_unmounted_apt_lists) not found' \\\n  /opt/scripts/packaging/package-image-wiring.sh \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)/package-image-wiring.sh\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-apt-list-cleanup.sh",
  "why": "standalone Torch setup copies must import the actual cleanup companion without a private fallback"
 },
 {
  "id": "lib.apt-cleanup-torch-delegation",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "_torch_clear_unmounted_apt_lists() {\n  clear_unmounted_apt_lists",
  "replace": "_torch_clear_unmounted_apt_lists() {\n  :",
  "test": "bash linux/scripts/tests/test-torch-setup-lifecycle.sh",
  "why": "both Torch apt phases must invoke shared mount-safe cleanup"
 },
 {
  "id": "lib.apt-cleanup-docker-companion-copy",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --chmod=755 linux/scripts/06-packaging/package-image-wiring.sh /opt/scripts/packaging/package-image-wiring.sh",
  "replace": "",
  "test": "bash linux/scripts/tests/test-apt-list-cleanup.sh",
  "why": "the required helper must be refreshed before the image executes Torch setup"
 },
 {
  "id": "lib.apt-cleanup-package-delegation",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    clear_unmounted_apt_lists",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-apt-list-cleanup.sh",
  "why": "the package main must retain the shared list cleanup after its separate archive-cache cleanup"
 },
 {
  "id": "lib.path-containment-root-boundary",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "case \"$path\" in \"$root\" | \"$root\"/*) return 0 ;; esac",
  "replace": "case \"$path\" in \"$root\"*) return 0 ;; esac",
  "test": "bash linux/scripts/tests/test-path-containment.sh",
  "why": "A lexical root must not authorize its prefix siblings."
 },
 {
  "id": "lib.path-containment-trim-one",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "if [ \"$policy\" = trim-one ]; then root=\"${root%/}\"; fi",
  "replace": "if false; then root=\"${root%/}\"; fi",
  "test": "bash linux/scripts/tests/test-path-containment.sh",
  "why": "Provenance removes exactly one slash while GST preserves verbatim roots."
 },
 {
  "id": "lib.path-containment-empty-root",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "    [ -n \"$root\" ] || continue",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-path-containment.sh",
  "why": "Empty roots never authorize arbitrary absolute paths."
 },
 {
  "id": "lib.path-containment-gst-policy",
  "target": "linux/scripts/03-media/build/gstreamer/common/gst-onnx-ort.sh",
  "find": "path_under_roots verbatim \"$@\"",
  "replace": "path_under_roots trim-one \"$@\"",
  "test": "bash linux/scripts/tests/test-path-containment.sh",
  "why": "GST must retain verbatim root matching even for trailing slashes."
 },
 {
  "id": "lib.path-containment-provenance-policy",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "path_under_roots trim-one \"$@\"",
  "replace": "path_under_roots verbatim \"$@\"",
  "test": "bash linux/scripts/tests/test-path-containment.sh",
  "why": "Provenance retains its historical trim-one matching policy."
 },
 {
  "id": "lib.path-containment-gst-companion",
  "target": "linux/scripts/03-media/build/gstreamer/common/gst-onnx-ort.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/../../../../01-core/path-helpers.sh\" || return $?",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/../../../../01-core/path-helpers.sh\" || true",
  "test": "bash linux/scripts/tests/test-path-containment.sh",
  "why": "A missing companion must stop GST loading before its gate API is declared."
 },
 {
  "id": "lib.path-containment-provenance-companion",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/../01-core/path-helpers.sh\" || return $?",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/../01-core/path-helpers.sh\" || true",
  "test": "bash linux/scripts/tests/test-path-containment.sh",
  "why": "A missing companion must stop provenance loading before its gate API is declared."
 },
 {
  "id": "lib.path-containment-genai-mount",
  "target": "linux/Dockerfile.media",
  "find": "    --mount=type=bind,source=linux/scripts/03-media/verify-genai-ort.sh,target=/opt/scripts/03-media/verify-genai-ort.sh,readonly \\\n    --mount=type=bind,source=linux/scripts/03-media/ort-provenance.sh,target=/opt/scripts/03-media/ort-provenance.sh,readonly \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/01-core/path-helpers.sh,readonly \\\n",
  "replace": "    --mount=type=bind,source=linux/scripts/03-media/verify-genai-ort.sh,target=/opt/scripts/03-media/verify-genai-ort.sh,readonly \\\n    --mount=type=bind,source=linux/scripts/03-media/ort-provenance.sh,target=/opt/scripts/03-media/ort-provenance.sh,readonly \\\n",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "The isolated GenAI verification RUN mounts the same path owner required by provenance."
 },
 {
  "id": "lib.image-ref-default",
  "target": "linux/scripts/01-core/image-ref-args.sh",
  "find": "_irca_tool=\"${NERDCTL_BIN:-nerdctl}\"",
  "replace": "_irca_tool=\"nerdctl\"",
  "test": "bash linux/scripts/tests/test-image-ref-cli.sh",
  "why": "one-reference calls honor the configured tool as one executable path"
 },
 {
  "id": "lib.image-ref-explicit",
  "target": "linux/scripts/01-core/image-ref-args.sh",
  "find": "    _irca_tool=\"$1\"\n",
  "replace": "    _irca_tool=\"${NERDCTL_BIN:-nerdctl}\"\n",
  "test": "bash linux/scripts/tests/test-image-ref-cli.sh",
  "why": "explicit tool overrides the environment"
 },
 {
  "id": "lib.image-ref-extras",
  "target": "linux/scripts/01-core/image-ref-args.sh",
  "find": "    _irca_ref=\"$2\"\n",
  "replace": "    _irca_ref=\"${3:-$2}\"\n",
  "test": "bash linux/scripts/tests/test-image-ref-cli.sh",
  "why": "extra arguments remain ignored"
 },
 {
  "id": "lib.image-ref-arity",
  "target": "linux/scripts/01-core/image-ref-args.sh",
  "find": "if [ \"$#\" -eq 1 ]; then",
  "replace": "if [ \"$#\" -le 1 ]; then",
  "test": "bash linux/scripts/tests/test-image-ref-cli.sh",
  "why": "zero argument nounset and relaxed policies remain distinct"
 },
 {
  "id": "lib.image-ref-build-helpers-import",
  "target": "linux/scripts/01-core/build-helpers.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/image-ref-args.sh\" || exit 1",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/image-ref-args.sh\" || return 1",
  "test": "bash linux/scripts/tests/test-image-ref-cli.sh",
  "why": "missing companions fail closed even inside conditional imports"
 },
 {
  "id": "lib.image-ref-digest-pinning-import",
  "target": "linux/scripts/01-core/digest-pinning.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/image-ref-args.sh\" || exit 1",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/image-ref-args.sh\" || return 1",
  "test": "bash linux/scripts/tests/test-image-ref-cli.sh",
  "why": "missing companions fail closed even inside conditional imports"
 },
 {
  "id": "lib.image-ref-toolchain-closure",
  "target": "linux/Dockerfile.toolchain",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/image-ref-args.sh,target=/opt/scripts/core/image-ref-args.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/opt/scripts/core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/opt/scripts/core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/opt/scripts/core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-apt.sh,target=/opt/scripts/core/cross-apt.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-env.sh,target=/opt/scripts/core/cross-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-gcc.sh,target=/opt/scripts/core/cross-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-meson.sh,target=/opt/scripts/core/cross-meson.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-python.sh,target=/opt/scripts/core/cross-python.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n",
  "replace": "    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/opt/scripts/core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/opt/scripts/core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/opt/scripts/core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-apt.sh,target=/opt/scripts/core/cross-apt.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-env.sh,target=/opt/scripts/core/cross-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-gcc.sh,target=/opt/scripts/core/cross-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-meson.sh,target=/opt/scripts/core/cross-meson.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-python.sh,target=/opt/scripts/core/cross-python.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n",
  "test": "bash linux/scripts/tests/test-image-ref-cli.sh",
  "why": "both minimal compiler mount closures carry the mandatory leaf"
 },
 {
  "id": "lib.image-ref-copied-bundle",
  "target": "linux/scripts/tests/test-arg-consistency.sh",
  "find": " \"${CORE}/image-ref-args.sh\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arg-consistency.sh",
  "why": "the isolated argument gate sources a complete core bundle"
 },
 {
  "id": "lib.ffmpeg-runtime-bin-depth",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "    find \"${FFMPEG_PREFIX}/bin\" -maxdepth 1 -type f 2>/dev/null",
  "replace": "    find \"${FFMPEG_PREFIX}/bin\" -maxdepth 2 -type f 2>/dev/null",
  "test": "bash linux/scripts/tests/test-ffmpeg-runtime-artifacts.sh",
  "why": "Only immediate installed binaries are runtime enumeration roots; nested files must not introduce SDK or apt dependencies."
 },
 {
  "id": "lib.ffmpeg-runtime-library-glob",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "    find \"${FFMPEG_PREFIX}/lib\" -maxdepth 2 -name '*.so*' -type f 2>/dev/null",
  "replace": "    find \"${FFMPEG_PREFIX}/lib\" -maxdepth 2 -type f 2>/dev/null",
  "test": "bash linux/scripts/tests/test-ffmpeg-runtime-artifacts.sh",
  "why": "Non-library metadata must not introduce SDK or apt dependencies."
 },
 {
  "id": "lib.ffmpeg-runtime-producer-failure",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "    find \"${FFMPEG_PREFIX}/bin\" -maxdepth 1 -type f 2>/dev/null",
  "replace": "    find \"${FFMPEG_PREFIX}/bin\" -maxdepth 1 -type f 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-ffmpeg-runtime-artifacts.sh",
  "why": "Strict direct manifest failures and advisory process-substitution partial output must preserve first-producer failure behavior."
 },
 {
  "id": "lib.ffmpeg-runtime-manifest-enumeration",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "    _ffmpeg_runtime_artifacts | while IFS= read -r _f; do",
  "replace": "    : | while IFS= read -r _f; do",
  "test": "bash linux/scripts/tests/test-ffmpeg-runtime-artifacts.sh",
  "why": "The runtime apt manifest must inspect the installed runtime roots rather than quietly publishing no package map."
 },
 {
  "id": "lib.ffmpeg-runtime-library-symlink",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "    find \"${FFMPEG_PREFIX}/lib\" -maxdepth 2 -name '*.so*' -type f 2>/dev/null",
  "replace": "    find \"${FFMPEG_PREFIX}/lib\" -maxdepth 2 -name '*.so*' \\( -type f -o -type l \\) 2>/dev/null",
  "test": "bash linux/scripts/tests/test-ffmpeg-runtime-artifacts.sh",
  "why": "Runtime roots retain regular-library-only traversal: symlinks must not introduce an otherwise excluded dependency."
 },
 {
  "id": "lib.ffmpeg-pin-tarball-unverified",
  "target": "linux/scripts/03-media/build/ffmpeg/fetch-ffmpeg.sh",
  "find": "    if ! _ffmpeg_pinned_tag \"${ref}\"; then\n        download_and_extract",
  "replace": "    if true; then\n        download_and_extract",
  "test": "bash linux/scripts/tests/test-ffmpeg-fetch.sh",
  "why": "the pinned tag unpacked unhashed is an unverified download that still looks pinned"
 },
 {
  "id": "lib.ffmpeg-pin-file-hash",
  "target": "linux/scripts/03-media/build/ffmpeg/fetch-ffmpeg.sh",
  "find": "\"${archive}\" stream; then",
  "replace": "\"${archive}\"; then",
  "test": "bash linux/scripts/tests/test-ffmpeg-fetch.sh",
  "why": "GitHub may re-gzip the same tar, so only the stream hash is stable"
 },
 {
  "id": "lib.ffmpeg-pin-clone-commit-unchecked",
  "target": "linux/scripts/03-media/build/ffmpeg/fetch-ffmpeg.sh",
  "find": "    if [[ \"${head}\" != \"${FFMPEG_TAG_COMMIT}\" ]]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-ffmpeg-fetch.sh",
  "why": "a tag moved on a git remote would build other sources under the pinned name"
 },
 {
  "id": "lib.ffmpeg-pin-empty-commit-allowed",
  "target": "linux/scripts/03-media/build/ffmpeg/fetch-ffmpeg.sh",
  "find": "[[ -z \"${FFMPEG_SHA256:-}\" || -z \"${FFMPEG_TAG_COMMIT:-}\" ]]",
  "replace": "[[ -z \"${FFMPEG_SHA256:-}\" ]]",
  "test": "bash linux/scripts/tests/test-ffmpeg-fetch.sh",
  "why": "an empty commit pin would wave every clone fallback through"
 },
 {
  "id": "lib.ffmpeg-pin-mirror-skipped",
  "target": "linux/scripts/03-media/build/ffmpeg/fetch-ffmpeg.sh",
  "find": "            _ffmpeg_clone \"${FFMPEG_GIT_MIRROR}\" \"${ref}\" || die",
  "replace": "            false || die",
  "test": "bash linux/scripts/tests/test-ffmpeg-fetch.sh",
  "why": "the mirror is the last source when the canonical remote is down or its tag moved"
 },
 {
  "id": "lib.runtime-flow-help-base-step",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "1. clean per-architecture base images",
  "replace": "1. reuse stale per-architecture base images",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Both runtime help pages retain the independently frozen clean-base stage description."
 },
 {
  "id": "lib.runtime-flow-help-wrapper-suffix",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "scripts)%s\\n' \"$1\"",
  "replace": "scripts)\\n'",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "The artifact help keeps its literal Dockerfile suffix while manifest help keeps its shorter third step."
 },
 {
  "id": "lib.runtime-flow-help-section-order",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  runtime_shared_usage_options\n  cat\n  runtime_shared_usage_env_overrides",
  "replace": "  runtime_shared_usage_env_overrides\n  cat\n  runtime_shared_usage_options",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Shared options, caller footer and shared environment rows retain their complete original output order."
 },
 {
  "id": "lib.runtime-flow-help-artifacts-stages",
  "target": "linux/scripts/build-runtime-artifacts.sh",
  "find": "  runtime_usage_build_steps ' from linux/Dockerfile.torch'",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Each runtime entrypoint includes the shared stage description in its complete help receipt."
 },
 {
  "id": "lib.runtime-flow-help-artifacts-sections",
  "target": "linux/scripts/build-runtime-artifacts.sh",
  "find": "  runtime_usage_shared_sections <<'EOF'",
  "replace": "  cat <<'EOF'",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Each runtime entrypoint includes the common options and environment sections around its own footer."
 },
 {
  "id": "lib.runtime-flow-help-manifest-stages",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  runtime_usage_build_steps ''",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Each runtime entrypoint includes the shared stage description in its complete help receipt."
 },
 {
  "id": "lib.runtime-flow-help-manifest-sections",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  runtime_usage_shared_sections <<'EOF'",
  "replace": "  cat <<'EOF'",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Each runtime entrypoint includes the common options and environment sections around its own footer."
 },
 {
  "id": "lib.cross-cli-image-repo-help",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "description='Image repository (default: ghcr.io/kataglyphis/kataglyphis_beschleuniger)'",
  "replace": "description='Image repository (default: invalid)'",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Both cross-lane help pages keep their independently frozen repository description and original padding."
 },
 {
  "id": "lib.cross-cli-raw-targets",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  _oct_targets=\"$1\"",
  "replace": "  _oct_targets=\"${1%%,*}\"",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "The common callback preserves complete raw cross-target values, including commas, spaces, newlines and literal shell text."
 },
 {
  "id": "lib.cross-cli-consumed-target-value",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "orchestrator_set_cross_targets() {\n  local -n _oct_targets=CROSS_TARGETS\n  _oct_targets=\"$1\"\n  _OARG_SHIFT=2\n}",
  "replace": "orchestrator_set_cross_targets() {\n  local -n _oct_targets=CROSS_TARGETS\n  _oct_targets=\"$1\"\n  _OARG_SHIFT=1\n}",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Both callbacks consume the option and its value while retaining dynamic caller locals."
 },
 {
  "id": "lib.cross-cli-chain-targets",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "    --cross-targets) orchestrator_set_cross_targets \"$2\" ;;",
  "replace": "    --cross-targets) : ;;",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Each cross-lane callback retains target assignment and consumed-argument count."
 },
 {
  "id": "lib.cross-cli-chain-help",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  runtime_usage_row '--image-repo REPO' 27",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Each cross-lane entrypoint emits the canonical repository row in its complete independently frozen help output."
 },
 {
  "id": "lib.cross-cli-compiler-targets",
  "target": "linux/scripts/build-cross-compiler.sh",
  "find": "    --cross-targets) orchestrator_set_cross_targets \"$2\" ;;",
  "replace": "    --cross-targets) : ;;",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Each cross-lane callback retains target assignment and consumed-argument count."
 },
 {
  "id": "lib.cross-cli-compiler-help",
  "target": "linux/scripts/build-cross-compiler.sh",
  "find": "  runtime_usage_row '--image-repo REPO' 25",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Each cross-lane entrypoint emits the canonical repository row in its complete independently frozen help output."
 },
 {
  "id": "lib.runtime-push-selector-artifact-rejects-images-only",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "    --push-images) [ \"$mode\" = manifest ] || return 1 ;;",
  "replace": "    --push-images) : ;;",
  "test": "bash linux/scripts/tests/test-runtime-push-selectors.sh",
  "timeout": 60,
  "why": "Artifacts must reject the manifest-only images selector without materializing any push fields."
 },
 {
  "id": "lib.runtime-push-selector-images-only-keeps-manifest",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  if [ \"$mode\" = manifest ] && [ \"$flag\" != --push-images ]; then",
  "replace": "  if [ \"$mode\" = manifest ]; then",
  "test": "bash linux/scripts/tests/test-runtime-push-selectors.sh",
  "timeout": 60,
  "why": "Images-only must retain the existing or unset manifest selector."
 },
 {
  "id": "lib.runtime-push-selector-intermediates-only-for-all",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  if [ \"$flag\" = --push-all ]; then _orp_intermediates=1; fi",
  "replace": "  if [ -n \"$flag\" ]; then _orp_intermediates=1; fi",
  "test": "bash linux/scripts/tests/test-runtime-push-selectors.sh",
  "timeout": 60,
  "why": "Ordinary push selectors must preserve existing or unset intermediate policy."
 },
 {
  "id": "lib.runtime-push-selector-assignment-order",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  _orp_images=1\n  if [ \"$mode\" = manifest ] && [ \"$flag\" != --push-images ]; then\n    local -n _orp_manifest=PUSH_MANIFEST\n    _orp_manifest=1\n  fi",
  "replace": "  if [ \"$mode\" = manifest ] && [ \"$flag\" != --push-images ]; then\n    local -n _orp_manifest=PUSH_MANIFEST\n    _orp_manifest=1\n  fi\n  _orp_images=1",
  "test": "bash linux/scripts/tests/test-runtime-push-selectors.sh",
  "timeout": 60,
  "why": "Manifest push retains images-before-manifest assignment order in caller dynamic scope."
 },
 {
  "id": "lib.runtime-push-selector-consumed-one",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  _orp_shift=1",
  "replace": "  _orp_shift=2",
  "test": "bash linux/scripts/tests/test-runtime-push-selectors.sh",
  "timeout": 60,
  "why": "A recognized push selector consumes exactly one argument; a wrong shift must fail the callback fixture without looping."
 },
 {
  "id": "lib.runtime-push-selector-unknown-is-inert",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "    --push-images) [ \"$mode\" = manifest ] || return 1 ;;\n    *) return 1 ;;",
  "replace": "    --push-images) [ \"$mode\" = manifest ] || return 1 ;;\n    *) PUSH_IMAGES=1; return 1 ;;",
  "test": "bash linux/scripts/tests/test-runtime-push-selectors.sh",
  "timeout": 60,
  "why": "Unknown options must preserve all fields and the preexisting consumed count, including unset state."
 },
 {
  "id": "lib.compiler-tool-toggle-titlecase-policy",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "_flag_disabled \"${2:-true}\" tool",
  "replace": "_flag_disabled \"${2:-true}\"",
  "test": "bash linux/scripts/tests/test-compiler-tool-toggles.sh",
  "why": "Tool checks historically accept False while default cache setup disables it."
 },
 {
  "id": "lib.compiler-tool-toggle-missing-tool",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "if command -v \"$1\" >/dev/null 2>&1; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-compiler-tool-toggles.sh",
  "why": "Missing optional tools must not enable linker or cache arguments."
 },
 {
  "id": "lib.compiler-tool-toggle-tool-diagnostics",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "if command -v \"$1\" >/dev/null 2>&1; then",
  "replace": "if command -v \"$1\"; then",
  "test": "bash linux/scripts/tests/test-compiler-tool-toggles.sh",
  "why": "Optional tool availability must suppress both lookup streams."
 },
 {
  "id": "lib.compiler-tool-toggle-ffmpeg-delegation",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-probe-framework.sh",
  "find": "if compiler_tool_enabled ld.lld \"${USE_LLD:-true}\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ffmpeg-probes.sh",
  "why": "Enabled lld is appended before compile and library flags in real FFmpeg probes."
 },
 {
  "id": "lib.compiler-tool-toggle-ort-delegation",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "if compiler_tool_enabled ccache \"${USE_CCACHE:-true}\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-compiler-tool-toggles.sh",
  "why": "Enabled ccache still configures the resolved compiler launcher in ONNX build arguments."
 },
 {
  "id": "lib.compiler-tool-toggle-availability-status",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "    status=$?\n  fi\n  return \"$status\"",
  "replace": "    status=1\n  fi\n  return \"$status\"",
  "test": "bash linux/scripts/tests/test-compiler-cache-policy.sh",
  "why": "Raw command availability failures remain observable to direct helper callers."
 },
 {
  "id": "lib.wheelhouse-sorted-manifest",
  "target": "linux/scripts/01-core/wheelhouse-manifest.sh",
  "find": "LC_ALL=C sort -z",
  "replace": "LC_ALL=C sort -rz",
  "test": "bash linux/scripts/tests/test-wheelhouse-manifest.sh",
  "why": "independent expected byte manifests retain lexical file order"
 },
 {
  "id": "lib.wheelhouse-regular-files",
  "target": "linux/scripts/01-core/wheelhouse-manifest.sh",
  "find": "find . -type f -print0",
  "replace": "find . -type f ! -name \"* *\" -print0",
  "test": "bash linux/scripts/tests/test-wheelhouse-manifest.sh",
  "why": "spaced file names remain in the null-safe manifest"
 },
 {
  "id": "lib.wheelhouse-binary-separator",
  "target": "linux/scripts/01-core/wheelhouse-manifest.sh",
  "find": "\"  \" substr($0, 67)",
  "replace": "\" *\" substr($0, 67)",
  "test": "bash linux/scripts/tests/test-wheelhouse-manifest.sh",
  "why": "binary sha256 separators normalize to the exact receipt protocol"
 },
 {
  "id": "lib.wheelhouse-host-delegation",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "  wheelhouse_manifest \"$1\"",
  "replace": "  wheelhouse_manifest \"$1\" | sed -n '1p'",
  "test": "bash linux/scripts/tests/test-wheelhouse-manifest.sh",
  "why": "host manifests delegate without changing ordered bytes"
 },
 {
  "id": "lib.wheelhouse-torch-delegation",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "(wheelhouse_manifest \"${d}\" | sha256sum)",
  "replace": "(wheelhouse_manifest \"${d}\" | sed -n '1p' | sha256sum)",
  "test": "bash linux/scripts/tests/test-wheelhouse-manifest.sh",
  "why": "Torch diagnostic hashes keep the same ordered byte protocol"
 },
 {
  "id": "lib.wheelhouse-host-required-import",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/01-core/wheelhouse-manifest.sh\" || exit 1",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/01-core/wheelhouse-manifest.sh\" || return 1",
  "test": "bash linux/scripts/tests/test-wheelhouse-manifest.sh",
  "why": "missing mandatory host companion fails even under conditional import"
 },
 {
  "id": "lib.wheelhouse-torch-required-import",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "source_required_symbol wheelhouse_manifest 'FATAL: wheelhouse-manifest.sh (wheelhouse_manifest) not found' \\\n  /opt/scripts/core/wheelhouse-manifest.sh \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)/../01-core/wheelhouse-manifest.sh\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-wheelhouse-manifest.sh",
  "why": "Torch source closure rejects missing manifest companion before reaching setup"
 },
 {
  "id": "lib.wheelhouse-docker-copy",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --chmod=755 linux/scripts/01-core/wheelhouse-manifest.sh /opt/scripts/core/wheelhouse-manifest.sh",
  "replace": "",
  "test": "bash linux/scripts/tests/test-wheelhouse-manifest.sh",
  "why": "Torch stage carries the minimal shared byte-manifest owner before execution"
 },
 {
  "id": "lib.ffmpeg-dnn-canonical-truthiness",
  "target": "linux/scripts/tests/test-ffmpeg-dnn-contract.sh",
  "find": "_truthy=\"$(t_fn_src \"${TESTS_DIR}/../01-core/platform.sh\" is_truthy)\" || return $?",
  "replace": "_truthy='is_truthy() { return 0; }'",
  "test": "bash linux/scripts/tests/test-ffmpeg-dnn-contract.sh",
  "why": "Actual canonical truthiness must guard both default-off and explicit TensorFlow SDK opt-ins in the fixture."
 },
 {
  "id": "lib.native-gcc-env-cppflags",
  "target": "linux/scripts/01-core/native-gcc-system-paths.sh",
  "find": "export CPPFLAGS=",
  "replace": "export LOST_CPPFLAGS=",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "each compiler language retains its consumer flags and system-header injection"
 },
 {
  "id": "lib.native-gcc-env-cflags",
  "target": "linux/scripts/01-core/native-gcc-system-paths.sh",
  "find": "export CFLAGS=",
  "replace": "export LOST_CFLAGS=",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "each compiler language retains its consumer flags and system-header injection"
 },
 {
  "id": "lib.native-gcc-env-cxxflags",
  "target": "linux/scripts/01-core/native-gcc-system-paths.sh",
  "find": "export CXXFLAGS=",
  "replace": "export LOST_CXXFLAGS=",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "each compiler language retains its consumer flags and system-header injection"
 },
 {
  "id": "lib.native-gcc-env-include-order",
  "target": "linux/scripts/01-core/native-gcc-system-paths.sh",
  "find": "${1:+$1:}/usr/include",
  "replace": "/usr/include${1:+:$1}",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "multiarch includes keep their original precedence after existing paths"
 },
 {
  "id": "lib.native-gcc-env-library-order",
  "target": "linux/scripts/01-core/native-gcc-system-paths.sh",
  "find": "${2:+$2:}/usr/lib",
  "replace": "/usr/lib${2:+:$2}",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "multiarch library paths keep their original precedence after existing paths"
 },
 {
  "id": "lib.native-gcc-env-torch-import",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "source /opt/scripts/core/native-gcc-system-paths.sh || exit 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "Torch source-build setup carries the required pure setter"
 },
 {
  "id": "lib.native-gcc-env-torch-binding",
  "target": "linux/scripts/06-packaging/setup-torch-venv.sh",
  "find": "native_gcc_system_paths \"${_mi}\" \"${_ml}\"",
  "replace": "native_gcc_system_paths \"${_ml}\" \"${_mi}\"",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "include and library discovery remain caller-specific arguments"
 },
 {
  "id": "lib.native-gcc-env-profile-import",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": ". /opt/scripts/core/native-gcc-system-paths.sh || return 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "generated POSIX profiles require the shared companion at sourcing time"
 },
 {
  "id": "lib.native-gcc-env-profile-binding",
  "target": "linux/scripts/06-packaging/swap-native-gcc.sh",
  "find": "native_gcc_system_paths /usr/include/${triplet} /usr/lib/${triplet}",
  "replace": "native_gcc_system_paths /usr/include/${triplet} /usr/include/${triplet}",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "generated profiles bind the target library triplet independently of headers"
 },
 {
  "id": "lib.native-gcc-env-android-copy",
  "target": "linux/Dockerfile.android",
  "find": "COPY --chmod=755 linux/scripts/01-core/native-gcc-system-paths.sh /opt/scripts/core/native-gcc-system-paths.sh",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "both consumer stages carry the shared runtime profile dependency before execution"
 },
 {
  "id": "lib.native-gcc-env-torch-copy",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --chmod=755 linux/scripts/01-core/native-gcc-system-paths.sh /opt/scripts/core/native-gcc-system-paths.sh",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-gcc-env.sh",
  "why": "both consumer stages carry the shared runtime profile dependency before execution"
 },
 {
  "id": "lib.native-gcc-env-cxx",
  "target": "linux/scripts/01-core/native-gcc-system-paths.sh",
  "find": "export CXXFLAGS=",
  "replace": "export LOST_CXXFLAGS=",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "critical fix6 rejects a setter that only preserves C headers"
 },
 {
  "id": "critical-fixes.native-gcc-env-torch-binding",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "-q '^native_gcc_system_paths ' \"${stv}\"",
  "replace": "-q 'torch-missing' \"${stv}\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "fix6 checks the real Torch setter call rather than only a correct uncalled helper"
 },
 {
  "id": "critical-fixes.native-gcc-env-torch-import",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "-q 'source /opt/scripts/core/native-gcc-system-paths.sh' \"${stv}\"",
  "replace": "-q 'torch-missing' \"${stv}\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "fix6 rejects a missing Torch companion import"
 },
 {
  "id": "critical-fixes.native-gcc-env-profile-import",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "-q '^\\. /opt/scripts/core/native-gcc-system-paths.sh' \"${swp}\"",
  "replace": "-q 'native_gcc_system_paths /usr/include/' \"${swp}\"",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "fix6 rejects a generated profile with no setter import"
 },
 {
  "id": "lib.lifecycle-fixture-sibling-reaped",
  "target": "linux/scripts/tests/test-chain-lifecycle.sh",
  "find": "t_stop_children \"${_sib_pid}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "The independent fixture stop must reap its live sibling before clearing ownership; EXIT still cleans up a failed proof."
 },
 {
  "id": "lib.lifecycle-retention-fixture-isolated",
  "target": "linux/scripts/tests/test-chain-lifecycle.sh",
  "find": "  LOG_DIR=\"${workdir}/$1\"",
  "replace": "  LOG_DIR=\"${workdir}/ret-collapsed\"",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "Independent retention cases require distinct archive roots while keeping every explicit path expectation."
 },
 {
  "id": "lib.lifecycle-descendant-death-verdict",
  "target": "linux/scripts/01-core/chain-lifecycle.sh",
  "find": "    kill \"-${sig}\" \"${kid}\" 2>/dev/null || true",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "The original descendant-death assertion stays red when production stops terminating children; fixture cleanup remains independent."
 },
 {
  "id": "lib.runtime-help-chain-arch-profile",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "runtime_usage_row '--target-arches LIST' 27 chain",
  "replace": "runtime_usage_row '--target-arches LIST' 27 runtime",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Cross-chain help retains its historical arch-list wording through the shared renderer."
 },
 {
  "id": "lib.runtime-help-chain-alias-row",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "runtime_usage_row '--architectures LIST' 27 chain",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Cross-chain help retains the independent alias row at its original position."
 },
 {
  "id": "lib.runtime-help-verify-image-row",
  "target": "linux/scripts/verify-cross-chain.sh",
  "find": "runtime_usage_row '--image-repo REPO' 27 chain",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "The verification wrapper renders the original image repository help row."
 },
 {
  "id": "lib.runtime-help-verify-required-renderer",
  "target": "linux/scripts/verify-cross-chain.sh",
  "find": "source \"${REPO_ROOT}/linux/scripts/01-core/runtime-build-fns.sh\" || return 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Help must import the actual renderer rather than merely claiming a companion dependency."
 },
 {
  "id": "lib.runtime-help-verify-lazy-renderer",
  "target": "linux/scripts/verify-cross-chain.sh",
  "find": "usage() {\n  # Loading only function definitions keeps help independent of build initialization.\n  source \"${REPO_ROOT}/linux/scripts/01-core/runtime-build-fns.sh\" || return 1",
  "replace": "source \"${REPO_ROOT}/linux/scripts/01-core/runtime-build-fns.sh\"\nusage() {",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Opaque forwarding works without a help renderer and keeps the child exit status."
 },
 {
  "id": "lib.runtime-help-verify-opaque-forwarding",
  "target": "linux/scripts/verify-cross-chain.sh",
  "find": "${FWD_ARGS[@]+\"${FWD_ARGS[@]}\"}",
  "replace": "${FWD_ARGS[*]}",
  "test": "bash linux/scripts/tests/test-runtime-sdk-help.sh",
  "why": "Forwarding preserves empty, spaced and multiline arguments independently of shared help."
 },
 {
  "id": "disk-guard.slug-removal-quiet",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "rm -rf \"${1:?}/${2}\" 2>/dev/null || true",
  "replace": "rm -rf \"${1:?}/${2}\" || true",
  "test": "bash linux/scripts/tests/test-disk-slug-removal.sh",
  "why": "Slug removal preserves guarded roots, quiet diagnostics, advisory command failure and actual remaining-path evidence."
 },
 {
  "id": "disk-guard.slug-removal-advisory",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "rm -rf \"${1:?}/${2}\" 2>/dev/null || true",
  "replace": "rm -rf \"${1:?}/${2}\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-disk-slug-removal.sh",
  "why": "Slug removal preserves guarded roots, quiet diagnostics, advisory command failure and actual remaining-path evidence."
 },
 {
  "id": "disk-guard.slug-removal-presence",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "if [ -e \"$1/$2\" ]; then return 1; fi",
  "replace": "if [ ! -e \"$1/$2\" ]; then return 1; fi",
  "test": "bash linux/scripts/tests/test-disk-slug-removal.sh",
  "why": "Slug removal preserves guarded roots, quiet diagnostics, advisory command failure and actual remaining-path evidence."
 },
 {
  "id": "disk-guard.slug-removal-root-required",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "${1:?}/${2}",
  "replace": "${1}/${2}",
  "test": "bash linux/scripts/tests/test-disk-slug-removal.sh",
  "why": "Slug removal preserves guarded roots, quiet diagnostics, advisory command failure and actual remaining-path evidence."
 },
 {
  "id": "disk-guard.slug-removal-callers",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "rm -rf \"${1:?}/${2}\" 2>/dev/null || true",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "Cache eviction callers delegate to the real slug removal owner and retain independent file-deletion assertions."
 },
 {
  "id": "lib.lld-literal-false-ffmpeg-policy",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "compiler_tool_enabled ld.lld \"${USE_LLD:-true}\" literal-false",
  "replace": "compiler_tool_enabled ld.lld \"${USE_LLD:-true}\"",
  "test": "bash linux/scripts/tests/test-lld-literal-false-policy.sh",
  "why": "These build arguments disable only literal false; broader configure-probe spellings must not leak into this caller."
 },
 {
  "id": "lib.lld-literal-false-onnx-policy",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "compiler_tool_enabled ld.lld \"${USE_LLD:-true}\" literal-false",
  "replace": "compiler_tool_enabled ld.lld \"${USE_LLD:-true}\"",
  "test": "bash linux/scripts/tests/test-lld-literal-false-policy.sh",
  "why": "These build arguments disable only literal false; broader configure-probe spellings must not leak into this caller."
 },
 {
  "id": "lib.lld-literal-false-exact-spelling",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "      literal-false) if [ \"${2:-true}\" = false ]; then status=1; fi ;;",
  "replace": "      literal-false) if [ \"${2:-true}\" = FALSE ]; then status=1; fi ;;",
  "test": "bash linux/scripts/tests/test-lld-literal-false-policy.sh",
  "why": "The literal false policy remains case-sensitive and does not normalize other spellings."
 },
 {
  "id": "lib.lld-literal-false-lookup-first",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "compiler_tool_enabled() {\n  local status=0",
  "replace": "compiler_tool_enabled() {\n  local status=0\n  if [ \"${3:-}\" = literal-false ] && [ \"${2:-true}\" = false ]; then return 1; fi",
  "test": "bash linux/scripts/tests/test-lld-literal-false-policy.sh",
  "why": "A failed lookup status is retained even for false, and the probe must happen before evaluating the flag."
 },
 {
  "id": "lib.lld-literal-false-raw-status",
  "target": "linux/scripts/01-core/compiler-cache-utils.sh",
  "find": "    status=$?\n  fi\n  return \"$status\"",
  "replace": "    status=1\n  fi\n  return \"$status\"",
  "test": "bash linux/scripts/tests/test-lld-literal-false-policy.sh",
  "why": "Optional-tool lookup statuses7 and127 must not be collapsed into a flag refusal1."
 },
 {
  "id": "lib.compiler-tool-fixture-subject-overrides",
  "target": "linux/scripts/tests/compiler-tool-fixture.sh",
  "find": "_ctf_ort=\"${2:-",
  "replace": "_ctf_ort=\"${1:-",
  "test": "bash linux/scripts/tests/test-lld-literal-false-policy.sh",
  "why": "Fixture subject overrides remain positional and isolated; fake-path assertions must fail without executing any production entrypoint."
 },
 {
  "id": "lib.nerdctl-services-user-stop-order",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  systemctl --user stop buildkit.service containerd.service 2>/dev/null || true",
  "replace": "  systemctl --user stop containerd.service buildkit.service 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-nerdctl-service-helpers.sh",
  "why": "The user stack stops buildkit before containerd in every original flow."
 },
 {
  "id": "lib.nerdctl-services-user-stop-best-effort",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  systemctl --user stop buildkit.service containerd.service 2>/dev/null || true",
  "replace": "  systemctl --user stop buildkit.service containerd.service 2>/dev/null",
  "test": "bash linux/scripts/tests/test-nerdctl-service-helpers.sh",
  "why": "User service stop failures stay best effort even under direct strict execution."
 },
 {
  "id": "lib.nerdctl-services-user-stop-stdout",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  systemctl --user stop buildkit.service containerd.service 2>/dev/null || true",
  "replace": "  systemctl --user stop buildkit.service containerd.service >/dev/null 2>&1 || true",
  "test": "bash linux/scripts/tests/test-nerdctl-service-helpers.sh",
  "why": "User service stderr is suppressed while its stdout remains observable."
 },
 {
  "id": "lib.nerdctl-services-rootful-unit-expansion",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  if sudo systemctl \"$action\" ${units}; then return 0; fi",
  "replace": "  if sudo systemctl \"$action\" \"${units}\"; then return 0; fi",
  "test": "bash linux/scripts/tests/test-nerdctl-service-helpers.sh",
  "why": "Rootful unit lists retain original IFS splitting and filename expansion."
 },
 {
  "id": "lib.nerdctl-services-rootful-warning-status",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  warn \"could not ${description} ${units}\"",
  "replace": "  warn \"could not ${description} ${units}\" || true",
  "test": "bash linux/scripts/tests/test-nerdctl-service-helpers.sh",
  "why": "Failed warnings keep their raw status and direct versus conditional errexit behavior."
 },
 {
  "id": "lib.nerdctl-services-rootful-restart-message",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "description=\"${3:-$1}\"",
  "replace": "description=\"$1\"",
  "test": "bash linux/scripts/tests/test-nerdctl-service-helpers.sh",
  "why": "The historical start failure says could not restart without changing the actual start action."
 },
 {
  "id": "lib.nerdctl-services-rollback-stop-wiring",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "    _rootful_service_action stop \"${_rb_rootful}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-nerdctl-service-helpers.sh",
  "why": "Rollback stops active rootful services before the user stack and restoration."
 },
 {
  "id": "lib.nerdctl-services-install-start-wiring",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  _rootful_service_action start \"${_rootful_active}\" restart",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-nerdctl-service-helpers.sh",
  "why": "An included rootful stack restarts only after the original user readiness checks."
 },
 {
  "id": "lib.host-python-pin-precedence",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "for candidate in \"${MEDIA_HOST_PYTHON:-}\" \"${UV_PYTHON:-}\"",
  "replace": "for candidate in \"${UV_PYTHON:-}\" \"${MEDIA_HOST_PYTHON:-}\"",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "explicit media pins precede uv pins even when both are executable"
 },
 {
  "id": "lib.host-python-pin-executable",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "[ -n \"${candidate}\" ] && [ -x \"${candidate}\" ] || continue",
  "replace": "[ -n \"${candidate}\" ] && [ -f \"${candidate}\" ] || continue",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "an existing nonexecutable pin must not displace the next executable candidate"
 },
 {
  "id": "lib.host-python-venv-pin",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "\"${VIRTUAL_ENV:+${VIRTUAL_ENV}/bin/python}\"",
  "replace": "\"${VIRTUAL_ENV:+${VIRTUAL_ENV}/python}\"",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "virtual environments retain the exact executable subpath"
 },
 {
  "id": "lib.host-python-path-precedence",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "command -v python3 2>/dev/null || command -v python 2>/dev/null || return 1",
  "replace": "command -v python 2>/dev/null || command -v python3 2>/dev/null || return 1",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "PATH fallback prefers python3 and returns its raw command-v path"
 },
 {
  "id": "lib.host-python-canonical-profile",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "  host_python_path derived",
  "replace": "  host_python_path explicit",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "canonical cross resolution retains optional PYTHON_VERSION derivation"
 },
 {
  "id": "lib.host-python-android-profile",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "    host_python_path explicit",
  "replace": "    host_python_path derived",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "the old-SDK Android fallback must not derive a version from PYTHON_VERSION"
 },
 {
  "id": "lib.host-python-android-override-status",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "        host_python_bin\n        return",
  "replace": "        host_python_bin\n        :",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "existing function and executable overrides remain authoritative even on failure"
 },
 {
  "id": "lib.host-python-cross-import-status",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/platform.sh\" || exit $?",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/platform.sh\" || exit 1",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "selected companion failure retains its actual status even in conditional source context"
 },
 {
  "id": "lib.host-python-android-import-status",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "source /opt/scripts/core/platform.sh || exit $?",
  "replace": "source /opt/scripts/core/platform.sh || exit 1",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "selected installed companion failure must not become a different status or a repository retry"
 },
 {
  "id": "lib.host-python-cross-required-symbol",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "declare -F host_python_path >/dev/null || { echo \"Error: platform.sh lacks host_python_path\" >&2; exit 1; }",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "a stale loaded platform guard cannot silently substitute PATH for the required selector"
 },
 {
  "id": "lib.host-python-android-required-symbol",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "declare -F host_python_path >/dev/null || { echo \"Error: platform.sh lacks host_python_path\" >&2; exit 1; }",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "the Android copied module requires the actual shared selector even when a host override exists"
 },
 {
  "id": "lib.host-python-source-only",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "if [ \"${BASH_SOURCE[0]}\" = \"$0\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "the cross module still rejects direct execution"
 },
 {
  "id": "lib.host-python-loaded-module",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "[ -z \"${_CROSS_PYTHON_LOADED:-}\" ] || return 0",
  "replace": "[ -z \"${_CROSS_PYTHON_LOADED:-}\" ] || :",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "already-loaded modules retain existing caller definitions"
 },
 {
  "id": "lib.host-python-platform-guard",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "[ -n \"${_PLATFORM_SH_LOADED:-}\" ] && return 0",
  "replace": "[ -n \"${_PLATFORM_SH_LOADED:-}\" ] && :",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "an already loaded platform does not overwrite caller selection hooks"
 },
 {
  "id": "lib.host-python-android-raw-newlines",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    if host_python_pinned_path interpreter; then\n      printf '%s' \"${interpreter}\"\n      return",
  "replace": "    if host_python_pinned_path interpreter; then\n      interpreter=\"$(printf '%s' \"${interpreter}\")\"\n      printf '%s' \"${interpreter}\"\n      return",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "Android explicit pins preserve trailing newline bytes while the canonical derived profile retains legacy capture semantics"
 },
 {
  "id": "lib.host-python-android-printf-status",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    if host_python_pinned_path interpreter; then\n      printf '%s' \"${interpreter}\"\n      return",
  "replace": "    if host_python_pinned_path interpreter; then\n      printf '%s' \"${interpreter}\"\n      return 0",
  "test": "bash linux/scripts/tests/test-host-python-pins.sh",
  "why": "a selected Android pin whose stdout emission fails retains that failure and never falls through to PATH"
 },
 {
  "id": "lib.tag-mode-refusal-status",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "_runtime_reject_artifact_mode() {\n  printf '[ERROR] Unsupported artifact build mode: %s\\n' \"${ARTIFACT_BUILD_MODE}\" >&2\n  return 1\n}",
  "replace": "_runtime_reject_artifact_mode() {\n  printf '[ERROR] Unsupported artifact build mode: %s\\n' \"${ARTIFACT_BUILD_MODE}\" >&2\n  return 0\n}",
  "test": "bash linux/scripts/tests/test-tag-mode-rejection.sh",
  "why": "Invalid modes must fail in direct and conditional contexts rather than becoming an empty successful tag."
 },
 {
  "id": "lib.tag-mode-diagnostic-stream",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "_runtime_reject_artifact_mode() {\n  printf '[ERROR] Unsupported artifact build mode: %s\\n' \"${ARTIFACT_BUILD_MODE}\" >&2\n  return 1\n}",
  "replace": "_runtime_reject_artifact_mode() {\n  printf '[ERROR] Unsupported artifact build mode: %s\\n' \"${ARTIFACT_BUILD_MODE}\"\n  return 1\n}",
  "test": "bash linux/scripts/tests/test-tag-mode-rejection.sh",
  "why": "The exact invalid-mode diagnostic belongs on stderr while stdout remains empty."
 },
 {
  "id": "lib.tag-mode-platform-delegates",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "    native) printf '%s' \"linux/${arch}\" ;;\n    *) _runtime_reject_artifact_mode ;;",
  "replace": "    native) printf '%s' \"linux/${arch}\" ;;\n    *) : ;;",
  "test": "bash linux/scripts/tests/test-tag-mode-rejection.sh",
  "why": "The platform caller must retain invalid-mode refusal through the shared owner."
 },
 {
  "id": "lib.tag-mode-reference-delegates",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "    native) printf '%s' \"${ARTIFACT_IMAGE_PREFIX}\" ;;\n    *) _runtime_reject_artifact_mode ;;",
  "replace": "    native) printf '%s' \"${ARTIFACT_IMAGE_PREFIX}\" ;;\n    *) : ;;",
  "test": "bash linux/scripts/tests/test-tag-mode-rejection.sh",
  "why": "The image-reference caller must retain invalid-mode refusal through the shared owner."
 },
 {
  "id": "lib.tag-mode-invalid-is-lazy",
  "target": "linux/scripts/01-core/tag-naming.sh",
  "find": "_runtime_reject_artifact_mode() {",
  "replace": "_runtime_reject_artifact_mode() {\n  : \"${ARTIFACT_IMAGE_PREFIX}\"",
  "test": "bash linux/scripts/tests/test-tag-mode-rejection.sh",
  "why": "Invalid modes must reject without first expanding an unrelated unset image prefix."
 },
 {
  "id": "lib.tag-mode-host-fixture-closure",
  "target": "linux/scripts/tests/test-host-payload.sh",
  "find": "$(t_fn_src \"${SCRIPTS}/01-core/tag-naming.sh\" _runtime_reject_artifact_mode)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-host-payload.sh",
  "why": "The extracted host-payload resolver must retain the shared refusal helper and its exact diagnostic."
 },
 {
  "id": "lib.smoke-native-cross-skip",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "if smoke_cross_presence_gate \"$1\" \"$2\"; then return 0; fi",
  "replace": "if false && smoke_cross_presence_gate \"$1\" \"$2\"; then return 0; fi",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "foreign targets prove presence without running the native tool callback"
 },
 {
  "id": "lib.smoke-native-callback-errexit",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  shift 2\n  \"$@\"\n}",
  "replace": "  shift 2\n  if \"$@\"; then :; fi\n}",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "native callbacks remain unconditional so unexpected failures retain caller errexit"
 },
 {
  "id": "lib.smoke-native-callback-status",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  shift 2\n  \"$@\"\n}",
  "replace": "  shift 2\n  \"$@\" || true\n}",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "conditional callers still receive the actual callback status"
 },
 {
  "id": "lib.smoke-native-callback-arguments",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  shift 2\n  \"$@\"\n}",
  "replace": "  shift 2\n  $@\n}",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "empty and spaced callback arguments retain their array boundaries"
 },
 {
  "id": "lib.smoke-native-callback-scope",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "smoke_native_dispatch() {",
  "replace": "smoke_native_dispatch() {\n  local label=hidden path=hidden",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "dispatch does not shadow callback-visible caller variables"
 },
 {
  "id": "lib.smoke-native-encode-rate",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "rate=${_sfte_rate}",
  "replace": "rate=1",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "H264 keeps rate one while advertised encoder roundtrips retain rate two"
 },
 {
  "id": "lib.smoke-native-encode-options",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    -c:v \"$@\" \"${_sfte_output}\" 2>/dev/null",
  "replace": "    -c:v \"$1\" \"${_sfte_output}\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "the H264 preset remains between codec and output without changing other codecs"
 },
 {
  "id": "lib.smoke-native-encode-stderr",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "\"${_sfte_output}\" 2>/dev/null",
  "replace": "\"${_sfte_output}\"",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "encoder stderr stays suppressed while caller diagnostics remain visible"
 },
 {
  "id": "lib.smoke-native-encode-stdout",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "\"${_sfte_output}\" 2>/dev/null",
  "replace": "\"${_sfte_output}\" >/dev/null 2>&1",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "encoder stdout remains visible before the caller reports encode success"
 },
 {
  "id": "lib.smoke-native-decode-status",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  \"$1\" -y -i \"$2\" -f null /dev/null 2>/dev/null",
  "replace": "  \"$1\" -y -i \"$2\" -f null /dev/null 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "a failed null decode remains a failed H264 or advertised codec verdict"
 },
 {
  "id": "lib.smoke-native-decode-stderr",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  \"$1\" -y -i \"$2\" -f null /dev/null 2>/dev/null",
  "replace": "  \"$1\" -y -i \"$2\" -f null /dev/null",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "decoder stderr remains suppressed independently of its result"
 },
 {
  "id": "lib.smoke-native-features-delegation",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "    _smoke_ffmpeg_features\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "the native tool still verifies configured codecs, advertised roundtrips and filters"
 },
 {
  "id": "lib.smoke-native-h264-temp-cleanup",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "  rm -rf \"${tmpdir}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "H264 cleanup retains its private-file effect and original position after feature checks"
 },
 {
  "id": "lib.smoke-native-camera-dispatch",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "  smoke_native_dispatch cam \"${_cam_bin}\" _smoke_cam_native",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "a native camera help probe is still run while foreign builds retain presence-only behavior"
 },
 {
  "id": "lib.smoke-native-gst-dispatch",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "  smoke_native_dispatch gst-inspect-1.0 \"${_gst_inspect}\" _smoke_gst_version",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "GStreamer version and ELF deferral stay before its independent pipeline/plugin checks"
 },
 {
  "id": "lib.smoke-native-ffmpeg-dispatch",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "  smoke_native_dispatch ffmpeg \"${_ffmpeg_bin}\" _smoke_ffmpeg_native",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-smoke-native-dispatch.sh",
  "why": "all native FFmpeg verdicts and cleanup remain connected to the binary discovery branch"
 },
 {
  "id": "lib.toolchain-downloads-adjacent-excluded",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "downloads.sh core-paths-only",
  "replace": "downloads.sh core-first",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "Adjacent downloads.sh was never a standalone installer candidate."
 },
 {
  "id": "lib.toolchain-downloads-provided-helper-wins",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  if command -v download_file >/dev/null 2>&1; then return 0; fi",
  "replace": "  if false; then return 0; fi",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "A supplied download_file prevents all downloader module lookup and initialization."
 },
 {
  "id": "lib.toolchain-downloads-repository-first",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "    candidates+=(\"${script_dir}/../01-core/${leaf}\" \"/opt/scripts/core/${leaf}\")",
  "replace": "    candidates+=(\"/opt/scripts/core/${leaf}\" \"${script_dir}/../01-core/${leaf}\")",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The repository downloader remains preferred to an installed downloader."
 },
 {
  "id": "lib.toolchain-downloads-unconditional-source",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  _source_toolchain_first_available _std_found \\\n    \"$(cd \"$(dirname \"$caller\")\" && pwd)\" downloads.sh core-paths-only",
  "replace": "  if _source_toolchain_first_available _std_found \\\n    \"$(cd \"$(dirname \"$caller\")\" && pwd)\" downloads.sh core-paths-only; then :; fi",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "Actual downloader initialization retains direct-strict failures and conditional-call behavior."
 },
 {
  "id": "lib.toolchain-downloads-android-bootstrap-required",
  "target": "linux/scripts/02-toolchain/android-sdk.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap-import.sh\" || exit $?",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap-import.sh\"",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The executable installer stops on a missing or failed mandatory bootstrap before loading downloads."
 },
 {
  "id": "lib.toolchain-downloads-vulkan-bootstrap-required",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap-import.sh\" || return $?",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap-import.sh\"",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The source-only Vulkan module returns a failed bootstrap before loading downloads."
 },
 {
  "id": "lib.toolchain-downloads-android-copy",
  "target": "linux/Dockerfile.android",
  "find": "COPY --chmod=755 linux/scripts/02-toolchain/android-sdk.sh linux/scripts/02-toolchain/bootstrap.sh linux/scripts/02-toolchain/bootstrap-import.sh /opt/scripts/",
  "replace": "COPY --chmod=755 linux/scripts/02-toolchain/android-sdk.sh linux/scripts/02-toolchain/bootstrap-import.sh /opt/scripts/",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The flattened Android installer carries the canonical bootstrap beside its copied bytes."
 },
 {
  "id": "lib.toolchain-downloads-sdk-copy",
  "target": "linux/Dockerfile.sdk",
  "find": "    linux/scripts/02-toolchain/bootstrap.sh \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The SDK refreshes the canonical bootstrap beside its current Vulkan helper."
 },
 {
  "id": "lib.toolchain-downloads-source-scope",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  local caller=\"$1\" _std_found",
  "replace": "  local caller=\"$1\" _std_found _DOWNLOADS_SH_LOADED",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "Sourcing actual downloads inside the transport must retain its global initialization guard."
 },
 {
  "id": "lib.toolchain-downloads-torch-bootstrap",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --chmod=755 linux/scripts/02-toolchain/vulkan.sh linux/scripts/02-toolchain/bootstrap.sh linux/scripts/02-toolchain/bootstrap-import.sh linux/scripts/02-toolchain/vulkan-install.sh /usr/local/bin/",
  "replace": "COPY --chmod=755 linux/scripts/02-toolchain/vulkan.sh linux/scripts/02-toolchain/bootstrap-import.sh linux/scripts/02-toolchain/vulkan-install.sh /usr/local/bin/",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The copied Vulkan runtime entry requires the canonical bootstrap beside it."
 },
 {
  "id": "lib.toolchain-downloads-torch-install-library",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --chmod=755 linux/scripts/02-toolchain/vulkan.sh linux/scripts/02-toolchain/bootstrap.sh linux/scripts/02-toolchain/bootstrap-import.sh linux/scripts/02-toolchain/vulkan-install.sh /usr/local/bin/",
  "replace": "COPY --chmod=755 linux/scripts/02-toolchain/vulkan.sh linux/scripts/02-toolchain/bootstrap.sh linux/scripts/02-toolchain/bootstrap-import.sh /usr/local/bin/",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The real copied Vulkan entry must source its sibling provisioning declarations without executing them."
 },
 {
  "id": "lib.toolchain-downloads-package-bootstrap",
  "target": "linux/Dockerfile.package",
  "find": "COPY --chmod=755 linux/scripts/02-toolchain/android-sdk.sh linux/scripts/02-toolchain/bootstrap.sh linux/scripts/02-toolchain/bootstrap-import.sh /opt/scripts/",
  "replace": "COPY --chmod=755 linux/scripts/02-toolchain/android-sdk.sh linux/scripts/02-toolchain/bootstrap-import.sh /opt/scripts/",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The package stage also refreshes the canonical bootstrap beside its flattened Android installer."
 },
 {
  "id": "lib.numeric-version-capture-shape",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "regex='^[0-9]+'",
  "replace": "regex='^([0-9]+)'",
  "test": "bash linux/scripts/tests/test-numeric-version-policy.sh",
  "why": "Numeric validation must retain only the original full-match BASH_REMATCH member, never introduce capture groups."
 },
 {
  "id": "lib.numeric-version-literal-dots",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "regex+='\\.[0-9]+'",
  "replace": "regex+='.[0-9]+'",
  "test": "bash linux/scripts/tests/test-numeric-version-policy.sh",
  "why": "Separators are literal dots; equal-length nonnumeric separators must not pass numeric version validation."
 },
 {
  "id": "lib.numeric-version-supported-parts",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "  case \"$parts\" in 3|4) ;; *) return 2 ;; esac",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-numeric-version-policy.sh",
  "why": "Unsupported component counts must fail before matching and retain the existing BASH_REMATCH array."
 },
 {
  "id": "lib.numeric-gcc-fallback-policy",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "  if ! version_has_numeric_parts \"${full}\" 3; then",
  "replace": "  if version_has_numeric_parts \"${full}\" 3; then",
  "test": "bash linux/scripts/tests/test-numeric-version-policy.sh",
  "why": "GCC retains exact three-part input or returns its caller-provided fallback without normalizing either."
 },
 {
  "id": "lib.numeric-rust-four-part-policy",
  "target": "linux/scripts/02-toolchain/rust/version_util.sh",
  "find": "    if ! version_has_numeric_parts \"$version\" 4; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-numeric-version-policy.sh",
  "why": "Rust normalizes three-part versions then still validates four parts before choosing its historical fallback."
 },
 {
  "id": "lib.numeric-builder-advisory-policy",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "  warn \"GCC_VERSION '${GCC_VERSION}' does not match expected format X.Y.Z (e.g., 16.1.0)\"",
  "replace": "  warn \"GCC_VERSION '${GCC_VERSION}' does not match expected format X.Y.Z (e.g., 16.1.0)\"; exit 1",
  "test": "bash linux/scripts/tests/test-numeric-version-policy.sh",
  "why": "The GCC version-format check remains advisory; invalid formatting must not become a new fatal build condition."
 },
 {
  "id": "lib.numeric-dartdoc-required-pin",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "    err \"No exact DARTDOC_VERSION in tool-pins.env.\"",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-numeric-version-policy.sh",
  "why": "A malformed documentation-tool pin must fail before any pub action rather than become a successful empty generation."
 },
 {
  "id": "lib.numeric-required-export-check",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  elif [ -n \"$symbol\" ] && ! declare -F \"$symbol\" >/dev/null; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "Present-but-old modules and stale loaded guards cannot satisfy the new required-export contract."
 },
 {
  "id": "lib.numeric-required-source-status",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  elif [ -n \"$symbol\" ] && [ \"$_toolchain_status\" -ne 0 ]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "A module defining the requested function and then failing must not become a successful conditional import."
 },
 {
  "id": "lib.numeric-gcc-bootstrap-failure",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap-import.sh\" || exit \"$?\"",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap-import.sh\"",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "Preexisting bootstrap functions cannot hide a missing or failed GCC bootstrap import under conditional sourcing."
 },
 {
  "id": "lib.numeric-gcc-required-export",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "source_toolchain_required \"$(dirname \"${BASH_SOURCE[0]}\")\" load-versions-env.sh exit core-first version_has_numeric_parts",
  "replace": "source_toolchain_required \"$(dirname \"${BASH_SOURCE[0]}\")\" load-versions-env.sh exit core-first",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "The numeric caller must request the new exported predicate rather than accept a file-only legacy loader."
 },
 {
  "id": "lib.numeric-builder-required-export",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "source_toolchain_required \"${_SCRIPT_DIR}\" load-versions-env.sh exit core-first version_has_numeric_parts",
  "replace": "source_toolchain_required \"${_SCRIPT_DIR}\" load-versions-env.sh exit core-first",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "The numeric caller must request the new exported predicate rather than accept a file-only legacy loader."
 },
 {
  "id": "lib.numeric-rust-export-guard",
  "target": "linux/scripts/02-toolchain/rust/version_util.sh",
  "find": "declare -F version_has_numeric_parts >/dev/null || err 'Required version_has_numeric_parts missing from load-versions-env.sh.'",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "The Rust utility must diagnose a missing numeric API instead of silently printing its normal invalid-input fallback."
 },
 {
  "id": "lib.numeric-dartdoc-export-guard",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  declare -F version_has_numeric_parts >/dev/null || err 'Required version_has_numeric_parts missing from load-versions-env.sh.'",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "A missing documentation validator must retain the required-export diagnostic, not be misreported as an invalid pin."
 },
 {
  "id": "lib.numeric-rust-source-status",
  "target": "linux/scripts/02-toolchain/rust/version_util.sh",
  "find": "if [ \"$_rust_version_loader_status\" -ne 0 ]; then exit \"$_rust_version_loader_status\"; fi",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "A failed Rust version-module source must remain failed even if it defined the requested predicate before returning."
 },
 {
  "id": "lib.numeric-dartdoc-source-status",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "  if [ \"$loader_status\" -ne 0 ]; then return \"$loader_status\"; fi",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "Documentation generation must not run after a failed version-module source under conditional invocation."
 },
 {
  "id": "lib.numeric-bootstrap-dispatcher",
  "target": "linux/scripts/02-toolchain/bootstrap-import.sh",
  "find": "declare -F source_toolchain_required >/dev/null || {\n  printf 'ERROR: bootstrap.sh does not provide source_toolchain_required\\n' >&2\n  return 1\n}",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "An older bootstrap must fail its dispatcher capability check before conditional callers can ignore unknown commands."
 },
 {
  "id": "lib.numeric-bootstrap-source-status",
  "target": "linux/scripts/02-toolchain/bootstrap-import.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap.sh\" || return \"$?\"",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap.sh\"",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "Functions-only bootstrap source failures must propagate even when the caller already provides all helper functions."
 },
 {
  "id": "lib.numeric-builder-bootstrap-failure",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "source \"${_SCRIPT_DIR}/bootstrap-import.sh\" || exit \"$?\"",
  "replace": "source \"${_SCRIPT_DIR}/bootstrap-import.sh\"",
  "test": "bash linux/scripts/tests/test-numeric-version-imports.sh",
  "why": "A missing or failed bootstrap remains fatal when caller-provided legacy helpers would otherwise permit conditional initialization."
 },
 {
  "id": "lib.stream-receipt-raw-exit",
  "target": "linux/scripts/tests/stream-receipt-fixture.sh",
  "find": "  t_run_fixture_worker \"$worker\" \"$@\" > \"$directory/out\" 2> \"$directory/err\" || _tsc_status=$?",
  "replace": "  t_run_fixture_worker \"$worker\" \"$@\" > \"$directory/out\" 2> \"$directory/err\" || true",
  "test": "bash linux/scripts/tests/test-stream-receipt-fixture.sh",
  "why": "Separate-stream capture must transfer the child failure to the caller instead of manufacturing status zero."
 },
 {
  "id": "lib.stream-receipt-comparison",
  "target": "linux/scripts/tests/stream-receipt-fixture.sh",
  "find": "    t_assert_eq \"$(t_stream_hex \"$directory/expected.$field\")\" \"$(t_stream_hex \"$directory/$field\")\"",
  "replace": "    t_assert_eq \"$(t_stream_hex \"$directory/$field\")\" \"$(t_stream_hex \"$directory/$field\")\"",
  "test": "bash linux/scripts/tests/test-stream-receipt-fixture.sh",
  "why": "Independent expected bytes must be compared against actual output; matching prefixes or self-comparison are insufficient."
 },
 {
  "id": "lib.stream-receipt-full-bytes",
  "target": "linux/scripts/tests/stream-receipt-fixture.sh",
  "find": "od -An -v -tx1 \"$1\"",
  "replace": "od -An -v -N 1 -tx1 \"$1\"",
  "test": "bash linux/scripts/tests/test-stream-receipt-fixture.sh",
  "why": "Byte receipts preserve embedded NUL and trailing newlines and must inspect every byte."
 },
 {
  "id": "lib.stream-receipt-conditional-return",
  "target": "linux/scripts/tests/stream-receipt-fixture.sh",
  "find": "  if [ \"${4:-0}\" -eq 1 ] || { [ \"$1\" = strict ] && [ \"$2\" = direct ]; }; then return 0; fi",
  "replace": "  if [ \"${4:-0}\" -eq 1 ] || [ \"$1\" = strict ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-stream-receipt-fixture.sh",
  "why": "Conditional calls retain a return marker after nonfatal failure even when the surrounding worker enables errexit."
 },
 {
  "id": "lib.guarded-link-existing-destination",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "  [ ! -e \"$2\" ] || return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "existing destination files must survive staging unchanged"
 },
 {
  "id": "lib.guarded-link-dangling-destination",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "  [ ! -e \"$2\" ] || return 0",
  "replace": "  [ ! -e \"$2\" ] && [ ! -L \"$2\" ] || return 0",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "dangling destinations still attempt the caller-specific ln operation"
 },
 {
  "id": "lib.guarded-link-source-check-timing",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "path_symlink_missing() {",
  "replace": "path_symlink_missing() {\n  [ -e \"$1\" ] || return 0",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "callers retain the original source check before basename without a new race-changing recheck"
 },
 {
  "id": "lib.guarded-link-lazy-sudo",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "path_symlink_missing() {",
  "replace": "path_symlink_missing() {\n  : \"$SUDO\"",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "an already present destination must not expand a missing required SUDO variable"
 },
 {
  "id": "lib.guarded-link-required-sudo",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "    $SUDO ln \"$3\" \"$1\" \"$2\"",
  "replace": "    ${SUDO:-} ln \"$3\" \"$1\" \"$2\"",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "GCC keeps its required SUDO expansion rather than accepting an unset prefix"
 },
 {
  "id": "lib.guarded-link-optional-sudo",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "    ${SUDO:-} ln \"$3\" \"$1\" \"$2\"",
  "replace": "    $SUDO ln \"$3\" \"$1\" \"$2\"",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "Vulkan accepts an unset optional SUDO prefix"
 },
 {
  "id": "lib.guarded-link-ln-status",
  "target": "linux/scripts/01-core/path-helpers.sh",
  "find": "    $SUDO ln \"$3\" \"$1\" \"$2\"",
  "replace": "    $SUDO ln \"$3\" \"$1\" \"$2\" || true",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "unconditional GCC staging propagates link failure while conditional callers retain their historical continuation"
 },
 {
  "id": "lib.guarded-link-gcc-flags",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "path_symlink_missing \"${entry}\" \"${dst_dir}/${base}\" -sfn required",
  "replace": "path_symlink_missing \"${entry}\" \"${dst_dir}/${base}\" -s required",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "GCC replaces a dangling target with its original force and no-dereference flags"
 },
 {
  "id": "lib.guarded-link-vulkan-flags",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "path_symlink_missing \"/usr/include/${entry}\" \"${target_include_dir}/${entry}\" -s optional",
  "replace": "path_symlink_missing \"/usr/include/${entry}\" \"${target_include_dir}/${entry}\" -sfn optional",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "Vulkan retains its failing ln -s behavior on a dangling destination"
 },
 {
  "id": "lib.guarded-link-gcc-required-export",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "path-helpers.sh exit core-paths-only path_symlink_missing",
  "replace": "path-helpers.sh exit core-paths-only",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "copied old helpers and stale loaded guards cannot silently omit the required link function"
 },
 {
  "id": "lib.guarded-link-gcc-conditional-import",
  "target": "linux/scripts/02-toolchain/gcc.sh",
  "find": "path-helpers.sh exit core-paths-only path_symlink_missing",
  "replace": "path-helpers.sh return core-paths-only path_symlink_missing",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "conditional library imports cannot swallow a missing required companion or export"
 },
 {
  "id": "lib.guarded-link-vulkan-required-export",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "path-helpers.sh exit core-paths-only path_symlink_missing",
  "replace": "path-helpers.sh exit core-paths-only",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "copied old helpers and stale loaded guards cannot silently omit the required link function"
 },
 {
  "id": "lib.guarded-link-vulkan-conditional-import",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "path-helpers.sh exit core-paths-only path_symlink_missing",
  "replace": "path-helpers.sh return core-paths-only path_symlink_missing",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "conditional library imports cannot swallow a missing required companion or export"
 },
 {
  "id": "lib.guarded-link-sdk-fresh-copy",
  "target": "linux/scripts/script-closures/core-common.txt",
  "find": "01-core/path-helpers.sh|core/path-helpers.sh\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "the SDK refreshes the exact shared helper beside the newly copied callers"
 },
 {
  "id": "lib.guarded-link-toolchain-mount-1",
  "target": "linux/Dockerfile.toolchain",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n",
  "replace": "    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "each minimal compiler RUN independently carries the current link helper"
 },
 {
  "id": "lib.guarded-link-toolchain-mount-2",
  "target": "linux/Dockerfile.toolchain",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n",
  "replace": "    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "each minimal compiler RUN independently carries the current link helper"
 },
 {
  "id": "lib.guarded-link-torch-fresh-core",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --chmod=755 linux/scripts/01-core/ /opt/scripts/core/",
  "replace": "COPY --chmod=755 linux/scripts/01-core/platform.sh /opt/scripts/core/platform.sh",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "the fresh loose Vulkan bundle cannot depend on an inherited older path helper API"
 },
 {
  "id": "lib.guarded-link-vulkan-dispatcher",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap-import.sh\" || return $?",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap-import.sh\"",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "the source-only Vulkan caller propagates initializer failure under conditional import instead of swallowing a missing dispatcher"
 },
 {
  "id": "lib.guarded-link-sdk-initializer-copy",
  "target": "linux/Dockerfile.sdk",
  "find": "    linux/scripts/02-toolchain/bootstrap-import.sh \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "the SDK carries the shared initializer beside its freshly copied bootstrap and Vulkan modules"
 },
 {
  "id": "lib.guarded-link-toolchain-initializer-1",
  "target": "linux/Dockerfile.toolchain",
  "find": "    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n",
  "replace": "    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "each minimal compiler RUN carries the shared bootstrap initializer"
 },
 {
  "id": "lib.guarded-link-toolchain-initializer-2",
  "target": "linux/Dockerfile.toolchain",
  "find": "    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n",
  "replace": "    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "each minimal compiler RUN carries the shared bootstrap initializer"
 },
 {
  "id": "lib.guarded-link-torch-initializer-copy",
  "target": "linux/Dockerfile.torch",
  "find": "linux/scripts/02-toolchain/bootstrap-import.sh ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-guarded-links.sh",
  "why": "the loose Vulkan runtime bundle includes its adjacent initializer rather than relying on inherited files elsewhere"
 },
 {
  "id": "lib.raw-pin-operator-value-wins",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "if [ -z \"${_rpi_value:-}\" ] && [ -f \"${_rpi_file}\" ]; then",
  "replace": "if [ -f \"${_rpi_file}\" ]; then",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Existing nonempty operator values prevent file reads and remain unchanged."
 },
 {
  "id": "lib.raw-pin-unset-target-safe",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "[ -z \"${_rpi_value:-}\" ]",
  "replace": "[ -z \"${_rpi_value}\" ]",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Unset targets remain safe under nounset, including when the pins file is missing."
 },
 {
  "id": "lib.raw-pin-regular-file-guard",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "[ -f \"${_rpi_file}\" ]",
  "replace": "[ -e \"${_rpi_file}\" ]",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Directories are skipped exactly as the original regular-file guard required."
 },
 {
  "id": "lib.raw-pin-all-matching-lines",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "s/^${_rpi_key}=//p",
  "replace": "s/^${_rpi_key}=//p;q",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "All matching lines are retained, including leading empty records and duplicate values."
 },
 {
  "id": "lib.raw-pin-raw-read-status",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "    _rpi_status=$?",
  "replace": "    _rpi_status=0",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Conditional and relaxed calls retain raw sed failure codes and partial assignment state."
 },
 {
  "id": "lib.raw-pin-read-diagnostics",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "    _rpi_value=\"$(sed -n \"s/^${_rpi_key}=//p\" \"${_rpi_file}\")\"",
  "replace": "    _rpi_value=\"$(sed -n \"s/^${_rpi_key}=//p\" \"${_rpi_file}\" 2>/dev/null)\"",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Raw sed diagnostics remain on stderr instead of being swallowed."
 },
 {
  "id": "lib.raw-pin-data-not-sourced",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "    _rpi_value=\"$(sed -n \"s/^${_rpi_key}=//p\" \"${_rpi_file}\")\"",
  "replace": "    . \"${_rpi_file}\"",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Pin values stay literal data; harmless fixture shell syntax must never execute."
 },
 {
  "id": "lib.raw-pin-single-key-only",
  "target": "linux/scripts/01-core/load-versions-env.sh",
  "find": "    _rpi_value=\"$(sed -n \"s/^${_rpi_key}=//p\" \"${_rpi_file}\")\"",
  "replace": "    load_versions_env \"${_rpi_file}\"",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "The whole-file loader changes quoting, duplicate-line and export behavior and cannot replace a raw single-key read."
 },
 {
  "id": "lib.raw-pin-android-key-binding",
  "target": "linux/scripts/02-toolchain/android-sdk.sh",
  "find": "load_raw_pin_if_empty ANDROID_CMDLINE_TOOLS_SHA256 ANDROID_CMDLINE_TOOLS_SHA256 /opt/scripts/core/versions.env",
  "replace": "load_raw_pin_if_empty ANDROID_CMDLINE_TOOLS_SHA256 RUSTUP_INIT_SHA256 /opt/scripts/core/versions.env",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Android reads its own command-line tools digest without borrowing the Rust pin."
 },
 {
  "id": "rust.rustup-required-retries",
  "target": "linux/scripts/02-toolchain/install-rust.sh",
  "find": "  for attempt in 1 2 3; do\n",
  "replace": "  for attempt in 1; do\n",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "a single qemu-user SIGABRT in rustup's download would again cost the whole arm64 package stage"
 },
 {
  "id": "rust.rustup-required-propagates",
  "target": "linux/scripts/02-toolchain/install-rust.sh",
  "find": "    [ \"${attempt}\" -eq 3 ] || sleep 5\n  done\n  return 1\n",
  "replace": "    [ \"${attempt}\" -eq 3 ] || sleep 5\n  done\n  return 0\n",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "three failed attempts must fail the installer; a required component silently missing ships an image whose cargo fmt or clippy gate cannot run"
 },
 {
  "id": "lib.raw-pin-rust-key-binding",
  "target": "linux/scripts/02-toolchain/install-rust.sh",
  "find": "load_raw_pin_if_empty RUSTUP_INIT_SHA256 RUSTUP_INIT_SHA256 /opt/scripts/core/versions.env",
  "replace": "load_raw_pin_if_empty RUSTUP_INIT_SHA256 ANDROID_CMDLINE_TOOLS_SHA256 /opt/scripts/core/versions.env",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Rust reads its own rustup-init digest without borrowing the Android pin."
 },
 {
  "id": "lib.raw-pin-android-required-export",
  "target": "linux/scripts/02-toolchain/android-sdk.sh",
  "find": "source_toolchain_required \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\" load-versions-env.sh exit core-paths-only load_raw_pin_if_empty",
  "replace": "source_toolchain_required \"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\" load-versions-env.sh exit core-paths-only",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Android rejects a present or cached owner that does not provide the raw pin function."
 },
 {
  "id": "lib.raw-pin-rust-required-export",
  "target": "linux/scripts/02-toolchain/install-rust.sh",
  "find": "if ! declare -F load_raw_pin_if_empty >/dev/null 2>&1; then",
  "replace": "if ! declare -F version_has_numeric_parts >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "An older numeric-only owner cannot satisfy the installer raw pin API requirement."
 },
 {
  "id": "lib.raw-pin-rust-import-status",
  "target": "linux/scripts/02-toolchain/install-rust.sh",
  "find": "_rust_pin_source_status=$?",
  "replace": "_rust_pin_source_status=0",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "A module that defines the function but returns failure remains fatal under a conditional caller."
 },
 {
  "id": "lib.raw-pin-android-fresh-copy",
  "target": "linux/Dockerfile.android",
  "find": "COPY --chmod=755 linux/scripts/01-core/platform.sh linux/scripts/01-core/load-versions-env.sh linux/scripts/01-core/modules.sh /opt/scripts/core/",
  "replace": "COPY --chmod=755 linux/scripts/01-core/platform.sh linux/scripts/01-core/modules.sh /opt/scripts/core/",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "The Android child refreshes the canonical raw pin API instead of inheriting an old owner."
 },
 {
  "id": "lib.raw-pin-rust-fresh-mount",
  "target": "linux/Dockerfile.toolchain",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/install-rust.sh,target=/opt/scripts/toolchain/install-rust.sh,ro \\\n",
  "replace": "    --mount=type=bind,source=linux/scripts/02-toolchain/install-rust.sh,target=/opt/scripts/toolchain/install-rust.sh,ro \\\n",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "The Rust RUN mounts the current owner read-only before executing the new API call."
 },
 {
  "id": "lib.raw-pin-android-initializer",
  "target": "linux/scripts/02-toolchain/android-sdk.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap-import.sh\" || exit $?",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/bootstrap.sh\" || exit $?",
  "test": "bash linux/scripts/tests/test-raw-pin-reader.sh",
  "why": "Android must initialize the required dispatcher through the fail-closed shared import protocol, including with an older bootstrap."
 },
 {
  "id": "lib.raw-pin-android-initializer-copy",
  "target": "linux/Dockerfile.android",
  "find": "COPY --chmod=755 linux/scripts/02-toolchain/android-sdk.sh linux/scripts/02-toolchain/bootstrap.sh linux/scripts/02-toolchain/bootstrap-import.sh /opt/scripts/\n",
  "replace": "COPY --chmod=755 linux/scripts/02-toolchain/android-sdk.sh linux/scripts/02-toolchain/bootstrap.sh /opt/scripts/\n",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The flattened Android SDK entry must carry its canonical initializer beside bootstrap.sh."
 },
 {
  "id": "lib.raw-pin-package-initializer-copy",
  "target": "linux/Dockerfile.package",
  "find": "COPY --chmod=755 linux/scripts/02-toolchain/android-sdk.sh linux/scripts/02-toolchain/bootstrap.sh linux/scripts/02-toolchain/bootstrap-import.sh /opt/scripts/\n",
  "replace": "COPY --chmod=755 linux/scripts/02-toolchain/android-sdk.sh linux/scripts/02-toolchain/bootstrap.sh /opt/scripts/\n",
  "test": "bash linux/scripts/tests/test-toolchain-download-loader.sh",
  "why": "The flattened Android SDK entry must carry its canonical initializer beside bootstrap.sh."
 },
 {
  "id": "lib.lint-scope-init-owner-required",
  "target": "linux/scripts/01-core/lint-scope-init.sh",
  "find": " || return 1",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lint-scope-init.sh",
  "why": "a missing scope owner cannot reuse a previously defined scope function"
 },
 {
  "id": "lib.lint-scope-init-root-failure",
  "target": "linux/scripts/01-core/lint-scope-init.sh",
  "find": " || exit 1",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lint-scope-init.sh",
  "why": "invalid consumer roots terminate before driver argument handling"
 },
 {
  "id": "lib.lint-scope-init-all-arguments",
  "target": "linux/scripts/01-core/lint-scope-init.sh",
  "find": "\"${REPO_ROOT}\" \"$@\"",
  "replace": "\"${REPO_ROOT}\" \"${1-}\"",
  "test": "bash linux/scripts/tests/test-lint-scope-init.sh",
  "why": "root parsing preserves repeated root selectors and positional arguments"
 },
 {
  "id": "lib.lint-scope-init-rest-handoff",
  "target": "linux/scripts/01-core/lint-scope-init.sh",
  "find": "set -- ${LINT_ROOT_REST[@]+\"${LINT_ROOT_REST[@]}\"}",
  "replace": "set -- \"$@\"",
  "test": "bash linux/scripts/tests/test-lint-scope-init.sh",
  "why": "the caller receives only remaining arguments with empty and multiline values intact"
 },
 {
  "id": "shellcheck.scope-init-entry",
  "target": "linux/scripts/lint-shell.sh",
  "find": ". \"${CORE_DIR}/lint-scope-init.sh\" || exit 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-lint-scope-init.sh",
  "why": "each lint driver initializes the selected consumer scope and remaining arguments"
 },
 {
  "id": "shellcheck.consumer-hook-templates-linted",
  "target": "linux/scripts/lint-shell.sh",
  "find": "    \"${REPO_ROOT}/shared/linux\" \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lint-shell-scope.sh",
  "why": "every consumer runs the hook templates and the copied bootstrap; outside the sweep no gate lints them"
 },
 {
  "id": "dockerfile-lint.scope-init-entry",
  "target": "linux/scripts/lint-dockerfiles.sh",
  "find": ". \"${CORE_DIR}/lint-scope-init.sh\" || exit 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-lint-scope-init.sh",
  "why": "each lint driver initializes the selected consumer scope and remaining arguments"
 },
 {
  "id": "python-lint.scope-init-entry",
  "target": "linux/scripts/lint-python.sh",
  "find": ". \"${_core}/lint-scope-init.sh\" || exit 1",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-lint-scope-init.sh",
  "why": "each lint driver initializes the selected consumer scope and remaining arguments"
 },
 {
  "id": "lib.packaging-execution-conditional-command",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "    \"$@\" || status=$?",
  "replace": "    \"$@\"; status=$?",
  "test": "bash linux/scripts/tests/test-packaging-execution.sh",
  "why": "Commands retain their original conditional execution context, including internal failures before their final status."
 },
 {
  "id": "lib.packaging-execution-success-fastpath",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "    if [ \"$status\" -eq 0 ]; then return 0; fi",
  "replace": "    if [ \"$status\" -ne 0 ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-packaging-execution.sh",
  "why": "A failed command must reach its independent failure policy and a successful command must not invoke fallback."
 },
 {
  "id": "lib.packaging-execution-argv-preserved",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "    \"$_pe_failure_handler\" \"$status\" \"$@\"",
  "replace": "    \"$_pe_failure_handler\" \"$status\" \"$*\"",
  "test": "bash linux/scripts/tests/test-packaging-execution.sh",
  "why": "Sudo fallback receives the original command and argument boundaries, including whitespace, empty arguments and literal globs."
 },
 {
  "id": "lib.packaging-execution-advisory-mode",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "    if best_effort_mode; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-packaging-execution.sh",
  "why": "Best-effort packaging steps retain their warning and successful outer verdict after the command fails."
 },
 {
  "id": "lib.packaging-execution-sudo-status",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "        sudo \"$@\"",
  "replace": "        sudo \"$@\" || true",
  "test": "bash linux/scripts/tests/test-packaging-execution.sh",
  "why": "A failed sudo retry preserves its raw status instead of becoming a successful packaging operation."
 },
 {
  "id": "lib.wheel-archive-action",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "replace": "  \"$@\" -m wheel unpack \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "test": "bash linux/scripts/tests/test-wheel-archive-transport.sh",
  "why": "Both pack and unpack must retain their selected wheel operation."
 },
 {
  "id": "lib.wheel-archive-source",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "replace": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_destination}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "test": "bash linux/scripts/tests/test-wheel-archive-transport.sh",
  "why": "The payload source is distinct from the output directory."
 },
 {
  "id": "lib.wheel-archive-runner-argv",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "replace": "  \"$*\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "test": "bash linux/scripts/tests/test-wheel-archive-transport.sh",
  "why": "The uv run python command prefix retains argument boundaries."
 },
 {
  "id": "lib.wheel-archive-stdout",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "replace": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-wheel-archive-transport.sh",
  "why": "Wheel tool stdout remains quiet."
 },
 {
  "id": "lib.wheel-archive-stderr",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "replace": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null",
  "test": "bash linux/scripts/tests/test-wheel-archive-transport.sh",
  "why": "Wheel tool stderr remains quiet."
 },
 {
  "id": "lib.wheel-archive-raw-status",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "replace": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1\n  return 0",
  "test": "bash linux/scripts/tests/test-wheel-archive-transport.sh",
  "why": "Failed unpack and pack retain raw statuses for caller verdicts."
 },
 {
  "id": "lib.wheel-archive-destination-quoting",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1",
  "replace": "  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d ${_war_destination} >/dev/null 2>&1",
  "test": "bash linux/scripts/tests/test-wheel-archive-transport.sh",
  "why": "Wheel destinations containing spaces remain one argument."
 },
 {
  "id": "lib.ort-component-name-exemption",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  case \"${1,,}\" in *onnxruntime[-_.]genai* | *onnxruntime[-_.]extensions* | *onnxruntime[-_.]ep[-_.]*) return 0 ;; esac",
  "replace": "  case \"${1,,}\" in *onnxruntime[-_.]genai* | *onnxruntime[-_.]extensions* | *onnxruntime[-_.]ep[-_.]*) return 1 ;; esac",
  "test": "bash linux/scripts/tests/test-ort-name-selection.sh",
  "why": "GenAI and extensions remain excluded from core binary and archive classifications while ordinary ORT names retain their findings."
 },
 {
  "id": "lib.ort-tree-archive-candidates",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  _ortg_file_candidates file_candidates archives",
  "replace": "  _ortg_file_candidates file_candidates",
  "test": "bash linux/scripts/tests/test-ort-name-selection.sh",
  "why": "Tree scans still inspect arbitrary tar.lzma2 archives while preserving the original filename predicate and raw suffix diagnostics."
 },
 {
  "id": "lib.ort-record-candidate-scope",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  _ortg_file_candidates file_candidates\n",
  "replace": "  _ortg_file_candidates file_candidates archives\n",
  "test": "bash linux/scripts/tests/test-ort-name-selection.sh",
  "why": "Record-directory scans retain their one-level filename policy and must not gain tree-only tar.lzma2 candidates."
 },
 {
  "id": "lib.ort-provider-header-candidates",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  _ofc_predicate=(-iname '*onnxruntime*' -o -name '*_provider_factory.h')",
  "replace": "  _ofc_predicate=(-iname '*onnxruntime*')",
  "test": "bash linux/scripts/tests/test-ort-name-selection.sh",
  "why": "Provider headers without onnxruntime in their filename still reach byte comparison in both tree and record scans."
 },
 {
  "id": "lib.stream-workspace-receipt-reset",
  "target": "linux/scripts/tests/stream-receipt-fixture.sh",
  "find": "  [ -z \"$_tsw_receipt\" ] || : > \"$_tsw_receipt\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-name-selection.sh",
  "why": "An explicit optional receipt is truncated at startup while an omitted receipt creates no output file."
 },
 {
  "id": "lib.stream-workspace-named-output",
  "target": "linux/scripts/tests/stream-receipt-fixture.sh",
  "find": "  _tsw_receipt=\"${3:-}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-name-selection.sh",
  "why": "Workspace startup assigns the caller receipt variable, including caller-local names and an omitted optional value."
 },
 {
  "id": "lib.stream-workspace-failure-status",
  "target": "linux/scripts/tests/stream-receipt-fixture.sh",
  "find": "  t_fixture_workspace_init \"$1\" || return \"$?\"",
  "replace": "  t_fixture_workspace_init \"$1\"",
  "test": "bash linux/scripts/tests/test-ort-name-selection.sh",
  "why": "Workspace creation failure must propagate before optional receipt handling can turn it into a successful initializer."
 },
 {
  "id": "lib.stream-workspace-companion",
  "target": "linux/scripts/tests/stream-receipt-fixture.sh",
  "find": "  source \"${BASH_SOURCE[0]%/*}/test-workspace-fixture.sh\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-name-selection.sh",
  "why": "The shared startup requires its workspace and EXIT-cleanup owner rather than assuming another suite imported it first."
 },
 {
  "id": "lib.wheel-tag-primary-precedence",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  if command -v cross_wheel_platform_tag >/dev/null 2>&1; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "An available canonical wheel-tag override runs before architecture fallback."
 },
 {
  "id": "lib.wheel-tag-primary-status",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    cross_wheel_platform_tag\n    return $?",
  "replace": "    cross_wheel_platform_tag\n    return 0",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "Canonical override failures retain their raw status under conditional callers."
 },
 {
  "id": "lib.wheel-tag-required-target",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    command -v cross_target_arch >/dev/null 2>&1 || return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "The LiteRT fallback requires a target resolver before mapping an architecture."
 },
 {
  "id": "lib.wheel-tag-best-effort-stderr",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    arch_linux_platform_tag_for \"$(cross_target_arch 2>/dev/null || true)\"",
  "replace": "    arch_linux_platform_tag_for \"$(cross_target_arch || true)\"",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "The Torch fallback keeps target-probe diagnostics suppressed while retaining mapper status."
 },
 {
  "id": "lib.wheel-tag-litert-policy",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "    wheel_platform_tag_with_fallback required",
  "replace": "    wheel_platform_tag_with_fallback best-effort",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "LiteRT preserves its required target-symbol fallback policy."
 },
 {
  "id": "lib.wheel-tag-torch-policy",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    wheel_platform_tag_with_fallback best-effort",
  "replace": "    wheel_platform_tag_with_fallback required",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "Torch preserves its best-effort fallback when the target resolver is absent."
 },
 {
  "id": "lib.wheel-tag-gst-native-scope",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "  if cross_build_is_active && command -v cross_target_arch >/dev/null 2>&1; then",
  "replace": "  if command -v cross_target_arch >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "Native GStreamer setup must not enable foreign-target workarounds."
 },
 {
  "id": "lib.wheel-tag-gst-target-availability",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "  if cross_build_is_active && command -v cross_target_arch >/dev/null 2>&1; then",
  "replace": "  if cross_build_is_active; then",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "Absent target resolvers must remain silent and must not be called."
 },
 {
  "id": "lib.wheel-tag-gst-riscv64",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "      arm64|riscv64) _mgft_match=1 ;;",
  "replace": "      arm64) _mgft_match=1 ;;",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "The shared GStreamer selection includes both arm64 and riscv64."
 },
 {
  "id": "lib.wheel-tag-gst-lookup-streams",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "    case \"$(cross_target_arch)\" in",
  "replace": "    case \"$(cross_target_arch 2>/dev/null)\" in",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "GStreamer target lookup diagnostics remain visible to the caller."
 },
 {
  "id": "lib.wheel-tag-gst-selector-required",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "media_gstreamer_foreign_target _gst_foreign_target\n",
  "replace": "_gst_foreign_target=0\n",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "GStreamer GI setup must invoke the shared foreign-target selector before deciding whether to resolve its wrapper architecture."
 },
 {
  "id": "lib.wheel-tag-gst-gi-raw-status",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "  unset _gst_foreign_target\n  gi_cross_wrapper_arch=\"$(cross_target_arch)\"",
  "replace": "  gi_cross_wrapper_arch=\"$(cross_target_arch)\"\n  unset _gst_foreign_target",
  "test": "bash linux/scripts/tests/test-wheel-tag-resolution.sh",
  "why": "Temporary selector cleanup precedes the second GI lookup so its raw failure status is not masked."
 },
 {
  "id": "lib.validator-source-unconditional",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  \"$1\"\n  \"$2\"\n",
  "replace": "  if \"$1\"; then :; fi\n  \"$2\"\n",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "source-writer failure remains fatal under strict callers and retains conditional continuation"
 },
 {
  "id": "lib.validator-probe-unconditional",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  \"$1\"\n  \"$2\"\n",
  "replace": "  \"$1\"\n  if \"$2\"; then :; fi\n",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "probe callbacks are unconditional so errexit is not disabled inside them"
 },
 {
  "id": "lib.validator-source-before-probe",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  \"$1\"\n  \"$2\"\n",
  "replace": "  \"$2\"\n  \"$1\"\n",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "the literal source is written before its compiler reads it"
 },
 {
  "id": "lib.validator-fixture-cleanup",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  \"$1\"\n  \"$2\"\n  rm -rf \"${d}\"",
  "replace": "  \"$1\"\n  \"$2\"\n  :",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "both fixture lifecycles retain actual cleanup and its returned status"
 },
 {
  "id": "lib.validator-gcc-dyn-local",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  local dyn=\"\"\n  _vc_source_fixture",
  "replace": "  dyn=\"\"\n  _vc_source_fixture",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "sanitizer metadata remains local while probes inherit the same temporary directory"
 },
 {
  "id": "lib.validator-gcc-source-binding",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  _vc_source_fixture _smoke_gcc_sanitizer_source _smoke_gcc_sanitizer_probe",
  "replace": "  _vc_source_fixture _smoke_clang_fuzzer_source _smoke_gcc_sanitizer_probe",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "GCC still receives the sanitizer header and variable-shift source rather than a different smoke source"
 },
 {
  "id": "lib.validator-fuzzer-probe-binding",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "  _vc_source_fixture _smoke_clang_fuzzer_source _smoke_clang_fuzzer_probe",
  "replace": "  _vc_source_fixture _smoke_clang_fuzzer_source _smoke_gcc_sanitizer_probe",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "Clang still links and runs its own libFuzzer target"
 },
 {
  "id": "lib.validator-version-first-line",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "_vc_version_result=\"$(\"$1\" --version 2>/dev/null | head -1 || true)\"",
  "replace": "_vc_version_result=\"$(\"$1\" --version 2>/dev/null | tail -1 || true)\"",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "only the first compiler version line participates in the existing matcher"
 },
 {
  "id": "lib.validator-version-pattern",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "echo \"${_vc_version_result}\" | grep -q \"${GCC_VERSION:-16.2.0}\"",
  "replace": "echo \"${_vc_version_result}\" | grep -Fq \"${GCC_VERSION:-16.2.0}\"",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "the original regex interpretation and invalid-pattern diagnostics remain unchanged"
 },
 {
  "id": "lib.validator-version-verdict",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "echo \"${_vc_version_result}\" | grep -q \"${GCC_VERSION:-16.2.0}\"",
  "replace": "echo \"${_vc_version_result}\" | grep -q \"${GCC_VERSION:-16.2.0}\" || true",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "a mismatching version reaches the caller-specific ELF fallback instead of being accepted"
 },
 {
  "id": "lib.validator-host-version-binding",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "if _vc_gcc_version_matches \"${gcc_prefix}/bin/gcc\" host_ver; then",
  "replace": "if _vc_gcc_version_matches \"${gcc_prefix}/bin/gcc\" host_elf; then",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "the host version text remains available for its unchanged diagnostics"
 },
 {
  "id": "lib.validator-native-version-binding",
  "target": "linux/scripts/06-packaging/validate-compilers.sh",
  "find": "if _vc_gcc_version_matches \"${native_gcc}/bin/gcc\" native_ver; then",
  "replace": "if _vc_gcc_version_matches \"${native_gcc}/bin/gcc\" gcc_prefix; then",
  "test": "bash linux/scripts/tests/test-validator-probes.sh",
  "why": "the native version report retains its own output variable and diagnostic text"
 },
 {
  "id": "lib.binfmt-csv-delimiter",
  "target": "linux/scripts/setup-rootless-binfmt.sh",
  "find": "  IFS=',' read -ra _arr <<< \"${ARCHES}\"",
  "replace": "  IFS=' ' read -ra _arr <<< \"${ARCHES}\"",
  "test": "bash linux/scripts/tests/test-binfmt-arches.sh",
  "why": "CSV fields use comma only; embedded whitespace and empty fields keep their original array boundaries."
 },
 {
  "id": "lib.binfmt-csv-raw-bytes",
  "target": "linux/scripts/setup-rootless-binfmt.sh",
  "find": "  IFS=',' read -ra _arr <<< \"${ARCHES}\"",
  "replace": "  IFS=',' read -a _arr <<< \"${ARCHES}\"",
  "test": "bash linux/scripts/tests/test-binfmt-arches.sh",
  "why": "The shared read preserves literal backslashes, comma edge cases, duplicate fields and the first-line boundary."
 },
 {
  "id": "lib.binfmt-csv-array-output",
  "target": "linux/scripts/setup-rootless-binfmt.sh",
  "find": "  IFS=',' read -ra _arr <<< \"${ARCHES}\"",
  "replace": "  IFS=',' read -r _arr <<< \"${ARCHES}\"",
  "test": "bash linux/scripts/tests/test-binfmt-arches.sh",
  "why": "The parser writes the complete dynamic caller array instead of replacing only an array element or retaining seeded entries."
 },
 {
  "id": "lib.binfmt-csv-ifs-scope",
  "target": "linux/scripts/setup-rootless-binfmt.sh",
  "find": "  IFS=',' read -ra _arr <<< \"${ARCHES}\"",
  "replace": "  IFS=','; read -ra _arr <<< \"${ARCHES}\"",
  "test": "bash linux/scripts/tests/test-binfmt-arches.sh",
  "why": "The comma IFS assignment remains scoped to read; normal calls preserve unset, custom and default caller IFS."
 },
 {
  "id": "lib.binfmt-csv-raw-status",
  "target": "linux/scripts/setup-rootless-binfmt.sh",
  "find": "  IFS=',' read -ra _arr <<< \"${ARCHES}\"",
  "replace": "  IFS=',' read -ra _arr <<< \"${ARCHES}\" || true",
  "test": "bash linux/scripts/tests/test-binfmt-arches.sh",
  "why": "Readonly output failures retain their raw status and strict/conditional fatal behavior instead of being normalized to success."
 },
 {
  "id": "lib.binfmt-csv-extract-caller",
  "target": "linux/scripts/setup-rootless-binfmt.sh",
  "find": "extract_emulators() {\n  mkdir -p \"${QDIR}\"\n  local need=0 a qb\n  _binfmt_read_arches",
  "replace": "extract_emulators() {\n  mkdir -p \"${QDIR}\"\n  local need=0 a qb",
  "test": "bash linux/scripts/tests/test-binfmt-arches.sh",
  "why": "The extract caller uses the shared CSV read while preserving its own unknown-architecture, namespace and failure policy."
 },
 {
  "id": "lib.binfmt-csv-register-caller",
  "target": "linux/scripts/setup-rootless-binfmt.sh",
  "find": "register() {\n  local a qb magic mask\n  _binfmt_read_arches",
  "replace": "register() {\n  local a qb magic mask",
  "test": "bash linux/scripts/tests/test-binfmt-arches.sh",
  "why": "The register caller uses the shared CSV read while preserving its own unknown-architecture, namespace and failure policy."
 },
 {
  "id": "lib.binfmt-csv-verify-caller",
  "target": "linux/scripts/setup-rootless-binfmt.sh",
  "find": "verify() {\n  local a qb ok=1\n  _binfmt_read_arches",
  "replace": "verify() {\n  local a qb ok=1",
  "test": "bash linux/scripts/tests/test-binfmt-arches.sh",
  "why": "The verify caller uses the shared CSV read while preserving its own unknown-architecture, namespace and failure policy."
 },
 {
  "id": "lib.triplet-query-optional-map",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "  if command -v arch_deb_multiarch_triplet_for >/dev/null 2>&1; then\n    arch_deb_multiarch_triplet_for \"$1\" 2>/dev/null || true\n  fi",
  "replace": "  if command -v arch_deb_multiarch_triplet_for >/dev/null 2>&1; then\n    arch_deb_multiarch_triplet_for \"$1\" 2>/dev/null || true\n  else\n    return 1\n  fi",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "An absent architecture mapper remains advisory and leaves each caller free to use its existing fallback."
 },
 {
  "id": "lib.triplet-query-stdout",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    arch_deb_multiarch_triplet_for \"$1\" 2>/dev/null || true",
  "replace": "    arch_deb_multiarch_triplet_for \"$1\" >/dev/null 2>&1 || true",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "Mapper stdout, including partial output on failure, remains available to path and symlink selection."
 },
 {
  "id": "lib.triplet-query-stderr",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    arch_deb_multiarch_triplet_for \"$1\" 2>/dev/null || true",
  "replace": "    arch_deb_multiarch_triplet_for \"$1\" || true",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "Mapper diagnostics remain suppressed while caller diagnostics remain visible."
 },
 {
  "id": "lib.triplet-query-argument",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    arch_deb_multiarch_triplet_for \"$1\" 2>/dev/null || true",
  "replace": "    arch_deb_multiarch_triplet_for amd64 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "The optional mapper receives the exact architecture selected by its caller."
 },
 {
  "id": "lib.triplet-query-advisory-status",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    arch_deb_multiarch_triplet_for \"$1\" 2>/dev/null || true",
  "replace": "    arch_deb_multiarch_triplet_for \"$1\" 2>/dev/null\n    return $?",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "A failed mapper still contributes its stdout without making the optional query fail."
 },
 {
  "id": "lib.triplet-query-pin-api-status",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  triplet=\"$(deb_multiarch_triplet_best_effort \"${arch}\")\" || return $?",
  "replace": "  triplet=\"$(deb_multiarch_triplet_best_effort \"${arch}\")\"",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "A missing or broken shared query API must retain its failure under conditional callers instead of reaching path or link fallbacks."
 },
 {
  "id": "lib.triplet-query-gst-api-status",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "  triplet=\"$(deb_multiarch_triplet_best_effort \"${TARGET_ARCH:-${TARGETARCH:-amd64}}\")\" || return $?",
  "replace": "  triplet=\"$(deb_multiarch_triplet_best_effort \"${TARGET_ARCH:-${TARGETARCH:-amd64}}\")\"",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "A missing or broken shared query API must retain its failure under conditional callers instead of reaching path or link fallbacks."
 },
 {
  "id": "lib.triplet-query-pin-argument",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  triplet=\"$(deb_multiarch_triplet_best_effort \"${arch}\")\" || return $?",
  "replace": "  triplet=\"$(deb_multiarch_triplet_best_effort amd64)\" || return $?",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "Compiler pinning maps the resolved target architecture rather than the build host."
 },
 {
  "id": "lib.triplet-query-gst-defaults",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "\"${TARGET_ARCH:-${TARGETARCH:-amd64}}\"",
  "replace": "\"${TARGETARCH:-${TARGET_ARCH:-amd64}}\"",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "GStreamer preserves TARGET_ARCH precedence over TARGETARCH and its amd64 default."
 },
 {
  "id": "lib.triplet-query-required-owner",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "deb_multiarch_triplet_best_effort() {\n  if command -v arch_deb_multiarch_triplet_for >/dev/null 2>&1; then\n    arch_deb_multiarch_triplet_for \"$1\" 2>/dev/null || true\n  fi\n  return 0\n}",
  "replace": "",
  "test": "bash linux/scripts/tests/test-triplet-query.sh",
  "why": "Both consumers require the shared query export from their existing platform owner."
 },
 {
  "id": "lib.verified-installer-curl-fatal",
  "target": "linux/scripts/01-core/verified-script-install.sh",
  "find": "  curl --proto '=https' --tlsv1.2 -fsSL --retry 3 -o \"${_vsi_file}\" \"${_vsi_url}\"",
  "replace": "  curl --proto '=https' --tlsv1.2 -fsSL --retry 3 -o \"${_vsi_file}\" \"${_vsi_url}\" || true",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "a failed or omitted fetch cannot execute stale or missing installer bytes"
 },
 {
  "id": "lib.verified-installer-hash-required",
  "target": "linux/scripts/01-core/verified-script-install.sh",
  "find": "| sha256sum -c - || \"${_vsi_failure}\" \"${_vsi_file}\"",
  "replace": "| sha256sum -c - || true",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "a pinned hash mismatch invokes the caller-specific refusal instead of executing the script"
 },
 {
  "id": "lib.verified-installer-execution-fatal",
  "target": "linux/scripts/01-core/verified-script-install.sh",
  "find": "  sh \"${_vsi_file}\" \"$@\"",
  "replace": "  sh \"${_vsi_file}\" \"$@\" || true",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "strict installer execution failures retain their original exit status and skip cleanup"
 },
 {
  "id": "lib.verified-installer-cleanup",
  "target": "linux/scripts/01-core/verified-script-install.sh",
  "find": "  rm -f \"${_vsi_file}\"",
  "replace": "  : \"${_vsi_file}\"",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "successful installer execution still removes the actual downloaded file"
 },
 {
  "id": "lib.verified-installer-arguments",
  "target": "linux/scripts/01-core/verified-script-install.sh",
  "find": "  sh \"${_vsi_file}\" \"$@\"",
  "replace": "  sh \"${_vsi_file}\"",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "Rust profile and pinned toolchain arguments reach sh as separate arguments"
 },
 {
  "id": "lib.verified-installer-optional-hash",
  "target": "linux/scripts/01-core/verified-script-install.sh",
  "find": "if [ -n \"${_vsi_digest}\" ]; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "an absent optional checksum still skips hashing rather than manufacturing a refusal"
 },
 {
  "id": "lib.verified-installer-uv-source-status",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "if [ \"${_uv_installer_source_status}\" -ne 0 ]; then return \"${_uv_installer_source_status}\"; fi",
  "replace": "if [ \"${_uv_installer_source_status}\" -ne 0 ]; then :; fi",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "a companion that defines its export then fails must retain its raw status under conditional source"
 },
 {
  "id": "lib.verified-installer-uv-export",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "if ! declare -F verified_script_install >/dev/null; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "an empty copied companion must fail at import before later declarations can hide the missing API"
 },
 {
  "id": "lib.verified-installer-rust-source-status",
  "target": "linux/scripts/02-toolchain/install-rust.sh",
  "find": "if [ \"${_rust_installer_source_status}\" -ne 0 ]; then exit \"${_rust_installer_source_status}\"; fi",
  "replace": "if [ \"${_rust_installer_source_status}\" -ne 0 ]; then :; fi",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "a companion that defines its export then fails must retain its raw status under conditional source"
 },
 {
  "id": "lib.verified-installer-rust-export",
  "target": "linux/scripts/02-toolchain/install-rust.sh",
  "find": "if ! declare -F verified_script_install >/dev/null; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "an empty copied companion must fail at import before later declarations can hide the missing API"
 },
 {
  "id": "lib.verified-installer-uv-import",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "source \"$_MODULE_DIR/verified-script-install.sh\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "the copied uv closure must actually import its mandatory installer companion"
 },
 {
  "id": "lib.verified-installer-rust-import",
  "target": "linux/scripts/02-toolchain/install-rust.sh",
  "find": "source /opt/scripts/core/verified-script-install.sh",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "the copied Rust closure must actually import its mandatory installer companion"
 },
 {
  "id": "lib.verified-installer-uv-binding",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "/install.sh\" \"$uv_install_sha\" _uv_install_hash_failure",
  "replace": "/install.sh\" \"\" _uv_install_hash_failure",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "UV passes its resolved preset or versions.env checksum into the shared installer"
 },
 {
  "id": "lib.verified-installer-rust-binding",
  "target": "linux/scripts/02-toolchain/install-rust.sh",
  "find": "-y --profile minimal --default-toolchain \"${RUST_VERSION}\"",
  "replace": "-y --profile minimal",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "Rust retains its explicit pinned default toolchain rather than selecting current upstream stable"
 },
 {
  "id": "lib.verified-installer-toolchain-closure",
  "target": "linux/Dockerfile.toolchain",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/verified-script-install.sh,target=/opt/scripts/core/verified-script-install.sh,ro \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "the Rust RUN carries the freshly changed companion even when its parent image is older"
 },
 {
  "id": "lib.verified-installer-uv-retry",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "source \"$_MODULE_DIR/verified-script-install.sh\"",
  "replace": "_PYTHON_UV_LOADED=1\nsource \"$_MODULE_DIR/verified-script-install.sh\"",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "a failed companion import must not mark UV loaded or prevent a corrected same-session retry"
 },
 {
  "id": "lib.verified-installer-ci-copy",
  "target": "linux/scripts/tests/python-ci-fixture.sh",
  "find": "01-core/python-probe.sh 01-core/verified-script-install.sh",
  "replace": "01-core/python-probe.sh",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "the real Python CI fixture carries the new mandatory leaf alongside its copied UV module"
 },
 {
  "id": "lib.binfmt-probe-old-owner-refusal",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  if ! grep -qx '# ANT_BINFMT_PROBE_SOURCE_API=1' \"$probe_owner\" 2>/dev/null; then\n    printf 'ERROR: binfmt probe owner lacks source API 1: %s\\n' \"$probe_owner\" >&2\n    exit 1\n  fi",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "An older installer must be rejected before sourcing can change globals or run install actions, even under conditional callers and CONFIRM=1."
 },
 {
  "id": "lib.binfmt-probe-api-version",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "grep -qx '# ANT_BINFMT_PROBE_SOURCE_API=1'",
  "replace": "grep -q 'ANT_BINFMT_PROBE_SOURCE_API='",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "Wrong API versions cannot satisfy the functions-only source contract merely by mentioning its marker name."
 },
 {
  "id": "lib.binfmt-probe-source-status",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  source \"$probe_owner\" --source-binfmt-probe || exit \"$?\"",
  "replace": "  source \"$probe_owner\" --source-binfmt-probe",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "Failed imports retain their raw status even when a caller predefines the probe and conditionally invokes verification."
 },
 {
  "id": "lib.binfmt-probe-required-export",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  declare -F binfmt_handler_enabled >/dev/null || {\n    printf 'ERROR: binfmt probe owner does not provide binfmt_handler_enabled\\n' >&2\n    exit 1\n  }",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "A marked source must expose the required probe; an unrelated command-not-found or final handler warning cannot replace its exact missing-export refusal."
 },
 {
  "id": "lib.binfmt-probe-source-only-fastpath",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "if [ \"${1:-}\" = --source-binfmt-probe ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "The functions-only import returns before flags, globals, traps or installer actions and leaves caller state and positional arguments unchanged."
 },
 {
  "id": "lib.binfmt-probe-source-context",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  if [ \"${BASH_SOURCE[0]}\" != \"$0\" ]; then return 0; fi",
  "replace": "  if false; then return 0; fi",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "A sourced functions-only request succeeds from both repository and flat copied owner paths, including spaces."
 },
 {
  "id": "lib.binfmt-probe-executed-refusal",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  printf 'ERROR: --source-binfmt-probe must be sourced\\n' >&2\n  exit 2",
  "replace": "  printf 'ERROR: --source-binfmt-probe must be sourced\\n' >&2\n  exit 0",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "The source-only flag refuses direct execution with status2 before any installer action instead of reporting a successful no-op."
 },
 {
  "id": "lib.binfmt-probe-host-first",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  grep -qs '^enabled' \"/proc/sys/fs/binfmt_misc/${handler}\" 2>/dev/null && return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "Enabled host handlers short-circuit namespace lookup and execution while host grep errors retain fallback behavior."
 },
 {
  "id": "lib.binfmt-probe-literal-tool-discovery",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "    tool=containerd-rootless-setuptool.sh",
  "replace": "    tool=\"$(command -v containerd-rootless-setuptool.sh 2>/dev/null)\"",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "Installer discovery invokes the original literal tool name and performs one lazy lookup per missing host handler, preserving overrides."
 },
 {
  "id": "lib.binfmt-probe-resolved-empty-is-final",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    if binfmt_handler_enabled \"${handler}\" \"${tool}\"; then continue; fi",
  "replace": "    if binfmt_handler_enabled \"${handler}\" \"${tool}\" discover-if-empty; then continue; fi",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "The manifest retains its upfront cached lookup; a missing tool must not be rediscovered later and turn a failed verification green."
 },
 {
  "id": "lib.binfmt-probe-quoted-tool",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  \"$tool\" nsenter -- grep -qs '^enabled' \"/proc/sys/fs/binfmt_misc/${handler}\" 2>/dev/null",
  "replace": "  $tool nsenter -- grep -qs '^enabled' \"/proc/sys/fs/binfmt_misc/${handler}\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "Resolved and override tool paths remain one command word when they contain spaces."
 },
 {
  "id": "lib.binfmt-probe-namespace-status",
  "target": "linux/host-config/install-nerdctl-full.sh",
  "find": "  \"$tool\" nsenter -- grep -qs '^enabled' \"/proc/sys/fs/binfmt_misc/${handler}\" 2>/dev/null",
  "replace": "  \"$tool\" nsenter -- grep -qs '^enabled' \"/proc/sys/fs/binfmt_misc/${handler}\" 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-binfmt-probes.sh",
  "why": "A failed namespace probe remains a missing handler, preserving advisory installer warnings and fatal manifest verification."
 },
 {
  "id": "lib.clang-jobs-zeros",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "[[ \"$1\" =~ ^[0-9]+$ ]]",
  "replace": "[[ \"$1\" =~ ^[1-9][0-9]*$ ]]",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "zero and leading-zero digit strings remain accepted without arithmetic coercion"
 },
 {
  "id": "lib.clang-jobs-empty-short-circuit",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "[ -n \"$1\" ] && [[ \"$1\" =~ ^[0-9]+$ ]]",
  "replace": "[[ \"$1\" =~ ^[0-9]+$ ]]",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "empty inputs retain the seeded BASH_REMATCH instead of executing an extra failing regex"
 },
 {
  "id": "lib.clang-jobs-anchored",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "[[ \"$1\" =~ ^[0-9]+$ ]]",
  "replace": "[[ \"$1\" =~ ^[0-9]+ ]]",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "decimal suffixes, spaces and exponents cannot masquerade as an all-digit CLI value"
 },
 {
  "id": "lib.clang-jobs-cli-missing",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "_clang_jobs_are_numeric \"${2:-}\"",
  "replace": "_clang_jobs_are_numeric \"$2\"",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "a missing jobs operand reaches the original diagnostic instead of a nounset error"
 },
 {
  "id": "lib.clang-jobs-cli-shift",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "NUM_JOBS=\"$2\"\n                shift 2",
  "replace": "NUM_JOBS=\"$2\"\n                shift",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "both jobs operands are consumed before parsing the following option"
 },
 {
  "id": "lib.clang-jobs-explicit-first",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "if _clang_jobs_are_numeric \"${NUM_JOBS:-}\"; then",
  "replace": "if _clang_jobs_are_numeric \"${CLANG_NUM_JOBS}\"; then",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "a valid explicit NUM_JOBS remains authoritative over the Clang environment override"
 },
 {
  "id": "lib.clang-jobs-override-nounset",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": ": \"${CLANG_NUM_JOBS:=}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "an unset CLANG_NUM_JOBS must take the mapper path, not stop the toolchain under set -u"
 },
 {
  "id": "lib.clang-jobs-override-value",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "NUM_JOBS=\"${CLANG_NUM_JOBS}\"",
  "replace": "NUM_JOBS=\"1\"",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "the raw valid Clang override including leading zeros reaches the final job value"
 },
 {
  "id": "lib.clang-jobs-memory-cap",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "compute_jobs_with_mem_cap \"\" \"${CLANG_BUILD_MB_PER_JOB}\"",
  "replace": "compute_jobs_with_mem_cap \"\" \"0\"",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "the existing memory cap and empty first argument reach the shared mapper unchanged"
 },
 {
  "id": "lib.clang-jobs-mapper-status",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "NUM_JOBS=\"$(compute_jobs_with_mem_cap \"\" \"${CLANG_BUILD_MB_PER_JOB}\")\"",
  "replace": "NUM_JOBS=\"$(compute_jobs_with_mem_cap \"\" \"${CLANG_BUILD_MB_PER_JOB}\")\" || true",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "strict mapper assignment failure retains the producer status instead of reporting selected jobs"
 },
 {
  "id": "lib.clang-jobs-nproc-fallback",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "nproc || echo 1",
  "replace": "nproc",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "a failed nproc retains the original emitted output plus fallback one"
 },
 {
  "id": "lib.meson-dispatch-optional-cross",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  if command -v \"${_amp_name}\" >/dev/null 2>&1; then",
  "replace": "  if [ \"${_amp_name}\" = append_meson_cross_flags ] || command -v \"${_amp_name}\" >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "Absent cross providers are skipped without invoking commands or project cross-file callbacks."
 },
 {
  "id": "lib.meson-dispatch-native-selected",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  if command -v \"${_amp_name}\" >/dev/null 2>&1; then",
  "replace": "  if [ \"${_amp_name}\" != append_meson_native_flags ] && command -v \"${_amp_name}\" >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "An available native provider receives the same array after the cross provider and project adjustment."
 },
 {
  "id": "lib.meson-dispatch-array-name",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    \"${_amp_invoke}\" \"${_amp_array}\"",
  "replace": "    if [ \"${_amp_name}\" = append_meson_cross_flags ]; then \"${_amp_invoke}\" MESON_SETUP_ARGS; else \"${_amp_invoke}\" \"${_amp_array}\"; fi",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "The caller array name reaches the provider intact, preserving both arrays and partial modifications."
 },
 {
  "id": "lib.meson-dispatch-project-callback",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    if [ -n \"${_amp_after}\" ]; then \"${_amp_after}\"; else return \"${_amp_status}\"; fi",
  "replace": "    if [ -n \"${_amp_after}\" ]; then :; else return \"${_amp_status}\"; fi",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "The GStreamer cross-file edit remains between cross and native provider calls."
 },
 {
  "id": "lib.meson-dispatch-provider-order",
  "target": "linux/scripts/01-core/common.sh",
  "find": "append_available_meson_toolchain_flags() {\n  local -a _amtf_caller_argv=(\"$@\")\n  local _amtf_array=\"$1\" _amtf_after_cross=\"${2:-}\"\n  append_available_meson_provider append_meson_cross_flags \"${3:-_common_meson_cross}\" \"${_amtf_array}\" \"${_amtf_after_cross}\"\n  append_available_meson_provider append_meson_native_flags \"${4:-_common_meson_native}\" \"${_amtf_array}\"\n}",
  "replace": "append_available_meson_toolchain_flags() {\n  local -a _amtf_caller_argv=(\"$@\")\n  local _amtf_array=\"$1\" _amtf_after_cross=\"${2:-}\"\n  append_available_meson_provider append_meson_native_flags \"${4:-_common_meson_native}\" \"${_amtf_array}\"\n  append_available_meson_provider append_meson_cross_flags \"${3:-_common_meson_cross}\" \"${_amtf_array}\" \"${_amtf_after_cross}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "Cross flags and project adjustment precede native flags, including stream output and array mutation order."
 },
 {
  "id": "lib.meson-dispatch-callback-scope",
  "target": "linux/scripts/01-core/common.sh",
  "find": "append_available_meson_provider() {\n  local _amp_name=\"$1\" _amp_invoke=\"$2\" _amp_array=\"$3\" _amp_after=\"${4:-}\" _amp_status\n  if command -v \"${_amp_name}\" >/dev/null 2>&1; then\n    \"${_amp_invoke}\" \"${_amp_array}\"\n    _amp_status=$?\n    if [ -n \"${_amp_after}\" ]; then \"${_amp_after}\"; else return \"${_amp_status}\"; fi\n  fi\n  return $?\n}",
  "replace": "append_available_meson_provider() {\n  local _amp_name=\"$1\" _amp_invoke=\"$2\" _amp_array=\"$3\" _amp_after=\"${4:-}\" _amp_status\n  if command -v \"${_amp_name}\" >/dev/null 2>&1; then\n    \"${_amp_invoke}\" \"${_amp_array}\"\n    _amp_status=$?\n  fi\n  if [ -n \"${_amp_after}\" ]; then \"${_amp_after}\"; else return \"${_amp_status:-0}\"; fi\n  return $?\n}",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "A project callback only runs when a cross provider was selected, even if a cross file already exists."
 },
 {
  "id": "lib.meson-dispatch-cross-errexit",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    \"${_amp_invoke}\" \"${_amp_array}\"",
  "replace": "    if [ \"${_amp_name}\" = append_meson_cross_flags ]; then \"${_amp_invoke}\" \"${_amp_array}\" || true; else \"${_amp_invoke}\" \"${_amp_array}\"; fi",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "Selected provider failures retain direct errexit and their original partial array changes."
 },
 {
  "id": "lib.meson-dispatch-native-errexit",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    \"${_amp_invoke}\" \"${_amp_array}\"",
  "replace": "    if [ \"${_amp_name}\" = append_meson_native_flags ]; then \"${_amp_invoke}\" \"${_amp_array}\" || true; else \"${_amp_invoke}\" \"${_amp_array}\"; fi",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "Selected provider failures retain direct errexit and their original partial array changes."
 },
 {
  "id": "lib.meson-dispatch-gst-unconditional",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "  append_available_meson_toolchain_flags MESON_FLAGS _gst_monorepo_cross_pkgconfig _gst_monorepo_meson_cross _gst_monorepo_meson_native",
  "replace": "  append_available_meson_toolchain_flags MESON_FLAGS _gst_monorepo_cross_pkgconfig _gst_monorepo_meson_cross _gst_monorepo_meson_native || true",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "Dispatch remains unconditional so strict provider failures cannot continue through a conditional wrapper."
 },
 {
  "id": "lib.meson-dispatch-camera-unconditional",
  "target": "linux/scripts/03-media/build/libcamera/build-libcamera.sh",
  "find": "_libcamera_meson_cross() {\n  local -a _lcmc_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_cross_argv[@]}\"\n  append_meson_cross_flags \"${_lcmc_exec_argv[@]}\"\n}\nappend_available_meson_provider append_meson_cross_flags _libcamera_meson_cross MESON_SETUP_ARGS\n\n_libcamera_meson_native_argv=(\"$@\")\n_libcamera_meson_native() {\n  local -a _lcmn_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_native_argv[@]}\"\n  append_meson_native_flags \"${_lcmn_exec_argv[@]}\"\n}\nappend_available_meson_provider append_meson_native_flags _libcamera_meson_native MESON_SETUP_ARGS",
  "replace": "_libcamera_meson_cross() {\n  local -a _lcmc_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_cross_argv[@]}\"\n  append_meson_cross_flags \"${_lcmc_exec_argv[@]}\"\n}\nappend_available_meson_provider append_meson_cross_flags _libcamera_meson_cross MESON_SETUP_ARGS || true\n\n_libcamera_meson_native_argv=(\"$@\")\n_libcamera_meson_native() {\n  local -a _lcmn_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_native_argv[@]}\"\n  append_meson_native_flags \"${_lcmn_exec_argv[@]}\"\n}\nappend_available_meson_provider append_meson_native_flags _libcamera_meson_native MESON_SETUP_ARGS || true",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "Dispatch remains unconditional so strict provider failures cannot continue through a conditional wrapper."
 },
 {
  "id": "lib.meson-dispatch-gst-required-api",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "  declare -F append_available_meson_toolchain_flags append_available_meson_provider >/dev/null || { printf 'ERROR: common.sh does not provide append_available_meson_toolchain_flags\\n' >&2; return 1; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "A missing shared dispatch export must fail explicitly with the caller-specific return policy, including conditional sourcing."
 },
 {
  "id": "lib.meson-dispatch-camera-required-api",
  "target": "linux/scripts/03-media/build/libcamera/build-libcamera.sh",
  "find": "declare -F append_available_meson_provider >/dev/null || { printf 'ERROR: common.sh does not provide append_available_meson_provider\\n' >&2; exit 1; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "A missing shared dispatch export must fail explicitly with the caller-specific exit policy, including conditional sourcing."
 },
 {
  "id": "lib.meson-dispatch-native-raw-status",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    if [ -n \"${_amp_after}\" ]; then \"${_amp_after}\"; else return \"${_amp_status}\"; fi",
  "replace": "    if [ -n \"${_amp_after}\" ]; then \"${_amp_after}\"; else if [ \"${_amp_name}\" = append_meson_native_flags ]; then return 0; else return \"${_amp_status}\"; fi; fi",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "The libcamera section preserves a failing native provider raw status under relaxed or conditional calls."
 },
 {
  "id": "lib.meson-dispatch-cross-file-present",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "  if [ -n \"${MESON_CROSS_FILE:-}\" ] && [ -f \"${MESON_CROSS_FILE}\" ]; then",
  "replace": "  if [ -n \"${MESON_CROSS_FILE:-}\" ]; then",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "GStreamer only edits an existing cross file; a missing optional file remains silent."
 },
 {
  "id": "lib.fleet-dependency-word-boundaries",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "*\" $2 \"*",
  "replace": "*\" $2\"*",
  "test": "bash linux/scripts/tests/test-fleet-dependencies.sh",
  "why": "dependency IDs retain both word boundaries rather than matching a longer repository name"
 },
 {
  "id": "lib.fleet-dependency-literal-ids",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "*\" $2 \"*",
  "replace": "*\" \"$2\" \"*",
  "test": "bash linux/scripts/tests/test-fleet-dependencies.sh",
  "why": "glob characters inside repository IDs remain literal membership text"
 },
 {
  "id": "lib.fleet-dependency-caller-index",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "case \"${OWN_DEPS[$1]}\" in",
  "replace": "case \"${OWN_DEPS[0]}\" in",
  "test": "bash linux/scripts/tests/test-fleet-dependencies.sh",
  "why": "membership reads the requested repository rather than the first member"
 },
 {
  "id": "lib.fleet-dependency-absent-verdict",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "  case \"${OWN_DEPS[$1]}\" in *\" $2 \"*) return 0 ;; esac\n  return 1",
  "replace": "  case \"${OWN_DEPS[$1]}\" in *\" $2 \"*) return 0 ;; esac\n  return 0",
  "test": "bash linux/scripts/tests/test-fleet-dependencies.sh",
  "why": "absent edges do not become mutual cycles or suppress new dependencies"
 },
 {
  "id": "lib.fleet-dependency-present-verdict",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "  case \"${OWN_DEPS[$1]}\" in *\" $2 \"*) return 0 ;; esac",
  "replace": "  case \"${OWN_DEPS[$1]}\" in *\" $2 \"*) return 1 ;; esac",
  "test": "bash linux/scripts/tests/test-fleet-dependencies.sh",
  "why": "present edges are recognized without duplicate dependency growth"
 },
 {
  "id": "lib.fleet-dependency-append-binding",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "  fleet_has_dep \"$1\" \"$2\" && return 0",
  "replace": "  fleet_has_dep \"$1\" \"$1\" && return 0",
  "test": "bash linux/scripts/tests/test-fleet-dependencies.sh",
  "why": "adding an edge checks its target identity and preserves existing entries"
 },
 {
  "id": "lib.fleet-dependency-closure-binding",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "          fleet_has_dep \"${i}\" \"${d2}\" && continue",
  "replace": "          fleet_has_dep \"${j}\" \"${d2}\" && continue",
  "test": "bash linux/scripts/tests/test-fleet-dependencies.sh",
  "why": "transitive closure checks whether the originating member already owns the inherited edge"
 },
 {
  "id": "lib.fleet-dependency-cycle-forward",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "      fleet_has_dep \"${i}\" \"${OWN_IDS[$j]}\" || continue",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-fleet-dependencies.sh",
  "why": "mutual pairs require the forward dependency as well as the reverse edge"
 },
 {
  "id": "lib.fleet-dependency-cycle-reverse",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "      fleet_has_dep \"${j}\" \"${OWN_IDS[$i]}\" || continue",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-fleet-dependencies.sh",
  "why": "a one-way edge is not reported as a mutual dependency cycle"
 },
 {
  "id": "lib.cross-active-preserves-provider",
  "target": "linux/scripts/01-core/cross-active-fallback.sh",
  "find": "  if ! command -v cross_build_is_active >/dev/null 2>&1; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "Existing function and PATH providers remain authoritative under both registration policies."
 },
 {
  "id": "lib.cross-active-native-false",
  "target": "linux/scripts/01-core/cross-active-fallback.sh",
  "find": "      native) cross_build_is_active() { false; } ;;",
  "replace": "      native) cross_build_is_active() { true; } ;;",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "Native fallback retains the exact false callback, including late shell-alias binding."
 },
 {
  "id": "lib.cross-active-core-enabled-choice",
  "target": "linux/scripts/01-core/cross-active-fallback.sh",
  "find": "        if command -v cross_build_enabled >/dev/null 2>&1; then",
  "replace": "        if false; then",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "Core selects an existing enabled provider at registration time and keeps later callback replacement observable."
 },
 {
  "id": "lib.cross-active-core-approximation-choice",
  "target": "linux/scripts/01-core/cross-active-fallback.sh",
  "find": "          cross_build_is_active() { core_cross_build_is_active; }",
  "replace": "          cross_build_is_active() { cross_build_enabled; }",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "An enabled provider introduced later cannot replace the previously selected approximation."
 },
 {
  "id": "lib.cross-active-typed-profile",
  "target": "linux/scripts/01-core/cross-active-fallback.sh",
  "find": "    *) printf 'ERROR: register_cross_active_fallback requires core or native\\n' >&2; return 2 ;;",
  "replace": "    *) return 0 ;;",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "Invalid profiles retain exact status2 diagnostics without changing prior binding or state."
 },
 {
  "id": "lib.cross-active-core-source-failure",
  "target": "linux/scripts/01-core/common.sh",
  "find": "source \"${_COMMON_SH_DIR}/cross-active-fallback.sh\" || { unset _COMMON_SH_LOADED; return 1; }",
  "replace": "source \"${_COMMON_SH_DIR}/cross-active-fallback.sh\"",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "A failed source defining the API cannot turn green; its caller loaded flag clears for retry."
 },
 {
  "id": "lib.cross-active-core-registration-failure",
  "target": "linux/scripts/01-core/common.sh",
  "find": "register_cross_active_fallback core || { unset _COMMON_SH_LOADED; return 1; }",
  "replace": "register_cross_active_fallback core",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "Missing exports and failed registration cannot poison the loaded flag or bypass a failing import."
 },
 {
  "id": "lib.cross-active-native-source-failure",
  "target": "linux/scripts/01-core/install-deps-preamble.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/cross-active-fallback.sh\" || { unset _INSTALL_DEPS_PREAMBLE_LOADED; return 1; }",
  "replace": "source \"$(dirname \"${BASH_SOURCE[0]}\")/cross-active-fallback.sh\"",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "A failed source defining the API cannot turn green; its caller loaded flag clears for retry."
 },
 {
  "id": "lib.cross-active-native-registration-failure",
  "target": "linux/scripts/01-core/install-deps-preamble.sh",
  "find": "register_cross_active_fallback native || { unset _INSTALL_DEPS_PREAMBLE_LOADED; return 1; }",
  "replace": "register_cross_active_fallback native",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "Missing exports and failed registration cannot poison the loaded flag or bypass a failing import."
 },
 {
  "id": "lib.cross-active-base-closure",
  "target": "linux/Dockerfile.base",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    /bin/bash /tmp/scripts/01-core/base-image.sh bootstrap-ca\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    /bin/bash /tmp/scripts/01-core/base-image.sh bootstrap-ca\n",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "Cold per-file common imports carry the adjacent pure registration owner without a cached ancestor."
 },
 {
  "id": "lib.cross-active-toolchain-closure",
  "target": "linux/Dockerfile.toolchain",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/ccache,id=ccache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH} \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-s3-level.sh,target=/opt/scripts/core/sccache-s3-level.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-server-address.sh,target=/opt/scripts/core/sccache-server-address.sh,ro \\\n    --mount=type=secret,id=sccache_s3,required=false \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/opt/scripts/core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/build-helpers.sh,target=/opt/scripts/core/build-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/elf-strip.sh,target=/opt/scripts/core/elf-strip.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/image-ref-args.sh,target=/opt/scripts/core/image-ref-args.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/opt/scripts/core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/opt/scripts/core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/opt/scripts/core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-apt.sh,target=/opt/scripts/core/cross-apt.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-env.sh,target=/opt/scripts/core/cross-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-gcc.sh,target=/opt/scripts/core/cross-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-meson.sh,target=/opt/scripts/core/cross-meson.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-python.sh,target=/opt/scripts/core/cross-python.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/configure-gcc-env.sh,target=/opt/scripts/toolchain/configure-gcc-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/core.sh,target=/opt/scripts/toolchain/core.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/gcc.sh,target=/opt/scripts/toolchain/gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/setup-dependencies.sh,target=/opt/scripts/toolchain/setup-dependencies.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/verify-gcc.sh,target=/opt/scripts/toolchain/verify-gcc.sh,ro \\\n    --mount=type=tmpfs,target=/tmp \\\n    --mount=type=tmpfs,target=/var/tmp \\\n    set -euo pipefail; \\\n    SETUP_DEPENDENCIES_SKIP_CORE_TOOLS=true \\\n    bash /opt/scripts/toolchain/setup-dependencies.sh dockerfile-gcc; \\\n    bash /opt/scripts/core/sccache-s3-level.sh drain\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/ccache,id=ccache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH} \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-s3-level.sh,target=/opt/scripts/core/sccache-s3-level.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-server-address.sh,target=/opt/scripts/core/sccache-server-address.sh,ro \\\n    --mount=type=secret,id=sccache_s3,required=false \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/opt/scripts/core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/build-helpers.sh,target=/opt/scripts/core/build-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/elf-strip.sh,target=/opt/scripts/core/elf-strip.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/image-ref-args.sh,target=/opt/scripts/core/image-ref-args.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/opt/scripts/core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/opt/scripts/core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-apt.sh,target=/opt/scripts/core/cross-apt.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-env.sh,target=/opt/scripts/core/cross-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-gcc.sh,target=/opt/scripts/core/cross-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-meson.sh,target=/opt/scripts/core/cross-meson.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-python.sh,target=/opt/scripts/core/cross-python.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/configure-gcc-env.sh,target=/opt/scripts/toolchain/configure-gcc-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/core.sh,target=/opt/scripts/toolchain/core.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/gcc.sh,target=/opt/scripts/toolchain/gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/setup-dependencies.sh,target=/opt/scripts/toolchain/setup-dependencies.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/verify-gcc.sh,target=/opt/scripts/toolchain/verify-gcc.sh,ro \\\n    --mount=type=tmpfs,target=/tmp \\\n    --mount=type=tmpfs,target=/var/tmp \\\n    set -euo pipefail; \\\n    SETUP_DEPENDENCIES_SKIP_CORE_TOOLS=true \\\n    bash /opt/scripts/toolchain/setup-dependencies.sh dockerfile-gcc; \\\n    bash /opt/scripts/core/sccache-s3-level.sh drain\n",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "Cold per-file common imports carry the adjacent pure registration owner without a cached ancestor."
 },
 {
  "id": "lib.cross-active-sdk-closure",
  "target": "linux/scripts/script-closures/core-common.txt",
  "find": "01-core/cross-active-fallback.sh|core/cross-active-fallback.sh\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "The SDK common refresh includes its new required owner even over an older compiler ancestor."
 },
 {
  "id": "lib.cross-active-media-closure",
  "target": "linux/Dockerfile.media",
  "find": "linux/scripts/01-core/cross-active-fallback.sh ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cross-active-registration.sh",
  "why": "Fresh dependency preambles carry their adjacent owner rather than assuming its presence in an SDK ancestor."
 },
 {
  "id": "lib.cross-active-layer0-classification",
  "target": "linux/scripts/tests/test-layer-order.sh",
  "find": " sccache-server-address.sh cross-active-fallback.sh sudo-policy.sh)",
  "replace": " sccache-server-address.sh sudo-policy.sh)",
  "test": "bash linux/scripts/tests/test-layer-order.sh",
  "why": "The import-free leaf remains in the independent architectural layer0 classification."
 },
 {
  "id": "lib.directory-visitor-directory-only",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "path_visit_existing_directories() {\n  local _pved_callback=\"$1\" _pved_state=\"$2\"\n  shift 2\n  for dir in \"$@\"; do\n    [ -d \"${dir}\" ] || continue\n    \"${_pved_callback}\" \"${_pved_state}\" \"${dir}\"\n  done\n  return $?\n}",
  "replace": "path_visit_existing_directories() {\n  local _pved_callback=\"$1\" _pved_state=\"$2\"\n  shift 2\n  for dir in \"$@\"; do\n    [ -e \"${dir}\" ] || continue\n    \"${_pved_callback}\" \"${_pved_state}\" \"${dir}\"\n  done\n  return $?\n}",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "A regular file is not a runtime library directory, including the final loop entry."
 },
 {
  "id": "lib.directory-visitor-raw-arguments",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "path_visit_existing_directories() {\n  local _pved_callback=\"$1\" _pved_state=\"$2\"\n  shift 2\n  for dir in \"$@\"; do\n    [ -d \"${dir}\" ] || continue\n    \"${_pved_callback}\" \"${_pved_state}\" \"${dir}\"\n  done\n  return $?\n}",
  "replace": "path_visit_existing_directories() {\n  local _pved_callback=\"$1\" _pved_state=\"$2\"\n  shift 2\n  for dir in $*; do\n    [ -d \"${dir}\" ] || continue\n    \"${_pved_callback}\" \"${_pved_state}\" \"${dir}\"\n  done\n  return $?\n}",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "Quoted candidates preserve empty entries, raw newlines, glob characters and caller IFS semantics."
 },
 {
  "id": "lib.directory-visitor-input-order",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "  shift 2\n  for dir in \"$@\"; do",
  "replace": "  shift 2\n  local -a _bad_order=(\"$@\")\n  for dir in \"${_bad_order[@]:1}\" \"${_bad_order[0]}\"; do",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "Probes and append callbacks retain original input order and the final caller loop slot."
 },
 {
  "id": "lib.directory-visitor-caller-slot",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "  local _pved_callback=\"$1\" _pved_state=\"$2\"",
  "replace": "  local _pved_callback=\"$1\" _pved_state=\"$2\" dir",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "The shared for loop updates the existing caller-owned local or global dir rather than a shadow."
 },
 {
  "id": "lib.directory-visitor-state-binding",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "    \"${_pved_callback}\" \"${_pved_state}\" \"${dir}\"",
  "replace": "    \"${_pved_callback}\" dir \"${dir}\"",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "Callbacks update the selected accumulation variable without corrupting the loop slot."
 },
 {
  "id": "lib.directory-visitor-cross-duplicates",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "  _calp_state=\"${_calp_state:+${_calp_state}:}$2\"",
  "replace": "  case \":${_calp_state}:\" in *\":$2:\"*) return 0 ;; esac\n  _calp_state=\"${_calp_state:+${_calp_state}:}$2\"",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "Cross paths retain repeated directories instead of borrowing LLVM deduplication policy."
 },
 {
  "id": "lib.directory-visitor-llvm-deduplication",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "  case \":${_larlp_state}:\" in\n    *\":${dir}:\"*) ;;\n    *) _larlp_state=\"${_larlp_state:+${_larlp_state}:}${dir}\" ;;\n  esac",
  "replace": "  _larlp_state=\"${_larlp_state:+${_larlp_state}:}${dir}\"",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "LLVM retains exact colon-membership deduplication and first occurrence order."
 },
 {
  "id": "lib.directory-visitor-duplicate-success",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "    *\":${dir}:\"*) ;;",
  "replace": "    *\":${dir}:\"*) return 1 ;;",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "Skipping an existing LLVM directory succeeds under direct errexit and continues remaining candidates."
 },
 {
  "id": "lib.directory-visitor-cross-post-loop",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "    \"/usr/${_elp[triplet]}/lib\"\n  if [ -n \"${target_link_path}\" ]; then",
  "replace": "    \"/usr/${_elp[triplet]}/lib\" || return $?\n  if [ -n \"${target_link_path}\" ]; then",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "An ignored readonly for-control failure still reaches export or printf when errexit is suppressed."
 },
 {
  "id": "lib.directory-visitor-llvm-post-loop",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "    \"/usr/${triplet}/lib\"\n\n  printf '%s' \"${path}\"",
  "replace": "    \"/usr/${triplet}/lib\" || return $?\n\n  printf '%s' \"${path}\"",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "An ignored readonly for-control failure still reaches export or printf when errexit is suppressed."
 },
 {
  "id": "lib.directory-visitor-required-callback",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "  if ! declare -F path_visit_existing_directories \"$1\" >/dev/null; then",
  "replace": "  if ! declare -F path_visit_existing_directories >/dev/null; then",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "Readiness requires the selected callback as well as the visitor before probing or accumulation."
 },
 {
  "id": "lib.directory-visitor-required-visitor",
  "target": "linux/scripts/01-core/platform.sh",
  "find": "  if ! declare -F path_visit_existing_directories \"$1\" >/dev/null; then",
  "replace": "  if ! declare -F \"$1\" >/dev/null; then",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "A partial platform cannot pass readiness with a callback but no directory visitor."
 },
 {
  "id": "lib.directory-visitor-cross-readiness",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "  path_require_directory_visitor _cross_append_library_path || return $?\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "Both callers fail before iteration when their required platform readiness API is absent or incomplete."
 },
 {
  "id": "lib.directory-visitor-llvm-readiness",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "  path_require_directory_visitor _llvm_append_runtime_library_path || return $?\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "Both callers fail before iteration when their required platform readiness API is absent or incomplete."
 },
 {
  "id": "lib.directory-visitor-sdk-fresh-platform",
  "target": "linux/Dockerfile.sdk",
  "find": "COPY --chmod=755 linux/scripts/01-core/platform.sh /opt/scripts/core/platform.sh\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "SDK refreshes the platform owner from the current context alongside its LLVM module."
 },
 {
  "id": "lib.directory-visitor-android-fresh-platform",
  "target": "linux/Dockerfile.android",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/wlt/01-core/platform.sh,ro \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-directory-visitor.sh",
  "why": "The Android web build mounts the same fresh platform owner as its cross-environment module."
 },
 {
  "id": "lib.media-file-set-regular-type",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "[ -f \"${_mrf_path}\" ]",
  "replace": "[ -e \"${_mrf_path}\" ]",
  "test": "bash linux/scripts/tests/test-media-file-sets.sh",
  "why": "directories must not satisfy a regular-file SDK completeness check while regular symlinks still do"
 },
 {
  "id": "lib.media-file-set-all-members",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "case \"${_mrf_status}\" in 0) ;; *) return \"${_mrf_status}\" ;; esac",
  "replace": "return \"${_mrf_status}\"",
  "test": "bash linux/scripts/tests/test-media-file-sets.sh",
  "why": "a present first member cannot hide missing later library or header artifacts"
 },
 {
  "id": "lib.media-file-set-failure-status",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "_mrf_status=$?",
  "replace": "_mrf_status=1",
  "test": "bash linux/scripts/tests/test-media-file-sets.sh",
  "why": "the first failed file probe retains its actual status and stops further probes"
 },
 {
  "id": "lib.media-file-set-quoted-paths",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "for _mrf_path in \"$@\"; do",
  "replace": "for _mrf_path in $*; do",
  "test": "bash linux/scripts/tests/test-media-file-sets.sh",
  "why": "literal spaces and glob characters in SDK roots or version stamps must reach each original -f test unchanged"
 },
 {
  "id": "lib.media-file-set-tf-stamp",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "media_regular_files_present \"${tf_dir}/.complete-${tf_version}\" \\",
  "replace": "media_regular_files_present \\",
  "test": "bash linux/scripts/tests/test-media-file-sets.sh",
  "why": "library and header presence without the current completion stamp cannot accept an interrupted TensorFlow extract"
 },
 {
  "id": "lib.media-file-set-tf-api",
  "target": "linux/scripts/03-media/build/ffmpeg/ffmpeg-dnn-backends.sh",
  "find": "if ! declare -F media_regular_files_present >/dev/null; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-media-file-sets.sh",
  "why": "a selected TensorFlow probe with an old media owner fails closed before treating missing API as a stale cache"
 },
 {
  "id": "lib.media-file-set-hb-api",
  "target": "linux/scripts/03-media/build/opencv/install-deps.sh",
  "find": "if [ -n \"${_hb_triplet}\" ] && ! declare -F media_regular_files_present >/dev/null; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-media-file-sets.sh",
  "why": "selected HarfBuzz staging validation cannot turn a missing required API into an ordinary warning and success"
 },
 {
  "id": "lib.media-file-set-hb-triplet",
  "target": "linux/scripts/03-media/build/opencv/install-deps.sh",
  "find": "if [ -n \"${_hb_triplet}\" ] \\\n       && media_regular_files_present",
  "replace": "if media_regular_files_present",
  "test": "bash linux/scripts/tests/test-media-file-sets.sh",
  "why": "an empty triplet skips the regular-file query and does not newly require the shared API"
 },
 {
  "id": "lib.media-file-set-hb-header",
  "target": "linux/scripts/03-media/build/opencv/install-deps.sh",
  "find": "\"/usr/${_hb_triplet}/include/harfbuzz/hb-ft.h\" \"/usr/${_hb_triplet}/lib/pkgconfig/harfbuzz.pc\"",
  "replace": "\"/usr/${_hb_triplet}/lib/pkgconfig/harfbuzz.pc\"",
  "test": "bash linux/scripts/tests/test-media-file-sets.sh",
  "why": "the static target HarfBuzz verdict requires the FreeType integration header as well as archive and pkgconfig file"
 },
 {
  "id": "lib.media-file-set-dnn-fixture-copy",
  "target": "linux/scripts/tests/test-ffmpeg-dnn-contract.sh",
  "find": "    ${_files}\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ffmpeg-dnn-contract.sh",
  "why": "the executable DNN fixture carries the actual shared helper before reaching the selected download branch"
 },
 {
  "id": "lib.qnn-query-regular-type",
  "target": "linux/scripts/01-core/qnn-sdk.sh",
  "find": "find \"$1\" -maxdepth 1 -name \"$2\" -type f",
  "replace": "find \"$1\" -maxdepth 1 -name \"$2\" -type d",
  "test": "bash linux/scripts/tests/test-qnn-runtime-query.sh",
  "why": "directories cannot satisfy the shallow regular backend library query"
 },
 {
  "id": "lib.qnn-query-shallow",
  "target": "linux/scripts/01-core/qnn-sdk.sh",
  "find": "find \"$1\" -maxdepth 1 -name \"$2\" -type f",
  "replace": "find \"$1\" -maxdepth 4 -name \"$2\" -type f",
  "test": "bash linux/scripts/tests/test-qnn-runtime-query.sh",
  "why": "a nested library does not satisfy the sibling backend library contract"
 },
 {
  "id": "lib.qnn-query-find-status",
  "target": "linux/scripts/01-core/qnn-sdk.sh",
  "find": "find \"$1\" -maxdepth 1 -name \"$2\" -type f 2>/dev/null | grep -q .",
  "replace": "find \"$1\" -maxdepth 1 -name \"$2\" -type f 2>/dev/null | grep -q . || true",
  "test": "bash linux/scripts/tests/test-qnn-runtime-query.sh",
  "why": "the shared query retains the original pipeline status rather than accepting a failed or empty producer"
 },
 {
  "id": "lib.qnn-query-inherited-pipefail",
  "target": "linux/scripts/01-core/qnn-sdk.sh",
  "find": "    find \"$1\" -maxdepth 1 -name \"$2\" -type f",
  "replace": "    set -o pipefail\n    find \"$1\" -maxdepth 1 -name \"$2\" -type f",
  "test": "bash linux/scripts/tests/test-qnn-runtime-query.sh",
  "why": "querying libraries must preserve the caller pipeline policy rather than turning it on globally"
 },
 {
  "id": "lib.qnn-query-child-strict",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "set -euo pipefail",
  "replace": "set -uo pipefail",
  "test": "bash linux/scripts/tests/test-qnn-runtime-query.sh",
  "why": "the sole CPU verification child retains strict flags independently of the redundant removed outer set command"
 },
 {
  "id": "lib.child-stop-signal",
  "target": "linux/scripts/01-core/parallel-loop.sh",
  "find": "for _psca_action in kill wait; do",
  "replace": "for _psca_action in wait; do",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "signaling is attempted before reaping an advisory child"
 },
 {
  "id": "lib.child-stop-reap",
  "target": "linux/scripts/01-core/parallel-loop.sh",
  "find": "for _psca_action in kill wait; do",
  "replace": "for _psca_action in kill; do",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "the child is reaped even when signaling reports it already exited"
 },
 {
  "id": "lib.child-stop-order",
  "target": "linux/scripts/01-core/parallel-loop.sh",
  "find": "for _psca_action in kill wait; do",
  "replace": "for _psca_action in wait kill; do",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "signal precedes the wait rather than blocking on a still-running child"
 },
 {
  "id": "lib.child-stop-advisory",
  "target": "linux/scripts/01-core/parallel-loop.sh",
  "find": "    \"${_psca_action}\" \"$1\" 2>/dev/null || true",
  "replace": "    \"${_psca_action}\" \"$1\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "signal and wait failures stay advisory while timer commands retain their own status"
 },
 {
  "id": "lib.child-stop-diagnostics",
  "target": "linux/scripts/01-core/parallel-loop.sh",
  "find": "    \"${_psca_action}\" \"$1\" 2>/dev/null || true",
  "replace": "    \"${_psca_action}\" \"$1\" || true",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "expected cleanup errors remain silent while command stdout is preserved"
 },
 {
  "id": "lib.child-stop-quoted-pid",
  "target": "linux/scripts/01-core/parallel-loop.sh",
  "find": "    \"${_psca_action}\" \"$1\" 2>/dev/null || true",
  "replace": "    \"${_psca_action}\" $1 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "literal supplied PID strings remain one argument without glob expansion"
 },
 {
  "id": "lib.child-stop-timed-owner",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "    parallel_stop_child_advisory \"${hb}\"",
  "replace": "    parallel_stop_child_advisory 999",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "timer cleanup targets its own heartbeat rather than an unrelated numeric PID"
 },
 {
  "id": "lib.child-stop-disk-reset",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  parallel_stop_child_advisory \"${_CHAIN_DISK_WATCH_PID}\"\n  _CHAIN_DISK_WATCH_PID=\"\"",
  "replace": "  parallel_stop_child_advisory \"${_CHAIN_DISK_WATCH_PID}\"",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "stopped disk watchers clear the saved PID even after advisory cleanup failures"
 },
 {
  "id": "lib.child-stop-fixture-companion",
  "target": "linux/scripts/tests/runtime-flow-fixtures.sh",
  "find": "  t_fn_src \"${scripts}/01-core/parallel-loop.sh\" parallel_stop_child_advisory || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "isolated timer workers carry the actual process companion before running production timer functions"
 },
 {
  "id": "lib.child-stop-required-api",
  "target": "linux/scripts/01-core/parallel-loop.sh",
  "find": "if ! declare -F parallel_stop_child_advisory >/dev/null; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "an incomplete shared process owner is refused before child work starts"
 },
 {
  "id": "lib.child-stop-timed-api",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  if ! is_dry_run; then\n    parallel_require_child_stop || return $?",
  "replace": "  if ! is_dry_run; then",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "a selected timer cannot spawn a heartbeat without its required cleanup API"
 },
 {
  "id": "lib.child-stop-watch-start-api",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  _disk_guard_positive_integer \"${threshold}\" || return 0\n  parallel_require_child_stop || return $?",
  "replace": "  _disk_guard_positive_integer \"${threshold}\" || return 0",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "a selected disk watcher checks cleanup readiness before starting its child"
 },
 {
  "id": "lib.child-stop-watch-stop-api",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  [ -n \"${_CHAIN_DISK_WATCH_PID}\" ] || return 0\n  parallel_require_child_stop || return $?",
  "replace": "  [ -n \"${_CHAIN_DISK_WATCH_PID}\" ] || return 0",
  "test": "bash linux/scripts/tests/test-runtime-child-stop.sh",
  "why": "missing cleanup API cannot clear a saved watcher PID and report a successful stop"
 },
 {
  "id": "lib.cache-readiness-positive-complete-closure",
  "target": "linux/scripts/tests/test-compiler-cache-companions.sh",
  "find": "for companion in compiler-cache-utils.sh load-versions-env.sh versions.env platform.sh cross-active-fallback.sh sudo-policy.sh; do",
  "replace": "for companion in compiler-cache-utils.sh load-versions-env.sh versions.env platform.sh sudo-policy.sh; do",
  "test": "bash linux/scripts/tests/test-compiler-cache-companions.sh",
  "why": "A complete common-module initialization must succeed before the missing-cache comparison; another missing companion cannot mask cache-guard regressions."
 },
 {
  "id": "lib.smoke-query-quiet-producer",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "\"$1\" \"${@:3}\" 2>/dev/null | \"$2\" \"${@:3}\"",
  "replace": "\"$1\" \"${@:3}\" | \"$2\" \"${@:3}\"",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "why": "Only the producer diagnostics are quiet; consumer failures stay observable."
 },
 {
  "id": "lib.smoke-query-consumer-arguments",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "_smoke_python_match() {\n  grep -q .\n}",
  "replace": "_smoke_python_match() {\n  grep -q wrong\n}",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "why": "Both callers retain the fixed quiet nonempty-output query and exact consumer arguments."
 },
 {
  "id": "lib.smoke-query-pipeline-status",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "\"$1\" \"${@:3}\" 2>/dev/null | \"$2\" \"${@:3}\"",
  "replace": "\"$1\" \"${@:3}\" 2>/dev/null | \"$2\" \"${@:3}\" || true",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "why": "Producer failures including141 and empty or failed consumers cannot become successful presence verdicts."
 },
 {
  "id": "lib.smoke-query-web-find-binding",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "_smoke_web_loaders() {\n  find \"${dir}\" \\( -name '*.js' -o -name '*.mjs' \\) -print -quit\n}",
  "replace": "_smoke_web_loaders() {\n  _smoke_python_files \"$@\"\n}",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "why": "Web producer lookup retains its own later parse-time alias rather than the Python phase binding."
 },
 {
  "id": "lib.smoke-query-web-grep-binding",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "_smoke_web_match() {\n  grep -q .\n}",
  "replace": "_smoke_web_match() {\n  _smoke_python_match \"$@\"\n}",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "why": "Web consumer lookup retains its later parse-time alias independently from the Python consumer."
 },
 {
  "id": "lib.smoke-query-web-selectors",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "find \"${dir}\" \\( -name '*.js' -o -name '*.mjs' \\) -print -quit",
  "replace": "find \"${dir}\" -name '*.js' -print -quit",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "why": "JS and MJS selector grouping, print/quit order and spaced roots remain caller owned."
 },
 {
  "id": "lib.log-dir-raw-value",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "orchestrator_consume_log_dir() {\n  LOG_DIR=\"$2\"\n  _OARG_SHIFT=2\n}",
  "replace": "orchestrator_consume_log_dir() {\n  LOG_DIR=\"$1\"\n  _OARG_SHIFT=2\n}",
  "test": "bash linux/scripts/tests/test-log-dir-consumer.sh",
  "why": "The handler value is the second raw argument, including empty strings and newlines."
 },
 {
  "id": "lib.log-dir-consumption",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "orchestrator_consume_log_dir() {\n  LOG_DIR=\"$2\"\n  _OARG_SHIFT=2\n}",
  "replace": "orchestrator_consume_log_dir() {\n  LOG_DIR=\"$2\"\n  _OARG_SHIFT=1\n}",
  "test": "bash linux/scripts/tests/test-log-dir-consumer.sh",
  "why": "The log-directory flag consumes its value as well as the flag."
 },
 {
  "id": "lib.log-dir-assignment-order",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "orchestrator_consume_log_dir() {\n  LOG_DIR=\"$2\"\n  _OARG_SHIFT=2\n}",
  "replace": "orchestrator_consume_log_dir() {\n  _OARG_SHIFT=2\n  LOG_DIR=\"$2\"\n}",
  "test": "bash linux/scripts/tests/test-log-dir-consumer.sh",
  "why": "Readonly destinations and aliased shift state preserve assignment order."
 },
 {
  "id": "lib.log-dir-stage-required",
  "target": "linux/scripts/build-cross-stage.sh",
  "find": "--log-dir) orchestrator_consume_log_dir \"$@\" ;;",
  "replace": "--log-dir) _OARG_SHIFT=2 ;;",
  "test": "bash linux/scripts/tests/test-log-dir-consumer.sh",
  "why": "Each actual handler must assign its log directory through the consumer."
 },
 {
  "id": "lib.log-dir-stage-argv",
  "target": "linux/scripts/build-cross-stage.sh",
  "find": "--log-dir) orchestrator_consume_log_dir \"$@\" ;;",
  "replace": "--log-dir) orchestrator_consume_log_dir \"$1\" \"$2\" ;;",
  "test": "bash linux/scripts/tests/test-log-dir-consumer.sh",
  "why": "Full handler positional context remains visible to nameref array subscripts."
 },
 {
  "id": "lib.log-dir-chain-required",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "--log-dir) orchestrator_consume_log_dir \"$@\" ;;",
  "replace": "--log-dir) _OARG_SHIFT=2 ;;",
  "test": "bash linux/scripts/tests/test-log-dir-consumer.sh",
  "why": "Each actual handler must assign its log directory through the consumer."
 },
 {
  "id": "lib.log-dir-chain-argv",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "--log-dir) orchestrator_consume_log_dir \"$@\" ;;",
  "replace": "--log-dir) orchestrator_consume_log_dir \"$1\" \"$2\" ;;",
  "test": "bash linux/scripts/tests/test-log-dir-consumer.sh",
  "why": "Full handler positional context remains visible to nameref array subscripts."
 },
 {
  "id": "lib.header-discovery-advisory-find",
  "target": "linux/scripts/01-core/guard-helpers.sh",
  "find": "\"${_fmu_find}\" \"${_fmu_path}\" \"$@\" -print -quit 2>/dev/null || true",
  "replace": "\"${_fmu_find}\" \"${_fmu_path}\" \"$@\" -print -quit 2>/dev/null",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "a failed find keeps any partial header path and remains advisory exactly as before"
 },
 {
  "id": "lib.header-discovery-quiet-find",
  "target": "linux/scripts/01-core/guard-helpers.sh",
  "find": "\"${_fmu_find}\" \"${_fmu_path}\" \"$@\" -print -quit 2>/dev/null || true",
  "replace": "\"${_fmu_find}\" \"${_fmu_path}\" \"$@\" -print -quit || true",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "legacy first-match stderr remains suppressed while partial stdout survives"
 },
 {
  "id": "lib.header-discovery-first-only",
  "target": "linux/scripts/01-core/guard-helpers.sh",
  "find": "\"${_fmu_find}\" \"${_fmu_path}\" \"$@\" -print -quit 2>/dev/null || true",
  "replace": "\"${_fmu_find}\" \"${_fmu_path}\" \"$@\" -print 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "the shared query retains first-hit traversal and exact -print -quit arguments"
 },
 {
  "id": "lib.header-discovery-legacy-required-path",
  "target": "linux/scripts/01-core/guard-helpers.sh",
  "find": "local _path=\"$1\"; shift",
  "replace": "local _path=\"${1:-}\"; shift",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "legacy zero-argument nounset and empty-argument behavior remain distinct"
 },
 {
  "id": "lib.header-discovery-legacy-shift",
  "target": "linux/scripts/01-core/guard-helpers.sh",
  "find": "local _path=\"$1\"; shift",
  "replace": "local _path=\"$1\"",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "the legacy path operand is consumed once before forwarding predicate or additional-root arguments"
 },
 {
  "id": "lib.header-discovery-legacy-find-binding",
  "target": "linux/scripts/01-core/guard-helpers.sh",
  "find": "first_match_using _first_match_find \"${_path}\" \"$@\"",
  "replace": "first_match_using find \"${_path}\" \"$@\"",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "legacy first_match retains its owner-bound find alias and dynamic local _path visibility"
 },
 {
  "id": "lib.header-discovery-litert-binding",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "find \"${_litert_header_exec_argv[@]}\"",
  "replace": "_first_match_find \"${_litert_header_exec_argv[@]}\"",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "the caller command-substitution retains late alias binding instead of borrowing the earlier helper-owner alias"
 },
 {
  "id": "lib.header-discovery-litert-api",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "if ! declare -F first_match_using >/dev/null; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "selected discovery fails closed on an old helper owner while already-present header branches need no new API"
 },
 {
  "id": "lib.header-discovery-litert-callback-scope",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "fbheader=$(\n            _litert_header_caller_argv=(\"$@\")\n            _litert_header_find() {\n                local -a _litert_header_exec_argv=(\"$@\")\n                set -- \"${_litert_header_caller_argv[@]}\"\n                find \"${_litert_header_exec_argv[@]}\"\n            }",
  "replace": "            _litert_header_caller_argv=(\"$@\")\n            _litert_header_find() {\n                local -a _litert_header_exec_argv=(\"$@\")\n                set -- \"${_litert_header_caller_argv[@]}\"\n                find \"${_litert_header_exec_argv[@]}\"\n            }\n        fbheader=$(",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "the find callback stays inside the existing captured subshell and leaves no parent function behind"
 },
 {
  "id": "lib.header-discovery-ort-binding",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "find \"${_trtep_header_exec_argv[@]}\"",
  "replace": "_first_match_find \"${_trtep_header_exec_argv[@]}\"",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "the caller command-substitution retains late alias binding instead of borrowing the earlier helper-owner alias"
 },
 {
  "id": "lib.header-discovery-ort-api",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "if ! declare -F first_match_using >/dev/null; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "selected discovery fails closed on an old helper owner while already-present header branches need no new API"
 },
 {
  "id": "lib.header-discovery-ort-callback-scope",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "header=$(\n      _trtep_header_caller_argv=(\"$@\")\n      _trtep_header_find() {\n        local -a _trtep_header_exec_argv=(\"$@\")\n        set -- \"${_trtep_header_caller_argv[@]}\"\n        find \"${_trtep_header_exec_argv[@]}\"\n      }",
  "replace": "      _trtep_header_caller_argv=(\"$@\")\n      _trtep_header_find() {\n        local -a _trtep_header_exec_argv=(\"$@\")\n        set -- \"${_trtep_header_caller_argv[@]}\"\n        find \"${_trtep_header_exec_argv[@]}\"\n      }\n    header=$(",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "the find callback stays inside the existing captured subshell and leaves no parent function behind"
 },
 {
  "id": "lib.header-discovery-trt-root-order",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "first_match_using _trtep_header_find /usr/include /usr/local -name \"NvInfer.h\"",
  "replace": "first_match_using _trtep_header_find /usr/local /usr/include -name \"NvInfer.h\"",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "the original TensorRT search roots retain their precedence and exact argument boundaries"
 },
 {
  "id": "lib.header-discovery-flatbuffers-regular-file",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "first_match_using _litert_header_find \"${LITERT_SRC}/litert\" -type f -path",
  "replace": "first_match_using _litert_header_find \"${LITERT_SRC}/litert\" -path",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "FlatBuffers discovery keeps its regular-file predicate instead of admitting any matching pathname type"
 },
 {
  "id": "lib.npm-python-arguments",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "  \"$1\" \"${@:2}\" 2>/dev/null",
  "replace": "  \"$1\" ${*:2} 2>/dev/null",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "Python code, empty arguments and archive paths remain separate literal arguments"
 },
 {
  "id": "lib.npm-python-stderr",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "  \"$1\" \"${@:2}\" 2>/dev/null",
  "replace": "  \"$1\" \"${@:2}\"",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "both metadata and digest interpreter diagnostics retain their original quiet policy"
 },
 {
  "id": "lib.npm-python-status",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "  \"$1\" \"${@:2}\" 2>/dev/null",
  "replace": "  \"$1\" \"${@:2}\" 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "the transport returns raw interpreter failure so digest failures keep strict-shell behavior"
 },
 {
  "id": "lib.npm-python-bound-command",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "  \"$1\" \"${@:2}\" 2>/dev/null",
  "replace": "  python3 \"${@:2}\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "caller-bound Python transports preserve runtime aliases and provided interpreter callbacks"
 },
 {
  "id": "lib.npm-python-metadata-advisory",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "      | _npm_python_quiet _npm_metadata_python \"$@\" || true",
  "replace": "      | _npm_python_quiet _npm_metadata_python \"$@\"",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "metadata lookup remains advisory even when Python or curl fails after partial output"
 },
 {
  "id": "lib.npm-python-digest-fatal",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "      _npm_python_quiet _npm_digest_python \"$@\"",
  "replace": "      _npm_python_quiet _npm_digest_python \"$@\" || true",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "digest interpreter failure must not be normalized into a later mismatch or a successful install"
 },
 {
  "id": "lib.npm-python-metadata-quiet",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "_npm_python_quiet _npm_metadata_python \"$@\"",
  "replace": "_npm_metadata_python \"$@\"",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "metadata errors remain quiet while the caller emits its existing best-effort warning"
 },
 {
  "id": "lib.npm-python-digest-quiet",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "_npm_python_quiet _npm_digest_python \"$@\"",
  "replace": "_npm_digest_python \"$@\"",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "digest errors retain their quiet stderr and original raw status"
 },
 {
  "id": "lib.npm-python-metadata-scope",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "  _want_int=\"$(\n",
  "replace": "  _npm_metadata_python() { python3 \"$@\"; }\n  _want_int=\"$(\n",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "metadata command binding remains inside the existing capture and does not leak a parent function"
 },
 {
  "id": "lib.npm-python-digest-scope",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "    _got_int=\"sha512-$(\n",
  "replace": "    _npm_digest_python() { python3 \"$@\"; }\n    _got_int=\"sha512-$(\n",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "digest command binding remains inside its capture rather than altering parent function state"
 },
 {
  "id": "lib.python-callback-fixture-partial-status",
  "target": "linux/scripts/tests/test-python-callback-scope.sh",
  "find": "t_source_functions \"$COLLECTOR\" cross_collect_python_dev_paths\ncross_target_python_custom_field() { printf custom-partial; return 7; }",
  "replace": "t_source_functions \"$COLLECTOR\" cross_collect_python_dev_paths\ncross_target_python_custom_field() { printf custom-partial; return 0; }",
  "test": "bash linux/scripts/tests/test-python-callback-scope.sh",
  "why": "The independent literal fake-provider contract requires failed partial output before the collector dynamically resolves the same provider."
 },
 {
  "id": "lib.python-provider-argv",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "\"$3\" \"${@:4}\" 2>/dev/null || true",
  "replace": "\"$3\" 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "Alias prefixes retain the original OpenCV output/tail/empty argument context."
 },
 {
  "id": "lib.python-provider-quiet",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "\"$3\" \"${@:4}\" 2>/dev/null || true",
  "replace": "\"$3\" \"${@:4}\" || true",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "Failed partial provider diagnostics remain quiet while their stdout survives."
 },
 {
  "id": "lib.python-provider-readiness",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "if ! declare -F cross_capture_python_dev_path >/dev/null; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "A partially installed owner cannot turn a missing capture export into a green caller."
 },
 {
  "id": "lib.python-provider-gst-ready",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  cross_python_provider_api_ready || return $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "Actual GStreamer refuses an older or guarded owner before attempting selected providers."
 },
 {
  "id": "lib.python-provider-opencv-ready",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "            cross_python_provider_api_ready || return $?",
  "replace": "            :",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "Actual OpenCV refuses an older or guarded owner rather than interpreting a failed capture as optional absence."
 },
 {
  "id": "lib.python-provider-gst-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gst_python_provider() { cross_target_python_include_dir; }",
  "replace": "_gst_python_provider() { command cross_target_python_include_dir; }",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "GStreamer retains literal provider aliases at its original zero-argument resolver parse phase."
 },
 {
  "id": "lib.python-provider-opencv-binding",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "_opencv_python_provider() { cross_target_python_library; }",
  "replace": "_opencv_python_provider() { command cross_target_python_library; }",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "OpenCV retains provider aliases established after the owner loads but before its function declaration."
 },
 {
  "id": "lib.python-provider-gst-no-leak",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gst_xpy_resolve_target_paths() {\n",
  "replace": "_gst_xpy_resolve_target_paths() {\n  _gst_python_provider() { :; }\n",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "Provider callbacks stay inside captures and cannot leak into the parent shell."
 },
 {
  "id": "lib.python-provider-opencv-no-leak",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "_opencv_cmake_python_opts() {\n",
  "replace": "_opencv_cmake_python_opts() {\n    _opencv_python_provider() { :; }\n",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "OpenCV provider callback declarations remain capture-local."
 },
 {
  "id": "lib.python-provider-cold-complete-closure",
  "target": "linux/scripts/tests/python-provider-context-tests.py",
  "find": "for name in (\"cross-python.sh\", \"platform.sh\"):",
  "replace": "for name in (\"cross-python.sh\",):",
  "test": "bash linux/scripts/tests/test-python-provider-context.sh",
  "why": "A complete copied owner must initialize before old or partial owner rejection is accepted."
 },
 {
  "id": "lib.python-provider-absent-default",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "    printf '%s' \"$2\"",
  "replace": "    printf '%s' ''",
  "test": "bash linux/scripts/tests/test-media-python-probes.sh",
  "why": "Absent provider commands retain the caller previous value rather than clearing it."
 },
 {
  "id": "lib.python-collector-partial-advisory",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "_ccpdp_paths[\"$1\"]=\"$(\"cross_target_python_$1\" 2>/dev/null || true)\"",
  "replace": "_ccpdp_paths[\"$1\"]=\"$(\"cross_target_python_$1\" 2>/dev/null)\"",
  "test": "bash linux/scripts/tests/test-python-callback-scope.sh",
  "why": "Legacy arbitrary-field collectors retain failed partial output under direct errexit."
 },
 {
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "id": "lib.smoke-query-python-caller-argv",
  "find": "_smoke_python_match \"$@\"; then",
  "replace": "_smoke_python_match \"$@\" -name \"${pattern}\" -type f; then",
  "why": "Python prefix aliases see only original post-shift paths, including empty arguments."
 },
 {
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "id": "lib.smoke-query-web-caller-argv",
  "find": "_smoke_web_match \"$@\"; then",
  "replace": "_smoke_web_match \"${dir}\"; then",
  "why": "Web prefix aliases retain label, directory and expected count in their original positions."
 },
 {
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "id": "lib.smoke-query-consumer-caller-argv",
  "find": "| \"$2\" \"${@:3}\"",
  "replace": "| \"$2\" -q .",
  "why": "Consumer aliases receive original caller arguments before fixed grep options."
 },
 {
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "id": "lib.smoke-query-web-consumer-arguments",
  "find": "_smoke_web_match() {\n  grep -q .\n}",
  "replace": "_smoke_web_match() {\n  grep -q wrong\n}",
  "why": "The web consumer retains the exact quiet nonempty-output predicate."
 },
 {
  "id": "lib.libcamera-report-availability",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "if command -v \"$1\" >/dev/null 2>&1; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "Unavailable tools remain silent and never execute component probes."
 },
 {
  "id": "lib.libcamera-report-quiet-probe",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "if \"$2\" \"${@:5}\" >/dev/null 2>&1; then",
  "replace": "if \"$2\" \"${@:5}\"; then",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "Both stdout and stderr from existence probes stay out of the diagnostic report."
 },
 {
  "id": "lib.libcamera-report-probe-verdict",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "if \"$2\" \"${@:5}\" >/dev/null 2>&1; then",
  "replace": "if \"$2\" \"${@:5}\" >/dev/null 2>&1 || true; then",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "A failed component probe must report missing instead of success."
 },
 {
  "id": "lib.libcamera-report-success-callback",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "      \"$3\" \"${@:5}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "Successful component probes execute the original report and version lookup."
 },
 {
  "id": "lib.libcamera-report-missing-message",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "      echo \"$4\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "Missing components retain their exact independent diagnostic messages."
 },
 {
  "id": "lib.libcamera-report-version-fallback",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "pkg-config --modversion libcamera 2>/dev/null || echo \"<version unknown>\"",
  "replace": "pkg-config --modversion libcamera 2>/dev/null",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "Failed version queries retain partial output plus the original unknown-version fallback."
 },
 {
  "id": "lib.libcamera-report-pkg-binding",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "  pkg-config --exists libcamera",
  "replace": "  command pkg-config --exists libcamera",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "The pkg-config probe preserves source-time function and alias binding."
 },
 {
  "id": "lib.libcamera-report-gst-binding",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "  gst-inspect-1.0 libcamerasrc",
  "replace": "  command gst-inspect-1.0 libcamerasrc",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "The GStreamer probe preserves source-time function and alias binding."
 },
 {
  "id": "lib.libcamera-report-dynamic-scope",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "_libcamera_report_available_probe() {\n",
  "replace": "_libcamera_report_available_probe() {\n  local tool=\"$1\" probe=\"$2\" success=\"$3\" missing=\"$4\"\n",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "Bound component wrappers retain caller locals and globals without new helper locals hiding their dynamic bindings."
 },
 {
  "id": "lib.libcamera-report-probe-argv",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "if \"$2\" \"${@:5}\" >/dev/null 2>&1; then",
  "replace": "if \"$2\" >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "Both literal probe aliases retain env_show positional arguments."
 },
 {
  "id": "lib.libcamera-report-success-argv",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "      \"$3\" \"${@:5}\"",
  "replace": "      \"$3\"",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "The pkg-config version alias retains env_show positional arguments."
 },
 {
  "id": "lib.libcamera-report-pkg-caller-argv",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "\"  pkg-config: libcamera NOT found in current PKG_CONFIG_PATH\" \"$@\"",
  "replace": "\"  pkg-config: libcamera NOT found in current PKG_CONFIG_PATH\"",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "The pkg-config probe and version report carry original show argv into bound callbacks."
 },
 {
  "id": "lib.libcamera-report-gst-caller-argv",
  "target": "linux/scripts/04-runtime/libcamera-env.sh",
  "find": "\"  gst-inspect-1.0: libcamerasrc plugin NOT found\" \"$@\"",
  "replace": "\"  gst-inspect-1.0: libcamerasrc plugin NOT found\"",
  "test": "bash linux/scripts/tests/test-libcamera-report.sh",
  "why": "The GStreamer presence alias receives original show argv with spaces and empty arguments."
 },
 {
  "id": "lib.smoke-query-dynamic-scope",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "_smoke_query_matches() {\n",
  "replace": "_smoke_query_matches() {\n  local producer=\"$1\" consumer=\"$2\"\n",
  "test": "bash linux/scripts/tests/test-smoke-query-contract.sh",
  "why": "Find and grep wrappers retain both caller-local and global producer/consumer bindings without helper shadowing."
 },
 {
  "id": "lib.python-callback-dynamic-scope",
  "target": "linux/scripts/01-core/cross-python.sh",
  "find": "cross_collect_python_dev_paths() {\n",
  "replace": "cross_collect_python_dev_paths() {\n  local field=include_dir probe=cross_target_python_include_dir python_paths=masked\n",
  "test": "bash linux/scripts/tests/test-python-callback-scope.sh",
  "why": "The actual GStreamer caller preserves global and caller-local field/probe/python_paths bindings visible to provided Python resolvers."
 },
 {
  "id": "lib.chain-sibling-pid-empty-excluded",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "_chain_is_live_other_pid() {\n  [ -n \"$1\" ] && [ \"$1\" != \"$$\" ] || return 1\n  kill -0 \"$1\" 2>/dev/null\n}",
  "replace": "_chain_is_live_other_pid() {\n  [ \"$1\" != \"$$\" ] || return 1\n  kill -0 \"$1\" 2>/dev/null\n}",
  "test": "bash linux/scripts/tests/test-chain-sibling-pid.sh",
  "why": "An empty pidfile does not invoke a process probe."
 },
 {
  "id": "lib.chain-sibling-pid-self-excluded",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "_chain_is_live_other_pid() {\n  [ -n \"$1\" ] && [ \"$1\" != \"$$\" ] || return 1\n  kill -0 \"$1\" 2>/dev/null\n}",
  "replace": "_chain_is_live_other_pid() {\n  [ -n \"$1\" ] || return 1\n  kill -0 \"$1\" 2>/dev/null\n}",
  "test": "bash linux/scripts/tests/test-chain-sibling-pid.sh",
  "why": "The current process never counts as a sibling and retains its own claimed pidfile."
 },
 {
  "id": "lib.chain-sibling-pid-probe-required",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "_chain_is_live_other_pid() {\n  [ -n \"$1\" ] && [ \"$1\" != \"$$\" ] || return 1\n  kill -0 \"$1\" 2>/dev/null\n}",
  "replace": "_chain_is_live_other_pid() {\n  [ -n \"$1\" ] && [ \"$1\" != \"$$\" ] || return 1\n  return 0\n}",
  "test": "bash linux/scripts/tests/test-chain-sibling-pid.sh",
  "why": "Stale pidfiles do not protect a dead process or prevent takeover."
 },
 {
  "id": "lib.chain-sibling-pid-raw-probe-status",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "_chain_is_live_other_pid() {\n  [ -n \"$1\" ] && [ \"$1\" != \"$$\" ] || return 1\n  kill -0 \"$1\" 2>/dev/null\n}",
  "replace": "_chain_is_live_other_pid() {\n  [ -n \"$1\" ] && [ \"$1\" != \"$$\" ] || return 1\n  kill -0 \"$1\" 2>/dev/null || return 1\n}",
  "test": "bash linux/scripts/tests/test-chain-sibling-pid.sh",
  "why": "The shared predicate retains raw nonzero probe statuses for its caller."
 },
 {
  "id": "lib.chain-sibling-pid-quiet-probe",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "_chain_is_live_other_pid() {\n  [ -n \"$1\" ] && [ \"$1\" != \"$$\" ] || return 1\n  kill -0 \"$1\" 2>/dev/null\n}",
  "replace": "_chain_is_live_other_pid() {\n  [ -n \"$1\" ] && [ \"$1\" != \"$$\" ] || return 1\n  kill -0 \"$1\"\n}",
  "test": "bash linux/scripts/tests/test-chain-sibling-pid.sh",
  "why": "Probe diagnostics stay suppressed without suppressing stdout or changing status."
 },
 {
  "id": "lib.chain-sibling-pid-reader-delegates",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  _chain_is_live_other_pid \"${other}\" || return 0",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-chain-sibling-pid.sh",
  "why": "The reader must expose a live sibling to archive and refusal checks."
 },
 {
  "id": "lib.chain-sibling-pid-writer-delegates",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "    if _chain_is_live_other_pid \"${other}\"; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-chain-sibling-pid.sh",
  "why": "The writer cannot clobber the pidfile of a live sibling."
 },
 {
  "id": "lib.command-callback-scope-action",
  "target": "linux/scripts/01-core/common.sh",
  "find": "wheel_archive_run() {\n  local _war_action=\"$1\" _war_source=\"$2\" _war_destination=\"$3\"\n  shift 3\n  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1\n}",
  "replace": "wheel_archive_run() {\n  local action=\"$1\" _war_source=\"$2\" _war_destination=\"$3\"\n  shift 3\n  \"$@\" -m wheel \"${action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1\n}",
  "test": "bash linux/scripts/tests/test-command-callback-scope.sh",
  "why": "Actual wheel and packaging caller command functions retain user action configuration from global and caller-local scope."
 },
 {
  "id": "lib.command-callback-scope-source",
  "target": "linux/scripts/01-core/common.sh",
  "find": "wheel_archive_run() {\n  local _war_action=\"$1\" _war_source=\"$2\" _war_destination=\"$3\"\n  shift 3\n  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1\n}",
  "replace": "wheel_archive_run() {\n  local _war_action=\"$1\" source=\"$2\" _war_destination=\"$3\"\n  shift 3\n  \"$@\" -m wheel \"${_war_action}\" \"${source}\" -d \"${_war_destination}\" >/dev/null 2>&1\n}",
  "test": "bash linux/scripts/tests/test-command-callback-scope.sh",
  "why": "Actual wheel and packaging caller command functions retain user source configuration from global and caller-local scope."
 },
 {
  "id": "lib.command-callback-scope-destination",
  "target": "linux/scripts/01-core/common.sh",
  "find": "wheel_archive_run() {\n  local _war_action=\"$1\" _war_source=\"$2\" _war_destination=\"$3\"\n  shift 3\n  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${_war_destination}\" >/dev/null 2>&1\n}",
  "replace": "wheel_archive_run() {\n  local _war_action=\"$1\" _war_source=\"$2\" destination=\"$3\"\n  shift 3\n  \"$@\" -m wheel \"${_war_action}\" \"${_war_source}\" -d \"${destination}\" >/dev/null 2>&1\n}",
  "test": "bash linux/scripts/tests/test-command-callback-scope.sh",
  "why": "Actual wheel and packaging caller command functions retain user destination configuration from global and caller-local scope."
 },
 {
  "id": "lib.command-callback-scope-failure_handler",
  "target": "linux/scripts/02-toolchain/packaging-deps.sh",
  "find": "_packaging_execute() {\n    local _pe_failure_handler=\"$1\" status=0\n    shift\n    \"$@\" || status=$?\n    if [ \"$status\" -eq 0 ]; then return 0; fi\n    \"$_pe_failure_handler\" \"$status\" \"$@\"\n}",
  "replace": "_packaging_execute() {\n    local failure_handler=\"$1\" status=0\n    shift\n    \"$@\" || status=$?\n    if [ \"$status\" -eq 0 ]; then return 0; fi\n    \"$failure_handler\" \"$status\" \"$@\"\n}",
  "test": "bash linux/scripts/tests/test-command-callback-scope.sh",
  "why": "Actual wheel and packaging caller command functions retain user failure_handler configuration from global and caller-local scope."
 },
 {
  "id": "lib.wheel-archive-alias-adapter-literal",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "_repair_wheel_uv() {\n  local -a _rwuv_exec_argv=(\"$@\")\n  set --\n  uv \"${_rwuv_exec_argv[@]}\"\n}",
  "replace": "_repair_wheel_uv() {\n  local -a _rwuv_exec_argv=(\"$@\")\n  set --\n  \"uv\" \"${_rwuv_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-command-callback-scope.sh",
  "why": "Load-time uv aliases remain bound at the original literal-command boundary."
 },
 {
  "id": "lib.wheel-archive-alias-unpack-bound",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "wheel_archive_run unpack \"${whl}\" \"${tmp}/u\" _repair_wheel_uv run python",
  "replace": "wheel_archive_run unpack \"${whl}\" \"${tmp}/u\" uv run python",
  "test": "bash linux/scripts/tests/test-command-callback-scope.sh",
  "why": "The unpack operation must invoke the bound literal uv caller, retaining alias phase and user variables."
 },
 {
  "id": "lib.wheel-archive-alias-pack-bound",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "wheel_archive_run pack \"${unpacked}\" \"${tmp}/p\" _repair_wheel_uv run python",
  "replace": "wheel_archive_run pack \"${unpacked}\" \"${tmp}/p\" uv run python",
  "test": "bash linux/scripts/tests/test-command-callback-scope.sh",
  "why": "The pack operation must invoke the bound literal uv caller, retaining alias phase and user variables."
 },
 {
  "id": "lib.wheel-archive-alias-caller-argv",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "_repair_wheel_uv() {\n  local -a _rwuv_exec_argv=(\"$@\")\n  set --\n  uv \"${_rwuv_exec_argv[@]}\"\n}",
  "replace": "_repair_wheel_uv() {\n  local -a _rwuv_exec_argv=(\"$@\")\n  uv \"${_rwuv_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-command-callback-scope.sh",
  "why": "Prefix aliases expand the original strip caller positional arguments, while exact unpack and pack tool arguments remain separate."
 },
 {
  "id": "lib.wheel-archive-alias-exec-argv",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "_repair_wheel_uv() {\n  local -a _rwuv_exec_argv=(\"$@\")\n  set --\n  uv \"${_rwuv_exec_argv[@]}\"\n}",
  "replace": "_repair_wheel_uv() {\n  local -a _rwuv_exec_argv=(\"$@\")\n  set --\n  uv \"$@\"\n}",
  "test": "bash linux/scripts/tests/test-command-callback-scope.sh",
  "why": "Prefix aliases expand the original strip caller positional arguments, while exact unpack and pack tool arguments remain separate."
 },
 {
  "id": "lib.meson-bound-gst-cross-literal",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "_gst_monorepo_meson_cross() {\n  local -a _gmmc_exec_argv=(\"$@\")\n  set --\n  append_meson_cross_flags \"${_gmmc_exec_argv[@]}\"\n}",
  "replace": "_gst_monorepo_meson_cross() {\n  local -a _gmmc_exec_argv=(\"$@\")\n  set --\n  \"append_meson_cross_flags\" \"${_gmmc_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "Provider aliases bind at the original gst source phase without changing command function scope."
 },
 {
  "id": "lib.meson-bound-gst-native-literal",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "_gst_monorepo_meson_native() {\n  local -a _gmmn_exec_argv=(\"$@\")\n  set --\n  append_meson_native_flags \"${_gmmn_exec_argv[@]}\"\n}",
  "replace": "_gst_monorepo_meson_native() {\n  local -a _gmmn_exec_argv=(\"$@\")\n  set --\n  \"append_meson_native_flags\" \"${_gmmn_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "Provider aliases bind at the original gst source phase without changing command function scope."
 },
 {
  "id": "lib.meson-bound-camera-cross-literal",
  "target": "linux/scripts/03-media/build/libcamera/build-libcamera.sh",
  "find": "_libcamera_meson_cross() {\n  local -a _lcmc_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_cross_argv[@]}\"\n  append_meson_cross_flags \"${_lcmc_exec_argv[@]}\"\n}",
  "replace": "_libcamera_meson_cross() {\n  local -a _lcmc_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_cross_argv[@]}\"\n  \"append_meson_cross_flags\" \"${_lcmc_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "Provider aliases bind at the original camera source phase without changing command function scope."
 },
 {
  "id": "lib.meson-bound-camera-native-literal",
  "target": "linux/scripts/03-media/build/libcamera/build-libcamera.sh",
  "find": "_libcamera_meson_native() {\n  local -a _lcmn_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_native_argv[@]}\"\n  append_meson_native_flags \"${_lcmn_exec_argv[@]}\"\n}",
  "replace": "_libcamera_meson_native() {\n  local -a _lcmn_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_native_argv[@]}\"\n  \"append_meson_native_flags\" \"${_lcmn_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "Provider aliases bind at the original camera source phase without changing command function scope."
 },
 {
  "id": "lib.meson-bound-core-cross-literal",
  "target": "linux/scripts/01-core/common.sh",
  "find": "_common_meson_cross() {\n  local -a _cmc_exec_argv=(\"$@\")\n  set -- \"${_amtf_caller_argv[@]}\"\n  append_meson_cross_flags \"${_cmc_exec_argv[@]}\"\n}",
  "replace": "_common_meson_cross() {\n  local -a _cmc_exec_argv=(\"$@\")\n  set -- \"${_amtf_caller_argv[@]}\"\n  \"append_meson_cross_flags\" \"${_cmc_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "Provider aliases bind at the original core source phase without changing command function scope."
 },
 {
  "id": "lib.meson-bound-core-native-literal",
  "target": "linux/scripts/01-core/common.sh",
  "find": "_common_meson_native() {\n  local -a _cmn_exec_argv=(\"$@\")\n  set -- \"${_amtf_caller_argv[@]}\"\n  append_meson_native_flags \"${_cmn_exec_argv[@]}\"\n}",
  "replace": "_common_meson_native() {\n  local -a _cmn_exec_argv=(\"$@\")\n  set -- \"${_amtf_caller_argv[@]}\"\n  \"append_meson_native_flags\" \"${_cmn_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "Provider aliases bind at the original core source phase without changing command function scope."
 },
 {
  "id": "lib.meson-bound-camera-native-phase",
  "target": "linux/scripts/03-media/build/libcamera/build-libcamera.sh",
  "find": "_libcamera_meson_cross() {\n  local -a _lcmc_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_cross_argv[@]}\"\n  append_meson_cross_flags \"${_lcmc_exec_argv[@]}\"\n}\nappend_available_meson_provider append_meson_cross_flags _libcamera_meson_cross MESON_SETUP_ARGS\n\n_libcamera_meson_native_argv=(\"$@\")\n_libcamera_meson_native() {\n  local -a _lcmn_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_native_argv[@]}\"\n  append_meson_native_flags \"${_lcmn_exec_argv[@]}\"\n}",
  "replace": "_libcamera_meson_native() {\n  local -a _lcmn_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_native_argv[@]}\"\n  append_meson_native_flags \"${_lcmn_exec_argv[@]}\"\n}\n\n_libcamera_meson_cross() {\n  local -a _lcmc_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_cross_argv[@]}\"\n  append_meson_cross_flags \"${_lcmc_exec_argv[@]}\"\n}\nappend_available_meson_provider append_meson_cross_flags _libcamera_meson_cross MESON_SETUP_ARGS\n\n_libcamera_meson_native_argv=(\"$@\")\n",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "A cross hook may install the native alias before the second top-level block is parsed."
 },
 {
  "id": "lib.meson-bound-gst-primitive-required",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "  declare -F append_available_meson_toolchain_flags append_available_meson_provider >/dev/null || { printf 'ERROR: common.sh does not provide append_available_meson_toolchain_flags\\n' >&2; return 1; }",
  "replace": "  declare -F append_available_meson_toolchain_flags >/dev/null || { printf 'ERROR: common.sh does not provide append_available_meson_toolchain_flags\\n' >&2; return 1; }",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "A guarded old core with a dispatcher but no provider primitive must fail explicitly before dispatch."
 },
 {
  "id": "lib.meson-bound-after-unconditional",
  "target": "linux/scripts/01-core/common.sh",
  "find": "    if [ -n \"${_amp_after}\" ]; then \"${_amp_after}\"; else return \"${_amp_status}\"; fi",
  "replace": "    if [ -n \"${_amp_after}\" ]; then \"${_amp_after}\" || true; else return \"${_amp_status}\"; fi",
  "test": "bash linux/scripts/tests/test-meson-dispatch.sh",
  "why": "The project callback is unconditional so strict inner failures remain fatal."
 },
 {
  "id": "lib.meson-bound-gst-cross-caller-argv",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "_gst_monorepo_meson_cross() {\n  local -a _gmmc_exec_argv=(\"$@\")\n  set --\n  append_meson_cross_flags \"${_gmmc_exec_argv[@]}\"\n}",
  "replace": "_gst_monorepo_meson_cross() {\n  local -a _gmmc_exec_argv=(\"$@\")\n  append_meson_cross_flags \"${_gmmc_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "A prefix alias containing literal positional arguments sees the original caller argv while the provider still receives its one exact array-name argument."
 },
 {
  "id": "lib.meson-bound-gst-native-caller-argv",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-monorepo.sh",
  "find": "_gst_monorepo_meson_native() {\n  local -a _gmmn_exec_argv=(\"$@\")\n  set --\n  append_meson_native_flags \"${_gmmn_exec_argv[@]}\"\n}",
  "replace": "_gst_monorepo_meson_native() {\n  local -a _gmmn_exec_argv=(\"$@\")\n  append_meson_native_flags \"${_gmmn_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "A prefix alias containing literal positional arguments sees the original caller argv while the provider still receives its one exact array-name argument."
 },
 {
  "id": "lib.meson-bound-camera-cross-caller-argv",
  "target": "linux/scripts/03-media/build/libcamera/build-libcamera.sh",
  "find": "_libcamera_meson_cross() {\n  local -a _lcmc_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_cross_argv[@]}\"\n  append_meson_cross_flags \"${_lcmc_exec_argv[@]}\"\n}",
  "replace": "_libcamera_meson_cross() {\n  local -a _lcmc_exec_argv=(\"$@\")\n  append_meson_cross_flags \"${_lcmc_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "A prefix alias containing literal positional arguments sees the original caller argv while the provider still receives its one exact array-name argument."
 },
 {
  "id": "lib.meson-bound-camera-native-caller-argv",
  "target": "linux/scripts/03-media/build/libcamera/build-libcamera.sh",
  "find": "_libcamera_meson_native() {\n  local -a _lcmn_exec_argv=(\"$@\")\n  set -- \"${_libcamera_meson_native_argv[@]}\"\n  append_meson_native_flags \"${_lcmn_exec_argv[@]}\"\n}",
  "replace": "_libcamera_meson_native() {\n  local -a _lcmn_exec_argv=(\"$@\")\n  append_meson_native_flags \"${_lcmn_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "A prefix alias containing literal positional arguments sees the original caller argv while the provider still receives its one exact array-name argument."
 },
 {
  "id": "lib.meson-bound-core-cross-caller-argv",
  "target": "linux/scripts/01-core/common.sh",
  "find": "_common_meson_cross() {\n  local -a _cmc_exec_argv=(\"$@\")\n  set -- \"${_amtf_caller_argv[@]}\"\n  append_meson_cross_flags \"${_cmc_exec_argv[@]}\"\n}",
  "replace": "_common_meson_cross() {\n  local -a _cmc_exec_argv=(\"$@\")\n  append_meson_cross_flags \"${_cmc_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "A prefix alias containing literal positional arguments sees the original caller argv while the provider still receives its one exact array-name argument."
 },
 {
  "id": "lib.meson-bound-core-native-caller-argv",
  "target": "linux/scripts/01-core/common.sh",
  "find": "_common_meson_native() {\n  local -a _cmn_exec_argv=(\"$@\")\n  set -- \"${_amtf_caller_argv[@]}\"\n  append_meson_native_flags \"${_cmn_exec_argv[@]}\"\n}",
  "replace": "_common_meson_native() {\n  local -a _cmn_exec_argv=(\"$@\")\n  append_meson_native_flags \"${_cmn_exec_argv[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-meson-bound-providers.sh",
  "why": "A prefix alias containing literal positional arguments sees the original caller argv while the provider still receives its one exact array-name argument."
 },
 {
  "id": "lib.header-discovery-litert-caller-argv",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "_litert_header_caller_argv=(\"$@\")",
  "replace": "_litert_header_caller_argv=()",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "The original enclosing arguments, including empty tails, remain available to prefix aliases."
 },
 {
  "id": "lib.header-discovery-litert-alias-argv",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "set -- \"${_litert_header_caller_argv[@]}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "The literal find alias expands against enclosing arguments rather than generated tool arguments."
 },
 {
  "id": "lib.header-discovery-litert-exec-argv",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "find \"${_litert_header_exec_argv[@]}\"",
  "replace": "find \"$@\"",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "Restoring alias positional arguments must not replace the actual finder roots, selectors or final print/quit options."
 },
 {
  "id": "lib.header-discovery-ort-caller-argv",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "_trtep_header_caller_argv=(\"$@\")",
  "replace": "_trtep_header_caller_argv=()",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "The original enclosing arguments, including empty tails, remain available to prefix aliases."
 },
 {
  "id": "lib.header-discovery-ort-alias-argv",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "set -- \"${_trtep_header_caller_argv[@]}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "The literal find alias expands against enclosing arguments rather than generated tool arguments."
 },
 {
  "id": "lib.header-discovery-ort-exec-argv",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "find \"${_trtep_header_exec_argv[@]}\"",
  "replace": "find \"$@\"",
  "test": "bash linux/scripts/tests/test-header-discovery.sh",
  "why": "Restoring alias positional arguments must not replace the actual finder roots, selectors or final print/quit options."
 },
 {
  "id": "lib.compiler-candidate-ordered-names",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "_resolve_build_gcc_candidates _rhcf_found \"${compiler}\" \"${alternate}\"",
  "replace": "_resolve_build_gcc_candidates _rhcf_found \"${alternate}\" \"${compiler}\"",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "the primary GCC name remains authoritative over its cc or c++ alias"
 },
 {
  "id": "lib.compiler-candidate-test-order",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    case \"${_rbg_first}\" in\n      1) _rbg_first=0 ;;\n      *) [ -n \"${resolved}\" ] && break ;;\n    esac",
  "replace": "    [ -n \"${resolved}\" ] && break",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "the ordered loop retains the exact nonempty-test count and placement between producer calls"
 },
 {
  "id": "lib.compiler-candidate-first-result",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "*) [ -n \"${resolved}\" ] && break ;;",
  "replace": "*) [ -n \"${resolved}\" ] && : ;;",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "a valid first candidate stops resolution before the alternate producer can replace it"
 },
 {
  "id": "lib.compiler-candidate-producer-advisory",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "resolve_build_gcc_tool \"${_rbg_tool}\" 2>/dev/null || true",
  "replace": "resolve_build_gcc_tool \"${_rbg_tool}\" 2>/dev/null",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "partial output from a failed optional producer remains usable without changing its historical status normalization"
 },
 {
  "id": "lib.compiler-candidate-producer-quiet",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "resolve_build_gcc_tool \"${_rbg_tool}\" 2>/dev/null || true",
  "replace": "resolve_build_gcc_tool \"${_rbg_tool}\" || true",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "optional resolver stderr stays suppressed while candidate stdout is preserved"
 },
 {
  "id": "lib.compiler-candidate-live-result",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "resolved=\"$(resolve_build_gcc_tool \"${_rbg_tool}\" 2>/dev/null || true)\"",
  "replace": "_rbg_shadow=\"$(resolve_build_gcc_tool \"${_rbg_tool}\" 2>/dev/null || true)\"",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "captures update the same caller-local resolved binding that subsequent resolver hooks observe"
 },
 {
  "id": "lib.compiler-candidate-publication-signal",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "_rbg_found=1;",
  "replace": "_rbg_found=2;",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "successful publication tells the public resolver to return instead of appending an unrelated fallback path"
 },
 {
  "id": "lib.compiler-candidate-caller-return",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "case \"${_rhcf_found}\" in 1) return 0 ;; esac",
  "replace": "case \"${_rhcf_found}\" in 1) : ;; esac",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "publishing a build-tool path prevents any triplet, filesystem or PATH fallback"
 },
 {
  "id": "lib.compiler-candidate-direct-publication",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "_resolve_build_gcc_candidates _rhcf_found \"${compiler}\" \"${alternate}\"",
  "replace": "_rhcf_capture=\"$(_resolve_build_gcc_candidates _rhcf_found \"${compiler}\" \"${alternate}\")\"",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "publication and its found flag stay in the caller shell rather than being lost in an extra capture"
 },
 {
  "id": "lib.compiler-candidate-printf-failure",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "printf '%s' \"${resolved}\"; _rbg_found=1;",
  "replace": "printf '%s' \"${resolved}\" || true; _rbg_found=1;",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "strict printf failure remains fatal while conditional callers retain the original forced-success behavior"
 },
 {
  "id": "lib.compiler-candidate-late-producer-binding",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "$(resolve_build_gcc_tool \"${_rbg_tool}\" 2>/dev/null || true)",
  "replace": "$(command resolve_build_gcc_tool \"${_rbg_tool}\" 2>/dev/null || true)",
  "test": "bash linux/scripts/tests/test-compiler-candidates.sh",
  "why": "late aliases and caller-provided resolver functions retain their original lookup precedence"
 },
 {
  "id": "lib.target-rust-callback-caller-scope",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "  local _cctre_output=\"$1\" _cctre_field",
  "replace": "  local _cctre_output=\"$1\" _cctre_field\n  local output=SHADOW_OUTPUT field=SHADOW_FIELD probe=SHADOW_PROBE",
  "test": "bash linux/scripts/tests/test-target-rust-callback-scope.sh",
  "why": "provided hooks keep literal global and caller-local output, field and probe bindings through the actual GStreamer caller"
 },
 {
  "id": "lib.target-rust-callback-alias-binding",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "_cctre_provider 2>/dev/null || true",
  "replace": "\"cross_target_${_cctre_field}_rust\" 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-target-rust-callback-scope.sh",
  "why": "alias-only and late-bound providers execute just as the original literal captures did"
 },
 {
  "id": "lib.target-rust-callback-captured-scope",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "      printf -v \"${_cctre_output}[${_cctre_field}]\" '%s' \"$(\n        case \"${_cctre_field}\" in\n          upper) _cctre_provider() { cross_target_upper_rust; } ;;\n          lower) _cctre_provider() { cross_target_lower_rust; } ;;\n        esac\n        _cctre_provider 2>/dev/null || true\n      )\"",
  "replace": "      case \"${_cctre_field}\" in\n        upper) _cctre_provider() { cross_target_upper_rust; } ;;\n        lower) _cctre_provider() { cross_target_lower_rust; } ;;\n      esac\n      printf -v \"${_cctre_output}[${_cctre_field}]\" '%s' \"$(_cctre_provider 2>/dev/null || true)\"",
  "test": "bash linux/scripts/tests/test-target-rust-callback-scope.sh",
  "why": "provider transport declarations stay in the original captured subshell and never persist as parent functions"
 },
 {
  "id": "lib.target-rust-callback-required-output",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "local _cctre_output=\"$1\" _cctre_field",
  "replace": "local _cctre_output=\"${1:-}\" _cctre_field",
  "test": "bash linux/scripts/tests/test-target-rust-callback-scope.sh",
  "why": "the required output operand retains native nounset failure even when no optional provider exists"
 },
 {
  "id": "lib.target-rust-callback-probe-order",
  "target": "linux/scripts/01-core/cross-env.sh",
  "find": "for _cctre_field in upper lower; do",
  "replace": "for _cctre_field in lower upper; do",
  "test": "bash linux/scripts/tests/test-target-rust-callback-scope.sh",
  "why": "the lower hook sees the published upper field after exactly one ordered availability check and probe per field"
 },
 {
  "id": "lib.npm-python-metadata-caller-argv",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "_npm_python_quiet _npm_metadata_python \"$@\"",
  "replace": "_npm_python_quiet _npm_metadata_python",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "Prefix aliases retain original enclosing package arguments separately from interpreter arguments."
 },
 {
  "id": "lib.npm-python-digest-caller-argv",
  "target": "linux/scripts/03-media/build/litert/install-litert-web.sh",
  "find": "_npm_python_quiet _npm_digest_python \"$@\"",
  "replace": "_npm_python_quiet _npm_digest_python",
  "test": "bash linux/scripts/tests/test-npm-python-transport.sh",
  "why": "Prefix aliases retain original enclosing package arguments separately from interpreter arguments."
 },
 {
  "id": "lib.cli-help-exit",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "  exit 0\n",
  "replace": "  return 0\n",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "help terminates its process instead of returning to caller work after rendering usage"
 },
 {
  "id": "lib.cli-help-success",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "  exit 0\n",
  "replace": "  exit 1\n",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "a successful help request retains its exact zero status"
 },
 {
  "id": "lib.cli-help-arguments",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "  \"${1:?usage command required}\" \"${@:2}\"",
  "replace": "  \"${1:?usage command required}\" ${*:2}",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "usage callback arguments retain spaces and explicitly empty values"
 },
 {
  "id": "lib.cli-help-requires-command",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "  \"${1:?usage command required}\" \"${@:2}\"",
  "replace": "  \"${1:-:}\" \"${@:2}\"",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "the new usage exit API refuses a missing callback rather than silently succeeding"
 },
 {
  "id": "lib.cli-help-strict-failure",
  "target": "linux/scripts/01-core/logging.sh",
  "find": "  \"${1:?usage command required}\" \"${@:2}\"",
  "replace": "  \"${1:?usage command required}\" \"${@:2}\" || true",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "the callback remains unconditional so strict help failures are not swallowed by an added OR wrapper"
 },
 {
  "id": "lib.cli-help-stop-binding",
  "target": "linux/scripts/stop-cross-chain.sh",
  "find": "show_usage_and_exit _stop_usage \"$@\"; exit $?",
  "replace": "show_usage_and_exit usage \"$@\"; exit $?",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "help uses the command binding captured at the original parser declaration phase"
 },
 {
  "id": "lib.cli-help-stop-missing-api",
  "target": "linux/scripts/stop-cross-chain.sh",
  "find": "show_usage_and_exit _stop_usage \"$@\"; exit $?",
  "replace": "show_usage_and_exit _stop_usage \"$@\"",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "a missing shared helper stops a conditional parser before cleanup or container work"
 },
 {
  "id": "lib.cli-help-parity-binding",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "show_usage_and_exit _parity_usage \"$@\"; exit $?",
  "replace": "show_usage_and_exit usage \"$@\"; exit $?",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "help uses the command binding captured at the original parser declaration phase"
 },
 {
  "id": "lib.cli-help-parity-missing-api",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "show_usage_and_exit _parity_usage \"$@\"; exit $?",
  "replace": "show_usage_and_exit _parity_usage \"$@\"",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "a missing shared helper stops a conditional parser before cleanup or container work"
 },
 {
  "id": "lib.cli-help-stop-argument-context",
  "target": "linux/scripts/stop-cross-chain.sh",
  "find": "show_usage_and_exit _stop_usage \"$@\"; exit $?",
  "replace": "show_usage_and_exit _stop_usage; exit $?",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "Command-prefix usage aliases retain the original parser argument context after preceding options were shifted."
 },
 {
  "id": "lib.cli-help-parity-argument-context",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "show_usage_and_exit _parity_usage \"$@\"; exit $?",
  "replace": "show_usage_and_exit _parity_usage; exit $?",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "Command-prefix usage aliases retain the original parser argument context after preceding options were shifted."
 },
 {
  "id": "lib.lifecycle-fixture-retention-budget",
  "target": "linux/scripts/tests/test-chain-lifecycle.sh",
  "find": "  CROSS_LOG_ARCHIVE_KEEP=\"$1\"",
  "replace": "  CROSS_LOG_ARCHIVE_KEEP=99",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "Every shared fixture applies its requested retention budget rather than a stale or fixed keep count."
 },
 {
  "id": "lib.lifecycle-fixture-retention-order",
  "target": "linux/scripts/tests/test-chain-lifecycle.sh",
  "find": "_prune_archive_with_keep() {\n  CROSS_LOG_ARCHIVE_KEEP=\"$1\"\n  _chain_prune_archived_logs\n}",
  "replace": "_prune_archive_with_keep() {\n  _chain_prune_archived_logs\n  CROSS_LOG_ARCHIVE_KEEP=\"$1\"\n}",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "The requested fixture budget is visible before the real prune runs, and its failure status remains observable."
 },
 {
  "id": "lib.lifecycle-fixture-retention-execution",
  "target": "linux/scripts/tests/test-chain-lifecycle.sh",
  "find": "_prune_archive_with_keep() {\n  CROSS_LOG_ARCHIVE_KEEP=\"$1\"\n  _chain_prune_archived_logs\n}",
  "replace": "_prune_archive_with_keep() {\n  CROSS_LOG_ARCHIVE_KEEP=\"$1\"\n  :\n}",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "Shared fixture setup executes the production prune; configuring a budget alone cannot satisfy archive assertions."
 },
 {
  "id": "lib.host-cargo-preparation-compiler-required",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "prepare_and_publish_host_cargo_compiler() {\n  local -n _pphc_wrapper=\"$1\"\n  local _pphc_compiler=\"$2\" _pphc_prepare=\"$3\" _pphc_publish=\"$4\"\n  if [ -n \"${_pphc_compiler}\" ]; then\n    _pphc_wrapper=\"$(\"${_pphc_prepare}\")\"\n    \"${_pphc_publish}\"\n  fi\n  return $?\n}",
  "replace": "prepare_and_publish_host_cargo_compiler() {\n  local -n _pphc_wrapper=\"$1\"\n  local _pphc_compiler=\"$2\" _pphc_prepare=\"$3\" _pphc_publish=\"$4\"\n  if true; then\n    _pphc_wrapper=\"$(\"${_pphc_prepare}\")\"\n    \"${_pphc_publish}\"\n  fi\n  return $?\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Empty compiler resolution skips wrapper creation and publication without touching the caller slots."
 },
 {
  "id": "lib.host-cargo-preparation-wrapper-required",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    _pphc_wrapper=\"$(\"${_pphc_prepare}\")\"",
  "replace": "    _pphc_wrapper=\"\"",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Selected compiler wrappers must be prepared before the caller publishes their paths."
 },
 {
  "id": "lib.host-cargo-preparation-publication-required",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    \"${_pphc_publish}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Host compiler bindings are published in the parent after wrapper creation."
 },
 {
  "id": "lib.host-cargo-preparation-wrapper-raw-failure",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    _pphc_wrapper=\"$(\"${_pphc_prepare}\")\"",
  "replace": "    _pphc_wrapper=\"$(\"${_pphc_prepare}\" || true)\"",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "A failed captured wrapper retains direct strict failure and conditional partial-publication behavior."
 },
 {
  "id": "lib.host-cargo-preparation-publication-unconditional",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    \"${_pphc_publish}\"",
  "replace": "    \"${_pphc_publish}\" || true",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "A failed publication remains strict when the original caller was strict."
 },
 {
  "id": "lib.host-cargo-preparation-wrapper-isolated",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    _pphc_wrapper=\"$(\"${_pphc_prepare}\")\"",
  "replace": "    \"${_pphc_prepare}\"",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Wrapper stdout is captured and wrapper mutations stay in the original subshell rather than leaking to the parent."
 },
 {
  "id": "lib.host-cargo-preparation-output-slot",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  local -n _pphc_wrapper=\"$1\"",
  "replace": "  local -n _pphc_wrapper=cargo_host_cc",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "The prepared wrapper updates the original selected wrapper slot rather than the resolved compiler slot."
 },
 {
  "id": "lib.host-cargo-preparation-publication-order",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    _pphc_wrapper=\"$(\"${_pphc_prepare}\")\"\n    \"${_pphc_publish}\"",
  "replace": "    \"${_pphc_publish}\"\n    _pphc_wrapper=\"$(\"${_pphc_prepare}\")\"",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Publication observes the completed wrapper assignment and retains compiler and language order."
 },
 {
  "id": "lib.host-cargo-preparation-setup-c-prepare-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gsh_prepare_c() {\n  prepare_cargo_host_linker_wrapper \"${cargo_host_cc}\"\n}",
  "replace": "_gsh_prepare_c() {\n  \"prepare_cargo_host_linker_wrapper\" \"${cargo_host_cc}\"\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Literal wrapper prefixes bind at the original caller declaration with empty positional context and the original compiler argument."
 },
 {
  "id": "lib.host-cargo-preparation-setup-c-publish-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gsh_publish_c() {\n  export_cargo_compiler_binding \"${build_rust_env}\" \"${build_rust_lower}\" c \"${cargo_host_linker}\" host\n}",
  "replace": "_gsh_publish_c() {\n  \"export_cargo_compiler_binding\" \"${build_rust_env}\" \"${build_rust_lower}\" c \"${cargo_host_linker}\" host\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Literal publication prefixes keep the original source binding, argument count and parent scope."
 },
 {
  "id": "lib.host-cargo-preparation-setup-cxx-prepare-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gsh_prepare_cxx() {\n  prepare_cargo_host_cxx_wrapper \"${cargo_host_cxx}\"\n}",
  "replace": "_gsh_prepare_cxx() {\n  \"prepare_cargo_host_cxx_wrapper\" \"${cargo_host_cxx}\"\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Literal wrapper prefixes bind at the original caller declaration with empty positional context and the original compiler argument."
 },
 {
  "id": "lib.host-cargo-preparation-setup-cxx-publish-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gsh_publish_cxx() {\n  export_cargo_compiler_binding \"${build_rust_env}\" \"${build_rust_lower}\" cxx \"${cargo_host_cxx_wrapper}\" host\n}",
  "replace": "_gsh_publish_cxx() {\n  \"export_cargo_compiler_binding\" \"${build_rust_env}\" \"${build_rust_lower}\" cxx \"${cargo_host_cxx_wrapper}\" host\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Literal publication prefixes keep the original source binding, argument count and parent scope."
 },
 {
  "id": "lib.host-cargo-preparation-setup-required-api",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  declare -F prepare_and_publish_host_cargo_compiler >/dev/null || { printf 'ERROR: compiler-resolution.sh lacks prepare_and_publish_host_cargo_compiler\\n' >&2; return 1; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "A selected host binding path must report a missing shared export before resolving any compiler."
 },
 {
  "id": "lib.host-cargo-preparation-setup-selected-api",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "prepare_host_cargo_toolchain_env() {\n  local build_rust_env=\"X86_64_UNKNOWN_LINUX_GNU\"\n  local build_rust_lower=\"x86_64_unknown_linux_gnu\"\n  local cargo_host_cc=\"\"\n  local cargo_host_linker=\"\"\n  local cargo_host_cxx=\"\"\n  local cargo_host_cxx_wrapper=\"\"\n\n  if ! cross_build_is_active; then\n    return 0\n  fi\n\n  declare -F prepare_and_publish_host_cargo_compiler >/dev/null || { printf 'ERROR: compiler-resolution.sh lacks prepare_and_publish_host_cargo_compiler\\n' >&2; return 1; }\n  if command -v cross_build_upper_rust >/dev/null 2>&1; then\n    build_rust_env=\"$(cross_build_upper_rust 2>/dev/null || true)\"\n  fi\n  if command -v cross_build_lower_rust >/dev/null 2>&1; then\n    build_rust_lower=\"$(cross_build_lower_rust 2>/dev/null || true)\"\n  fi\n  [ -n \"${build_rust_env}\" ] || build_rust_env=\"X86_64_UNKNOWN_LINUX_GNU\"\n  [ -n \"${build_rust_lower}\" ] || build_rust_lower=\"x86_64_unknown_linux_gnu\"\n\n  # No PATH scrub: /opt/cross-bin holds only triplet-prefixed names, so host build scripts already find the native cc.\n\n  cargo_host_cc=\"$(resolve_host_gcc_for_cargo)\"\n  prepare_and_publish_host_cargo_compiler cargo_host_linker \"${cargo_host_cc}\" _gsh_prepare_c _gsh_publish_c\n\n  cargo_host_cxx=\"$(resolve_host_gxx_for_cargo)\"\n  prepare_and_publish_host_cargo_compiler cargo_host_cxx_wrapper \"${cargo_host_cxx}\" _gsh_prepare_cxx _gsh_publish_cxx\n\n  _gst_prepare_target_cargo_env\n}",
  "replace": "prepare_host_cargo_toolchain_env() {\n  declare -F prepare_and_publish_host_cargo_compiler >/dev/null || { printf 'ERROR: compiler-resolution.sh lacks prepare_and_publish_host_cargo_compiler\\n' >&2; return 1; }\n  local build_rust_env=\"X86_64_UNKNOWN_LINUX_GNU\"\n  local build_rust_lower=\"x86_64_unknown_linux_gnu\"\n  local cargo_host_cc=\"\"\n  local cargo_host_linker=\"\"\n  local cargo_host_cxx=\"\"\n  local cargo_host_cxx_wrapper=\"\"\n\n  if ! cross_build_is_active; then\n    return 0\n  fi\n\n  if command -v cross_build_upper_rust >/dev/null 2>&1; then\n    build_rust_env=\"$(cross_build_upper_rust 2>/dev/null || true)\"\n  fi\n  if command -v cross_build_lower_rust >/dev/null 2>&1; then\n    build_rust_lower=\"$(cross_build_lower_rust 2>/dev/null || true)\"\n  fi\n  [ -n \"${build_rust_env}\" ] || build_rust_env=\"X86_64_UNKNOWN_LINUX_GNU\"\n  [ -n \"${build_rust_lower}\" ] || build_rust_lower=\"x86_64_unknown_linux_gnu\"\n\n  # No PATH scrub: /opt/cross-bin holds only triplet-prefixed names, so host build scripts already find the native cc.\n\n  cargo_host_cc=\"$(resolve_host_gcc_for_cargo)\"\n  prepare_and_publish_host_cargo_compiler cargo_host_linker \"${cargo_host_cc}\" _gsh_prepare_c _gsh_publish_c\n\n  cargo_host_cxx=\"$(resolve_host_gxx_for_cargo)\"\n  prepare_and_publish_host_cargo_compiler cargo_host_cxx_wrapper \"${cargo_host_cxx}\" _gsh_prepare_cxx _gsh_publish_cxx\n\n  _gst_prepare_target_cargo_env\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Native operation and supplied standalone host setup do not require the unused fallback helper."
 },
 {
  "id": "lib.host-cargo-preparation-setup-c-selection",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  prepare_and_publish_host_cargo_compiler cargo_host_linker \"${cargo_host_cc}\" _gsh_prepare_c _gsh_publish_c",
  "replace": "  prepare_and_publish_host_cargo_compiler cargo_host_linker \"${cargo_host_cc}\" _gsh_prepare_cxx _gsh_publish_c",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Each compiler language selects its original wrapper callback and output slot."
 },
 {
  "id": "lib.host-cargo-preparation-setup-cxx-selection",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  prepare_and_publish_host_cargo_compiler cargo_host_cxx_wrapper \"${cargo_host_cxx}\" _gsh_prepare_cxx _gsh_publish_cxx",
  "replace": "  prepare_and_publish_host_cargo_compiler cargo_host_cxx_wrapper \"${cargo_host_cxx}\" _gsh_prepare_c _gsh_publish_cxx",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Each compiler language selects its original wrapper callback and output slot."
 },
 {
  "id": "lib.host-cargo-preparation-standalone-c-prepare-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "_gsrh_prepare_c() {\n  prepare_cargo_host_linker_wrapper \"${cargo_host_cc}\"\n}",
  "replace": "_gsrh_prepare_c() {\n  \"prepare_cargo_host_linker_wrapper\" \"${cargo_host_cc}\"\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Literal wrapper prefixes bind at the original caller declaration with empty positional context and the original compiler argument."
 },
 {
  "id": "lib.host-cargo-preparation-standalone-c-publish-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "_gsrh_publish_c() {\n  export_cargo_compiler_binding \"X86_64_UNKNOWN_LINUX_GNU\" \"x86_64_unknown_linux_gnu\" c \"${cargo_host_linker}\"\n}",
  "replace": "_gsrh_publish_c() {\n  \"export_cargo_compiler_binding\" \"X86_64_UNKNOWN_LINUX_GNU\" \"x86_64_unknown_linux_gnu\" c \"${cargo_host_linker}\"\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Literal publication prefixes keep the original source binding, argument count and parent scope."
 },
 {
  "id": "lib.host-cargo-preparation-standalone-cxx-prepare-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "_gsrh_prepare_cxx() {\n  prepare_cargo_host_cxx_wrapper \"${cargo_host_cxx}\"\n}",
  "replace": "_gsrh_prepare_cxx() {\n  \"prepare_cargo_host_cxx_wrapper\" \"${cargo_host_cxx}\"\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Literal wrapper prefixes bind at the original caller declaration with empty positional context and the original compiler argument."
 },
 {
  "id": "lib.host-cargo-preparation-standalone-cxx-publish-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "_gsrh_publish_cxx() {\n  export_cargo_compiler_binding \"X86_64_UNKNOWN_LINUX_GNU\" \"x86_64_unknown_linux_gnu\" cxx \"${cargo_host_cxx_wrapper}\"\n}",
  "replace": "_gsrh_publish_cxx() {\n  \"export_cargo_compiler_binding\" \"X86_64_UNKNOWN_LINUX_GNU\" \"x86_64_unknown_linux_gnu\" cxx \"${cargo_host_cxx_wrapper}\"\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Literal publication prefixes keep the original source binding, argument count and parent scope."
 },
 {
  "id": "lib.host-cargo-preparation-standalone-required-api",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "    declare -F prepare_and_publish_host_cargo_compiler >/dev/null || { printf 'ERROR: compiler-resolution.sh lacks prepare_and_publish_host_cargo_compiler\\n' >&2; return 1; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "A selected host binding path must report a missing shared export before resolving any compiler."
 },
 {
  "id": "lib.host-cargo-preparation-standalone-selected-api",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "_gst_rs_host_cargo_config() {\n  if command -v prepare_host_cargo_toolchain_env >/dev/null 2>&1; then\n    prepare_host_cargo_toolchain_env\n  elif cross_build_is_active; then\n    declare -F prepare_and_publish_host_cargo_compiler >/dev/null || { printf 'ERROR: compiler-resolution.sh lacks prepare_and_publish_host_cargo_compiler\\n' >&2; return 1; }\n    cargo_host_cc=\"$(resolve_host_gcc_for_cargo)\"\n    prepare_and_publish_host_cargo_compiler cargo_host_linker \"${cargo_host_cc}\" _gsrh_prepare_c _gsrh_publish_c\n\n    cargo_host_cxx=\"$(resolve_host_gxx_for_cargo)\"\n    prepare_and_publish_host_cargo_compiler cargo_host_cxx_wrapper \"${cargo_host_cxx}\" _gsrh_prepare_cxx _gsrh_publish_cxx\n  fi\n\n}",
  "replace": "_gst_rs_host_cargo_config() {\n    declare -F prepare_and_publish_host_cargo_compiler >/dev/null || { printf 'ERROR: compiler-resolution.sh lacks prepare_and_publish_host_cargo_compiler\\n' >&2; return 1; }\n  if command -v prepare_host_cargo_toolchain_env >/dev/null 2>&1; then\n    prepare_host_cargo_toolchain_env\n  elif cross_build_is_active; then\n    cargo_host_cc=\"$(resolve_host_gcc_for_cargo)\"\n    prepare_and_publish_host_cargo_compiler cargo_host_linker \"${cargo_host_cc}\" _gsrh_prepare_c _gsrh_publish_c\n\n    cargo_host_cxx=\"$(resolve_host_gxx_for_cargo)\"\n    prepare_and_publish_host_cargo_compiler cargo_host_cxx_wrapper \"${cargo_host_cxx}\" _gsrh_prepare_cxx _gsrh_publish_cxx\n  fi\n\n}",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Native operation and supplied standalone host setup do not require the unused fallback helper."
 },
 {
  "id": "lib.host-cargo-preparation-standalone-c-selection",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "    prepare_and_publish_host_cargo_compiler cargo_host_linker \"${cargo_host_cc}\" _gsrh_prepare_c _gsrh_publish_c",
  "replace": "    prepare_and_publish_host_cargo_compiler cargo_host_linker \"${cargo_host_cc}\" _gsrh_prepare_cxx _gsrh_publish_c",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Each compiler language selects its original wrapper callback and output slot."
 },
 {
  "id": "lib.host-cargo-preparation-standalone-cxx-selection",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gst-plugins-rs.sh",
  "find": "    prepare_and_publish_host_cargo_compiler cargo_host_cxx_wrapper \"${cargo_host_cxx}\" _gsrh_prepare_cxx _gsrh_publish_cxx",
  "replace": "    prepare_and_publish_host_cargo_compiler cargo_host_cxx_wrapper \"${cargo_host_cxx}\" _gsrh_prepare_c _gsrh_publish_cxx",
  "test": "bash linux/scripts/tests/test-host-cargo-preparation.sh",
  "why": "Each compiler language selects its original wrapper callback and output slot."
 },
 {
  "id": "lib.media-pin-advisory",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "\"$2\" \"${@:3}\" || true",
  "replace": "\"$2\" \"${@:3}\"",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "An optional pin failure remains advisory under both strict and conditional callers."
 },
 {
  "id": "lib.media-pin-quiet-lookup",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "if \"$1\" \"${@:3}\" >/dev/null 2>&1; then",
  "replace": "if \"$1\" \"${@:3}\"; then",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "Availability output stays quiet without suppressing the actual pin output."
 },
 {
  "id": "lib.media-pin-availability",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "if \"$1\" \"${@:3}\" >/dev/null 2>&1; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "A missing optional provider skips invocation and the FFmpeg target query."
 },
 {
  "id": "lib.media-pin-lookup-argv",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "if \"$1\" \"${@:3}\" >/dev/null 2>&1; then",
  "replace": "if \"$1\" \"$@\" >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "Lookup prefix aliases see the original enclosing arguments rather than adapter metadata."
 },
 {
  "id": "lib.media-pin-invoke-argv",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "\"$2\" \"${@:3}\" || true",
  "replace": "\"$2\" \"${@:4}\" || true",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "Pin prefix aliases retain every caller argument, including an empty tail."
 },
 {
  "id": "lib.media-pin-caller-scope",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "media_pin_target_libstdcxx_if_available() {\n",
  "replace": "media_pin_target_libstdcxx_if_available() {\n  local host_cc=helper\n",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "Provided pin functions observe the original FFmpeg caller scope without generic helper locals."
 },
 {
  "id": "lib.media-pin-ff-query-lazy",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "_ffmpeg_pin_available() {\n",
  "replace": "_ffmpeg_pin_available() {\n    cross_target_arch >/dev/null\n",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "FFmpeg resolves the pin target only after provider availability succeeds."
 },
 {
  "id": "lib.media-pin-ff-pin-binding",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "pin_target_libstdcxx \"$(cross_target_arch)\"",
  "replace": "\"pin_target_libstdcxx\" \"$(cross_target_arch)\"",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "Invocation aliases stay bound at the original caller parse point."
 },
 {
  "id": "lib.media-pin-ff-lookup-binding",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "_ffmpeg_pin_available() {\n    command -v pin_target_libstdcxx\n}",
  "replace": "_ffmpeg_pin_available() {\n    builtin command -v pin_target_libstdcxx\n}",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "Lookup aliases retain their caller parse-time binding and positional context."
 },
 {
  "id": "lib.media-pin-ff-required-api-status",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "declare -F media_pin_target_libstdcxx_if_available >/dev/null || { printf 'ERROR: runtime pinning requires media_pin_target_libstdcxx_if_available from media common.sh\\n' >&2; return 1; }",
  "replace": "declare -F media_pin_target_libstdcxx_if_available >/dev/null || { printf 'ERROR: runtime pinning requires media_pin_target_libstdcxx_if_available from media common.sh\\n' >&2; return 0; }",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "An old required owner cannot report an error and still turn the selected caller green."
 },
 {
  "id": "lib.media-pin-gst-pin-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-stage.sh",
  "find": "pin_target_libstdcxx \"${TARGET_ARCH:-${TARGETARCH:-}}\"",
  "replace": "\"pin_target_libstdcxx\" \"${TARGET_ARCH:-${TARGETARCH:-}}\"",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "Invocation aliases stay bound at the original caller parse point."
 },
 {
  "id": "lib.media-pin-gst-lookup-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-stage.sh",
  "find": "_gst_pin_available() {\n  command -v pin_target_libstdcxx\n}",
  "replace": "_gst_pin_available() {\n  builtin command -v pin_target_libstdcxx\n}",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "Lookup aliases retain their caller parse-time binding and positional context."
 },
 {
  "id": "lib.media-pin-gst-required-api-status",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-stage.sh",
  "find": "declare -F media_pin_target_libstdcxx_if_available >/dev/null || { printf 'ERROR: runtime pinning requires media_pin_target_libstdcxx_if_available from media common.sh\\n' >&2; exit 1; }",
  "replace": "declare -F media_pin_target_libstdcxx_if_available >/dev/null || { printf 'ERROR: runtime pinning requires media_pin_target_libstdcxx_if_available from media common.sh\\n' >&2; exit 0; }",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "An old required owner cannot report an error and still turn the selected caller green."
 },
 {
  "id": "lib.media-pin-gst-target-fallback",
  "target": "linux/scripts/03-media/build/gstreamer/common/build-gstreamer-stage.sh",
  "find": "pin_target_libstdcxx \"${TARGET_ARCH:-${TARGETARCH:-}}\"",
  "replace": "pin_target_libstdcxx \"${TARGET_ARCH:-}\"",
  "test": "bash linux/scripts/tests/test-media-pin-advisory.sh",
  "why": "The GStreamer pin keeps TARGET_ARCH precedence and TARGETARCH fallback independently of its gate."
 },
 {
  "id": "lib.sudo-policy-nonroot-selection",
  "target": "linux/scripts/01-core/sudo-policy.sh",
  "find": "if \"$1\" \"${@:6}\"; then",
  "replace": "if ! \"$1\" \"${@:6}\"; then",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Root and nonroot branches retain their original privilege predicate and publisher selection."
 },
 {
  "id": "lib.sudo-policy-availability-enforced",
  "target": "linux/scripts/01-core/sudo-policy.sh",
  "find": "\"$2\" \"${@:6}\" >/dev/null 2>&1 || \"$3\" \"${@:6}\"",
  "replace": "\"$2\" \"${@:6}\" >/dev/null 2>&1 || true",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "A missing sudo command reaches the original bound die action before publication."
 },
 {
  "id": "lib.sudo-policy-availability-quiet",
  "target": "linux/scripts/01-core/sudo-policy.sh",
  "find": "\"$2\" \"${@:6}\" >/dev/null 2>&1",
  "replace": "\"$2\" \"${@:6}\"",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Availability probes remain quiet while callbacks retain parent-shell effects."
 },
 {
  "id": "lib.sudo-policy-nonroot-publisher",
  "target": "linux/scripts/01-core/sudo-policy.sh",
  "find": "    \"$4\" \"${@:6}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Selected nonroot publication executes in the caller shell and writes the original outputs."
 },
 {
  "id": "lib.sudo-policy-root-publisher",
  "target": "linux/scripts/01-core/sudo-policy.sh",
  "find": "    \"$5\" \"${@:6}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Selected root publication clears only the fields owned by that caller."
 },
 {
  "id": "lib.sudo-policy-availability-argv",
  "target": "linux/scripts/01-core/sudo-policy.sh",
  "find": "\"$2\" \"${@:6}\" >/dev/null 2>&1",
  "replace": "\"$2\" >/dev/null 2>&1",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Even quiet availability callbacks retain the original caller arguments including empty values."
 },
 {
  "id": "lib.sudo-policy-publisher-status",
  "target": "linux/scripts/01-core/sudo-policy.sh",
  "find": "  return $?",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "The shared policy returns the selected publisher status instead of hiding a failed publication."
 },
 {
  "id": "lib.sudo-policy-parent-scope",
  "target": "linux/scripts/01-core/sudo-policy.sh",
  "find": "sudo_policy_select() {\n",
  "replace": "sudo_policy_select() {\n  local SUDO=masked SUDO_WRAP=masked\n",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "New helper locals must not hide the parent SUDO outputs read by original publishers."
 },
 {
  "id": "lib.sudo-policy-common-before-clear",
  "target": "linux/scripts/01-core/common.sh",
  "find": "require_sudo() {\n",
  "replace": "require_sudo() {\n  unset -f sudo_policy_select || return $?\n",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Common delegates to the SDK wrapper before touching a readonly existing policy or importing a missing leaf."
 },
 {
  "id": "lib.sudo-policy-common-fresh-export",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  unset -f sudo_policy_select || return $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "A stale policy cannot satisfy a selected Common leaf that has no export."
 },
 {
  "id": "lib.sudo-policy-bootstrap-fresh-export",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  unset -f sudo_policy_select || exit $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "A stale policy cannot satisfy required-export validation for an empty selected fallback leaf."
 },
 {
  "id": "lib.sudo-policy-common-clear-status",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  unset -f sudo_policy_select || return $?",
  "replace": "  unset -f sudo_policy_select || true",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "A failed clear of a readonly old export cannot continue into an empty leaf and reuse the stale function."
 },
 {
  "id": "lib.sudo-policy-bootstrap-clear-status",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  unset -f sudo_policy_select || exit $?",
  "replace": "  unset -f sudo_policy_select || true",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Bootstrap keeps a failed readonly export clear fatal instead of accepting the stale export from an empty file."
 },
 {
  "id": "lib.sudo-policy-common-source-status",
  "target": "linux/scripts/01-core/common.sh",
  "find": "source \"${_COMMON_SH_DIR}/sudo-policy.sh\" || return $?",
  "replace": "source \"${_COMMON_SH_DIR}/sudo-policy.sh\" || true",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Common preserves a selected leaf failure even if the file defines the expected function first."
 },
 {
  "id": "lib.sudo-policy-common-required-api",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  declare -F sudo_policy_select >/dev/null || { printf 'ERROR: sudo policy API missing\\n' >&2; return 1; }",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Common rejects an empty fresh leaf with the named API diagnostic before undefined-command fallthrough."
 },
 {
  "id": "lib.sudo-policy-bootstrap-required-api",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "source_toolchain_required \"$_TOOLCHAIN_BOOTSTRAP_OWNER_DIR\" sudo-policy.sh exit core-paths-only sudo_policy_select",
  "replace": "source_toolchain_required \"$_TOOLCHAIN_BOOTSTRAP_OWNER_DIR\" sudo-policy.sh exit core-paths-only",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Bootstrap validates the required sudo export rather than accepting only file presence."
 },
 {
  "id": "lib.sudo-policy-bootstrap-owner-route",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "source_toolchain_required \"$_TOOLCHAIN_BOOTSTRAP_OWNER_DIR\" sudo-policy.sh",
  "replace": "source_toolchain_required \"$script_dir\" sudo-policy.sh",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "An unrelated project directory cannot hide the canonical owner companion or change original common-file lookup."
 },
 {
  "id": "lib.sudo-policy-common-wrap-output",
  "target": "linux/scripts/01-core/common.sh",
  "find": "_common_sudo_publish_nonroot() {\n  SUDO=\"sudo\"\n  SUDO_WRAP=\"sudo\"\n}",
  "replace": "_common_sudo_publish_nonroot() {\n  SUDO=\"sudo\"\n}",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Common preserves both SUDO and SUDO_WRAP publication for nonroot fallback callers."
 },
 {
  "id": "lib.sudo-policy-bootstrap-wrap-untouched",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "  _toolchain_sudo_publish_nonroot() { SUDO=\"sudo\"; }\n  _toolchain_sudo_publish_root() { SUDO=\"\"; }",
  "replace": "  _toolchain_sudo_publish_nonroot() { SUDO=\"sudo\"; SUDO_WRAP=\"sudo\"; }\n  _toolchain_sudo_publish_root() { SUDO=\"\"; SUDO_WRAP=\"\"; }",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Bootstrap preserves seeded or readonly SUDO_WRAP in both privilege branches."
 },
 {
  "id": "lib.sudo-policy-source-time-owner",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "source_toolchain_required \"$_TOOLCHAIN_BOOTSTRAP_OWNER_DIR\" sudo-policy.sh",
  "replace": "source_toolchain_required \"$(dirname \"${BASH_SOURCE[0]}\")\" sudo-policy.sh",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "A bare or relative import retains its original owner after the caller changes directories."
 },
 {
  "id": "lib.sudo-policy-owner-global",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "declare -g +x _TOOLCHAIN_BOOTSTRAP_OWNER_DIR=",
  "replace": "declare +x _TOOLCHAIN_BOOTSTRAP_OWNER_DIR=",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Owner provenance survives a temporary importing function before later fallback initialization."
 },
 {
  "id": "lib.sudo-policy-owner-private",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "declare -g +x _TOOLCHAIN_BOOTSTRAP_OWNER_DIR=",
  "replace": "declare -g -x _TOOLCHAIN_BOOTSTRAP_OWNER_DIR=",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "Internal source provenance cannot leak as a newly exported child-process setting."
 },
 {
  "id": "lib.sudo-policy-owner-pwd-unset",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "${PWD:-$(builtin pwd)}",
  "replace": "${PWD}",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "A valid relative import still works when PWD was unset before sourcing."
 },
 {
  "id": "lib.sudo-policy-owner-pwd-builtin",
  "target": "linux/scripts/02-toolchain/bootstrap.sh",
  "find": "${PWD:-$(builtin pwd)}",
  "replace": "${PWD:-$(pwd)}",
  "test": "bash linux/scripts/tests/test-sudo-policy.sh",
  "why": "The rare missing-PWD path uses the Bash builtin rather than an overridden SDK pwd function."
 },
 {
  "id": "lib.target-cargo-target-required",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if [ -n \"${_ctp_target}\" ] && \"${_ctp_available}\"; then",
  "replace": "  if \"${_ctp_available}\"; then",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "An empty Rust target must skip resolver availability, captures and publication."
 },
 {
  "id": "lib.target-cargo-availability-required",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if [ -n \"${_ctp_target}\" ] && \"${_ctp_available}\"; then",
  "replace": "  if [ -n \"${_ctp_target}\" ]; then",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "A missing target resolver skips the selected preparation path."
 },
 {
  "id": "lib.target-cargo-body-required",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    \"${_ctp_prepare_publish}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "The selected target path performs preparation and parent publication."
 },
 {
  "id": "lib.target-cargo-body-parent-scope",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    \"${_ctp_prepare_publish}\"",
  "replace": "    _ctp_unused=\"$(\"${_ctp_prepare_publish}\")\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Preparation and publication run in the original parent rather than a newly captured child."
 },
 {
  "id": "lib.target-cargo-body-unconditional",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    \"${_ctp_prepare_publish}\"",
  "replace": "    \"${_ctp_prepare_publish}\" || true",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "The selected body keeps original strict failures and ignored-errexit partial publication."
 },
 {
  "id": "lib.target-cargo-body-once",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "    \"${_ctp_prepare_publish}\"",
  "replace": "    \"${_ctp_prepare_publish}\"\n    \"${_ctp_prepare_publish}\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Each selected path performs its original one Rice or two independent GStreamer resolver captures once."
 },
 {
  "id": "lib.target-cargo-body-raw-result",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "cargo_target_pipeline() {\n  local _ctp_target=\"$1\" _ctp_available=\"$2\" _ctp_prepare_publish=\"$3\"\n  if [ -n \"${_ctp_target}\" ] && \"${_ctp_available}\"; then\n    \"${_ctp_prepare_publish}\"\n  fi\n  return $?\n}",
  "replace": "cargo_target_pipeline() {\n  local _ctp_target=\"$1\" _ctp_available=\"$2\" _ctp_prepare_publish=\"$3\"\n  if [ -n \"${_ctp_target}\" ] && \"${_ctp_available}\"; then\n    \"${_ctp_prepare_publish}\"\n  fi\n  return 0\n}",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "A failed publisher diagnostic retains its raw selected-body status for the caller."
 },
 {
  "id": "lib.target-cargo-availability-once",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if [ -n \"${_ctp_target}\" ] && \"${_ctp_available}\"; then",
  "replace": "  if [ -n \"${_ctp_target}\" ] && \"${_ctp_available}\" && \"${_ctp_available}\"; then",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Availability callbacks and their parent mutations occur once, before preparation."
 },
 {
  "id": "lib.target-cargo-target-quoted",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if [ -n \"${_ctp_target}\" ] && \"${_ctp_available}\"; then",
  "replace": "  if [ -n ${_ctp_target} ] && \"${_ctp_available}\"; then",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Raw Rust target values retain whitespace, newlines and literal glob characters."
 },
 {
  "id": "lib.target-cargo-resolver-stdout-quiet",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if \"${_crcf_resolve}\" >/dev/null 2>&1; then",
  "replace": "  if \"${_crcf_resolve}\" 2>/dev/null; then",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Resolver stdout is diagnostic noise and cannot become a compiler path."
 },
 {
  "id": "lib.target-cargo-resolver-stderr-quiet",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if \"${_crcf_resolve}\" >/dev/null 2>&1; then",
  "replace": "  if \"${_crcf_resolve}\" >/dev/null; then",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Resolver stderr remains suppressed without suppressing the projected compiler value."
 },
 {
  "id": "lib.target-cargo-resolver-success-required",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if \"${_crcf_resolve}\" >/dev/null 2>&1; then",
  "replace": "  if \"${_crcf_resolve}\" >/dev/null 2>&1 || true; then",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "A failed resolver cannot publish its partial CC or CXX mutation."
 },
 {
  "id": "lib.target-cargo-resolver-noarg-context",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if \"${_crcf_resolve}\" >/dev/null 2>&1; then",
  "replace": "  if \"${_crcf_resolve}\" \"${_crcf_field}\" >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Bound resolver callbacks receive the original empty positional context, not the field selector."
 },
 {
  "id": "lib.target-cargo-resolver-once",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "  if \"${_crcf_resolve}\" >/dev/null 2>&1; then",
  "replace": "  if \"${_crcf_resolve}\" >/dev/null 2>&1; then :; fi\n  if \"${_crcf_resolve}\" >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "The field projection retains the original resolver call count and order in each existing capture."
 },
 {
  "id": "lib.target-cargo-CC-field",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "      CC) \"${_crcf_printf}\" \"${CC:-}\" ;;",
  "replace": "      CC) \"${_crcf_printf}\" \"${CXX:-}\" ;;",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "CC projection reads CC from that successful resolver call."
 },
 {
  "id": "lib.target-cargo-CXX-field",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "      CXX) \"${_crcf_printf}\" \"${CXX:-}\" ;;",
  "replace": "      CXX) \"${_crcf_printf}\" \"${CC:-}\" ;;",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "CXX projection reads CXX from its separate successful resolver call."
 },
 {
  "id": "lib.target-cargo-invalid-field",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "      *) return 2 ;;",
  "replace": "      *) return 0 ;;",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Unknown field selectors fail explicitly rather than producing a successful empty projection."
 },
 {
  "id": "lib.target-cargo-resolver-raw-status",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "cargo_resolved_compiler_field() {\n  local _crcf_field=\"$1\" _crcf_resolve=\"$2\" _crcf_printf=\"$3\"\n  if \"${_crcf_resolve}\" >/dev/null 2>&1; then\n    case \"${_crcf_field}\" in\n      CC) \"${_crcf_printf}\" \"${CC:-}\" ;;\n      CXX) \"${_crcf_printf}\" \"${CXX:-}\" ;;\n      *) return 2 ;;\n    esac\n  else\n    return $?\n  fi\n  return $?\n}",
  "replace": "cargo_resolved_compiler_field() {\n  local _crcf_field=\"$1\" _crcf_resolve=\"$2\" _crcf_printf=\"$3\"\n  if \"${_crcf_resolve}\" >/dev/null 2>&1; then\n    case \"${_crcf_field}\" in\n      CC) \"${_crcf_printf}\" \"${CC:-}\" ;;\n      CXX) \"${_crcf_printf}\" \"${CXX:-}\" ;;\n      *) return 2 ;;\n    esac\n  else\n    return 1\n  fi\n  return $?\n}",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Raw resolver failures retain their original status in the surrounding assignment."
 },
 {
  "id": "lib.target-cargo-printf-raw-status",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "cargo_resolved_compiler_field() {\n  local _crcf_field=\"$1\" _crcf_resolve=\"$2\" _crcf_printf=\"$3\"\n  if \"${_crcf_resolve}\" >/dev/null 2>&1; then\n    case \"${_crcf_field}\" in\n      CC) \"${_crcf_printf}\" \"${CC:-}\" ;;\n      CXX) \"${_crcf_printf}\" \"${CXX:-}\" ;;\n      *) return 2 ;;\n    esac\n  else\n    return $?\n  fi\n  return $?\n}",
  "replace": "cargo_resolved_compiler_field() {\n  local _crcf_field=\"$1\" _crcf_resolve=\"$2\" _crcf_printf=\"$3\"\n  if \"${_crcf_resolve}\" >/dev/null 2>&1; then\n    case \"${_crcf_field}\" in\n      CC) \"${_crcf_printf}\" \"${CC:-}\" ;;\n      CXX) \"${_crcf_printf}\" \"${CXX:-}\" ;;\n      *) return 2 ;;\n    esac\n  else\n    return $?\n  fi\n  return 0\n}",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "A failing captured printf retains its raw assignment failure instead of a partial successful compiler path."
 },
 {
  "id": "lib.target-cargo-CC-value-quoted",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "      CC) \"${_crcf_printf}\" \"${CC:-}\" ;;",
  "replace": "      CC) \"${_crcf_printf}\" ${CC:-} ;;",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Compiler path whitespace remains one scalar value for the bound formatter."
 },
 {
  "id": "lib.target-cargo-gst-required-exports",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  declare -F cargo_target_pipeline cargo_resolved_compiler_field >/dev/null || { printf 'ERROR: compiler-resolution.sh lacks target cargo pipeline exports\\n' >&2; return 1; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Missing target pipeline exports fail before any resolver call, including conditional invocation."
 },
 {
  "id": "lib.target-cargo-gst-pipeline-required",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  cargo_target_pipeline \"${target_rust_env}\" _gst_target_resolver_available _gst_target_prepare_publish",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Each actual caller invokes the selected target cargo pipeline."
 },
 {
  "id": "lib.target-cargo-gst-availability-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gst_target_resolver_available() {\n  command -v resolve_cross_cc_cxx_for_arch >/dev/null 2>&1\n}",
  "replace": "_gst_target_resolver_available() {\n  \"command\" -v resolve_cross_cc_cxx_for_arch >/dev/null 2>&1\n}",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Availability keeps the original source-phase command prefix and lookup argument count."
 },
 {
  "id": "lib.target-cargo-gst-availability-stderr",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gst_target_resolver_available() {\n  command -v resolve_cross_cc_cxx_for_arch >/dev/null 2>&1\n}",
  "replace": "_gst_target_resolver_available() {\n  command -v resolve_cross_cc_cxx_for_arch >/dev/null\n}",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Provided availability diagnostics stay quiet as in the original conditional lookup."
 },
 {
  "id": "lib.target-cargo-gst-publisher-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gst_target_publish() {\n    if export_cargo_target_linker \"${target_rust_env}\" \"${target_rust_lower}\" \"${target_cc}\" \"${target_cxx}\"; then\n      echo \"Cross cargo: target linker ${target_cc} (CARGO_TARGET_${target_rust_env}_LINKER)\"\n    else\n      echo \"WARN: could not resolve cross gcc for target; Rust target crates may fail to link\" >&2\n    fi\n}",
  "replace": "_gst_target_publish() {\n    if \"export_cargo_target_linker\" \"${target_rust_env}\" \"${target_rust_lower}\" \"${target_cc}\" \"${target_cxx}\"; then\n      echo \"Cross cargo: target linker ${target_cc} (CARGO_TARGET_${target_rust_env}_LINKER)\"\n    else\n      echo \"WARN: could not resolve cross gcc for target; Rust target crates may fail to link\" >&2\n    fi\n}",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Publication remains bound at the original caller source phase with its original argument count."
 },
 {
  "id": "lib.target-cargo-gst-CC-resolver-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  target_cc=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CC _gst_target_resolve _gst_target_printf\n  )\"",
  "replace": "  target_cc=\"$(\n    _gst_target_resolve() { \"resolve_cross_cc_cxx_for_arch\" \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CC _gst_target_resolve _gst_target_printf\n  )\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "The resolver remains bound inside that original capture, including aliases installed during availability."
 },
 {
  "id": "lib.target-cargo-gst-CC-printf-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  target_cc=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CC _gst_target_resolve _gst_target_printf\n  )\"",
  "replace": "  target_cc=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; \"printf\" '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CC _gst_target_resolve _gst_target_printf\n  )\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Compiler output uses the original capture-phase printf binding."
 },
 {
  "id": "lib.target-cargo-gst-CC-printf-context",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  target_cc=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CC _gst_target_resolve _gst_target_printf\n  )\"",
  "replace": "  target_cc=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CC _gst_target_resolve _gst_target_printf\n  )\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Prefix aliases see the original empty capture context while printf still receives its format and scalar value."
 },
 {
  "id": "lib.target-cargo-gst-CXX-resolver-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  target_cxx=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CXX _gst_target_resolve _gst_target_printf\n  )\"",
  "replace": "  target_cxx=\"$(\n    _gst_target_resolve() { \"resolve_cross_cc_cxx_for_arch\" \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CXX _gst_target_resolve _gst_target_printf\n  )\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "The resolver remains bound inside that original capture, including aliases installed during availability."
 },
 {
  "id": "lib.target-cargo-gst-CXX-printf-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  target_cxx=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CXX _gst_target_resolve _gst_target_printf\n  )\"",
  "replace": "  target_cxx=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; \"printf\" '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CXX _gst_target_resolve _gst_target_printf\n  )\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Compiler output uses the original capture-phase printf binding."
 },
 {
  "id": "lib.target-cargo-gst-CXX-printf-context",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  target_cxx=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CXX _gst_target_resolve _gst_target_printf\n  )\"",
  "replace": "  target_cxx=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CXX _gst_target_resolve _gst_target_printf\n  )\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Prefix aliases see the original empty capture context while printf still receives its format and scalar value."
 },
 {
  "id": "lib.target-cargo-gst-independent-CXX-capture",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  target_cxx=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CXX _gst_target_resolve _gst_target_printf\n  )\"",
  "replace": "  target_cxx=\"${target_cc}\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "The CXX path performs its own resolver call rather than copying the first captured CC value."
 },
 {
  "id": "lib.target-cargo-rice-required-exports",
  "target": "linux/scripts/03-media/build/gstreamer/common/install-rice-proto.sh",
  "find": "  declare -F cargo_target_pipeline cargo_resolved_compiler_field >/dev/null || { printf 'ERROR: compiler-resolution.sh lacks target cargo pipeline exports\\n' >&2; exit 1; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Missing target pipeline exports fail before any resolver call, including conditional invocation."
 },
 {
  "id": "lib.target-cargo-rice-pipeline-required",
  "target": "linux/scripts/03-media/build/gstreamer/common/install-rice-proto.sh",
  "find": "  cargo_target_pipeline \"${rust_target}\" _rice_target_resolver_available _rice_target_prepare_publish",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Each actual caller invokes the selected target cargo pipeline."
 },
 {
  "id": "lib.target-cargo-rice-availability-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/install-rice-proto.sh",
  "find": "  _rice_target_resolver_available() {\n    command -v resolve_cross_cc_cxx_for_arch >/dev/null 2>&1\n  }",
  "replace": "  _rice_target_resolver_available() {\n    \"command\" -v resolve_cross_cc_cxx_for_arch >/dev/null 2>&1\n  }",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Availability keeps the original source-phase command prefix and lookup argument count."
 },
 {
  "id": "lib.target-cargo-rice-availability-stderr",
  "target": "linux/scripts/03-media/build/gstreamer/common/install-rice-proto.sh",
  "find": "  _rice_target_resolver_available() {\n    command -v resolve_cross_cc_cxx_for_arch >/dev/null 2>&1\n  }",
  "replace": "  _rice_target_resolver_available() {\n    command -v resolve_cross_cc_cxx_for_arch >/dev/null\n  }",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Provided availability diagnostics stay quiet as in the original conditional lookup."
 },
 {
  "id": "lib.target-cargo-rice-publisher-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/install-rice-proto.sh",
  "find": "  _rice_target_publish() {\n    if export_cargo_target_linker \"${rice_rust_env}\" \"${rice_rust_lower}\" \"${rice_cross_cc}\"; then\n      echo \"Cross build: rice-proto target linker = ${rice_cross_cc} (CARGO_TARGET_${rice_rust_env}_LINKER)\"\n    else\n      echo \"WARN: could not resolve cross gcc for '${TARGET_ARCH:-?}'; rice-proto may fail to link (webrtcbin2 skipped)\" >&2\n    fi\n  }",
  "replace": "  _rice_target_publish() {\n    if \"export_cargo_target_linker\" \"${rice_rust_env}\" \"${rice_rust_lower}\" \"${rice_cross_cc}\"; then\n      echo \"Cross build: rice-proto target linker = ${rice_cross_cc} (CARGO_TARGET_${rice_rust_env}_LINKER)\"\n    else\n      echo \"WARN: could not resolve cross gcc for '${TARGET_ARCH:-?}'; rice-proto may fail to link (webrtcbin2 skipped)\" >&2\n    fi\n  }",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Publication remains bound at the original caller source phase with its original argument count."
 },
 {
  "id": "lib.target-cargo-rice-CC-resolver-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/install-rice-proto.sh",
  "find": "    rice_cross_cc=\"$(\n      _rice_target_resolve() { resolve_cross_cc_cxx_for_arch \"${TARGET_ARCH:-${TARGETARCH:-}}\"; }\n      _rice_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n      cargo_resolved_compiler_field CC _rice_target_resolve _rice_target_printf\n    )\"",
  "replace": "    rice_cross_cc=\"$(\n      _rice_target_resolve() { \"resolve_cross_cc_cxx_for_arch\" \"${TARGET_ARCH:-${TARGETARCH:-}}\"; }\n      _rice_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n      cargo_resolved_compiler_field CC _rice_target_resolve _rice_target_printf\n    )\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "The resolver remains bound inside that original capture, including aliases installed during availability."
 },
 {
  "id": "lib.target-cargo-rice-CC-printf-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/install-rice-proto.sh",
  "find": "    rice_cross_cc=\"$(\n      _rice_target_resolve() { resolve_cross_cc_cxx_for_arch \"${TARGET_ARCH:-${TARGETARCH:-}}\"; }\n      _rice_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n      cargo_resolved_compiler_field CC _rice_target_resolve _rice_target_printf\n    )\"",
  "replace": "    rice_cross_cc=\"$(\n      _rice_target_resolve() { resolve_cross_cc_cxx_for_arch \"${TARGET_ARCH:-${TARGETARCH:-}}\"; }\n      _rice_target_printf() { local _crtp_value=\"$1\"; set --; \"printf\" '%s' \"${_crtp_value}\"; }\n      cargo_resolved_compiler_field CC _rice_target_resolve _rice_target_printf\n    )\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Compiler output uses the original capture-phase printf binding."
 },
 {
  "id": "lib.target-cargo-rice-CC-printf-context",
  "target": "linux/scripts/03-media/build/gstreamer/common/install-rice-proto.sh",
  "find": "    rice_cross_cc=\"$(\n      _rice_target_resolve() { resolve_cross_cc_cxx_for_arch \"${TARGET_ARCH:-${TARGETARCH:-}}\"; }\n      _rice_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n      cargo_resolved_compiler_field CC _rice_target_resolve _rice_target_printf\n    )\"",
  "replace": "    rice_cross_cc=\"$(\n      _rice_target_resolve() { resolve_cross_cc_cxx_for_arch \"${TARGET_ARCH:-${TARGETARCH:-}}\"; }\n      _rice_target_printf() { local _crtp_value=\"$1\"; printf '%s' \"${_crtp_value}\"; }\n      cargo_resolved_compiler_field CC _rice_target_resolve _rice_target_printf\n    )\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Prefix aliases see the original empty capture context while printf still receives its format and scalar value."
 },
 {
  "id": "lib.target-cargo-gst-arch-local-scope",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "_gst_target_prepare_publish() {\n  local _tgt_arch\n  _tgt_arch=\"$(cross_target_arch 2>/dev/null || true)\"\n  target_cc=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CC _gst_target_resolve _gst_target_printf\n  )\"\n  target_cxx=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CXX _gst_target_resolve _gst_target_printf\n  )\"\n  _gst_target_publish\n}",
  "replace": "_gst_target_prepare_publish() {\n  :\n  _tgt_arch=\"$(cross_target_arch 2>/dev/null || true)\"\n  target_cc=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CC _gst_target_resolve _gst_target_printf\n  )\"\n  target_cxx=\"$(\n    _gst_target_resolve() { resolve_cross_cc_cxx_for_arch \"${_tgt_arch}\"; }\n    _gst_target_printf() { local _crtp_value=\"$1\"; set --; printf '%s' \"${_crtp_value}\"; }\n    cargo_resolved_compiler_field CXX _gst_target_resolve _gst_target_printf\n  )\"\n  _gst_target_publish\n}",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "The selected architecture remains local through preparation and publication and cannot overwrite the caller sentinel."
 },
 {
  "id": "lib.target-cargo-rice-name-derivation-before-publish",
  "target": "linux/scripts/03-media/build/gstreamer/common/install-rice-proto.sh",
  "find": "    rice_rust_env=\"$(printf '%s' \"${rust_target}\" | tr 'a-z-' 'A-Z_')\"\n    rice_rust_lower=\"$(printf '%s' \"${rust_target}\" | tr '-' '_')\"\n    _rice_target_publish",
  "replace": "    _rice_target_publish\n    rice_rust_env=\"$(printf '%s' \"${rust_target}\" | tr 'a-z-' 'A-Z_')\"\n    rice_rust_lower=\"$(printf '%s' \"${rust_target}\" | tr '-' '_')\"",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "Rice derives both Rust names after its CC capture and before the publisher observes them."
 },
 {
  "id": "lib.target-cargo-owner-exports-visible",
  "target": "linux/scripts/01-core/compiler-resolution.sh",
  "find": "cargo_target_pipeline() {",
  "replace": "return 0\n\ncargo_target_pipeline() {",
  "test": "bash linux/scripts/tests/test-target-cargo-pipeline.sh",
  "why": "A real fresh module import must reach both target pipeline exports rather than only exposing their text to fixture extraction."
 },
 {
  "id": "lib.apt-update-lookup-argv",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "if \"$1\" \"${@:4}\" >/dev/null 2>&1; then",
  "replace": "if \"$1\" \"$@\" >/dev/null 2>&1; then",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Lookup aliases retain caller arguments without internal selector metadata."
 },
 {
  "id": "lib.apt-update-cross-argv",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "\"$2\" \"${@:4}\"",
  "replace": "\"$2\" \"${@:5}\"",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Cross-update prefix aliases retain every original argument, including empty tails."
 },
 {
  "id": "lib.apt-update-system-argv",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "\"$3\" \"${@:4}\"",
  "replace": "\"$3\" \"${@:5}\"",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "System-update aliases retain their original positional context independently of outgoing apt flags."
 },
 {
  "id": "lib.apt-update-selection",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "\"$2\" \"${@:4}\"",
  "replace": "\"$3\" \"${@:4}\"",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "An available SDK provider wins over the direct system apt route."
 },
 {
  "id": "lib.apt-update-lookup-quiet",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "if \"$1\" \"${@:4}\" >/dev/null 2>&1; then",
  "replace": "if \"$1\" \"${@:4}\"; then",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Only availability output is quiet; the selected updater retains its streams."
 },
 {
  "id": "lib.apt-update-cross-status",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "\"$2\" \"${@:4}\"",
  "replace": "\"$2\" \"${@:4}\" || true",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Selected cross-update failures keep their raw strict and conditional status."
 },
 {
  "id": "lib.apt-update-system-status",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "\"$3\" \"${@:4}\"",
  "replace": "\"$3\" \"${@:4}\" || true",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "System apt failures remain fatal under strict callers and observable under conditional callers."
 },
 {
  "id": "lib.apt-update-smart-default",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "extra_args=(-y)",
  "replace": "extra_args=()",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Only apt_update_smart adds its original default -y for an empty argument list."
 },
 {
  "id": "lib.apt-update-smart-lookup-binding",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "_apt_smart_cross_available() {\n  command -v cross_apt_update\n}",
  "replace": "_apt_smart_cross_available() {\n  builtin command -v cross_apt_update\n}",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Availability keeps the original literal command lookup binding and caller positional arguments."
 },
 {
  "id": "lib.apt-update-smart-cross-binding",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "_apt_smart_cross_update() {\n  cross_apt_update \"${extra_args[@]}\"\n}",
  "replace": "_apt_smart_cross_update() {\n  \"cross_apt_update\" \"${extra_args[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "The cross-provider alias binds at its own original declaration phase."
 },
 {
  "id": "lib.apt-update-smart-system-binding",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "_apt_smart_system_update() {\n  apt-get update \"${extra_args[@]}\"\n}",
  "replace": "_apt_smart_system_update() {\n  \"apt-get\" update \"${extra_args[@]}\"\n}",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "The system apt alias retains its own caller phase and original prefix arguments."
 },
 {
  "id": "lib.apt-update-refresh-lookup-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "_gst_cross_apt_available() {\n  command -v cross_apt_update\n}",
  "replace": "_gst_cross_apt_available() {\n  builtin command -v cross_apt_update\n}",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Availability keeps the original literal command lookup binding and caller positional arguments."
 },
 {
  "id": "lib.apt-update-refresh-cross-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "_gst_cross_apt_update() {\n  cross_apt_update \"$@\"\n}",
  "replace": "_gst_cross_apt_update() {\n  \"cross_apt_update\" \"$@\"\n}",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "The cross-provider alias binds at its own original declaration phase."
 },
 {
  "id": "lib.apt-update-refresh-system-binding",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "_gst_system_apt_update() {\n  apt-get update \"$@\"\n}",
  "replace": "_gst_system_apt_update() {\n  \"apt-get\" update \"$@\"\n}",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "The system apt alias retains its own caller phase and original prefix arguments."
 },
 {
  "id": "lib.apt-update-source-api-marker",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "# ANT_APT_UPDATE_SOURCE_API=1\n# shellcheck shell=bash",
  "replace": "# ANT_APT_UPDATE_SOURCE_API=2\n# shellcheck shell=bash",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Consumers validate the exact helper-only source API before running any owner code."
 },
 {
  "id": "lib.apt-update-mode-before-init",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "if [ \"${1:-}\" = --ant-source-apt-update-only ]; then",
  "replace": "if [ \"${1:-}\" = --disabled-apt-helper-mode ]; then",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Helper-only sourcing returns before existing loaded flags, globals and SDK provider definitions."
 },
 {
  "id": "lib.apt-update-mode-source-only",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "if [ \"${1:-}\" = --ant-source-apt-update-only ]; then\n  if [ \"${BASH_SOURCE[0]}\" = \"$0\" ]; then",
  "replace": "if [ \"${1:-}\" = --ant-source-apt-update-only ]; then\n  if false; then",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "The internal mode rejects execution identity instead of silently acting like a full executable owner."
 },
 {
  "id": "lib.apt-update-owner-reset",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "unset -f apt_update_select\ncase \"$?\" in 0) ;; *) return \"$?\" ;; esac",
  "replace": ":\ncase \"$?\" in 0) ;; *) return \"$?\" ;; esac",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "A readonly stale helper fails before a new source can mask its failed replacement."
 },
 {
  "id": "lib.apt-update-owner-owned-reset",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "unset -f apt_update_select\ncase \"$?\" in 0) ;; *) return \"$?\" ;; esac",
  "replace": "unset -f apt_update_select cross_apt_update\ncase \"$?\" in 0) ;; *) return \"$?\" ;; esac",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Only the newly owned helper is reset; provided SDK update functions remain untouched."
 },
 {
  "id": "lib.apt-update-owner-unset-status",
  "target": "linux/scripts/01-core/cross-apt.sh",
  "find": "unset -f apt_update_select\ncase \"$?\" in 0) ;; *) return \"$?\" ;; esac",
  "replace": "unset -f apt_update_select\ncase \"$?\" in 0) ;; *) return 0 ;; esac",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "The owner preserves a failed helper reset status even under a conditional source."
 },
 {
  "id": "lib.apt-update-marker-before-source",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "if ! IFS= read -r _gar_marker < \"${_gar_owner}\" || [ \"${_gar_marker}\" != '# ANT_APT_UPDATE_SOURCE_API=1' ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "An old or mismarked owner is rejected before it can execute initialization or replace SDK providers."
 },
 {
  "id": "lib.apt-update-consumer-reset",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "unset -f apt_update_select\n  case \"$?\" in 0) ;; *) exit \"$?\" ;; esac",
  "replace": ":\n  case \"$?\" in 0) ;; *) exit \"$?\" ;; esac",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "A partial marked owner cannot borrow an already defined helper and turn a cold import green."
 },
 {
  "id": "lib.apt-update-consumer-owned-reset",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "unset -f apt_update_select\n  case \"$?\" in 0) ;; *) exit \"$?\" ;; esac",
  "replace": "unset -f apt_update_select cross_apt_update\n  case \"$?\" in 0) ;; *) exit \"$?\" ;; esac",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "The consumer clears only its new helper and retains provided SDK updater functions."
 },
 {
  "id": "lib.apt-update-consumer-unset-status",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "unset -f apt_update_select\n  case \"$?\" in 0) ;; *) exit \"$?\" ;; esac",
  "replace": "unset -f apt_update_select\n  case \"$?\" in 0) ;; *) exit 0 ;; esac",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "Readonly helper reset failures remain failing process statuses rather than error-text-only warnings."
 },
 {
  "id": "lib.apt-update-consumer-source-status",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "source \"${_gar_owner}\" --ant-source-apt-update-only\n  case \"$?\" in 0) ;; *) exit \"$?\" ;; esac",
  "replace": "source \"${_gar_owner}\" --ant-source-apt-update-only\n  case \"$?\" in 0) ;; *) exit 0 ;; esac",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "A marked owner that returns23 after a partial export must stop with the same raw status."
 },
 {
  "id": "lib.apt-update-consumer-source-mode",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "source \"${_gar_owner}\" --ant-source-apt-update-only",
  "replace": "source \"${_gar_owner}\" --disabled-apt-helper-mode",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "The consumer requests the no-initialization API even when no previous loaded flag protects the SDK provider."
 },
 {
  "id": "lib.apt-update-consumer-export",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "declare -F apt_update_select >/dev/null || { printf 'ERROR: cross-apt.sh helper source mode lacks apt_update_select\\n' >&2; exit 1; }",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "A marked file without the required export fails before any updater is invoked."
 },
 {
  "id": "lib.apt-update-boundary-status",
  "target": "linux/scripts/tests/apt-update-selection-tests.py",
  "find": "trap '_apt_guard_exit \"$?\"' EXIT",
  "replace": "trap ':' EXIT",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "An unstubbed unqualified tool cannot be masked into a green fixture after the empty PATH blocks its execution."
 },
 {
  "id": "lib.apt-update-callee-owner-priority",
  "target": "linux/scripts/03-media/build/gstreamer/common/pre-setup.sh",
  "find": "_gar_owner=\"${_PRE_SETUP_DIR}/../../../../01-core/cross-apt.sh\"\n  if [ ! -f \"${_gar_owner}\" ]; then\n    _gar_owner=/opt/scripts/core/cross-apt.sh\n  fi",
  "replace": "if [ -f /opt/scripts/core/cross-apt.sh ]; then\n    _gar_owner=/opt/scripts/core/cross-apt.sh\n  else\n    _gar_owner=\"${_PRE_SETUP_DIR}/../../../../01-core/cross-apt.sh\"\n  fi",
  "test": "bash linux/scripts/tests/test-apt-update-selection.sh",
  "why": "The current repository helper policy wins over an older SDK owner while the existing SDK cross-update provider remains registered."
 },
 {
  "id": "lib.sudo-policy-base-bootstrap-ca-companion",
  "target": "linux/Dockerfile.base",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    /bin/bash /tmp/scripts/01-core/base-image.sh bootstrap-ca\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    /bin/bash /tmp/scripts/01-core/base-image.sh bootstrap-ca\n",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Selected fallback APIs require a fresh readonly policy companion in this recipe, including when the parent image is older."
 },
 {
  "id": "lib.sudo-policy-base-os-packages-companion",
  "target": "linux/Dockerfile.base",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cpython-dev-packages.sh,target=/tmp/scripts/01-core/cpython-dev-packages.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    bash /tmp/scripts/01-core/base-image.sh install-os-packages\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cpython-dev-packages.sh,target=/tmp/scripts/01-core/cpython-dev-packages.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    bash /tmp/scripts/01-core/base-image.sh install-os-packages\n",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Selected fallback APIs require a fresh readonly policy companion in this recipe, including when the parent image is older."
 },
 {
  "id": "lib.sudo-policy-base-shared-tools-companion",
  "target": "linux/Dockerfile.base",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=tmpfs,target=/tmp \\\n    bash /tmp/scripts/01-core/base-image.sh install-shared-build-tooling \\\n      --cmake-version \"${CMAKE_VERSION}\"\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=tmpfs,target=/tmp \\\n    bash /tmp/scripts/01-core/base-image.sh install-shared-build-tooling \\\n      --cmake-version \"${CMAKE_VERSION}\"\n",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Selected fallback APIs require a fresh readonly policy companion in this recipe, including when the parent image is older."
 },
 {
  "id": "lib.sudo-policy-base-node-companion",
  "target": "linux/Dockerfile.base",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    bash /tmp/scripts/01-core/base-image.sh install-node \\\n      --version \"${NODE_VERSION}\"\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    bash /tmp/scripts/01-core/base-image.sh install-node \\\n      --version \"${NODE_VERSION}\"\n",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Selected fallback APIs require a fresh readonly policy companion in this recipe, including when the parent image is older."
 },
 {
  "id": "lib.sudo-policy-base-vulkan-files-companion",
  "target": "linux/Dockerfile.base",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=bind,source=linux/vulkan,target=/tmp/vulkan,ro \\\n    bash /tmp/scripts/01-core/base-image.sh install-vulkan-runtime-files \\\n      --version \"${VULKAN_VERSION}\" \\\n      /tmp/vulkan\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=bind,source=linux/vulkan,target=/tmp/vulkan,ro \\\n    bash /tmp/scripts/01-core/base-image.sh install-vulkan-runtime-files \\\n      --version \"${VULKAN_VERSION}\" \\\n      /tmp/vulkan\n",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Selected fallback APIs require a fresh readonly policy companion in this recipe, including when the parent image is older."
 },
 {
  "id": "lib.sudo-policy-base-uv-caches-companion",
  "target": "linux/Dockerfile.base",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/tmp/scripts/01-core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/root/.cache/uv,id=uv-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/ccache,id=ccache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH} \\\n    set -euo pipefail; \\\n    bash /tmp/scripts/01-core/base-image.sh install-uv \\\n      --version \"${UV_VERSION}\" && \\\n    bash /tmp/scripts/01-core/base-image.sh init-compiler-caches \\\n      --max-size \"${CCACHE_MAXSIZE}\"\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core/base-image.sh,target=/tmp/scripts/01-core/base-image.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/tmp/scripts/01-core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/tmp/scripts/01-core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/tmp/scripts/01-core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/tmp/scripts/01-core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/tmp/scripts/01-core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/tmp/scripts/01-core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/tmp/scripts/01-core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/tmp/scripts/01-core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/tmp/scripts/01-core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/tmp/scripts/01-core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/tmp/scripts/01-core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/use-fast-ubuntu-mirror.sh,target=/tmp/scripts/01-core/use-fast-ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/tmp/scripts/01-core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/tmp/scripts/01-core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/package-lists.sh,target=/tmp/scripts/01-core/package-lists.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/cmake.sh,target=/tmp/scripts/02-toolchain/cmake.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/packaging-deps.sh,target=/tmp/scripts/02-toolchain/packaging-deps.sh,ro \\\n    --mount=type=cache,target=/root/.cache/uv,id=uv-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/ccache,id=ccache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH} \\\n    set -euo pipefail; \\\n    bash /tmp/scripts/01-core/base-image.sh install-uv \\\n      --version \"${UV_VERSION}\" && \\\n    bash /tmp/scripts/01-core/base-image.sh init-compiler-caches \\\n      --max-size \"${CCACHE_MAXSIZE}\"\n",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Selected fallback APIs require a fresh readonly policy companion in this recipe, including when the parent image is older."
 },
 {
  "id": "lib.sudo-policy-toolchain-gcc-companion",
  "target": "linux/Dockerfile.toolchain",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/ccache,id=ccache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH} \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-s3-level.sh,target=/opt/scripts/core/sccache-s3-level.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-server-address.sh,target=/opt/scripts/core/sccache-server-address.sh,ro \\\n    --mount=type=secret,id=sccache_s3,required=false \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/opt/scripts/core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/build-helpers.sh,target=/opt/scripts/core/build-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/elf-strip.sh,target=/opt/scripts/core/elf-strip.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/image-ref-args.sh,target=/opt/scripts/core/image-ref-args.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/opt/scripts/core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/opt/scripts/core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/opt/scripts/core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-apt.sh,target=/opt/scripts/core/cross-apt.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-env.sh,target=/opt/scripts/core/cross-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-gcc.sh,target=/opt/scripts/core/cross-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-meson.sh,target=/opt/scripts/core/cross-meson.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-python.sh,target=/opt/scripts/core/cross-python.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/configure-gcc-env.sh,target=/opt/scripts/toolchain/configure-gcc-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/core.sh,target=/opt/scripts/toolchain/core.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/gcc.sh,target=/opt/scripts/toolchain/gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/setup-dependencies.sh,target=/opt/scripts/toolchain/setup-dependencies.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/verify-gcc.sh,target=/opt/scripts/toolchain/verify-gcc.sh,ro \\\n    --mount=type=tmpfs,target=/tmp \\\n    --mount=type=tmpfs,target=/var/tmp \\\n    set -euo pipefail; \\\n    SETUP_DEPENDENCIES_SKIP_CORE_TOOLS=true \\\n    bash /opt/scripts/toolchain/setup-dependencies.sh dockerfile-gcc; \\\n    bash /opt/scripts/core/sccache-s3-level.sh drain\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/ccache,id=ccache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH} \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-s3-level.sh,target=/opt/scripts/core/sccache-s3-level.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-server-address.sh,target=/opt/scripts/core/sccache-server-address.sh,ro \\\n    --mount=type=secret,id=sccache_s3,required=false \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/opt/scripts/core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/build-helpers.sh,target=/opt/scripts/core/build-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/elf-strip.sh,target=/opt/scripts/core/elf-strip.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/image-ref-args.sh,target=/opt/scripts/core/image-ref-args.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/opt/scripts/core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/opt/scripts/core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-apt.sh,target=/opt/scripts/core/cross-apt.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-env.sh,target=/opt/scripts/core/cross-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-gcc.sh,target=/opt/scripts/core/cross-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-meson.sh,target=/opt/scripts/core/cross-meson.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-python.sh,target=/opt/scripts/core/cross-python.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/configure-gcc-env.sh,target=/opt/scripts/toolchain/configure-gcc-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/core.sh,target=/opt/scripts/toolchain/core.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/gcc.sh,target=/opt/scripts/toolchain/gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/setup-dependencies.sh,target=/opt/scripts/toolchain/setup-dependencies.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/verify-gcc.sh,target=/opt/scripts/toolchain/verify-gcc.sh,ro \\\n    --mount=type=tmpfs,target=/tmp \\\n    --mount=type=tmpfs,target=/var/tmp \\\n    set -euo pipefail; \\\n    SETUP_DEPENDENCIES_SKIP_CORE_TOOLS=true \\\n    bash /opt/scripts/toolchain/setup-dependencies.sh dockerfile-gcc; \\\n    bash /opt/scripts/core/sccache-s3-level.sh drain\n",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Selected fallback APIs require a fresh readonly policy companion in this recipe, including when the parent image is older."
 },
 {
  "id": "lib.sudo-policy-toolchain-llvm-companion",
  "target": "linux/Dockerfile.toolchain",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/ccache,id=ccache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH} \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-s3-level.sh,target=/opt/scripts/core/sccache-s3-level.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-server-address.sh,target=/opt/scripts/core/sccache-server-address.sh,ro \\\n    --mount=type=secret,id=sccache_s3,required=false \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/opt/scripts/core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/build-helpers.sh,target=/opt/scripts/core/build-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/elf-strip.sh,target=/opt/scripts/core/elf-strip.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/image-ref-args.sh,target=/opt/scripts/core/image-ref-args.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/opt/scripts/core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sudo-policy.sh,target=/opt/scripts/core/sudo-policy.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/opt/scripts/core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-apt.sh,target=/opt/scripts/core/cross-apt.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-env.sh,target=/opt/scripts/core/cross-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-gcc.sh,target=/opt/scripts/core/cross-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-meson.sh,target=/opt/scripts/core/cross-meson.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-python.sh,target=/opt/scripts/core/cross-python.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/configure-gcc-env.sh,target=/opt/scripts/toolchain/configure-gcc-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/core.sh,target=/opt/scripts/toolchain/core.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/gcc.sh,target=/opt/scripts/toolchain/gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/llvm-cross.sh,target=/opt/scripts/toolchain/llvm-cross.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/llvm-validate.sh,target=/opt/scripts/toolchain/llvm-validate.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/llvm.sh,target=/opt/scripts/toolchain/llvm.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/setup-dependencies.sh,target=/opt/scripts/toolchain/setup-dependencies.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/verify-gcc.sh,target=/opt/scripts/toolchain/verify-gcc.sh,ro \\\n    --mount=type=cache,target=/var/cache/llvm-src,id=llvm-src-${TARGETARCH} \\\n    --mount=type=tmpfs,target=/tmp \\\n    --mount=type=tmpfs,target=/var/tmp \\\n    set -euo pipefail; \\\n    apt-get update -qq && \\\n    apt-get install -y --no-install-recommends binutils-dev; \\\n    SETUP_DEPENDENCIES_SKIP_CORE_TOOLS=true \\\n    LLVM_CROSS_SOURCE_ROOT=/var/cache/llvm-src \\\n    bash /opt/scripts/toolchain/setup-dependencies.sh dockerfile-llvm; \\\n    bash /opt/scripts/core/sccache-s3-level.sh drain\n",
  "replace": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/ccache,id=ccache-${TARGETARCH} \\\n    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH} \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-s3-level.sh,target=/opt/scripts/core/sccache-s3-level.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-server-address.sh,target=/opt/scripts/core/sccache-server-address.sh,ro \\\n    --mount=type=secret,id=sccache_s3,required=false \\\n    --mount=type=bind,source=linux/scripts/01-core/arch-mapping.sh,target=/opt/scripts/core/arch-mapping.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/build-helpers.sh,target=/opt/scripts/core/build-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/elf-strip.sh,target=/opt/scripts/core/elf-strip.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/image-ref-args.sh,target=/opt/scripts/core/image-ref-args.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/common.sh,target=/opt/scripts/core/common.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-active-fallback.sh,target=/opt/scripts/core/cross-active-fallback.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-apt.sh,target=/opt/scripts/core/cross-apt.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-env.sh,target=/opt/scripts/core/cross-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-gcc.sh,target=/opt/scripts/core/cross-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-meson.sh,target=/opt/scripts/core/cross-meson.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/cross-python.sh,target=/opt/scripts/core/cross-python.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/path-helpers.sh,target=/opt/scripts/core/path-helpers.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/downloads.sh,target=/opt/scripts/core/downloads.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/load-versions-env.sh,target=/opt/scripts/core/load-versions-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/logging.sh,target=/opt/scripts/core/logging.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/meson-rust-wrapper.sh,target=/opt/scripts/core/meson-rust-wrapper.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/module-bootstrap.sh,target=/opt/scripts/core/module-bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/compiler-cache-utils.sh,target=/opt/scripts/core/compiler-cache-utils.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/modules.sh,target=/opt/scripts/core/modules.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/parallelism.sh,target=/opt/scripts/core/parallelism.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/platform.sh,target=/opt/scripts/core/platform.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/repos.sh,target=/opt/scripts/core/repos.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-launcher.sh,target=/opt/scripts/core/sccache-launcher.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/ubuntu-mirror.sh,target=/opt/scripts/core/ubuntu-mirror.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/verify.sh,target=/opt/scripts/core/verify.sh,ro \\\n    --mount=type=bind,source=linux/scripts/01-core/versions.env,target=/opt/scripts/core/versions.env,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap.sh,target=/opt/scripts/toolchain/bootstrap.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/bootstrap-import.sh,target=/opt/scripts/toolchain/bootstrap-import.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-clang.sh,target=/opt/scripts/toolchain/build-clang.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/build-gcc.sh,target=/opt/scripts/toolchain/build-gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/configure-gcc-env.sh,target=/opt/scripts/toolchain/configure-gcc-env.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/core.sh,target=/opt/scripts/toolchain/core.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/gcc.sh,target=/opt/scripts/toolchain/gcc.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/llvm-cross.sh,target=/opt/scripts/toolchain/llvm-cross.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/llvm-validate.sh,target=/opt/scripts/toolchain/llvm-validate.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/llvm.sh,target=/opt/scripts/toolchain/llvm.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/setup-dependencies.sh,target=/opt/scripts/toolchain/setup-dependencies.sh,ro \\\n    --mount=type=bind,source=linux/scripts/02-toolchain/verify-gcc.sh,target=/opt/scripts/toolchain/verify-gcc.sh,ro \\\n    --mount=type=cache,target=/var/cache/llvm-src,id=llvm-src-${TARGETARCH} \\\n    --mount=type=tmpfs,target=/tmp \\\n    --mount=type=tmpfs,target=/var/tmp \\\n    set -euo pipefail; \\\n    apt-get update -qq && \\\n    apt-get install -y --no-install-recommends binutils-dev; \\\n    SETUP_DEPENDENCIES_SKIP_CORE_TOOLS=true \\\n    LLVM_CROSS_SOURCE_ROOT=/var/cache/llvm-src \\\n    bash /opt/scripts/toolchain/setup-dependencies.sh dockerfile-llvm; \\\n    bash /opt/scripts/core/sccache-s3-level.sh drain\n",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Selected fallback APIs require a fresh readonly policy companion in this recipe, including when the parent image is older."
 },
 {
  "id": "lib.sudo-policy-sdk-companion",
  "target": "linux/scripts/script-closures/core-common.txt",
  "find": "01-core/sudo-policy.sh|core/sudo-policy.sh\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "The SDK copies the current source-only policy alongside its current common owner."
 },
 {
  "id": "lib.sudo-policy-package-whole-core",
  "target": "linux/Dockerfile.package",
  "find": "COPY linux/scripts/01-core/ /opt/scripts/core/\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Existing whole-core copies carry the new companion without widening any build closure."
 },
 {
  "id": "lib.sudo-policy-torch-whole-core",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --chmod=755 linux/scripts/01-core/ /opt/scripts/core/\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Existing whole-core copies carry the new companion without widening any build closure."
 },
 {
  "id": "lib.sudo-policy-toolchain-whole-core",
  "target": "linux/Dockerfile.toolchain",
  "find": "COPY --chmod=755 linux/scripts/01-core/ /opt/scripts/core/\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Existing whole-core copies carry the new companion without widening any build closure."
 },
 {
  "id": "lib.sudo-policy-copied-api-used",
  "target": "linux/scripts/01-core/sudo-policy.sh",
  "find": "sudo_policy_select() {",
  "replace": "sudo_policy_retired() {",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "A complete copied common owner really invokes the shipped policy API."
 },
 {
  "id": "lib.sudo-policy-copied-missing-refused",
  "target": "linux/scripts/01-core/common.sh",
  "find": "  source \"${_COMMON_SH_DIR}/sudo-policy.sh\" || return $?",
  "replace": "  source \"${_COMMON_SH_DIR}/sudo-policy.sh\" || return 0",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "A selected copied fallback cannot report success when its physical policy file is missing."
 },
 {
  "id": "lib.sudo-policy-layer-zero",
  "target": "linux/scripts/tests/test-layer-order.sh",
  "find": " sccache-server-address.sh cross-active-fallback.sh sudo-policy.sh)",
  "replace": " sccache-server-address.sh cross-active-fallback.sh)",
  "test": "bash linux/scripts/tests/test-layer-order.sh",
  "why": "The source-only policy remains a leaf and is available to the common layer."
 },
 {
  "id": "lib.media-selector-first-candidate",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "for _mfef_candidate in \"$@\"; do",
  "replace": "for _mfef_candidate in \"${@:2}\"; do",
  "test": "bash linux/scripts/tests/test-media-file-selection.sh",
  "why": "The container's first existing media file wins over the repository fallback."
 },
 {
  "id": "lib.media-selector-caller-slot",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "_mfef_slot=\"${_mfef_candidate}\"",
  "replace": "_mfef_slot=''",
  "test": "bash linux/scripts/tests/test-media-file-selection.sh",
  "why": "Sourced setup files retain the candidate variable the original caller loop exposed."
 },
 {
  "id": "lib.media-selector-alias-arguments",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "if _media_candidate_exists \"${_mfef_caller_args[@]}\"; then",
  "replace": "if _media_candidate_exists; then",
  "test": "bash linux/scripts/tests/test-media-file-selection.sh",
  "why": "A caller-bound file-test alias receives the same positional arguments as the old loop."
 },
 {
  "id": "lib.media-selector-missing-status",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "  done\n  return 1\n}\n\n# See docs/cross-build-verification.md",
  "replace": "  done\n  return 0\n}\n\n# See docs/cross-build-verification.md",
  "test": "bash linux/scripts/tests/test-media-file-selection.sh",
  "why": "An absent optional media file leaves defaults intact without trying to source an empty path."
 },
 {
  "id": "lib.media-selector-selected-source-fatal",
  "target": "linux/scripts/03-media/core/common.sh",
  "find": "source \"${_dep_env}\" || { echo \"FATAL: cannot load ${_dep_env}\" >&2; exit 1; }",
  "replace": "source \"${_dep_env}\" || return 0",
  "test": "bash linux/scripts/tests/test-media-file-selection.sh",
  "why": "A selected preamble that fails must remain fatal and cannot fall through to the repo copy."
 },
 {
  "id": "python.test-reports-zero-package-coverage",
  "target": "linux/scripts/02-toolchain/python/verify-test-reports.py",
  "find": "if valid <= 0 or covered <= 0 or covered > valid:",
  "replace": "if valid <= 0 or covered > valid:",
  "test": "bash linux/scripts/tests/test-verify-test-reports.sh",
  "why": "A test run with no covered package lines cannot certify that the requested package was measured."
 },
 {
  "id": "python.ci-tests-report-check-executed",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "python3 -I \"$SCRIPT_DIR/verify-test-reports.py\" \\\n",
  "replace": "true \\\n",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "A green pytest command without JUnit or package coverage reports must fail its stable leg."
 },
 {
  "id": "python.ci-tests-stale-reports-removed",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "rm -f \"$TEST_RESULTS_DIR/report-${V}.xml\" \"$TEST_RESULTS_DIR/coverage-${V}.xml\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "A previous run's reports must not certify a new green pytest invocation that wrote nothing."
 },
 {
  "id": "python.lane-coverage-floor-forwarded",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "-e PYTHON_COVERAGE_MIN=${{ inputs.coverage-min }}",
  "replace": "-e PYTHON_COVERAGE_MIN=0",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "The declared minimum coverage input must reach the test driver, not remain a dead workflow option."
 },
 {
  "id": "windows-lane.powershell-complexity-strict-opt-in",
  "target": ".github/workflows/python-ci-windows.yml",
  "find": "strict: ${{ inputs.complexity-strict }}",
  "replace": "strict: false",
  "test": "bash linux/scripts/tests/test-reusable-windows-lane.sh",
  "why": "The opt-in must turn a consumer complexity finding into a failed job while report mode stays the default."
 },
 {
  "id": "consumer-inventory.ratchets-required",
  "target": "linux/scripts/verify_consumer_quality_wiring.py",
  "find": "    if ratchets != \"true\" or _inactive(job) or _nonfatal(job):",
  "replace": "    if _inactive(job) or _nonfatal(job):",
  "test": "bash linux/scripts/tests/test-consumer-quality-wiring.sh",
  "why": "A declared consumer quality call with the measurement ratchets disabled must fail the weekly inventory."
 },
 {
  "id": "python-types.strict-verdict",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  exit \"${rc}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "A typed return mismatch in a quality script must fail the CI type gate, even when the full-tree report is advisory."
 },
 {
  "id": "python-types.verifier-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/verify_*.py'",
  "replace": "'linux/scripts/verify_none_*.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Every tracked Python verifier must remain in the strict type scope."
 },
 {
  "id": "python-types.test-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/tests/*.py'",
  "replace": "'linux/scripts/tests/no_matches_*.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Every tracked Python test helper must remain in the strict type scope."
 },
 {
  "id": "python-types.framework-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/05-frameworks/*.py'",
  "replace": "'linux/scripts/05-frameworks/no_matches_*.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Framework Python scripts must remain in the strict Linux type scope."
 },
 {
  "id": "python-types.flutter-web-artifact-type-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/05-frameworks/flutter/check-web-artefacts.py' \\",
  "replace": "  'linux/scripts/05-frameworks/flutter/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The Flutter web artifact checker must remain in the fatal ty quality scope."
 },
 {
  "id": "python-types.flutter-web-artifact-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/05-frameworks/flutter/check-web-artefacts.py' \\",
  "replace": "  'linux/scripts/05-frameworks/flutter/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The Flutter web artifact checker must remain in the fatal Ruff parameter and public-return scope."
 },
 {
  "id": "python-types.chain-ort-fixture-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/chain-ort-fixtures.py' \\",
  "replace": "  'linux/scripts/tests/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The chain ORT fixture must retain fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.sudo-policy-test-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/sudo-policy-tests.py' \\",
  "replace": "  'linux/scripts/tests/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The sudo policy test helpers must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.raw-pin-reader-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/raw_pin_reader_tests.py' \\",
  "replace": "  'linux/scripts/tests/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The raw pin reader test must retain fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.gateway-e2e-client-and-ops-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/llm-stack/tests/gateway_e2e/conftest.py' \\\n  'linux/llm-stack/tests/gateway_e2e/gw_client.py' \\\n  'linux/llm-stack/tests/gateway_e2e/test_e2e_ops.py' \\\n  'linux/llm-stack/tests/gateway_e2e/test_e2e_routing.py' \\",
  "replace": "  'linux/llm-stack/tests/gateway_e2e/subject.py' \\\n  'linux/llm-stack/tests/gateway_e2e/subject.py' \\\n  'linux/llm-stack/tests/gateway_e2e/subject.py' \\\n  'linux/llm-stack/tests/gateway_e2e/test_e2e_routing.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The gateway E2E fixture, HTTP client and operations tests must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.cross-active-registration-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/cross_active_registration_tests.py' \\",
  "replace": "  'linux/scripts/tests/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The cross-active registration fixture must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.compiler-candidate-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/compiler_candidate_tests.py' \\",
  "replace": "  'linux/scripts/tests/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The mocked compiler candidate test must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.media-file-set-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/media_file_set_tests.py' \\",
  "replace": "  'linux/scripts/tests/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The media file-set fixture must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.host-python-pins-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/host_python_pin_tests.py' \\",
  "replace": "  'linux/scripts/tests/host_python_pin_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Host Python pin receipts and policy tests must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.validator-probe-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/validator_probe_tests.py' \\",
  "replace": "  'linux/scripts/tests/validator_probe_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Validator probe receipts and test methods must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.runtime-child-stop-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/runtime_child_stop_tests.py' \\",
  "replace": "  'linux/scripts/tests/runtime_child_stop_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Runtime child-stop receipts and tests must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.wheel-tag-resolution-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/wheel_tag_resolution_tests.py' \\",
  "replace": "  'linux/scripts/tests/wheel_tag_resolution_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Wheel tag resolution rows and captures must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.runtime-sdk-help-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/runtime_sdk_help_tests.py' \\",
  "replace": "  'linux/scripts/tests/runtime_sdk_help_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Runtime SDK help tests and fixture helpers must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.triplet-query-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/triplet_query_tests.py' \\",
  "replace": "  'linux/scripts/tests/triplet_query_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Triplet query cases, captures and API contract must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.advertised-keys-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/verify_advertised_keys.py' \\",
  "replace": "  'linux/scripts/verify_advertised_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Advertised version-key verification helpers must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.cli-help-exit-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/cli_help_exit_tests.py' \\",
  "replace": "  'linux/scripts/tests/cli_help_exit_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "CLI help exit fixtures and receipt methods must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.image-ref-cli-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/image_ref_cli_tests.py' \\",
  "replace": "  'linux/scripts/tests/image_ref_cli_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Image-reference CLI receipts and test methods must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.smoke-native-dispatch-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/smoke_native_dispatch_tests.py' \\",
  "replace": "  'linux/scripts/tests/smoke_native_dispatch_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Native smoke dispatch fixtures and callbacks must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.nerdctl-service-receipt-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/nerdctl_service_receipt_tests.py' \\",
  "replace": "  'linux/scripts/tests/nerdctl_service_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Nerdctl service section receipts must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.binfmt-probe-controls-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/binfmt_probe_controls.py' \\",
  "replace": "  'linux/scripts/tests/binfmt_probe_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Binfmt mutation controls must retain typed process and receipt callbacks in the fatal Ruff scope."
 },
 {
  "id": "python-types.native-gcc-environment-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/native_gcc_env_tests.py' \\",
  "replace": "  'linux/scripts/tests/native_gcc_env_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Native GCC environment receipts and tests must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.dockerfile-env-order-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/verify_dockerfile_env_order.py' \\",
  "replace": "  'linux/scripts/verify_dockerfile_env_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Dockerfile ENV ordering parser helpers must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.image-consumer-bootstrap-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/test-image-consumer-bootstrap.py' \\",
  "replace": "  'linux/scripts/tests/image-consumer-bootstrap-subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Image consumer bootstrap setup and test helpers must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.npm-python-transport-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/npm_python_transport_tests.py' \\",
  "replace": "  'linux/scripts/tests/npm_python_transport_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "NPM Python transport fixtures and tests must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.python-provider-context-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/python-provider-context-tests.py' \\",
  "replace": "  'linux/scripts/tests/python-provider-context-subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Python provider context receipts and copied-owner controls must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.serving-stack-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/llm-stack/tests/test_serving_stack.py' \\",
  "replace": "  'linux/llm-stack/tests/serving-stack-subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Serving stack contract tests must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.llm-network-guard-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/llm-stack/tests/conftest.py' \\",
  "replace": "  'linux/llm-stack/tests/network-guard-subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The LLM test network guard must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.libcamera-report-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/libcamera-report-tests.py' \\",
  "replace": "  'linux/scripts/tests/libcamera-report-subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Libcamera report receipts and dynamic scope checks must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.consumer-quality-wiring-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/consumer_quality_wiring_tests.py' \\",
  "replace": "  'linux/scripts/tests/consumer_quality_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Consumer quality wiring fixtures and failure tests must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.embedded-python-extractor-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/extract_embedded_python.py' \\",
  "replace": "  'linux/scripts/extract_embedded_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Embedded Python extraction helpers must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.corrosion-toolchain-test-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/test-corrosion-toolchain.py' \\",
  "replace": "  'linux/scripts/tests/corrosion-toolchain-subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Corrosion toolchain fixtures must keep their configure and test methods in fatal Ruff annotation coverage."
 },
 {
  "id": "python-types.sudo-policy-closure-test-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/sudo_policy_closure_tests.py' \\",
  "replace": "  'linux/scripts/tests/sudo_policy_closure_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Sudo policy closure tests must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.wheel-archive-transport-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/wheel_archive_transport_tests.py' \\",
  "replace": "  'linux/scripts/tests/wheel_archive_transport_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Wheel archive transport receipts and helpers must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.webdav-download-test-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/webdav_download_tests.py' \\",
  "replace": "  'linux/scripts/tests/webdav_download_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "WebDAV client receipt tests must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.meson-bound-provider-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/meson_bound_provider_tests.py' \\",
  "replace": "  'linux/scripts/tests/meson_bound_provider_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Meson provider binding receipts must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.flutter-trace-summary-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/05-frameworks/flutter/flutter-trace-summary.py' \\",
  "replace": "  'linux/scripts/05-frameworks/flutter/flutter-trace-subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Flutter trace summary parsing and span reporting must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.wheelhouse-manifest-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/wheelhouse_manifest_tests.py' \\",
  "replace": "  'linux/scripts/tests/wheelhouse_manifest_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Wheelhouse manifest receipts and methods must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.host-cargo-preparation-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/host_cargo_preparation_tests.py' \\",
  "replace": "  'linux/scripts/tests/host_cargo_preparation_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The host Cargo fixture's shared capture contract must stay under fatal parameter and public-return checks."
 },
 {
  "id": "python-types.target-cargo-pipeline-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/target_cargo_pipeline_tests.py' \\",
  "replace": "  'linux/scripts/tests/target_cargo_pipeline_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The target Cargo pipeline receipt fixture must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.meson-dispatch-test-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/meson_dispatch_tests.py' \\",
  "replace": "  'linux/scripts/tests/meson_dispatch_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The Meson dispatch fixture must keep typed case rows and capture results inside the fatal Ruff scope."
 },
 {
  "id": "python-types.binfmt-probe-test-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/binfmt_probe_tests.py' \\",
  "replace": "  'linux/scripts/tests/binfmt_probe_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The binfmt probe test's subprocess receipts and helpers must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.frontend-perf-report-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/05-frameworks/flutter/frontend-perf-report.py' \\",
  "replace": "  'linux/scripts/05-frameworks/flutter/subject-report.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The frontend performance reporter must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.clang-job-policy-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/clang_job_policy_tests.py' \\",
  "replace": "  'linux/scripts/tests/clang_job_subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The Clang job policy receipt fixture must keep its explicit types in the fatal Ruff scope."
 },
 {
  "id": "python-types.smoke-query-contract-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/tests/smoke-query-contract-tests.py' \\",
  "replace": "  'linux/scripts/tests/smoke-query-no-contract-tests.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The smoke query contract suite must keep its case shapes and helper signatures in the fatal Ruff scope."
 },
 {
  "id": "python-types.jetson-webcam-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/jetson-webcam/app.py' \\",
  "replace": "  'linux/jetson-webcam/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The Jetson webcam's threaded frame transport and HTTP entry points must keep fatal parameter and public-return annotations."
 },
 {
  "id": "python-types.windows-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'windows/scripts/certificates/*.py'",
  "replace": "'windows/scripts/certificates/no_matches_*.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Windows Python source must retain a strict Windows-platform type check."
 },
 {
  "id": "python-types.llm-test-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/llm-stack/tests/*.py'",
  "replace": "'linux/llm-stack/tests/no_matches_*.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "LLM stack tests must remain in the strict type scope."
 },
 {
  "id": "python-types.wheel-test-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/02-toolchain/python/free-threaded-wheel-tests.py'",
  "replace": "'linux/scripts/02-toolchain/python/no-matches.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Free-threaded wheel tests must remain in the strict type scope."
 },
 {
  "id": "python-types.renovate-audit-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/renovate_audit.py' 'linux/scripts/renovate_cmake.py' \\",
  "replace": "'linux/scripts/no-renovate-audit.py' 'linux/scripts/renovate_cmake.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Renovate's YAML audit must remain in the strict type scope."
 },
 {
  "id": "python-types.markdown-parser-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/lib/dartdoc-guides.py' \\",
  "replace": "  'linux/scripts/lib/no-dartdoc-guides.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The Markdown parser helper must remain in the strict type scope."
 },
 {
  "id": "python-types.locked-environment-wiring",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--python \"${quality_python}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "ty must resolve the locked quality environment so selected third-party imports are checked."
 },
 {
  "id": "python-types.staticmethod-annotation-gate",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--select ANN002,ANN003,ANN204,ANN205,ANN206",
  "replace": "--select ANN002,ANN003,ANN204,ANN206",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "A missing staticmethod return annotation must fail the full tracked-tree gate."
 },
 {
  "id": "python-types.classmethod-annotation-gate",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--select ANN002,ANN003,ANN204,ANN205,ANN206",
  "replace": "--select ANN002,ANN003,ANN204,ANN205",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "A missing classmethod return annotation must fail the full tracked-tree gate."
 },
 {
  "id": "python-types.constructor-annotation-gate",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--select ANN002,ANN003,ANN204,ANN205,ANN206",
  "replace": "--select ANN002,ANN003,ANN205,ANN206",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "A missing constructor return annotation must fail the full tracked-tree gate."
 },
 {
  "id": "python-types.variadic-annotation-gate",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--select ANN002,ANN003,ANN204,ANN205,ANN206",
  "replace": "--select ANN003,ANN204,ANN205,ANN206",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "A missing variadic positional annotation must fail the full tracked-tree gate."
 },
 {
  "id": "python-types.keyword-annotation-gate",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--select ANN002,ANN003,ANN204,ANN205,ANN206",
  "replace": "--select ANN002,ANN204,ANN205,ANN206",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "A missing variadic keyword annotation must fail the full tracked-tree gate."
 },
 {
  "id": "python-types.private-return-gate",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--select ANN202 --output-format concise",
  "replace": "--select ANN204 --output-format concise",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "A missing private return annotation in any tracked Python file must fail the Ruff gate."
 },
 {
  "id": "python-types.private-return-full-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--select ANN202 --output-format concise \"${py_files[@]}\"",
  "replace": "--select ANN202 --output-format concise \"${quality_files[@]}\"",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Windows and image-only Python outside ty's quality subset must remain in the strict ANN202 scan."
 },
 {
  "id": "python-lint.hub-unused-import-gate",
  "target": "linux/scripts/lint-python.sh",
  "find": "HUB_UNUSED_SELECT=\"F401,F841,RUF059\"",
  "replace": "HUB_UNUSED_SELECT=\"F841,RUF059\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "An unused import in hub Python or a shell heredoc must fail the full hub sweep."
 },
 {
  "id": "python-lint.hub-unused-assignment-gate",
  "target": "linux/scripts/lint-python.sh",
  "find": "HUB_UNUSED_SELECT=\"F401,F841,RUF059\"",
  "replace": "HUB_UNUSED_SELECT=\"F401,RUF059\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "An unused assigned value must fail the full hub sweep."
 },
 {
  "id": "python-lint.hub-unused-unpacking-gate",
  "target": "linux/scripts/lint-python.sh",
  "find": "HUB_UNUSED_SELECT=\"F401,F841,RUF059\"",
  "replace": "HUB_UNUSED_SELECT=\"F401,F841\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "An unused unpacked binding must fail the full hub sweep."
 },
 {
  "id": "python-lint.hub-regex-flag-gate",
  "target": "linux/scripts/lint-python.sh",
  "find": "HUB_REGEX_SELECT=\"FURB167\"",
  "replace": "HUB_REGEX_SELECT=\"E9\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "An abbreviated regex flag in hub Python or an extracted shell block must fail the full hub sweep."
 },
 {
  "id": "python-lint.hub-string-concatenation-gate",
  "target": "linux/scripts/lint-python.sh",
  "find": "HUB_STRING_SELECT=\"ISC004\"",
  "replace": "HUB_STRING_SELECT=\"E9\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "An unparenthesized adjacent string in a hub collection must fail the full lint sweep."
 },
 {
  "id": "python-lint.hub-string-format-gate",
  "target": "linux/scripts/lint-python.sh",
  "find": "HUB_FORMAT_SELECT=\"UP032\"",
  "replace": "HUB_FORMAT_SELECT=\"E9\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "A format call in hub Python or an extracted shell block must fail the full lint sweep."
 },
 {
  "id": "python-lint.hub-literal-attribute-gate",
  "target": "linux/scripts/lint-python.sh",
  "find": "HUB_ATTR_SELECT=\"B009\"",
  "replace": "HUB_ATTR_SELECT=\"E9\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "A constant getattr in hub Python or an extracted shell block must fail; dynamic names and consumer roots remain outside this rule."
 },
 {
  "id": "python-types.ty-pin-env-override",
  "target": "linux/scripts/lint-python-types.sh",
  "find": ". linux/scripts/01-core/load-ty-tool.sh\nunset RUFF_VERSION\nload_ty_tool linux/scripts/01-core/tool-pins.env",
  "replace": ". linux/scripts/01-core/load-versions-env.sh\nunset RUFF_VERSION\nload_versions_env linux/scripts/01-core/tool-pins.env",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "An ambient ty version must not replace the repository pin in the strict type gate."
 },
 {
  "id": "python-types.ruff-pin-env-override",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "unset RUFF_VERSION",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "An ambient Ruff version must not replace the repository pin in the annotation gate."
 },
 {
  "id": "python-types.parameter-annotation-gate",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--select ANN001,ANN201 --output-format concise",
  "replace": "--select ANN201 --output-format concise",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Missing parameter types in all 37 selected Python files must fail the strict Ruff gate."
 },
 {
  "id": "python-types.public-return-annotation-gate",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--select ANN001,ANN201 --output-format concise",
  "replace": "--select ANN001 --output-format concise",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Missing public return types in all 37 selected Python files must fail the strict Ruff gate."
 },
 {
  "id": "python-types.parameter-return-file-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'docs/scripts/verify_code_dupes.py' 'docs/scripts/verify_doc_dupes.py'",
  "replace": "'docs/scripts/verify_code_dupes.py' 'docs/scripts/subject.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "All 37 typed Python files must remain in the strict parameter and public-return scope."
 },
 {
  "id": "python-types.complexity-file-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/verify_code_complexity.py'",
  "replace": "'linux/scripts/subject.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The complexity scanner must remain in the strict parameter and public-return scope."
 },
 {
  "id": "python-types.venv-probe-file-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/06-packaging/venv-version-probe.py' \\",
  "replace": "  'linux/scripts/06-packaging/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The runtime venv version probe must remain in the fatal parameter and public-return scope."
 },
 {
  "id": "python-types.data-lock-fetcher-file-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/lib/fetch-data-lock.py' \\",
  "replace": "  'linux/scripts/lib/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The SHA-256 data-lock fetcher must remain in the fatal parameter and public-return scope."
 },
 {
  "id": "python-types.gstreamer-metadata-file-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/03-media/build/gstreamer/common/gst-python-build-config.py' \\",
  "replace": "  'linux/scripts/03-media/build/gstreamer/common/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The GStreamer metadata helper must remain in the fatal parameter and public-return scope."
 },
 {
  "id": "python-types.ort-census-file-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/03-media/runtime/ort-venv-census.py' \\",
  "replace": "  'linux/scripts/03-media/runtime/subject.py' \\",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The shared Linux and Windows ORT census must keep strict parameter and public-return annotations."
 },
 {
  "id": "python-types.docs-conf-file-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "git ls-files -z -- 'docs/conf.py'",
  "replace": "git ls-files -z -- 'docs/scripts/subject.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "A type error in docs/conf.py must fail the theme-aware docs type gate."
 },
 {
  "id": "python-types.docs-conf-theme-path",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--extra-search-path \"${theme}\"",
  "replace": "--extra-search-path \"${ROOT}/docs/scripts\"",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The strict docs type gate must resolve the pinned theme source instead of reporting its import as unresolved."
 },
 {
  "id": "python-types.chain-sibling-pid-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/tests/chain_sibling_pid_tests.py'",
  "replace": "'linux/scripts/subject.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Chain sibling PID receipts must remain in the fatal parameter and public-return annotation scope."
 },
 {
  "id": "python-types.log-dir-consumer-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/tests/log_dir_consumer_tests.py'",
  "replace": "'linux/scripts/subject.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Log-directory consumer receipts must remain in the fatal parameter and public-return annotation scope."
 },
 {
  "id": "python-types.gateway-logtail-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/llm-stack/tests/test_gateway_logtail.py'",
  "replace": "'linux/scripts/subject.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Gateway log-tail tests must remain in the fatal parameter and public-return annotation scope."
 },
 {
  "id": "python-types.webdav-downloader-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/verify_consumer_inventory.py' 'linux/scripts/verify_package_names.py' \\\n  'linux/scripts/01-core/download-webdav-files.py' \\\n  'linux/llm-stack/gateway/render_apisix.py'",
  "replace": "'linux/scripts/verify_consumer_inventory.py' 'linux/scripts/verify_package_names.py' \\\n  'linux/scripts/subject.py' \\\n  'linux/llm-stack/gateway/render_apisix.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The WebDAV downloader must remain in the fatal parameter and public-return annotation scope."
 },
 {
  "id": "python-types.docs-conf-report-partition",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'docs/conf.py'",
  "replace": "  'docs/scripts/subject.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The docs configuration must stay in its theme-aware type gate instead of the generic report environment."
 },
 {
  "id": "python-types.jetson-app-report-partition",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "linux_environment_checked_files=(\n  'docs/conf.py'\n  'linux/jetson-webcam/app.py'",
  "replace": "linux_environment_checked_files=(\n  'docs/conf.py'\n  'linux/scripts/subject.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The Jetson app must stay in the assembled runtime type gate instead of the generic report environment."
 },
 {
  "id": "python-types.webdav-report-partition",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/jetson-webcam/app.py'\n  'linux/scripts/01-core/download-webdav-files.py'\n  'linux/scripts/06-packaging/venv-version-probe.py'",
  "replace": "  'linux/jetson-webcam/app.py'\n  'linux/scripts/subject.py'\n  'linux/scripts/06-packaging/venv-version-probe.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The WebDAV downloader must stay in its pinned-client type gate instead of the generic report environment."
 },
 {
  "id": "python-types.venv-probe-report-partition",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/01-core/download-webdav-files.py'\n  'linux/scripts/06-packaging/venv-version-probe.py'\n)",
  "replace": "  'linux/scripts/01-core/download-webdav-files.py'\n  'linux/scripts/subject.py'\n)",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The runtime venv probe must stay in its assembled environment type gate instead of the generic report."
 },
 {
  "id": "python-types.litert-report-partition",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "windows_environment_checked_files=('windows/scripts/build/litert-wheel-smoke.py')",
  "replace": "windows_environment_checked_files=('windows/scripts/subject.py')",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The LiteRT smoke must stay in its installed-wheel type gate instead of the generic Windows report."
 },
 {
  "id": "python-types.dedicated-source-existence",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  [ -f \"$file\" ] || {",
  "replace": "  true || {",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "A file removed from an environment-specific type gate must fail before the common report skips it."
 },
 {
  "id": "python-types.jetson-build-source-mount",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "source=linux/jetson-webcam/app.py,target=/tmp/venv-probe-ty/jetson-webcam-app.py,ro",
  "replace": "source=linux/jetson-webcam/subject.py,target=/tmp/venv-probe-ty/jetson-webcam-app.py,ro",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The Jetson app must be mounted into the runtime dependency type gate."
 },
 {
  "id": "python-types.jetson-build-typecheck",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "bash /tmp/venv-probe-ty/check.sh /opt/venv /tmp/venv-probe-ty/jetson-webcam-app.py",
  "replace": "bash /tmp/venv-probe-ty/check.sh /opt/venv /tmp/venv-probe-ty/subject.py",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The Jetson app must be type-checked against the assembled torch environment."
 },
 {
  "id": "python-types.generic-report-fatal",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "      printf '%s failed (exit 1); %s\\n' \"${label}\" \"${report}\" >&2\n      return 1",
  "replace": "      printf '%s failed (exit 1); %s\\n' \"${label}\" \"${report}\" >&2\n      return 0",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Findings in dynamically discovered Linux and Windows Python files must fail the compatible ty report."
 },
 {
  "id": "python-types.annotation-report-fatal",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  printf 'Ruff annotation gate failed (exit 1); %s\\n' \"${annotations_report}\" >&2\n  exit 1",
  "replace": "  printf 'Ruff annotation gate failed (exit 1); %s\\n' \"${annotations_report}\" >&2\n  exit 0",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Any Ruff ANN finding in the full tracked-Python scan must fail the quality gate."
 },
 {
  "id": "python-lint.full-default-ruleset-fatal",
  "target": "linux/scripts/lint-python.sh",
  "find": "    err \"full Ruff ruleset failed\"",
  "replace": "    echo \"full Ruff ruleset failed\"",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "The default full hub sweep must fail on Ruff findings outside its focused selectors."
 },
 {
  "id": "python-lint.utf8-diagnostic-output",
  "target": "linux/scripts/lint-python.sh",
  "find": "  PYTHONIOENCODING=utf-8 ${_LINT_PY} - \"${_EMB_MAP:-/dev/null}\" \"$1\" <<'EMBPY'",
  "replace": "  ${_LINT_PY} - \"${_EMB_MAP:-/dev/null}\" \"$1\" <<'EMBPY'",
  "test": "bash linux/scripts/tests/test-python-lint-gate.sh",
  "why": "Windows Python can inherit cp1252 and fail to print non-ASCII Ruff source lines unless the relabeler explicitly uses UTF-8."
 },
 {
  "id": "version-bump.checksum-network-only",
  "target": "docs/scripts/bump_fetch.py",
  "find": "        except OSError:\n            text = None\n        if text is None:",
  "replace": "        except Exception:\n            text = None\n        if text is None:",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "a checksum mirror's network failure may fall through, but a parser bug must not masquerade as a missing checksum"
 },
 {
  "id": "version-bump.release-api-fallback-narrow",
  "target": "docs/scripts/bump_fetch.py",
  "find": "    except (OSError, json.JSONDecodeError):\n        rel = None",
  "replace": "    except Exception:\n        rel = None",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "only an unavailable or invalid-JSON release API response may trigger the large asset-hash fallback"
 },
 {
  "id": "version-bump.artifact-probe-network-only",
  "target": "docs/scripts/bump_fetch.py",
  "find": "    except OSError:\n        return False",
  "replace": "    except Exception:\n        return False",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "an unavailable artifact endpoint is a negative candidate, but an implementation error must not be treated as absence"
 },
 {
  "id": "gitleaks.ignored-logs-excluded",
  "target": ".gitleaks.toml",
  "find": "paths = ['''^logs/''', '''(^|/)__pycache__/''', '''^quality/\\.venv/''']",
  "replace": "paths = ['''(^|/)__pycache__/''', '''^quality/\\.venv/''']",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "ignored test logs hold synthetic credentials and must not be mistaken for source"
 },
 {
  "id": "gitleaks.python-bytecode-excluded",
  "target": ".gitleaks.toml",
  "find": "paths = ['''^logs/''', '''(^|/)__pycache__/''', '''^quality/\\.venv/''']",
  "replace": "paths = ['''^logs/''', '''^quality/\\.venv/''']",
  "test": "bash linux/scripts/tests/test-secret-scan.sh",
  "why": "ignored Python bytecode caches can contain scanner-shaped bytes but are not source"
 },
 {
  "id": "renovate.wrapper-consumer-complexity",
  "target": "shared/linux/templates/antfrastructure.sh",
  "find": "    antfrastructure_renovate_check_gitlink \"$git_bin\" \"$git_root\" || return 1",
  "replace": "    if false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false; then :; fi\n    antfrastructure_renovate_check_gitlink \"$git_bin\" \"$git_root\" || return 1",
  "test": "bash linux/scripts/tests/test-renovate-template-bootstrap.sh",
  "why": "a copied Renovate bootstrap with too many decision paths must fail the consumer complexity gate"
 },
 {
  "id": "renovate.wrapper-windows-git-index-view",
  "target": "shared/linux/templates/renovate-git-mode.sh",
  "find": "    [ \"$autocrlf\" = true ] || return 1",
  "replace": "    [ \"$autocrlf\" = false ] || return 1",
  "test": "bash linux/scripts/tests/test-renovate-template-bootstrap.sh",
  "why": "a Windows-authored WSL checkout can show a false .gitmodules modification under WSL Git, so bootstrap must use Windows Git for index checks, initialization and rollback"
 },
 {
  "id": "renovate.wrapper-windows-config-path",
  "target": "shared/linux/templates/antfrastructure.sh",
  "find": "        config=\"$(wslpath -u \"$config\")\" || exit 1",
  "replace": "        config=\"$config\"",
  "test": "bash linux/scripts/tests/test-renovate-template-bootstrap.sh",
  "why": "Windows Git emits a Windows config path; the WSL shell must translate it before backing up the parent config"
 },
 {
  "id": "renovate.driver-windows-git-after-initialization",
  "target": "linux/scripts/renovate-tree.sh",
  "find": "    win_target=\"$(antfrastructure_renovate_windows_git_root \"${TARGET}\")\" || return 0",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-renovate-submodule-default.sh",
  "why": "a Windows-authored checkout must keep Windows Git after initialization removes the last missing-submodule signal"
 },
 {
  "id": "renovate.wrapper-apply-initializes-hub",
  "target": "shared/linux/templates/antfrastructure.sh",
  "find": "            --apply) apply=1 ;;",
  "replace": "            --apply) : ;;",
  "test": "bash linux/scripts/tests/test-renovate-template-bootstrap.sh",
  "why": "without the copied wrapper's bootstrap, a fresh consumer clone cannot load the Renovate driver for its first apply"
 },
 {
  "id": "renovate.wrapper-dry-run-does-not-clone",
  "target": "shared/linux/templates/antfrastructure.sh",
  "find": "            --dry-run) return 1 ;;",
  "replace": "            --dry-run) : ;;",
  "test": "bash linux/scripts/tests/test-renovate-template-bootstrap.sh",
  "why": "a preview must not initialize the very hub checkout whose absence the user is inspecting"
 },
 {
  "id": "renovate.wrapper-fatal-restores-hub",
  "target": "shared/linux/templates/antfrastructure.sh",
  "find": "    if [ \"$status\" -ne 0 ] && [ \"$status\" -ne 2 ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-renovate-template-bootstrap.sh",
  "why": "a fatal driver status after bootstrap must not leave an initialized hub or changed parent config behind"
 },
 {
  "id": "renovate.wrapper-refusal-keeps-hub",
  "target": "shared/linux/templates/antfrastructure.sh",
  "find": "    if [ \"$status\" -ne 0 ] && [ \"$status\" -ne 2 ]; then",
  "replace": "    if [ \"$status\" -ne 0 ]; then",
  "test": "bash linux/scripts/tests/test-renovate-template-bootstrap.sh",
  "why": "driver exit two can carry applied updates and explicit refusals, so its initialized hub must remain for review"
 },
 {
  "id": "lib.ci-image-python-marker",
  "target": "linux/scripts/01-core/python-probe.sh",
  "find": "[ -z \"${PYTHON_MAJOR_MINOR:-}\" ]",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "a runnable host interpreter alone must not satisfy the family image requirement"
 },
 {
  "id": "lib.ci-image-python-runs",
  "target": "linux/scripts/01-core/python-probe.sh",
  "find": "! (PREFLIGHT_PYTHON=\"$python\"; preflight_python_require \"$caller\") >/dev/null 2>&1",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-python-path-policies.sh",
  "why": "an executable but broken interpreter must fail before consumer tests begin"
 },
 {
  "id": "hub-reuse.finding-is-fatal",
  "target": "docs/scripts/verify_hub_reuse.py",
  "find": "    if findings and not args.report_only:\n        return 1",
  "replace": "    if findings and not args.report_only:\n        return 0",
  "test": "bash linux/scripts/tests/test-hub-reuse.sh",
  "why": "an actual copied Bash or PowerShell unit must fail strict mode even though report-only remains advisory"
 },
 {
  "id": "hub-reuse.shared-drift-is-fatal",
  "target": "docs/scripts/verify_hub_reuse.py",
  "find": "        if result.returncode:\n            details = (result.stdout + result.stderr).strip()",
  "replace": "        if False:\n            details = (result.stdout + result.stderr).strip()",
  "test": "bash linux/scripts/tests/test-hub-reuse.sh",
  "why": "a declared copied bootstrap that drifts from the hub must fail even when findings are only reported"
 },
 {
  "id": "hub-reuse.windows-native-drift-check",
  "target": "docs/scripts/verify_hub_reuse.py",
  "find": "    if sys.platform == \"win32\":\n        commands = commands[::-1]",
  "replace": "    if False:\n        commands = commands[::-1]",
  "test": "bash linux/scripts/tests/test-hub-reuse.sh",
  "why": "native Windows checkout paths must be checked with PowerShell before a bash command can enter WSL"
 },
 {
  "id": "hub-reuse.workflow-invokes-scanner",
  "target": ".github/workflows/code-quality-report.yml",
  "find": "            python3 \"${hub}/docs/scripts/verify_hub_reuse.py\" \\",
  "replace": "            python3 \"${hub}/docs/scripts/verify_hub_reuse_missing.py\" \\",
  "test": "bash linux/scripts/tests/test-code-quality-report-workflow.sh",
  "why": "the reusable measurement workflow must execute the Hub reuse scanner rather than only write a report placeholder"
 },
 {
  "id": "hub-reuse.missing-owned-scanner-fails",
  "target": ".github/workflows/code-quality-report.yml",
  "find": "              cat logs/code-quality/measurements/hub-reuse.txt >&2\n              exit 1",
  "replace": "              cat logs/code-quality/measurements/hub-reuse.txt >&2\n              :",
  "test": "bash linux/scripts/tests/test-code-quality-report-workflow.sh",
  "why": "an owned caller with an old ANTfrastructure gitlink must fail instead of publishing a green upgrade notice"
 },
 {
  "id": "lib.media-runtime-foreign-directml",
  "target": "windows/scripts/modules/WindowsMediaRuntime.Common.psm1",
  "find": "Where-Object { $_.Name -eq 'DirectML.dll' }",
  "replace": "Where-Object { $_.Name -eq 'never-directml.dll' }",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only WindowsMediaRuntime.Common.Tests.ps1 -ResultFile logs/code-quality/media-runtime-directml.json",
  "why": "a GStreamer root must not supply DirectML.dll; only the chain install may stage its redist bytes"
 },
 {
  "id": "probe.app-venv-syncs-frontend",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "    --extra \"docs\" \\\n    --extra \"frontend\")",
  "replace": "    --extra \"docs\")",
  "test": "bash linux/scripts/tests/test-app-venv-frontend.sh",
  "why": "the image's app venv must carry OrchestrANT's frontend extra so the Flet viewers run in it"
 },
 {
  "id": "probe.venvset-contract-holds-frontend",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "_VENV_CONTRACT_EXTRAS=\"ml-ai docs frontend\"",
  "replace": "_VENV_CONTRACT_EXTRAS=\"ml-ai docs\"",
  "test": "bash linux/scripts/tests/test-app-venv-frontend.sh",
  "why": "VENV-SET must assert the frontend extra's packages on the arches whose markers want them"
 },
 {
  "id": "probe.venvset-frontend-off-riscv64",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    riscv64) printf '%s\\n' \"${_VENV_CONTRACT_EXTRAS/ frontend/}\" ;;",
  "replace": "    riscv64) printf '%s\\n' \"${_VENV_CONTRACT_EXTRAS}\" ;;",
  "test": "bash linux/scripts/tests/test-app-venv-frontend.sh",
  "why": "riscv64's markers drop every frontend edge, so asserting the extra there would fail a correct image as NOREQ"
 },
 {
  "id": "probe.app-parity-requires-flet-desktop",
  "target": "linux/scripts/06-packaging/smoke-torch-venv.sh",
  "find": "    (\"flet-desktop\",       \"frontend\"),\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-app-venv-frontend.sh",
  "why": "APP-PARITY must fail a venv that lost flet-desktop, the package that starts the desktop client"
 },
 {
  "id": "probe.app-parity-flet-web-riscv64-exempt",
  "target": "linux/scripts/06-packaging/smoke-torch-venv.sh",
  "find": "for dist, extra in REQUIRED if extra == \"frontend\"})",
  "replace": "for dist, extra in REQUIRED if extra == \"never\"})",
  "test": "bash linux/scripts/tests/test-app-venv-frontend.sh",
  "why": "riscv64's absent flet-web is a recorded decision; without the row APP-PARITY fails a correct riscv64 image"
 },
 {
  "id": "python.relocate.interpreter-runpath",
  "target": "linux/scripts/06-packaging/python-relocate.py",
  "find": "subprocess.run([args.patchelf, \"--set-rpath\", RUNPATH, str(exe)], check=True)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-python-relocate.sh",
  "why": "without $ORIGIN/../lib a moved interpreter loads the image's /usr/local libpython through ld.so.conf, or none on a host"
 },
 {
  "id": "python.relocate.sysconfig-rewrite",
  "target": "linux/scripts/06-packaging/python-relocate.py",
  "find": "_PREFIX_TOKEN.sub(lambda _m: _sys.base_prefix, _value) if isinstance(_value, str) else _value",
  "replace": "_value",
  "test": "bash linux/scripts/tests/test-python-relocate.sh",
  "why": "an unrewritten _sysconfigdata points LIBDIR and INCLUDEPY at the build prefix, so builds inside the bundle link the image's tree"
 },
 {
  "id": "python.relocate.drop-system-site",
  "target": "linux/scripts/06-packaging/python-relocate.py",
  "find": "return [n for n in names if n != \"README.txt\"]",
  "replace": "return []",
  "test": "bash linux/scripts/tests/test-python-relocate.sh",
  "why": "the system interpreter's site-packages would travel into every bundle beside the locked wheels"
 },
 {
  "id": "python.relocate.drop-readline",
  "target": "linux/scripts/06-packaging/python-relocate.py",
  "find": "return [n for n in names if n.startswith(\"readline.\")]",
  "replace": "return []",
  "test": "bash linux/scripts/tests/test-python-relocate.sh",
  "why": "the readline binding links GNU readline (GPL-3) into a shipped bundle"
 },
 {
  "id": "python.relocate.check-libpython-origin",
  "target": "linux/scripts/06-packaging/python-relocate.py",
  "find": "if not libs or any(not str(lib).startswith(f\"{moved}/\") for lib in libs):",
  "replace": "if not libs:",
  "test": "bash linux/scripts/tests/test-python-relocate.sh",
  "why": "a moved interpreter that maps the unmoved libpython passes inside the image and fails on a host"
 },
 {
  "id": "python.relocate.check-absolute-runpath",
  "target": "linux/scripts/06-packaging/python-relocate.py",
  "find": "if not e.startswith(\"$ORIGIN\")",
  "replace": "if not e",
  "test": "bash linux/scripts/tests/test-python-relocate.sh",
  "why": "an absolute RUNPATH ties the bundle to a directory that does not exist on the user's host"
 },
 {
  "id": "python.relocate.check-shared-only",
  "target": "linux/scripts/06-packaging/python-relocate.py",
  "find": "if not facts[\"shared\"]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-python-relocate.sh",
  "why": "a static interpreter has no libpython to move, and its RUNPATH rewrite proves nothing"
 },
 {
  "id": "python.bundle.image-runtime-default",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "PYTHON_RUNTIME=\"image\"",
  "replace": "PYTHON_RUNTIME=\"standalone\"",
  "test": "bash linux/scripts/tests/test-python-relocate.sh",
  "why": "the bundle would download python-build-standalone again instead of the interpreter that built the wheels"
 },
 {
  "id": "python.relocate.smoke-row",
  "target": "linux/scripts/06-packaging/check-python-runtime.sh",
  "find": "&& $'\\n'\"${out}\" != *$'\\nFAIL: '* ]]",
  "replace": "]]",
  "test": "bash linux/scripts/tests/test-python-relocate.sh",
  "why": "a FAIL line from the relocation check would pass the runtime smoke"
 },
 {
  "id": "disk-guard.lane-need-arches-add-up",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "    need=$(( need + per ))\n",
  "replace": "    [ \"${per}\" -gt \"${need}\" ] && need=\"${per}\"\n",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "every wrapper stays local until the gates after the arch loop, so a 3-arch lane needs the sum; one wrapper is how a 289G entry passed and the run used 376G (CON141)"
 },
 {
  "id": "disk-guard.lane-need-amd64-figure",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "case \"$1\" in amd64) gb=165 ;; *) gb=105 ;; esac",
  "replace": "case \"$1\" in amd64) gb=120 ;; *) gb=105 ;; esac",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "amd64 alone used 165G on 2026-10-21; the per-arch figure is the measurement, not a guess"
 },
 {
  "id": "disk-guard.lane-need-local-wrapper-credit",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "      per=$(( per > credit ? per - credit : 0 ))\n",
  "replace": "      :\n",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "a rerun replaces a local wrapper and releases its layers; without the credit a warm rerun is refused at the host's normal free space"
 },
 {
  "id": "disk-guard.lane-need-watch-floor",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "need=$(( need + ${CROSS_DISK_GUARD_GB:-40} ))",
  "replace": "need=$(( need + 0 ))",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "the lane must end above the in-stage watch threshold, or the watch trims mid-run"
 },
 {
  "id": "runtime-push.drop-called-after-index",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    runtime_step_phase freshness _manifest_check_freshness\n  fi\n  runtime_step_phase drop-pushed _manifest_drop_pushed_images\n}",
  "replace": "    runtime_step_phase freshness _manifest_check_freshness\n  fi\n}",
  "test": "bash linux/scripts/tests/test-runtime-drop-pushed.sh",
  "why": "a helper with no call site frees nothing; pushed wrappers stayed local at ~50G each (CON141)"
 },
 {
  "id": "chain-status.resource-monitor-phase-marks-the-step",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  runtime_step_mark index \"$1\" on\n  \"${@:2}\"\n",
  "replace": "  \"${@:2}\"\n",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "a whole-lane phase without its marker is the stage=? sample this exists to end"
 },
 {
  "id": "chain-status.resource-monitor-phase-drops-its-marker",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  set -- \"$?\" \"$1\"\n  runtime_step_mark index \"$2\" off\n",
  "replace": "  set -- \"$?\" \"$1\"\n",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "a marker left behind names every later peak after a phase that has ended"
 },
 {
  "id": "chain-status.resource-monitor-phase-returns-its-status",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  runtime_step_mark index \"$2\" off\n  return \"$1\"\n",
  "replace": "  runtime_step_mark index \"$2\" off\n  return 0\n",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "a phase that swallows its status would let a refused gate continue to publication"
 },
 {
  "id": "chain-status.resource-monitor-gate-names-its-arch",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  runtime_step_mark \"$3\" \"${step}\" on\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "a gate's peak must name the arch and the gate, which run side by side"
 },
 {
  "id": "chain-status.resource-monitor-gate-keeps-its-status",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  runtime_step_mark \"$3\" \"${step}\" off\n  return \"${rc}\"\n",
  "replace": "  runtime_step_mark \"$3\" \"${step}\" off\n",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "a failed content gate that returns the marker's status would pass an index over a stale wrapper"
 },
 {
  "id": "chain-status.resource-monitor-main-marks-the-index",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    runtime_step_phase manifest create_manifest\n",
  "replace": "    create_manifest\n",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "the index gates and the push ran after the arch loop with nothing naming them"
 },
 {
  "id": "runtime-push.drop-no-push-keeps",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "[ \"${mode}\" = keep ] || [ \"${CROSS_NO_PUSH:-0}\" = \"1\" ] || ! runtime_pushes_wrapper_images || is_dry_run",
  "replace": "[ \"${mode}\" = keep ] || is_dry_run",
  "test": "bash linux/scripts/tests/test-runtime-drop-pushed.sh",
  "why": "a --no-push run's local images are its only copy; removing them loses the build"
 },
 {
  "id": "runtime-push.drop-knob-validated",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  _manifest_drop_mode >/dev/null || exit 2\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-drop-pushed.sh",
  "why": "a typo in RUNTIME_DROP_PUSHED_IMAGES must stop the lane at its start, not after hours of build"
 },
 {
  "id": "runtime-push.drop-leftover-tag",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "\"${wrapper}-tmp-reduced-platform\" ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-drop-pushed.sh",
  "why": "nerdctl push leaves <tag>-tmp-reduced-platform behind; it holds the same layers as the wrapper"
 },
 {
  "id": "lib.asset-mirror-verify-mirror-copy",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "    if download_verify_sha256 \"${expected_sha256}\" \"${dest}\" \"${hash_mode}\"; then",
  "replace": "    if true; then",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "a mirrored copy is trusted only after the pinned sha256 matches; the mirror never vouches for its own bytes"
 },
 {
  "id": "lib.asset-mirror-upstream-fallback",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "  download_file \"$url\" \"$dest\" || return 1\n  download_verify_sha256",
  "replace": "  return 1\n  download_verify_sha256",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "a mirror miss or a bad mirrored copy falls back to the upstream URL, so the mirror can only add availability"
 },
 {
  "id": "lib.asset-mirror-dead-mirror-latch",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "      _DOWNLOAD_MIRROR_DOWN=1",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "a mirror that takes no connection is skipped for the rest of the shell, so later downloads do not each wait on it"
 },
 {
  "id": "lib.asset-mirror-key-off-argv",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "-K - \"$@\" <<<\"${cfg}\"",
  "replace": "--user \"${key}:${secret}\" \"$@\"",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "the mirror's secret key reaches curl on stdin, never on a command line a process listing shows"
 },
 {
  "id": "lib.asset-mirror-object-name-strips-query",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "  local name=\"${1%%[?#]*}\"",
  "replace": "  local name=\"${1}\"",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "the object name is the URL's last path segment without its query, the name the fill script uploads under"
 },
 {
  "id": "lib.asset-mirror-secret-private-file",
  "target": "linux/scripts/01-core/build-helpers.sh",
  "find": "  if [ -n \"$(find \"${file}\" -perm /077 2>/dev/null)\" ]; then\n    printf '[WARN] %s: %s is readable",
  "replace": "  if false; then\n    printf '[WARN] %s: %s is readable",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "a host secret file others can read is never handed to a build"
 },
 {
  "id": "lib.asset-mirror-secret-needs-url",
  "target": "linux/scripts/01-core/build-helpers.sh",
  "find": "\"asset mirror\" \"\" ASSET_MIRROR_URL || return 0",
  "replace": "\"asset mirror\" \"\" ASSET_MIRROR_URL || :",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "a mirror config without ASSET_MIRROR_URL is not passed to a build"
 },
 {
  "id": "lib.asset-mirror-common-build-args",
  "target": "linux/scripts/01-core/build-helpers.sh",
  "find": "  append_asset_mirror_secret _acba_out",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "every cross stage and runtime build receives the mirror secret through append_common_build_args"
 },
 {
  "id": "lib.asset-mirror-dockerfile-mount",
  "target": "linux/Dockerfile.amd",
  "find": "RUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core,target=/tmp/core-scripts,ro",
  "replace": "RUN --mount=type=bind,source=linux/scripts/01-core,target=/tmp/core-scripts,ro",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "a RUN that reads a hub script mounts the mirror secret, or its downloads go to GitHub alone"
 },
 {
  "id": "lib.asset-mirror-fill-pinned-only",
  "target": "linux/host-config/fill-asset-mirror.sh",
  "find": "  if ! grep -qE -e \"^[A-Z0-9_]+=${sha}\\$\" \"${PIN_FILES[@]}\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "the fill script mirrors only digests versions.env or tool-pins.env pins, never what a log line names"
 },
 {
  "id": "lib.asset-mirror-fill-idempotent",
  "target": "linux/host-config/fill-asset-mirror.sh",
  "find": "  if download_mirror_curl \"${FILE}\" -I -o /dev/null \"${obj}\" 2>/dev/null; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "the fill script leaves a present object alone, so a rerun uploads nothing twice"
 },
 {
  "id": "handoff.reuse-key-ignores-android",
  "target": "linux/scripts/lib-runtime-reuse.sh",
  "find": "printf 'closure %s\\narch %s\\nandroid %s\\n' \"${closure}\" \"${arch}\" \"${android}\"",
  "replace": "printf 'closure %s\\narch %s\\nandroid %s\\n' \"${closure}\" \"${arch}\" \"\"",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a rebuilt android parent must change the key, or a child built on the old one is reused"
 },
 {
  "id": "handoff.reuse-key-ignores-knobs",
  "target": "linux/scripts/lib-runtime-reuse.sh",
  "find": "      printf 'knob %s=%s\\n' \"${name}\" \"${!name:-}\"",
  "replace": "      printf 'knob %s=\\n' \"${name}\"",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "another app commit or GPU pair must change the key"
 },
 {
  "id": "handoff.reuse-state-key-unchecked",
  "target": "linux/scripts/lib-runtime-reuse.sh",
  "find": "  if [ -n \"${want}\" ] && [ \"${got}\" = \"${want}\" ]; then printf 'reusable'; else printf 'stale'; fi",
  "replace": "  if true; then printf 'reusable'; else printf 'stale'; fi",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a child built from other inputs must stay stale"
 },
 {
  "id": "handoff.reuse-mode-default-off",
  "target": "linux/scripts/lib-runtime-reuse.sh",
  "find": "runtime_switch_mode RUNTIME_REUSE_CHILDREN 1 ",
  "replace": "runtime_switch_mode RUNTIME_REUSE_CHILDREN 0 ",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "reuse is the default; RUNTIME_REUSE_CHILDREN=0 is the strict switch"
 },
 {
  "id": "handoff.reuse-plan-keeps-unreusable",
  "target": "linux/scripts/lib-runtime-reuse.sh",
  "find": "    if [ \"${state}\" != reusable ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a stale published child must not join the index"
 },
 {
  "id": "handoff.reuse-pull-unchecked",
  "target": "linux/scripts/lib-runtime-reuse.sh",
  "find": "    \"${check}\" \"${arch}\" \"${ref}\" \"${tag}\" || failed=\"${failed:+${failed} }${arch}\"",
  "replace": "    \"${check}\" \"${arch}\" \"${ref}\" \"${tag}\" || true",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a reused child that cannot be pulled, or that moved, must fail rather than pass with the others"
 },
 {
  "id": "handoff.reuse-recheck-digest-ignored",
  "target": "linux/scripts/lib-runtime-reuse.sh",
  "find": "  if [ \"${state}\" = reusable ] && [ \"${now##*@}\" = \"${2##*@}\" ]; then return 0; fi",
  "replace": "  if [ \"${state}\" = reusable ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "the index must list the digest the gates read, not one the tag moved to"
 },
 {
  "id": "handoff.reuse-pull-skipped",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  runtime_step_phase reuse-pull runtime_reuse_pull || return 1",
  "replace": "  : runtime_reuse_pull",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "the gates must read each reused child re-pulled by digest"
 },
 {
  "id": "handoff.reuse-recheck-skipped",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    runtime_reuse_recheck || err",
  "replace": "    true || err",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a reused child that moved after its gates must refuse the index"
 },
 {
  "id": "handoff.reuse-index-by-tag",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "    if [ -z \"${RUNTIME_REUSED_REFS:-}\" ] || ! ref=\"$(runtime_reused_ref \"${arch}\")\"; then",
  "replace": "    if true; then",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a reused child goes into the index by digest, never by its mutable tag"
 },
 {
  "id": "handoff.reuse-gates-target-only",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  mapfile -t arches < <(arch_list_to_words \"${RUNTIME_INDEX_ARCHES:-${TARGET_ARCHES}}\" | sed '/^$/d')\n  jobs=",
  "replace": "  mapfile -t arches < <(arch_list_to_words \"${TARGET_ARCHES}\" | sed '/^$/d')\n  jobs=",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "every gate must read every child of the index, reused ones included"
 },
 {
  "id": "handoff.reuse-completeness-target-only",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "rc=0 index=\"${RUNTIME_INDEX_ARCHES:-${TARGET_ARCHES}}\"",
  "replace": "rc=0 index=\"${TARGET_ARCHES}\"",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "the completeness gate must count the reused children of the index"
 },
 {
  "id": "handoff.reuse-on-manifest-only",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  [ \"${BUILD_IMAGES}\" -eq 1 ] && [ \"${CREATE_MANIFEST}\" -eq 1 ] || return 0\n  runtime_reuse_plan",
  "replace": "  [ \"${CREATE_MANIFEST}\" -eq 1 ] || return 0\n  runtime_reuse_plan",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a --manifest-only repair runs no gate, so it must not add older children"
 },
 {
  "id": "handoff.reuse-closure-skips-nothing",
  "target": "linux/scripts/runtime-build-key.py",
  "find": "_SKIP_DIRS = frozenset({\"__pycache__\"})",
  "replace": "_SKIP_DIRS = frozenset()",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a test run's __pycache__ is outside the build context and must not change the key"
 },
 {
  "id": "handoff.reuse-closure-follows-from",
  "target": "linux/scripts/runtime-build-key.py",
  "find": "if fields.get(\"type\", \"bind\") != \"bind\" or \"from\" in fields:",
  "replace": "if fields.get(\"type\", \"bind\") != \"bind\":",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a bind from another stage reads no context file"
 },
 {
  "id": "handoff.reuse-closure-misses-copy",
  "target": "linux/scripts/runtime-build-key.py",
  "find": "        found.extend(_copy_sources(line))",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a COPYed script must be in the key, or editing it would not rebuild the child"
 },
 {
  "id": "handoff.reuse-wrapper-unstamped",
  "target": "linux/scripts/lib-runtime-reuse.sh",
  "find": "  [ -z \"${!var:-}\" ] || _rbkla_out+=(--label \"${RUNTIME_BUILD_KEY_LABEL}=${!var}\")",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a wrapper without its key can never be reused"
 },
 {
  "id": "handoff.reuse-freshness-key-unchecked",
  "target": "linux/scripts/verify-manifest-freshness.sh",
  "find": "    if got!=want:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "the post-push check must hold a reused child to this run's build key"
 },
 {
  "id": "chain-status.runtime-state-wrong-tag",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  runtime_child_state \"$1\" \"${FINAL_IMAGE}-$1\"",
  "replace": "  runtime_child_state \"$1\" \"${FINAL_IMAGE}\"",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "the failure report reads each arch's own wrapper tag"
 },
 {
  "id": "handoff.reuse-closure-keeps-pyc",
  "target": "linux/scripts/runtime-build-key.py",
  "find": "_SKIP_SUFFIXES = (\".pyc\",)",
  "replace": "_SKIP_SUFFIXES = (\".never\",)",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "a .pyc is outside the build context and must not change the key"
 },
 {
  "id": "chain-status.resource-monitor-step-markers-first",
  "target": "linux/scripts/01-core/resource-monitor.sh",
  "find": "  s=\"$(_rm_steps \"${3:-}\")\"\n",
  "replace": "  s=\"\"\n",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "a runtime-lane sample is named by the lane's arch/step markers, not stage=? (CON142)"
 },
 {
  "id": "chain-status.resource-monitor-step-join-no-comma",
  "target": "linux/scripts/01-core/resource-monitor.sh",
  "find": "out=\"${out:+${out}+}${f%%.*}/${f#*.}\"",
  "replace": "out=\"${out:+${out},}${f%%.*}/${f#*.}\"",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "parallel arches join without a comma, or the CSV row gains columns and the summary reads the wrong field"
 },
 {
  "id": "chain-status.resource-monitor-orchestrator-step-dir",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  export RESOURCE_MONITOR_STEP_DIR\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "the orchestrator hands its monitor and its child lanes the directory the lane marks its steps in"
 },
 {
  "id": "chain-status.resource-monitor-child-keeps-parent-dir",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  if [ -z \"${RESOURCE_MONITOR_STEP_DIR:-}\" ]; then\n",
  "replace": "  if :; then\n",
  "test": "bash linux/scripts/tests/test-resource-monitor.sh",
  "why": "a child lane marks where the parent chain's monitor reads, and must not wipe its live markers"
 },
 {
  "id": "chain-status.runtime-timed-uses-step-marker",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  runtime_step_run \"${arch}\" \"${step}\" \"$@\" || rc=$?\n",
  "replace": "  \"$@\" || rc=$?\n",
  "test": "bash linux/scripts/tests/test-runtime-heartbeat.sh",
  "why": "a timed runtime step is visible to the resource monitor while it runs"
 },
 {
  "id": "chain-status.runtime-step-mark-on",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  runtime_step_mark \"$1\" \"$2\" on\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-heartbeat.sh",
  "why": "the marked command runs under its marker"
 },
 {
  "id": "chain-status.runtime-step-mark-off",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "  runtime_step_mark \"$1\" \"$2\" off\n}",
  "replace": "}",
  "test": "bash linux/scripts/tests/test-runtime-heartbeat.sh",
  "why": "a finished step drops its marker, or every later sample names it"
 },
 {
  "id": "chain-status.runtime-step-mark-off-on-failure",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "\"${@:3}\" || { set -- \"$?\" \"$1\" \"$2\"; runtime_step_mark \"$2\" \"$3\" off; return \"$1\"; }",
  "replace": "\"${@:3}\" || return $?",
  "test": "bash linux/scripts/tests/test-runtime-heartbeat.sh",
  "why": "a failed step drops its marker too"
 },
 {
  "id": "chain-status.runtime-step-failure-status",
  "target": "linux/scripts/lib-orchestrator.sh",
  "find": "runtime_step_mark \"$2\" \"$3\" off; return \"$1\"; }",
  "replace": "runtime_step_mark \"$2\" \"$3\" off; return 1; }",
  "test": "bash linux/scripts/tests/test-runtime-heartbeat.sh",
  "why": "the marked command's raw failure status reaches the timer"
 },
 {
  "id": "runtime-push.step-mark-on",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "      _runtime_push_mark \"${arch}\" on\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k queue",
  "why": "a background upload names its arch in the resource samples it overlaps"
 },
 {
  "id": "runtime-push.step-mark-off",
  "target": "linux/scripts/lib-runtime-push.sh",
  "find": "      _runtime_push_mark \"${arch}\" off\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-push-queue.sh -k queue",
  "why": "a finished upload drops its push marker"
 },
 {
  "id": "disk-guard.trim-names-evicted",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  _DISK_GUARD_TRIM_EVICTED+=\"${_DISK_GUARD_TRIM_EVICTED:+,}${victim}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "the trim's summary names every slug it evicted (CON152)"
 },
 {
  "id": "disk-guard.trim-names-kept",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "kept: $(_disk_guard_slug_list \"${bc_dir}\")",
  "replace": "kept: none",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "the trim's summary names the slugs that survived it"
 },
 {
  "id": "disk-guard.buildkit-unknown-usage",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  printf '%s' \"${u:-?}\"\n",
  "replace": "  printf '%s' \"${u:-0 record(s), 0.0 GiB}\"\n",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "an unreadable store must not log as an empty layer cache"
 },
 {
  "id": "disk-guard.buildkit-usage-before",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "layer cache ${reg_before:-?} -> ",
  "replace": "layer cache $(_disk_guard_regular_usage) -> ",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "the prune log shows the layer cache before the prune, so the eviction is measurable"
 },
 {
  "id": "runtime-push.switch-unknown-value-fails",
  "target": "linux/scripts/lib-runtime-switch.sh",
  "find": "      return 2\n",
  "replace": "      return 0\n",
  "test": "bash linux/scripts/tests/test-runtime-reuse.sh",
  "why": "an unknown 1/0 switch value must stop the lane at its start, not run with a guessed mode"
 },
 {
  "id": "lib.asset-mirror-setup-refuses-unparsed-key",
  "target": "linux/sccache-s3/setup-asset-mirror.sh",
  "find": "  [ -n \"${id}\" ] && [ -n \"${secret}\" ] \\\n    || die",
  "replace": "  [ -n \"${id}\" ] \\\n    || die",
  "test": "bash linux/scripts/tests/test-asset-mirror-setup.sh",
  "why": "a Garage whose key output changed shape must stop the setup, not write an env file with an empty secret"
 },
 {
  "id": "lib.asset-mirror-setup-reuses-bucket",
  "target": "linux/sccache-s3/setup-asset-mirror.sh",
  "find": "garage bucket info \"${BUCKET}\" >/dev/null 2>&1 || garage bucket create",
  "replace": "garage bucket create",
  "test": "bash linux/scripts/tests/test-asset-mirror-setup.sh",
  "why": "a second host's setup must reuse the bucket and keys, not create them again"
 },
 {
  "id": "lib.asset-mirror-host-removes-remote-copies",
  "target": "linux/host-config/set-asset-mirror.sh",
  "find": "  ssh \"${FROM}\" \"rm -f",
  "replace": "  true \"${FROM}\" \"rm -f",
  "test": "bash linux/scripts/tests/test-asset-mirror-setup.sh",
  "why": "the Garage host must not keep a second copy of the secrets once a build host holds them"
 },
 {
  "id": "lib.asset-mirror-host-read-key-may-not-write",
  "target": "linux/host-config/set-asset-mirror.sh",
  "find": "_probe \"read key cannot write\" 1",
  "replace": "_probe \"read key cannot write\" 0",
  "test": "bash linux/scripts/tests/test-asset-mirror-setup.sh",
  "why": "a read key that can write would let every chain build overwrite mirrored assets"
 },
 {
  "id": "lib.asset-mirror-host-mode-600",
  "target": "linux/host-config/set-asset-mirror.sh",
  "find": "[ \"$(stat -c '%a' \"${f}\")\" = 600 ] || die",
  "replace": "true || die",
  "test": "bash linux/scripts/tests/test-asset-mirror-setup.sh",
  "why": "a world-readable key file leaks the mirror's credentials to every local user"
 },
 {
  "id": "lib.asset-mirror-host-ships-setup-closure",
  "target": "linux/host-config/set-asset-mirror.sh",
  "find": " scripts/lib/log-bootstrap.sh)",
  "replace": ")",
  "test": "bash linux/scripts/tests/test-asset-mirror-setup.sh",
  "why": "the Garage host has no checkout, so a file the setup script sources must travel with it"
 },
 {
  "id": "lib.asset-mirror-host-removes-remote-setup",
  "target": "linux/host-config/set-asset-mirror.sh",
  "find": "  ssh \"${FROM}\" \"rm -rf $(printf %q \"${d}\")\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-asset-mirror-setup.sh",
  "why": "every host's setup would leave a copy of the scripts in the Garage host's temp directory"
 },
 {
  "id": "ansible-backup.ha-unencrypted",
  "target": "linux/ansible/scripts/ha_backup_newest.py",
  "find": "    if not report[\"protected\"]:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ansible-backup.sh",
  "why": "an unencrypted Home Assistant archive must never be copied off the Pi"
 },
 {
  "id": "ansible-backup.ha-stale",
  "target": "linux/ansible/scripts/ha_backup_newest.py",
  "find": "    if age_hours > args.max_age_hours:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ansible-backup.sh",
  "why": "a Home Assistant that stopped backing up must fail the run, not ship an old archive as current"
 },
 {
  "id": "ansible-backup.ha-newest-by-date",
  "target": "linux/ansible/scripts/ha_backup_newest.py",
  "find": "    return max(found, key=lambda item: item[0])",
  "replace": "    return found[-1]",
  "test": "bash linux/scripts/tests/test-ansible-backup.sh",
  "why": "the newest archive is the one backup.json dates latest, not the one whose name sorts last"
 },
 {
  "id": "ansible-backup.secrets-tar-error",
  "target": "linux/ansible/scripts/backup-secrets.sh",
  "find": "if [ \"${rc}\" -ne 0 ] || grep -q -e '^tar: ' \"${listing}\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ansible-backup.sh",
  "why": "a missing secret path must fail the bundle, not ship an incomplete one"
 },
 {
  "id": "ansible-backup.secrets-age-header",
  "target": "linux/ansible/scripts/backup-secrets.sh",
  "find": "[ \"$(head -c 21 \"${partial}\")\" = \"age-encryption.org/v1\" ] ||",
  "replace": "true ||",
  "test": "bash linux/scripts/tests/test-ansible-backup.sh",
  "why": "output that is not an age file is plaintext and must never reach the NAS"
 },
 {
  "id": "ansible-backup.secrets-partial-cleanup",
  "target": "linux/ansible/scripts/backup-secrets.sh",
  "find": "trap 'rm -f \"${partial}\" \"${listing}\"' EXIT",
  "replace": "trap 'rm -f \"${listing}\"' EXIT",
  "test": "bash linux/scripts/tests/test-ansible-backup.sh",
  "why": "a failed bundle must leave no partial file on the NAS"
 },
 {
  "id": "semaphore-setup.one-task-at-a-time",
  "target": "linux/ansible/scripts/semaphore-setup.sh",
  "find": "{name: $n, max_parallel_tasks: 1, alert: true}",
  "replace": "{name: $n, max_parallel_tasks: 0, alert: true}",
  "test": "bash linux/scripts/tests/test-semaphore-setup.sh",
  "why": "a backup must not copy from a host the update is rebooting"
 },
 {
  "id": "semaphore-setup.update-in-place",
  "target": "linux/ansible/scripts/semaphore-setup.sh",
  "find": "  if [ -z \"${id}\" ]; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-semaphore-setup.sh",
  "why": "a second run must not leave two schedules that both start the update"
 },
 {
  "id": "semaphore-setup.password-on-stdin",
  "target": "linux/ansible/scripts/semaphore-setup.sh",
  "find": "--data-binary @-)",
  "replace": "--data-binary \"${body}\")",
  "test": "bash linux/scripts/tests/test-semaphore-setup.sh",
  "why": "the admin password must not show in the host's process list"
 },
 {
  "id": "semaphore-setup.update-schedule",
  "target": "linux/ansible/scripts/semaphore-setup.sh",
  "find": "'Update the fleet|playbooks/update.yml|30 4 * * 0'",
  "replace": "'Update the fleet|playbooks/update.yml|'",
  "test": "bash linux/scripts/tests/test-semaphore-setup.sh",
  "why": "the weekly update has no systemd timer any more, only this schedule"
 },
 {
  "id": "semaphore-setup.backup-schedule",
  "target": "linux/ansible/scripts/semaphore-setup.sh",
  "find": "'Back up to the NAS|playbooks/backup.yml|0 7 * * 6'",
  "replace": "'Back up to the NAS|playbooks/backup.yml|'",
  "test": "bash linux/scripts/tests/test-semaphore-setup.sh",
  "why": "the weekly backup has no systemd timer any more, only this schedule"
 },
 {
  "id": "semaphore-setup.alerts-on",
  "target": "linux/ansible/scripts/semaphore-setup.sh",
  "find": "max_parallel_tasks: 1, alert: true}",
  "replace": "max_parallel_tasks: 1, alert: false}",
  "test": "bash linux/scripts/tests/test-semaphore-setup.sh",
  "why": "a failed backup must reach the phone; three failed Saturdays once went unseen"
 },
 {
  "id": "semaphore-setup.windows-schedule",
  "target": "linux/ansible/scripts/semaphore-setup.sh",
  "find": "'Update Windows|playbooks/update-windows.yml|50 3 * * 0'",
  "replace": "'Update Windows|playbooks/update-windows.yml|'",
  "test": "bash linux/scripts/tests/test-semaphore-setup.sh",
  "why": "the fleet's update no longer starts the Windows lane itself"
 },
 {
  "id": "semaphore-setup.backup-name-watched",
  "target": "linux/ansible/scripts/semaphore-setup.sh",
  "find": "'Back up to the NAS|playbooks/backup.yml|",
  "replace": "'Backup to the NAS|playbooks/backup.yml|",
  "test": "bash linux/scripts/tests/test-semaphore-setup.sh",
  "why": "a renamed backup template would never reset its overdue watchdog, which would then nag over green backups"
 },
 {
  "id": "lib.stop-chain-removes-its-pidfile",
  "target": "linux/scripts/stop-cross-chain.sh",
  "find": "_stop_remove_pidfile_if() {",
  "replace": "_stop_remove_pidfile_if_gone() {",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "a stopped chain's script must exit 0 and drop its pidfile, or the next start sees a stale chain"
 },
 {
  "id": "lib.cmake-pin-carries-ccache-binary",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "for name in CMAKE_C_COMPILER_LAUNCHER CMAKE_CXX_COMPILER_LAUNCHER CCACHE_BINARY; do",
  "replace": "for name in CMAKE_C_COMPILER_LAUNCHER CMAKE_CXX_COMPILER_LAUNCHER; do",
  "test": "bash linux/scripts/tests/test-cmake-compiler-cache-pin.sh",
  "why": "without CCACHE_BINARY pthreadpool's FORCE puts the distro ccache under most of ONNX Runtime and LiteRT"
 },
 {
  "id": "lib.cmake-pin-gate-compares-launchers",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "if [ \"${_cce_got}\" != \"${_cce_want}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-cmake-compiler-cache-pin.sh",
  "why": "a gate that never compares passes a build whose launcher a subproject replaced"
 },
 {
  "id": "lib.cmake-linker-pins-env-launcher",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "_accla_launcher=\"${CMAKE_CXX_COMPILER_LAUNCHER:-${CMAKE_C_COMPILER_LAUNCHER}}\"",
  "replace": "_accla_launcher=\"\"",
  "test": "bash linux/scripts/tests/test-cmake-compiler-cache-pin.sh",
  "why": "a launcher that only travels in the environment loses to a FORCEd cache entry"
 },
 {
  "id": "lib.ort-ccache-args-pin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "append_cmake_compiler_cache_pin build_args_ref \"${_ort_launcher}\" \"\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-compiler-tool-toggles.sh",
  "why": "ONNX Runtime's build.py must receive the launcher and CCACHE_BINARY as defines"
 },
 {
  "id": "lib.ort-native-build-gates-pin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  cmake_assert_compiler_cache_pin \"${build_dir}/${config}\" \"${_ort_launcher:-}\" || exit 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cmake-compiler-cache-pin.sh",
  "why": "an ONNX Runtime build that bypassed sccache must fail, not ship after 104 minutes uncached"
 },
 {
  "id": "lib.litert-gates-cache-pin",
  "target": "linux/scripts/03-media/build/litert/build-litert.sh",
  "find": "cmake_assert_compiler_cache_pin \"${c_api_build}\" \"${CMAKE_COMPILER_CACHE_PIN:-}\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-cmake-compiler-cache-pin.sh",
  "why": "the TFLite C API build fetches pthreadpool too, so its configure needs the gate"
 },
 {
  "id": "lib.vulkan-component-pins-launcher",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "append_cmake_compiler_cache_pin cache_pin \"${launcher}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "the foreign-arch Vulkan components compiled 7768 objects uncached for 79 minutes per arch"
 },
 {
  "id": "lib.vulkan-component-gates-pin",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "cmake_assert_compiler_cache_pin \"${build_dir}\" \"${launcher}\" || err",
  "replace": "true || err",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "a Vulkan component whose launcher was replaced must stop the sdk stage"
 },
 {
  "id": "lib.vulkan-exports-launcher-for-vulkansdk",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  export CMAKE_C_COMPILER_LAUNCHER=\"${launcher}\" CMAKE_CXX_COMPILER_LAUNCHER=\"${launcher}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-vulkan-target-decomposition.sh",
  "why": "./vulkansdk's own cmake runs see no launcher unless the environment carries it"
 },
 {
  "id": "lib.torch-cmake-args-pin",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "append_cmake_compiler_cache_pin _tca_ref \"${_cc_l}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "torch's vendored pthreadpool FORCEs the launcher too, so its CMAKE_ARGS carry the pin"
 },
 {
  "id": "lib.sccache-drain-prints-stats",
  "target": "linux/scripts/01-core/sccache-s3-level.sh",
  "find": "  _sccache_stats_line\n  start=",
  "replace": "  start=",
  "test": "bash linux/scripts/tests/test-sccache-s3-level.sh",
  "why": "without per-RUN totals a bypassed cache is invisible, as ONNX Runtime's was"
 },
 {
  "id": "lib.sccache-drain-names-failed-writes",
  "target": "linux/scripts/01-core/sccache-s3-level.sh",
  "find": "        _sccache_s3_failure_reason\n        _sccache_s3_reupload_failed",
  "replace": "        :\n        _sccache_s3_reupload_failed",
  "test": "bash linux/scripts/tests/test-sccache-s3-level.sh",
  "why": "a drain that only counts failed S3 writes left 9 of 12 failures unexplained"
 },
 {
  "id": "lib.sdk-vulkan-run-mounts-caches",
  "target": "linux/Dockerfile.sdk",
  "find": "    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH} \\\n    --mount=type=bind,source=linux/scripts/01-core/sccache-s3-level.sh",
  "replace": "    --mount=type=bind,source=linux/scripts/01-core/sccache-s3-level.sh",
  "test": "bash linux/scripts/tests/test-sccache-s3-level.sh",
  "why": "the Vulkan SDK RUN had no cache mount, so its sccache wrote into a layer that every chain throws away"
 },
 {
  "id": "lib.prune-safe-refuses-arguments",
  "target": "linux/host-config/prune-safe.sh",
  "find": "  *) echo \"FATAL: prune-safe.sh takes no arguments",
  "replace": "  *) : echo \"FATAL: prune-safe.sh takes no arguments",
  "test": "bash linux/scripts/tests/test-prune-safe.sh",
  "why": "`prune-safe.sh --help` went straight down the prune path; a flag that is not understood must stop it"
 },
 {
  "id": "lib.gstreamer-debug-logs-default-at-reader",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": ": \"${GSTREAMER_DEBUG_LOGS:=false}\"\nif [ \"${GSTREAMER_DEBUG_LOGS}\" = \"true\" ]; then",
  "replace": "if [ \"${GSTREAMER_DEBUG_LOGS}\" = \"true\" ]; then",
  "test": "bash linux/scripts/tests/test-gstreamer-debug-logs-knob.sh",
  "why": "with the default only inside save_logs, set -u killed every GStreamer build at its first line (2026-10-27 chain)"
 },
 {
  "id": "lib.gstreamer-cargo-toolchain-default-top-level",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": ": \"${GSTREAMER_CARGO_HOST_TOOLCHAIN_DIR:=/tmp/gstreamer-cargo-host-toolchain}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gstreamer-debug-logs-knob.sh",
  "why": "defaulted inside the linker wrapper only, set -u killed GStreamer's C++ cargo wrapper, which ran first (2026-10-27 chain)"
 },
 {
  "id": "script-tests.no-zero-executed-pass",
  "target": "linux/scripts/tests/run-tests.sh",
  "find": "elif [ \"$((SUITES - ${#SKIPPED[@]}))\" -eq 0 ]; then",
  "replace": "elif [ \"$((SUITES - ${#SKIPPED[@]}))\" -lt 0 ]; then",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "empty discovery and allowed Git Bash skips cannot pass when no suite succeeded"
 },
 {
  "id": "windows-lane.pester-action-requires-passing-test",
  "target": ".github/actions/run-pester-suite/Invoke-PesterSuite.ps1",
  "find": "    if ($Result.Passed -lt 1) {",
  "replace": "    if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Ci.PesterActionExit.Tests.ps1",
  "why": "a skipped or pending Pester suite cannot count as a passing test run"
 },
 {
  "id": "windows-lane.pester-action-ends-with-its-verdict",
  "target": ".github/actions/run-pester-suite/Invoke-PesterSuite.ps1",
  "find": "exit (Get-SuiteExitCode -Result $result -Path $Path)",
  "replace": "$null = Get-SuiteExitCode -Result $result -Path $Path",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Ci.PesterActionExit.Tests.ps1",
  "why": "a passing suite whose own native calls left $LASTEXITCODE nonzero must not fail the step through GitHub's pwsh wrapper"
 },
 {
  "id": "windows-lane.pester-action-modern-dialect",
  "target": ".github/actions/run-pester-suite/Invoke-PesterSuite.ps1",
  "find": "    return ([version]$Version).Major -ge 5",
  "replace": "    return $false",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Ci.PesterActionExit.Tests.ps1",
  "why": "Pester 5 and 6 reject -Quiet and drop TestResult, so the legacy call fails every modern suite"
 },
 {
  "id": "windows-lane.pester-action-pester-never-exits",
  "target": ".github/actions/run-pester-suite/Invoke-PesterSuite.ps1",
  "find": "    $config.Run.Exit = $false\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Ci.PesterActionExit.Tests.ps1",
  "why": "a Pester that ends the process itself skips the no-test and no-pass verdicts"
 },
 {
  "id": "windows-lane.pester-action-failed-container-fails",
  "target": ".github/actions/run-pester-suite/Invoke-PesterSuite.ps1",
  "find": "    if ($Result.Failed -gt 0 -or $Result.FailedContainers -gt 0) {",
  "replace": "    if ($Result.Failed -gt 0) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Ci.PesterActionExit.Tests.ps1",
  "why": "a file that fails discovery reports no failed test, only a failed container, and its error must be printed"
 },
 {
  "id": "windows-lane.pester-action-container-errors-printed",
  "target": ".github/actions/run-pester-suite/Invoke-PesterSuite.ps1",
  "find": "        $failures += @($Run.Containers | Where-Object { $_.Result -eq 'Failed' } | ForEach-Object {\n                Get-SuiteFailure -Item $_ -Name \"container $($_.Item)\"\n            })\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Ci.PesterActionExit.Tests.ps1",
  "why": "without the container's error a discovery failure reads as a red step with no reason"
 },
 {
  "id": "windows-lane.pester-action-broken-file-is-not-empty",
  "target": ".github/actions/run-pester-suite/Invoke-PesterSuite.ps1",
  "find": "($Result.Total -eq 0 -and $Result.FailedContainers -eq 0)",
  "replace": "($Result.Total -eq 0)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Ci.PesterActionExit.Tests.ps1",
  "why": "a file that broke before its tests ran must say so, not that the path matched nothing"
 },
 {
  "id": "windows-lane.pester-action-inputs-through-env",
  "target": ".github/actions/run-pester-suite/action.yml",
  "find": "-Path $env:PESTER_SUITE_PATH",
  "replace": "-Path '${{ inputs.path }}'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Ci.PesterActionExit.Tests.ps1",
  "why": "an input expanded into the script text runs whatever a quote in the path closes"
 },
 {
  "id": "lib.wsl-quality-windows-test-exit-is-fatal",
  "target": "linux/scripts/wsl-quality.sh",
  "find": "  run_logged windows-tests \"${WINDOWS_PWSH_BIN}\" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File \"${windows_test_script}\" -Jobs \"$1\"",
  "replace": "  run_logged windows-tests \"${WINDOWS_PWSH_BIN}\" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File \"${windows_test_script}\" -Jobs \"$1\" || true",
  "test": "bash linux/scripts/tests/test-wsl-quality.sh",
  "why": "a failed native Windows test run must retain its nonzero exit through the WSL logging pipe"
 },
 {
  "id": "lib.wsl-quality-python-project-absolute",
  "target": "linux/scripts/wsl-quality.sh",
  "find": "    python -c 'import sys; print(sys.executable)')\" || die",
  "replace": "    python -c 'import sys; print(sys.executable)')\"; python_command=\"uv run --project ${REPO_ROOT}/quality --locked --no-sync --python ${PYTHON_VERSION} python\" || die",
  "test": "bash linux/scripts/tests/test-wsl-quality.sh",
  "why": "a multi-word PREFLIGHT_PYTHON exits 127 in every suite that runs it quoted"
 },
 {
  "id": "lib.wsl-quality-requires-native-pester",
  "target": "linux/scripts/wsl-quality.sh",
  "find": "  windows_pester_ready || die \"Windows Pester >= ${PESTER_MIN_VERSION} is missing; run bash linux/scripts/wsl-quality.sh setup\"",
  "replace": "  true",
  "test": "bash linux/scripts/tests/test-wsl-quality.sh",
  "why": "the check must reject a missing Windows Pester before trying to run native suites"
 },
 {
  "id": "lib.compile-governor-caps-slots",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "if [ -r \"${_gov_slot}\" ] && command exec 9<\"${_gov_slot}\" && flock -n 9; then",
  "replace": "if [ -r \"${_gov_slot}\" ] && command exec 9<\"${_gov_slot}\"; then",
  "test": "bash linux/scripts/tests/test-compile-governor.sh",
  "why": "without the lock every launcher takes slot 0, and the fan-out peak of 39 compilers comes back"
 },
 {
  "id": "lib.compile-governor-admits-by-memory",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "[ \"${_gov_avail:-0}\" -ge \"${KATAGLYPHIS_COMPILE_GOVERNOR_ADMIT_MB}\" ] 2>/dev/null && return 0",
  "replace": "return 0",
  "test": "bash linux/scripts/tests/test-compile-governor.sh",
  "why": "a second slot must not start a compile the host has no memory for"
 },
 {
  "id": "lib.compile-governor-slot-off-children",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "sccache \"$@\" 2>\"${_err}\" 9>&-\n_rc=$?",
  "replace": "sccache \"$@\" 2>\"${_err}\"\n_rc=$?",
  "test": "bash linux/scripts/tests/test-compile-governor.sh",
  "why": "a sccache server the client autostarts would inherit the slot fd and hold the slot for good"
 },
 {
  "id": "lib.compile-governor-waits-bounded",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "if [ $(( $(date +%s) - _gov_start )) -ge \"${KATAGLYPHIS_COMPILE_GOVERNOR_MAX_WAIT}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-compile-governor.sh",
  "why": "a slot held forever must slow a compile, never stop the build"
 },
 {
  "id": "lib.compile-governor-keeps-diagnostics",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "if [ -r \"${_gov_slot}\" ] && command exec 9<\"${_gov_slot}\" && flock -n 9; then",
  "replace": "if [ -r \"${_gov_slot}\" ] && command exec 9<\"${_gov_slot}\" 2>/dev/null && flock -n 9; then",
  "test": "bash linux/scripts/tests/test-compile-governor.sh",
  "why": "a 2> on the bare exec stays on the shell and swallows every compiler message"
 },
 {
  "id": "renovate.uv-exports-plan",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  plan_uv_exports\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "declared compatibility exports must join the lock update plan"
 },
 {
  "id": "renovate.uv-exports-rollback",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  refresh_uv_exports || undo_run \"uv compatibility export failed\"",
  "replace": "  refresh_uv_exports || true",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "a failed derived export must undo every touched manifest, lock and export"
 },
 {
  "id": "renovate.uv-exports-tracked",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  assert_uv_exports_tracked\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "a dirty configuration or untracked export must refuse before writing"
 },
 {
  "id": "renovate.uv-submodule-rollback",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  snapshot_targets ${EDIT_FILES[@]+\"${EDIT_FILES[@]}\"} ${UV_EXPORT_PATHS[@]+\"${UV_EXPORT_PATHS[@]}\"}",
  "replace": "  snapshot_targets ${EDIT_FILES[@]+\"${EDIT_FILES[@]}\"}",
  "test": "bash linux/scripts/tests/test-renovate-submodule-default.sh",
  "why": "a late submodule checkout failure must restore completed uv exports"
 },
 {
  "id": "renovate.uv-lock-dry-working-dir",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "out=\"$(run_lock_argv \"${tool}\" \"${dir}\" \"${argv[@]}\" </dev/null 2>&1)\"",
  "replace": "out=\"$(cd \"${dir}\" && \"${argv[@]}\" </dev/null 2>&1)\"",
  "test": "bash linux/scripts/tests/test-renovate-lockmaint.sh",
  "why": "the report-only uv dry run must not follow an inherited working-directory override"
 },
 {
  "id": "renovate.uv-lock-working-dir",
  "target": "linux/scripts/renovate-locks.sh",
  "find": "env -u UV_WORKING_DIR \"$@\"",
  "replace": "\"$@\"",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh && bash linux/scripts/tests/test-renovate-lockmaint.sh",
  "why": "uv lock updates and reports must not follow an inherited working-directory override"
 },
 {
  "id": "renovate.uv-exports-group-env",
  "target": "linux/scripts/renovate-uv-exports.sh",
  "find": "env -u UV_NO_GROUP -u UV_NO_DEFAULT_GROUPS -u UV_NO_DEV -u UV_WORKING_DIR",
  "replace": "env",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "ambient uv group and directory settings must not change the export"
 },
 {
  "id": "renovate.uv-exports-default-groups",
  "target": "linux/scripts/renovate-uv-exports.sh",
  "find": "--locked --no-dev --no-default-groups --no-emit-project",
  "replace": "--locked --no-dev --no-emit-project",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "a compatibility export must exclude default dependency groups"
 },
 {
  "id": "renovate.uv-exports-config-clean",
  "target": "linux/scripts/renovate-uv-exports.sh",
  "find": "  \"${GIT_BIN}\" -C \"${GIT_TARGET}\" diff --quiet HEAD -- \"${path}\" \\\n    || err \"uv export configuration has local changes; nothing written\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "a deleted or modified export mapping must block the lock update"
 },
 {
  "id": "renovate.uv-exports-independent-edit",
  "target": "linux/scripts/renovate-uv-exports.sh",
  "find": "    rl_has \"${output}\" ${EDIT_FILES[@]+\"${EDIT_FILES[@]}\"} && err \"generated uv export ${output} has an independent planned edit; disable its separate manager\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "a generated file cannot also carry an independent package-manager edit"
 },
 {
  "id": "renovate.uv-exports-symlink",
  "target": "linux/scripts/renovate_uv_exports.py",
  "find": " or has_symlink or not path.is_file()",
  "replace": " or not path.is_file()",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "a symlink in an output path within the checkout must not redirect the transaction"
 },
 {
  "id": "renovate.uv-exports-parent-symlink",
  "target": "linux/scripts/renovate_uv_exports.py",
  "find": "    has_symlink = any(root.joinpath(*parts[:index]).is_symlink() for index in range(1, len(parts) + 1))",
  "replace": "    has_symlink = path.is_symlink()",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "a symlinked ancestor cannot alias a tracked project input"
 },
 {
  "id": "renovate.uv-exports-overlap",
  "target": "linux/scripts/renovate_uv_exports.py",
  "find": "    if outputs & inputs:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-renovate-uv-exports.sh",
  "why": "one generated output cannot overwrite another configured project's lock"
 },
 {
  "id": "python.dartdoc-locked-project",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "    uv_pip_install_locked_project \"${venv_dir}\" \"${_DARTDOC_BUILD_LIB_DIR}/../../../quality/dartdoc\" || return 1",
  "replace": "    uv_pip_install_requirements \"${venv_dir}\" \"$1\" || return 1",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "dartdoc's default must install its shared locked project rather than an independent requirements pin"
 },
 {
  "id": "python.dartdoc-locked-failure",
  "target": "linux/scripts/lib/dartdoc-build.sh",
  "find": "    uv_pip_install_locked_project \"${venv_dir}\" \"${_DARTDOC_BUILD_LIB_DIR}/../../../quality/dartdoc\" || return 1",
  "replace": "    uv_pip_install_locked_project \"${venv_dir}\" \"${_DARTDOC_BUILD_LIB_DIR}/../../../quality/dartdoc\" || true",
  "test": "bash linux/scripts/tests/test-dartdoc-python.sh",
  "why": "a failed dartdoc lock install cannot produce a successful build"
 },
 {
  "id": "python.locked-project-chain-ort",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  if [ \"$status\" -eq 0 ] && [ -n \"${ORT_CHAIN_WHEEL_DIR:-}\" ] && grep -qiE '^[[:space:]]*onnxruntime([_.-][[:alnum:]._-]+)?(\\[[^]]+\\])?==' \"$output\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-uv-locked-project.sh",
  "why": "a tool install must not replace a chain-owned ONNX Runtime with PyPI bytes"
 },
 {
  "id": "python.locked-project-empty-export",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  if [ \"$status\" -eq 0 ] && ! grep -qE '^[[:space:]]*[[:alnum:]][[:alnum:]_.-]*(\\[[^]]+\\])?==' \"$output\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-uv-locked-project.sh",
  "why": "a successful but empty export cannot produce a green tool install"
 },
 {
  "id": "python.locked-project-cleanup-companion",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "  declare -F uv_image_overlay_cleanup >/dev/null || { printf 'ERROR: uv-image-overlay cleanup is missing\\n' >&2; return 1; }",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-uv-locked-project.sh",
  "why": "a copied companion without its cleanup API must fail before running uv"
 },
 {
  "id": "python.locked-project-export",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    --locked --no-dev --no-emit-project --format requirements-txt --output-file \"$output\" >/dev/null || status=$?",
  "replace": "    --no-dev --no-emit-project --format requirements-txt --output-file \"$output\" >/dev/null || status=$?",
  "test": "bash linux/scripts/tests/test-uv-locked-project.sh",
  "why": "a tool install must refuse an outdated lock instead of resolving a new one"
 },
 {
  "id": "python.locked-project-hashes",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "      --no-deps --require-hashes -r \"$output\" || status=$?",
  "replace": "      --no-deps -r \"$output\" || status=$?",
  "test": "bash linux/scripts/tests/test-uv-locked-project.sh",
  "why": "the exported uv lock's wheel hashes must be verified on installation"
 },
 {
  "id": "python.locked-project-export-failure",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "    --locked --no-dev --no-emit-project --format requirements-txt --output-file \"$output\" >/dev/null || status=$?",
  "replace": "    --locked --no-dev --no-emit-project --format requirements-txt --output-file \"$output\" >/dev/null || true",
  "test": "bash linux/scripts/tests/test-uv-locked-project.sh",
  "why": "a failed lock export must stop before package installation and reach the caller"
 },
 {
  "id": "python.uv-compatibility-export-drift",
  "target": "linux/scripts/verify-uv-exports.sh",
  "find": "  if ! cmp -s \"${tmp}/requirements.txt\" \"${root}/${output}\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-uv-export-drift.sh",
  "why": "a stale compatibility export must fail CI even when the locked export succeeds"
 },
 {
  "id": "windows-lane.uv-tool-lock-required",
  "target": "windows/scripts/modules/WindowsUv.Common.psm1",
  "find": "'--python', $VenvPython, '--locked', '--no-dev'",
  "replace": "'--python', $VenvPython, '--no-dev'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Uv.LockedProject.Tests.ps1 -ResultFile logs/code-quality/uv-locked-project-mutation.json",
  "why": "the Windows installer must export the existing lock"
 },
 {
  "id": "windows-lane.uv-tool-hashes-required",
  "target": "windows/scripts/modules/WindowsUv.Common.psm1",
  "find": "'--no-deps', '--require-hashes', '--directory', (Get-Location).ProviderPath, '--project', $LockedProjectPath",
  "replace": "'--no-deps', '--directory', (Get-Location).ProviderPath, '--project', $LockedProjectPath",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Uv.LockedProject.Tests.ps1 -ResultFile logs/code-quality/uv-locked-project-mutation.json",
  "why": "Windows tool installs must verify lock hashes"
 },
 {
  "id": "windows-lane.uv-tool-no-dependencies",
  "target": "windows/scripts/modules/WindowsUv.Common.psm1",
  "find": "'--no-deps', '--require-hashes', '--directory', (Get-Location).ProviderPath, '--project', $LockedProjectPath",
  "replace": "'--require-hashes', '--directory', (Get-Location).ProviderPath, '--project', $LockedProjectPath",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Uv.LockedProject.Tests.ps1 -ResultFile logs/code-quality/uv-locked-project-mutation.json",
  "why": "the locked tool install must not resolve or replace other packages"
 },
 {
  "id": "windows-lane.uv-tool-empty-export",
  "target": "windows/scripts/modules/WindowsUv.Common.psm1",
  "find": "if ($requirements.Count -eq 0) { throw 'uv export produced an empty lock export' }",
  "replace": "if ($false) { throw 'uv export produced an empty lock export' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Uv.LockedProject.Tests.ps1 -ResultFile logs/code-quality/uv-locked-project-mutation.json",
  "why": "an empty or header-only export cannot pass as a locked tool install"
 },
 {
  "id": "windows-lane.cmake-uv-wiring-consumer-relative",
  "target": "shared/windows/tests/Test-CmakeUvProjectWiring.ps1",
  "find": "$ScriptPath = [IO.Path]::GetFullPath($ScriptPath, (Get-Location -PSProvider FileSystem).ProviderPath)\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Shared.CmakeUvWiring.Tests.ps1 -ResultFile logs/code-quality/cmake-uv-wiring-mutation.json",
  "why": "consumers pass repo-relative paths; resolving them against the hub makes every consumer call fail"
 },
 {
  "id": "windows-lane.cmake-uv-wiring-legacy",
  "target": "shared/windows/tests/Test-CmakeUvProjectWiring.ps1",
  "find": "if (-not $Arguments.ContainsKey('UvProjectPath') -or $Arguments.ContainsKey('RequirementsPath')) {",
  "replace": "if (-not $Arguments.ContainsKey('UvProjectPath')) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Shared.CmakeUvWiring.Tests.ps1 -ResultFile logs/code-quality/cmake-uv-wiring-mutation.json",
  "why": "the consumer wiring check must reject a simultaneous legacy requirements argument"
 },
 {
  "id": "python.overlay-working-directory-isolation",
  "target": "linux/scripts/01-core/uv-image-overlay.sh",
  "find": "env -u UV_WORKING_DIR -u UV_PROJECT uv \"$@\"",
  "replace": "env -u UV_PROJECT uv \"$@\"",
  "test": "bash linux/scripts/tests/test-uv-image-overlay.sh",
  "why": "all overlay uv commands must use the caller's working directory"
 },
 {
  "id": "python.overlay-project-isolation",
  "target": "linux/scripts/01-core/uv-image-overlay.sh",
  "find": "env -u UV_WORKING_DIR -u UV_PROJECT uv \"$@\"",
  "replace": "env -u UV_WORKING_DIR uv \"$@\"",
  "test": "bash linux/scripts/tests/test-uv-image-overlay.sh",
  "why": "all overlay uv commands must use the caller's project"
 },
 {
  "id": "python.tool-export-working-directory-isolation",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "env -u UV_PYTHON -u UV_PROJECT_ENVIRONMENT -u UV_WORKING_DIR -u UV_PROJECT uv export",
  "replace": "env -u UV_PYTHON -u UV_PROJECT_ENVIRONMENT -u UV_PROJECT uv export",
  "test": "bash linux/scripts/tests/test-uv-locked-project.sh",
  "why": "relative tool projects must use the caller's working directory"
 },
 {
  "id": "python.tool-install-working-directory-isolation",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "env -u UV_PYTHON -u UV_PROJECT_ENVIRONMENT -u UV_WORKING_DIR -u UV_PROJECT uv pip install",
  "replace": "env -u UV_PYTHON -u UV_PROJECT_ENVIRONMENT -u UV_PROJECT uv pip install",
  "test": "bash linux/scripts/tests/test-uv-locked-project.sh",
  "why": "relative tool environments must use the caller's working directory"
 },
 {
  "id": "windows-lane.uv-tool-export-directory",
  "target": "windows/scripts/modules/WindowsUv.Common.psm1",
  "find": "'--no-emit-project', '--format', 'requirements-txt', '--directory', (Get-Location).ProviderPath, '--output-file', $exportPath",
  "replace": "'--no-emit-project', '--format', 'requirements-txt', '--output-file', $exportPath",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Uv.LockedProject.Tests.ps1 -ResultFile logs/code-quality/uv-locked-project-mutation.json",
  "why": "Windows lock export must preserve the caller's working directory"
 },
 {
  "id": "windows-lane.uv-tool-install-directory",
  "target": "windows/scripts/modules/WindowsUv.Common.psm1",
  "find": "'--no-deps', '--require-hashes', '--directory', (Get-Location).ProviderPath",
  "replace": "'--no-deps', '--require-hashes'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Uv.LockedProject.Tests.ps1 -ResultFile logs/code-quality/uv-locked-project-mutation.json",
  "why": "Windows tool installation must preserve the caller's working directory"
 },
 {
  "id": "windows-lane.uv-tool-install-project",
  "target": "windows/scripts/modules/WindowsUv.Common.psm1",
  "find": "'--no-deps', '--require-hashes', '--directory', (Get-Location).ProviderPath, '--project', $LockedProjectPath",
  "replace": "'--no-deps', '--require-hashes', '--directory', (Get-Location).ProviderPath",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Uv.LockedProject.Tests.ps1 -ResultFile logs/code-quality/uv-locked-project-mutation.json",
  "why": "Windows tool installation must override a foreign UV_PROJECT"
 },
 {
  "id": "windows-lane.uv-tool-absolute-project",
  "target": "windows/scripts/modules/WindowsUv.Common.psm1",
  "find": "    $ProjectPath = (Resolve-Path -LiteralPath $ProjectPath).ProviderPath",
  "replace": "    $null = $ProjectPath",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Uv.LockedProject.Tests.ps1 -ResultFile logs/code-quality/uv-locked-project-mutation.json",
  "why": "relative Windows tool projects must resolve before uv reads inherited settings"
 },
 {
  "id": "packaging.archive-tar-project-license",
  "target": "linux/scripts/06-packaging/package_archive.sh",
  "find": "tar -C \"$ArchiveStage\" -czvf \"$ArchiveName\" \"$Binary\" LICENSE",
  "replace": "tar -C \"$ArchiveStage\" -czvf \"$ArchiveName\" \"$Binary\"",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "Archive must carry project license."
 },
 {
  "id": "packaging.archive-bundle-project-license",
  "target": "linux/scripts/06-packaging/package_archive.sh",
  "find": "    app_packaging_stage_project_license \"$LicenseFile\" \"$Stage\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "All bundle formats must carry project license."
 },
 {
  "id": "packaging.project-license-rejects-empty",
  "target": "linux/scripts/lib/app-packaging-license.sh",
  "find": "  if [[ ! -f \"$source\" || ! -s \"$source\" || ! -r \"$source\" ]] || ! LC_ALL=C grep -q '[^[:space:]]' \"$source\"; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "A missing, empty or whitespace-only project license must fail."
 },
 {
  "id": "packaging.project-license-staging",
  "target": "linux/scripts/lib/app-packaging-license.sh",
  "find": "  install -m 0644 \"$source\" \"$destination/LICENSE\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "Staging must copy source license bytes."
 },
 {
  "id": "packaging.project-license-companion",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "source \"${_APP_PACKAGING_DIR}/app-packaging-license.sh\" || return $?",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "Copied packaging library must fail if its license companion is missing."
 },
 {
  "id": "package.desktop-icon-requires-png",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  if [[ ! -r \"$icon\" || ! -s \"$icon\" ]] || [[ \"$(head -c 16 \"$icon\" | od -An -tx1 | tr -d ' \\n')\" != '89504e470d0a1a0a0000000d49484452' ]] || [[ \"$(tail -c 12 \"$icon\" | od -An -tx1 | tr -d ' \\n')\" != '0000000049454e44ae426082' ]]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "Missing, corrupt and truncated project icons must fail."
 },
 {
  "id": "package.desktop-icon-valid-dimensions",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  [[ \"$dimensions\" =~ ^[1-9][0-9]*x[1-9][0-9]*$ ]] || { echo \"Error: project icon has invalid dimensions: $icon\" >&2; return 1; }",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-app-packaging-bundle-facts.sh",
  "why": "An icon with zero dimensions must fail."
 },
 {
  "id": "packaging.cpack-installs-license",
  "target": "cmake/CPackCommon.cmake",
  "find": "    RENAME LICENSE)",
  "replace": "    RENAME LICENSE.mutant)",
  "test": "bash linux/scripts/tests/test-cmake-package-license.sh",
  "why": "Every CPack output must contain the actual project license."
 },
 {
  "id": "packaging.cpack-wix-actual-license",
  "target": "cmake/CPackCommon.cmake",
  "find": "        kataglyphis_write_license_rtf(\"${KGCPACK_LICENSE_FILE}\" \"${KGCPACK_WIX_LICENSE_RTF}\")",
  "replace": "        file(WRITE \"${KGCPACK_WIX_LICENSE_RTF}\" \"PLACEHOLDER\")",
  "test": "bash linux/scripts/tests/test-cmake-package-license.sh",
  "why": "WiX must display the real terms rather than a placeholder."
 },
 {
  "id": "lib.cpack-nsis-zlib-compressor",
  "target": "cmake/CPackCommon.cmake",
  "find": "set(CPACK_NSIS_COMPRESSOR \"zlib\")",
  "replace": "set(CPACK_NSIS_COMPRESSOR \"lzma\")",
  "test": "bash linux/scripts/tests/test-cmake-package-license.sh",
  "why": "CPack defaults to lzma, whose CPL-1.0 stub ships without a source notice"
 },
 {
  "id": "windows-lane.package-license-copies",
  "target": "windows/scripts/modules/WindowsMsix.Common.psm1",
  "find": "  Copy-Item -LiteralPath $source -Destination $target -Force -ErrorAction Stop",
  "replace": "  $null = $target",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PackageLicense.Portable.Tests.ps1 -ResultFile logs/code-quality/package-license-mutation.json",
  "why": "Windows package staging must copy the complete project text."
 },
 {
  "id": "packaging.license-verifier-full-text",
  "target": "linux/scripts/verify_package_license.py",
  "find": "and expected in content:",
  "replace": "and True:",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "A named file containing different text cannot pass the verifier."
 },
 {
  "id": "packaging.license-verifier-every-rule",
  "target": "linux/scripts/verify_package_license.py",
  "find": "return [pattern for (pattern, _), matched in zip(rules, found, strict=True) if not matched]",
  "replace": "return []",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "Every declared project and dependency rule must pass."
 },
 {
  "id": "packaging.license-verifier-zip-symlinks",
  "target": "linux/scripts/verify_package_license.py",
  "find": "and not stat.S_ISLNK(mode) and wanted(name, rules):",
  "replace": "and wanted(name, rules):",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "A ZIP symlink cannot replace a delivered regular license file."
 },
 {
  "id": "ort-chain.onnx-native-license-finalizer-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  stage_onnx_native_licenses \"${src_dir}\" \"${output_dir}\" || return $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-onnx-native-licenses.sh",
  "why": "Every CPU and GPU native build must stage checked-out notices."
 },
 {
  "id": "ort-chain.onnx-native-license-finalizer-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  stage_onnx_native_licenses \"${src_dir}\" \"${output_dir}\" || return $?",
  "replace": "  stage_onnx_native_licenses \"${src_dir}\" \"${output_dir}\" || true",
  "test": "bash linux/scripts/tests/test-onnx-native-licenses.sh",
  "why": "Missing license or copy failure must prevent publication."
 },
 {
  "id": "ort-chain.onnx-native-license-require-source",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "    if [[ ! -f \"${src_dir}/${file}\" || -L \"${src_dir}/${file}\" || ! -s \"${src_dir}/${file}\" || ! -r \"${src_dir}/${file}\" ]]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-onnx-native-licenses.sh",
  "why": "Missing, empty or substituted checkout files must fail."
 },
 {
  "id": "ort-chain.onnx-native-license-copy-notices",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  for file in LICENSE ThirdPartyNotices.txt; do\n    install -m 0644 \"${src_dir}/${file}\" \"${output_dir}/licenses/${file}\" || return $?\n  done",
  "replace": "  for file in LICENSE; do\n    install -m 0644 \"${src_dir}/${file}\" \"${output_dir}/licenses/${file}\" || return $?\n  done",
  "test": "bash linux/scripts/tests/test-onnx-native-licenses.sh",
  "why": "Project license and upstream third-party notices must both be retained."
 },
 {
  "id": "ort-chain.onnx-native-license-output-directory-symlink",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  if [[ -L \"${output_dir}/licenses\" ]]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-onnx-native-licenses.sh",
  "why": "A symlinked output directory must be refused."
 },
 {
  "id": "ort-chain.onnx-native-license-output-file-symlink",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "    if [[ -L \"${output_dir}/licenses/${file}\" ]]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-onnx-native-licenses.sh",
  "why": "A symlinked output file must be refused."
 },
 {
  "id": "windows-lane.result-file-parent",
  "target": "windows/scripts/tests/Invoke-Tests.ps1",
  "find": "    if ($resultParent) { $null = New-Item -ItemType Directory -Force -Path $resultParent -ErrorAction Stop }",
  "replace": "    $null = $resultParent",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Runner.ResultFile.Tests.ps1 -ResultFile logs/code-quality/result-file-mutation.json",
  "why": "An isolated mutation mirror must create the requested result parent before writing the real tally."
 },
 {
  "id": "ordered-jobs.interrupted-wait-retries",
  "target": "linux/scripts/lib-ordered-jobs.sh",
  "find": "    [ \"${_OJ_WAIT_INTERRUPTED}\" -eq 0 ] || continue",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ordered-jobs-lifecycle.sh",
  "why": "A signal-interrupted wait must not replace a just-finished command's real exit status."
 },
 {
  "id": "windows-lane.msix-project-logo",
  "target": "windows/scripts/modules/WindowsMsix.Common.psm1",
  "find": "  if ($GenerateTransparentLogos) {",
  "replace": "  if ($true) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only MsixLogo.Portable.Tests.ps1 -ResultFile logs/code-quality/msix-logo-mutation.json",
  "why": "A selected project logo must not be replaced with transparent placeholders."
 },
 {
  "id": "flutter.android-launcher-gate",
  "target": "linux/scripts/05-frameworks/flutter/check-web-artefacts.py",
  "find": " + check_android_launcher(root)",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-web-artefacts.sh",
  "why": "A missing or corrupt Android launcher must fail the shared Flutter gate."
 },
 {
  "id": "flutter.android-launcher-all-densities",
  "target": "linux/scripts/05-frameworks/flutter/check-web-artefacts.py",
  "find": "ANDROID_DENSITIES = (\"mdpi\", \"hdpi\", \"xhdpi\", \"xxhdpi\", \"xxxhdpi\")",
  "replace": "ANDROID_DENSITIES = (\"mdpi\", \"xhdpi\", \"xxhdpi\", \"xxxhdpi\")",
  "test": "bash linux/scripts/tests/test-check-web-artefacts.sh",
  "why": "A missing standard Android icon density must not pass."
 },
 {
  "id": "windows-lane.wix-variable-forwarding",
  "target": "windows/scripts/modules/WindowsMsix.Common.psm1",
  "find": "  $wixArgs += @(Get-WixVariableArguments -Variables $WixVariables)",
  "replace": "  $null = $WixVariables",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only WixVariables.Portable.Tests.ps1 -ResultFile logs/code-quality/wix-variables-mutation.json",
  "why": "WiX must receive the selected project icon and other validated variables without losing argument boundaries."
 },
 {
  "id": "rust.cargo-license-source-digest",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "if expected_digest and digest != expected_digest:",
  "replace": "if False and expected_digest and digest != expected_digest:",
  "test": "bash linux/scripts/tests/test-stage-cargo-licenses.sh",
  "why": "A policy source whose hash differs from the reviewed original must fail."
 },
 {
  "id": "rust.cargo-license-and-review",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "if not extras or entry.get(\"reviewed_expression\") != license_expression:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-stage-cargo-licenses.sh",
  "why": "An AND license needs an explicit reviewed expression and sources."
 },
 {
  "id": "rust.cargo-license-source-nonempty",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "if not data.strip() or len(data) > MAX_FILE_BYTES:",
  "replace": "if len(data) > MAX_FILE_BYTES:",
  "test": "bash linux/scripts/tests/test-stage-cargo-licenses.sh",
  "why": "Empty license texts must not satisfy an inventory."
 },
 {
  "id": "rust.cargo-license-notice-not-text",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "not Path(relative).name.lower().startswith(\"notice\")",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-stage-cargo-licenses.sh",
  "why": "A notice alone must not be accepted as a license text."
 },
 {
  "id": "packaging.python-bundle-license-required",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "app_packaging_validate_project_license \"${LICENSE_FILE}\" || err \"the Python app license is required\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-app-bundle-license.sh",
  "why": "A missing license must stop before deleting an existing bundle."
 },
 {
  "id": "packaging.python-bundle-license-staging",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "app_packaging_stage_project_license \"${LICENSE_FILE}\" \"${BUNDLE}\" || err \"could not stage the Python app license\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-app-bundle-license.sh",
  "why": "Every Python app bundle must contain the original project license."
 },
 {
  "id": "packaging.python-app-lock-ships-the-lock",
  "target": "linux/scripts/06-packaging/python-app-data.py",
  "find": "    for name in [lock.name, *lock_names(lock)]:\n",
  "replace": "    for name in lock_names(lock):\n",
  "test": "bash linux/scripts/tests/test-python-app-data.sh",
  "why": "the app derives its model's file name from the shipped lock; a bundle without it cannot find the model"
 },
 {
  "id": "packaging.python-app-lock-refuses-an-empty-lock",
  "target": "linux/scripts/06-packaging/python-app-data.py",
  "find": "    if not names:\n        sys.exit(f\"{lock} names no file\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-app-data.sh",
  "why": "an empty lock would ship a bundle with no model and no error"
 },
 {
  "id": "packaging.python-app-lock-refuses-a-path",
  "target": "linux/scripts/06-packaging/python-app-data.py",
  "find": "    if bad:\n        sys.exit(",
  "replace": "    if False:\n        sys.exit(",
  "test": "bash linux/scripts/tests/test-python-app-data.sh",
  "why": "a lock row naming ../ would copy a file from outside the lock's directory into the bundle"
 },
 {
  "id": "packaging.python-app-lock-row-dispatch",
  "target": "linux/scripts/06-packaging/python-app-data.py",
  "find": "        if \"lock\" in item:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-python-app-data.sh",
  "why": "a lock row has no 'from'; treated as a plain row it copies nothing the lock names"
 },
 {
  "id": "windows-lane.python-app-lock-ships-the-lock",
  "target": "windows/scripts/python/New-PythonAppBundle.ps1",
  "find": "    foreach ($name in @([IO.Path]::GetFileName($lock)) + $names) {",
  "replace": "    foreach ($name in $names) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PythonApp.BundleLockData.Tests.ps1",
  "why": "the app derives its model's file name from the shipped lock; a bundle without it cannot find the model"
 },
 {
  "id": "windows-lane.python-app-lock-refuses-an-empty-lock",
  "target": "windows/scripts/python/New-PythonAppBundle.ps1",
  "find": "    if ($names.Count -eq 0) { throw \"$($Item['lock']) names no file\" }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PythonApp.BundleLockData.Tests.ps1",
  "why": "an empty lock would ship a bundle with no model and no error"
 },
 {
  "id": "windows-lane.python-app-lock-refuses-a-path",
  "target": "windows/scripts/python/New-PythonAppBundle.ps1",
  "find": "    if ($bad.Count -gt 0) { throw",
  "replace": "    if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PythonApp.BundleLockData.Tests.ps1",
  "why": "a lock row naming ..\\ would copy a file from outside the lock's directory into the bundle"
 },
 {
  "id": "windows-lane.python-app-lock-row-dispatch",
  "target": "windows/scripts/python/New-PythonAppBundle.ps1",
  "find": "        if ($item.ContainsKey('lock')) {",
  "replace": "        if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PythonApp.BundleLockData.Tests.ps1",
  "why": "a lock row has no 'from'; treated as a plain row it copies nothing the lock names"
 },
 {
  "id": "rust.cargo-license-atomic-noreplace",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "if rename(-100, os.fsencode(staging), -100, os.fsencode(output), 1) != 0:",
  "replace": "if rename(-100, os.fsencode(staging), -100, os.fsencode(output), 0) != 0:",
  "test": "python3 linux/scripts/tests/test_stage_cargo_publish.py",
  "why": "Publishing a license inventory must not overwrite a concurrently created destination."
 },
 {
  "id": "package.cmake-pe-icon-source",
  "target": "cmake/CPackCommon.cmake",
  "find": "  target_sources(\"${target}\" PRIVATE \"${_resource}\")",
  "replace": "",
  "test": "bash linux/scripts/tests/test-windows-icon-pe.sh",
  "why": "Both x64 and ARM64 PE executables must contain their configured icon."
 },
 {
  "id": "package.rust-pe-icon-names",
  "target": "shared/rust/windows_icon.rs",
  "find": "    let resource = dir.join(format!(\"{binary}-icon.res\"));",
  "replace": "    let resource = dir.join(\"project-icon.res\");",
  "test": "bash linux/scripts/tests/test-windows-icon-pe.sh",
  "why": "Different Cargo binary targets must not overwrite each other's icon resources."
 },
 {
  "id": "package.pe-test-setup-failfast",
  "target": "linux/scripts/ensure-pe-icon-test-tools.sh",
  "find": "  pe_icon_as_root apt-get update || return $?",
  "replace": "  pe_icon_as_root apt-get update",
  "test": "bash linux/scripts/tests/test-pe-icon-tool-setup.sh",
  "why": "Failed apt updates must not continue into installation."
 },
 {
  "id": "windows-lane.python-licence-reset-order",
  "target": "windows/scripts/python/New-PythonAppBundle.ps1",
  "find": "    $license = Resolve-PackageLicense -Path (Get-PythonAppBundleInputPath -App $App -RepoRoot $RepoRoot -Name 'license_file' -Required)\n    Initialize-PythonAppDirectory -Path $Bundle -Empty",
  "replace": "    Initialize-PythonAppDirectory -Path $Bundle -Empty\n    $license = Resolve-PackageLicense -Path (Get-PythonAppBundleInputPath -App $App -RepoRoot $RepoRoot -Name 'license_file' -Required)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.BundleStaging.Tests.ps1 -ResultFile logs/code-quality/python-app-icon-mutation.json",
  "why": "Invalid license inputs must fail before clearing an existing bundle."
 },
 {
  "id": "windows-lane.python-launcher-icon-link",
  "target": "windows/scripts/modules/WindowsPythonApp.Common.psm1",
  "find": "$script:LauncherSource /link /SUBSYSTEM:CONSOLE @icon",
  "replace": "$script:LauncherSource /link /SUBSYSTEM:CONSOLE",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.BundleStaging.Tests.ps1 -ResultFile logs/code-quality/python-app-icon-mutation.json",
  "why": "The linker must receive the icon resource after its linker options."
 },
 {
  "id": "windows-lane.python-bundle-icon-wiring",
  "target": "windows/scripts/python/New-PythonAppBundle.ps1",
  "find": " -IconResource $launcherIcon)",
  "replace": ")",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.BundleStaging.Tests.ps1 -ResultFile logs/code-quality/python-app-icon-mutation.json",
  "why": "The bundle driver must forward the generated icon to its launchers."
 },
 {
  "id": "windows-lane.icon-compiler-exit-status",
  "target": "windows/scripts/modules/WindowsIcon.Common.psm1",
  "find": "        if ($status -ne 0) { throw \"Icon resource compiler failed with exit $status\" }",
  "replace": "        $null = $status",
  "test": "bash linux/scripts/tests/test-windows-icon-pe.sh",
  "why": "A failed resource compiler must not pass even if it leaves output bytes."
 },
 {
  "id": "windows-lane.msi-license-unique",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "    if ($matchingRows.Count -ne 1) { throw \"MSI file name '$FileName' matched $($matchingRows.Count) rows; expected exactly one\" }",
  "replace": "    if ($matchingRows.Count -eq 0) { throw \"MSI file name '$FileName' matched $($matchingRows.Count) rows; expected exactly one\" }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-license-mutation.json",
  "why": "An ambiguous MSI filename must fail instead of choosing one row."
 },
 {
  "id": "windows-lane.msi-license-long-name",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "        $names = @([string]$_.FileName -split '\\|', 2)",
  "replace": "        $names = @([string]$_.FileName)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-license-mutation.json",
  "why": "Short and long names must both match exactly."
 },
 {
  "id": "windows-lane.msi-license-identifier",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "    if ($Id -notmatch '^[A-Za-z_][A-Za-z0-9_.]*$') { throw \"invalid MSI file identifier: $Id\" }",
  "replace": "    $null = $Id",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-license-mutation.json",
  "why": "MSI identifiers may not become wildcard patterns."
 },
 {
  "id": "windows-lane.msi-license-verdict",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "    if ($LASTEXITCODE -ne 0) { throw \"package license verification failed for '$Pattern' (exit $LASTEXITCODE)\" }",
  "replace": "    $null = $LASTEXITCODE",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-license-mutation.json",
  "why": "The shared verifier's nonzero status must fail the package."
 },
 {
  "id": "windows-lane.msi-license-dynamic-id",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "    $id = Get-MsiLicenseFileId -Path $Path -FileName $FileName",
  "replace": "    $id = 'payloadFile109'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-license-mutation.json",
  "why": "The cabinet identifier must come from this MSI, never a release-specific number."
 },
 {
  "id": "packaging.license-verifier-flatpak-dispatch",
  "target": "linux/scripts/verify_package_license.py",
  "find": "elif path.suffix.lower() == \".flatpak\":",
  "replace": "elif path.suffix.lower() == \".flatpak-mutant\":",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "Flatpak inputs must reach the isolated artifact reader."
 },
 {
  "id": "packaging.license-verifier-flatpak-import",
  "target": "linux/scripts/verify_package_license.py",
  "find": "subprocess.run([\"flatpak\", \"build-import-bundle\", str(repo), str(path.resolve())], check=True, capture_output=True)",
  "replace": "subprocess.run([\"flatpak\", \"build-import-bundle\", str(repo), str(path.resolve())], check=False, capture_output=True)",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "A failed Flatpak import must not be treated as a valid package."
 },
 {
  "id": "packaging.license-verifier-flatpak-unique-ref",
  "target": "linux/scripts/verify_package_license.py",
  "find": "if len(refs) != 1 or not refs[0].startswith(\"app/\"):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "A Flatpak must produce exactly one application reference."
 },
 {
  "id": "windows-lane.icon-decode",
  "target": "windows/scripts/modules/WindowsIcon.Common.psm1",
  "find": "    $decoded = Read-MsixLogo -Path $PngPath\n    $decoded.Dispose()",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only WindowsIcon.Portable.Tests.ps1 -ResultFile logs/test-results/icon-validation-mutation.json",
  "why": "Icon conversion must reject images the shared decoder rejects."
 },
 {
  "id": "windows-lane.icon-first-resource-compiler",
  "target": "windows/scripts/modules/WindowsIcon.Common.psm1",
  "find": "-ErrorAction Stop | Select-Object -First 1).Source",
  "replace": "-ErrorAction Stop).Source",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only WindowsIcon.Portable.Tests.ps1 -ResultFile logs/test-results/icon-validation-mutation.json",
  "why": "Images carry several llvm-rc copies on PATH; the helper must invoke one of them, not the match list."
 },
 {
  "id": "windows-lane.icon-transparency-verdict",
  "target": "windows/scripts/modules/WindowsMsix.Common.psm1",
  "find": "  if (-not $IsPng -or -not $IsVisible) { throw \"MSIX logo must be a visible PNG: $Path\" }",
  "replace": "  if (-not $IsPng) { throw \"MSIX logo must be a visible PNG: $Path\" }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only WindowsIcon.Portable.Tests.ps1 -ResultFile logs/test-results/icon-validation-mutation.json",
  "why": "A transparent image cannot satisfy the shared logo verdict."
 },
 {
  "id": "windows-lane.icon-transparency-wiring",
  "target": "windows/scripts/modules/WindowsMsix.Common.psm1",
  "find": "-IsVisible (Test-MsixImageVisible -Image $logo)",
  "replace": "-IsVisible $true",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only WindowsIcon.Portable.Tests.ps1 -ResultFile logs/test-results/icon-validation-mutation.json",
  "why": "The decoder must pass measured visibility into the shared verdict."
 },
 {
  "id": "packaging.python-app-tar-license",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "  verify_python_app_package_license \"${OUT_DIR}/${name}.tar.gz\" \"${name}/LICENSE\" || return $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-python-app-package-licenses.sh",
  "why": "The tar must contain the complete project license even when self-tests are disabled."
 },
 {
  "id": "packaging.python-app-deb-license",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "  verify_python_app_package_license \"${output}\" \"opt/${APP_ID}/LICENSE\" || return $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-python-app-package-licenses.sh",
  "why": "The actual deb payload must contain the complete project license."
 },
 {
  "id": "packaging.python-app-appimage-license",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "  bash \"${SCRIPT_DIR}/verify-native-appimage-license.sh\" \"${output}\" \"${UNAME_ARCH}\" \"usr/lib/${APP_ID}/LICENSE\" \"${LICENSE_FILE}\" || return $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-python-app-package-licenses.sh",
  "why": "The built native AppImage must be checked by the shared extractor."
 },
 {
  "id": "packaging.python-app-license-source",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "app_packaging_validate_project_license \"${LICENSE_FILE}\" || err \"the Python app license is required\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-app-package-licenses.sh",
  "why": "A missing or empty source license must fail before an artifact is created."
 },
 {
  "id": "packaging.native-appimage-license-verdict",
  "target": "linux/scripts/06-packaging/appimage-verification.sh",
  "find": "    python3 \"$verifier\" squashfs-root --require \"${entry}=${expected}\"",
  "replace": "    true",
  "test": "bash linux/scripts/tests/test-verify-native-appimage-license.sh",
  "why": "Shared native extraction must actually verify selected original licence content; binary policy remains separate."
 },
 {
  "id": "windows-lane.rust-msix-license",
  "target": "windows/scripts/rust/New-MsixPackage.ps1",
  "find": "    $null = Copy-PackageLicense -Path $License -Destination $StagingDir",
  "replace": "    $null = $License",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only RustMsix.ProjectAssets.Tests.ps1 -ResultFile logs/test-results/rust-msix-mutation.json",
  "why": "The Rust MSIX must contain the original project license."
 },
 {
  "id": "windows-lane.rust-msix-logo",
  "target": "windows/scripts/rust/New-MsixPackage.ps1",
  "find": "    Write-MsixStageAssets -StagingDir $StagingDir -LogoPath $Logo",
  "replace": "    Write-MsixStageAssets -StagingDir $StagingDir -LogoPath 'wrong.png'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only RustMsix.ProjectAssets.Tests.ps1 -ResultFile logs/test-results/rust-msix-mutation.json",
  "why": "The Rust MSIX must render the configured logo."
 },
 {
  "id": "windows-lane.rust-msix-dispatch",
  "target": "windows/scripts/rust/New-MsixPackage.ps1",
  "find": "        Set-RustMsixProjectAssets -License $projectLicense -Logo (Resolve-PathFromRoot -Root $Workspace -Path $LogoPath) -StagingDir $stagingRoot",
  "replace": "        $null = $projectLicense",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only RustMsix.ProjectAssets.Tests.ps1 -ResultFile logs/test-results/rust-msix-mutation.json",
  "why": "The real Rust package script must call its license and logo staging helper."
 },
 {
  "id": "packaging.native-appimage-license-path",
  "target": "linux/scripts/06-packaging/appimage-verification.sh",
  "find": "case \"$part\" in .|..)",
  "replace": "case \"$part\" in impossible_literal)",
  "test": "bash linux/scripts/tests/test-verify-native-appimage-license.sh",
  "why": "An AppImage entry must not traverse outside the extracted payload."
 },
 {
  "id": "rust.cargo-tree-build-edges",
  "target": "linux/scripts/06-packaging/cargo_license_tree.py",
  "find": "\"normal,build\",",
  "replace": "\"normal\",",
  "test": "bash linux/scripts/tests/test-cargo-license-tree.sh",
  "why": "The selected Cargo tree must retain build dependencies and proc macros."
 },
 {
  "id": "rust.cargo-tree-ambiguous-source",
  "target": "linux/scripts/06-packaging/cargo_license_tree.py",
  "find": "if len(matches) != 1:",
  "replace": "if not matches:",
  "test": "bash linux/scripts/tests/test-cargo-license-tree.sh",
  "why": "A package name and version must resolve to exactly one metadata source."
 },
 {
  "id": "rust.cargo-tree-root-match",
  "target": "linux/scripts/06-packaging/cargo_license_tree.py",
  "find": "if index == 0 and package[\"id\"] != roots[0][\"id\"]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-cargo-license-tree.sh",
  "why": "The live Cargo tree must start at the requested workspace package."
 },
 {
  "id": "rust.cargo-tree-fixture-refusal",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "if args.metadata and (args.graph_scope != \"metadata-normal\" or feature_args):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-cargo-license-tree.sh",
  "why": "Fixture metadata cannot stand in for a live target-filtered Cargo tree."
 },
 {
  "id": "package.pe-setup-requires-cargo",
  "target": "linux/scripts/ensure-pe-icon-test-tools.sh",
  "find": "  if ! command -v cargo >/dev/null; then echo cargo; fi",
  "replace": "",
  "test": "bash linux/scripts/tests/test-pe-icon-tool-setup.sh",
  "why": "Offline Cargo fixtures require Cargo independently of rustc."
 },
 {
  "id": "windows-lane.wix-license-source-unique",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "    if ($matched.Count -ne 1) { throw \"WiX source '$source' matched $($matched.Count) files; expected exactly one\" }",
  "replace": "    if ($matched.Count -eq 0) { throw \"WiX source '$source' matched $($matched.Count) files; expected exactly one\" }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-license-mutation.json",
  "why": "Reject duplicate source matches."
 },
 {
  "id": "windows-lane.wix-license-source-absolute",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "        [IO.Path]::IsPathFullyQualified($candidate) -and\n            [string]::Equals([IO.Path]::GetFullPath($candidate), $source, [StringComparison]::OrdinalIgnoreCase)",
  "replace": "        [IO.Path]::GetFileName($candidate) -eq [IO.Path]::GetFileName($source)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-license-mutation.json",
  "why": "Only absolute exact source paths can select a package entry."
 },
 {
  "id": "windows-lane.wix-license-dtd",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "    $document = Read-SafeXmlDocument -Path $wix -DtdPolicy Prohibit",
  "replace": "    $document = Read-SafeXmlDocument -Path $wix -DtdPolicy Ignore",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-license-mutation.json",
  "why": "Prohibit DTDs in WiX source."
 },
 {
  "id": "windows-lane.python-package-zip-license",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    Assert-PackageLicense -Path $zip -Pattern \"$stem/LICENSE\" -LicensePath $licensePath",
  "replace": "    $null = $zip",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.PackageLicense.Tests.ps1 -ResultFile logs/code-quality/python-package-license-mutation.json",
  "why": "Verify project license in built ZIP."
 },
 {
  "id": "windows-lane.python-package-msi-license",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    Assert-PackageLicense -Path $msi -Pattern $licenseId -LicensePath $licensePath",
  "replace": "    $null = $msi",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.PackageLicense.Tests.ps1 -ResultFile logs/code-quality/python-package-license-mutation.json",
  "why": "Verify project license in built MSI."
 },
 {
  "id": "windows-lane.python-package-msix-license",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    Assert-PackageLicense -Path $msix -Pattern 'LICENSE' -LicensePath $licensePath",
  "replace": "    $null = $msix",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.PackageLicense.Tests.ps1 -ResultFile logs/code-quality/python-package-license-mutation.json",
  "why": "Verify project license in built MSIX."
 },
 {
  "id": "windows-lane.python-package-msi-source",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    $licenseId = Get-WixSourceFileId -WixPath $wxs -SourcePath (Join-Path $Bundle 'LICENSE')",
  "replace": "    $licenseId = 'f1'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.PackageLicense.Tests.ps1 -ResultFile logs/code-quality/python-package-license-mutation.json",
  "why": "Map the MSI cabinet entry from the current WiX source."
 },
 {
  "id": "python.mutation-merge-anchor-unique",
  "target": "docs/scripts/merge_mutation_recipes.py",
  "find": "    if count != 1:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-merge-mutation-recipes.sh",
  "why": "A stale or ambiguous mutation anchor must not be written."
 },
 {
  "id": "python.mutation-merge-explicit-replacement",
  "target": "docs/scripts/merge_mutation_recipes.py",
  "find": "            if name not in updates:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-merge-mutation-recipes.sh",
  "why": "Existing recipes cannot be overwritten without an explicit ID."
 },
 {
  "id": "python.mutation-merge-target-containment",
  "target": "docs/scripts/merge_mutation_recipes.py",
  "find": "    if not target.is_relative_to(root):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-merge-mutation-recipes.sh",
  "why": "A symlink must not redirect mutation anchor validation outside the checkout."
 },
 {
  "id": "rust.cargo-tree-host-unique",
  "target": "linux/scripts/06-packaging/cargo_license_tree.py",
  "find": "or len(hosts) != 1",
  "replace": "or len(hosts) == 0",
  "test": "bash linux/scripts/tests/test-cargo-license-tree.sh",
  "why": "The recorded compiler host must be unambiguous."
 },
 {
  "id": "rust.cargo-test-junit-crash-counted",
  "target": "linux/scripts/02-toolchain/rust/cargo-test-junit.py",
  "find": "        if not suite.finished:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-cargo-test-junit.sh",
  "why": "a test binary that died mid-run, as a SIGSEGV does, is a failure; without it the record reads green"
 },
 {
  "id": "rust.cargo-test-status-kept",
  "target": "linux/scripts/02-toolchain/rust/cargo_test.sh",
  "find": "rc=\"${PIPESTATUS[0]}\"",
  "replace": "rc=0",
  "test": "bash linux/scripts/tests/test-cargo-test-junit.sh",
  "why": "the JUnit record must not hide a failing cargo test; the step's status is cargo's"
 },
 {
  "id": "rust.cargo-test-empty-record-fails",
  "target": "linux/scripts/02-toolchain/rust/cargo_test.sh",
  "find": "[ \"${rc}\" != 0 ] || rc=\"${junit_rc}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cargo-test-junit.sh",
  "why": "a log with no test binary in it records nothing, and nothing is no pass"
 },
 {
  "id": "windows-lane.ort-license-match-dll",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "            if ((Get-WheelEntryHash -Entry $dll) -ceq $digest) { $matchingWheels.Add($wheel) }",
  "replace": "            $matchingWheels.Add($wheel)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/ort-wheel-licenses-mutation.json",
  "why": "Keep wheel provenance and complete installed license texts fail-closed."
 },
 {
  "id": "windows-lane.ort-license-unique-wheel",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "    if ($matchingWheels.Count -ne 1) { throw \"ORT DLL '$OrtDll' matched $($matchingWheels.Count) wheels in '$WheelDir'; expected one\" }",
  "replace": "    if ($matchingWheels.Count -eq 0) { throw \"ORT DLL '$OrtDll' matched $($matchingWheels.Count) wheels in '$WheelDir'; expected one\" }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/ort-wheel-licenses-mutation.json",
  "why": "Keep wheel provenance and complete installed license texts fail-closed."
 },
 {
  "id": "windows-lane.ort-license-unique-entry",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "    if ($entries.Count -ne 1) { throw \"ORT wheel entry '$Name' matched $($entries.Count) entries; expected one\" }",
  "replace": "    if ($entries.Count -eq 0) { throw \"ORT wheel entry '$Name' matched $($entries.Count) entries; expected one\" }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/ort-wheel-licenses-mutation.json",
  "why": "Keep wheel provenance and complete installed license texts fail-closed."
 },
 {
  "id": "windows-lane.ort-license-nonempty",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "    if ($entries[0].Length -le 0) { throw \"ORT wheel entry is empty: $Name\" }",
  "replace": "    $null = $entries[0].Length",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/ort-wheel-licenses-mutation.json",
  "why": "Keep wheel provenance and complete installed license texts fail-closed."
 },
 {
  "id": "windows-lane.ort-license-original-bytes",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "        [IO.File]::WriteAllBytes($target, $texts[$name])",
  "replace": "        [IO.File]::WriteAllText($target, 'wrong text')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/ort-wheel-licenses-mutation.json",
  "why": "Keep wheel provenance and complete installed license texts fail-closed."
 },
 {
  "id": "windows-lane.ort-license-verifier",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "        Assert-PackageLicense -Path $Path -Pattern $member -LicensePath $source",
  "replace": "        $null = $member",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/ort-wheel-licenses-mutation.json",
  "why": "Keep wheel provenance and complete installed license texts fail-closed."
 },
 {
  "id": "windows-lane.ort-license-msi-wix-required",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "            if (-not $WixPath) { throw 'WiX source is required for MSI license mapping' }",
  "replace": "            $null = $WixPath",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/ort-wheel-licenses-mutation.json",
  "why": "Keep wheel provenance and complete installed license texts fail-closed."
 },
 {
  "id": "windows-lane.ort-license-notice-required",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "        foreach ($name in 'LICENSE', 'ThirdPartyNotices.txt') {\n            $entry = Get-OrtWheelEntry -Archive $archive -Name \"onnxruntime/$name\"",
  "replace": "        foreach ($name in 'LICENSE') {\n            $entry = Get-OrtWheelEntry -Archive $archive -Name \"onnxruntime/$name\"",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/ort-wheel-licenses-mutation.json",
  "why": "Keep wheel provenance and complete installed license texts fail-closed."
 },
 {
  "id": "windows-lane.ort-license-blank",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "            if ([string]::IsNullOrWhiteSpace([Text.Encoding]::UTF8.GetString($texts[$name]))) { throw \"ORT wheel text is blank: $name\" }",
  "replace": "            $null = $texts[$name]",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/ort-wheel-licenses-mutation.json",
  "why": "Blank texts cannot satisfy ONNX license staging."
 },
 {
  "id": "package.ort-wheel-identity",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "    return file_sha(str(copied)) == expected",
  "replace": "    return True",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "A different ELF must never acquire another wheel's notices."
 },
 {
  "id": "package.ort-wheel-all-libraries",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "if all(wheel_has_library(archive, library, strip, scratch, require_unstripped) for library in libraries):",
  "replace": "if any(wheel_has_library(archive, library, strip, scratch, require_unstripped) for library in libraries):",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "Every selected packaged ORT library must match the same wheel."
 },
 {
  "id": "package.ort-wheel-unique",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "    if len(matches) != 1:",
  "replace": "    if len(matches) == 0:",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "Multiple matching wheels cannot establish a unique source."
 },
 {
  "id": "package.ort-wheel-duplicate-entry",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "    if len(entries) != 1:\n        raise ValueError(f\"duplicate wheel entry: {name}\")",
  "replace": "    if len(entries) == 0:\n        raise ValueError(f\"duplicate wheel entry: {name}\")",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "Duplicate wheel members cannot silently override original bytes."
 },
 {
  "id": "package.ort-wheel-blank-notice",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": " or not content.decode(\"utf-8\").strip()",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "A blank text is not a license."
 },
 {
  "id": "package.ort-wheel-original-text",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "            texts[name] = content",
  "replace": "            texts[name] = content.upper()",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "The delivered texts must retain the exact original bytes."
 },
 {
  "id": "package.ort-wheel-output-symlink",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "        if path.is_symlink():",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "License output cannot be redirected by a symlink."
 },
 {
  "id": "package.ort-stage-bundled-libraries",
  "target": "linux/scripts/06-packaging/ort-wheel-licenses.sh",
  "find": "    libraries+=(--library \"$library\")",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "Stage notices for the actual bundled ORT files only."
 },
 {
  "id": "package.ort-archive-notices",
  "target": "linux/scripts/06-packaging/ort-wheel-licenses.sh",
  "find": "  for name in LICENSE ThirdPartyNotices.txt; do\n    rules+=(--require",
  "replace": "  for name in LICENSE; do\n    rules+=(--require",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "Every archive must contain both original notice texts."
 },
 {
  "id": "package.ort-appimage-notices",
  "target": "linux/scripts/06-packaging/ort-wheel-licenses.sh",
  "find": "  for name in LICENSE ThirdPartyNotices.txt; do\n    bash \"${_ORT_WHEEL_LICENSE_DIR}/verify-native-appimage-license.sh\"",
  "replace": "  for name in LICENSE; do\n    bash \"${_ORT_WHEEL_LICENSE_DIR}/verify-native-appimage-license.sh\"",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "A native AppImage must contain both original notice texts."
 },
 {
  "id": "package.ort-appimage-failure",
  "target": "linux/scripts/06-packaging/ort-wheel-licenses.sh",
  "find": "\"${prefix:+${prefix%/}/}licenses/onnxruntime/${name}\" \"${bundle}/licenses/onnxruntime/${name}\" || return $?",
  "replace": "\"${prefix:+${prefix%/}/}licenses/onnxruntime/${name}\" \"${bundle}/licenses/onnxruntime/${name}\" || true",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "AppImage extraction or content failures remain fatal."
 },
 {
  "id": "package.ort-wheel-architecture",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "        if elf_target(header) != native_target:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "A foreign ELF must not reach the target-specific strip provider."
 },
 {
  "id": "package.ort-wheel-large-cap",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "MAX_LIBRARY_BYTES = 1024 * 1024 * 1024",
  "replace": "MAX_LIBRARY_BYTES = 256 * 1024 * 1024",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "NVIDIA's provider exceeds the former 256 MiB limit."
 },
 {
  "id": "package.ort-wheel-bounded-stream",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "while chunk := stream.read(CHUNK_BYTES):",
  "replace": "while chunk := stream.read():",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "Wheel libraries must be read in bounded chunks."
 },
 {
  "id": "package.python-gpu-available",
  "target": "linux/scripts/06-packaging/python-app-selftest.py",
  "find": "    if args.require_available_provider and args.require_available_provider not in report.get(\"available_providers\", []):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-python-app-selftest.sh",
  "why": "GPU builds must reject a runtime missing the requested provider."
 },
 {
  "id": "package.python-gpu-active",
  "target": "linux/scripts/06-packaging/python-app-selftest.py",
  "find": "    if args.require_provider and args.require_provider not in report.get(\"providers\", []):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-python-app-selftest.sh",
  "why": "The hardware proof must reject CPU fallback."
 },
 {
  "id": "package.python-gpu-no-test",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "if [ -n \"${required_provider}\" ] && [ \"${RUN_TESTS}\" != true ]; then err",
  "replace": "if false; then err",
  "test": "bash linux/scripts/tests/test-python-app-package-licenses.sh",
  "why": "A GPU package cannot bypass its recorded provider check."
 },
 {
  "id": "package.python-gpu-hardware-option",
  "target": "linux/scripts/06-packaging/python-app-cli.sh",
  "find": "if [ \"${PYTHON_APP_REQUIRE_ACTIVE_PROVIDER:-false}\" = true ]; then args+=(--require-provider \"${provider}\"); fi",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-app-package-licenses.sh",
  "why": "The hardware validation option must reach the installed package self-test."
 },
 {
  "id": "package.python-gpu-absolute-needed",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "  if [ \"${RELOCATABLE}\" = true ] && [ \"${USE_LDD}\" = true ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "The ldd walk must reject absolute NEEDED paths outside the bundle."
 },
 {
  "id": "package.python-gpu-loader-alias",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "  if [[ \"$2\" == /* ]] && [[ \"${3##*/}\" == ld-linux*.so* ]] && [ \"$(realpath -m \"$2\")\" = \"$(realpath -m \"$1\")\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "The ldd loader alias must not be mistaken for an external library."
 },
 {
  "id": "package.ort-wheel-elf-valid",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "        raise ValueError(\"invalid ELF identity\")",
  "replace": "        return (0, 0, 0)",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "A corrupt wheel ELF must not be silently treated as an unrelated architecture."
 },
 {
  "id": "ort-census.dlopen-runpath-core",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "                    hit = self.versioned_on_runpath(importer, dyn)",
  "replace": "                    hit = None",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "a dlopen user with no DT_NEEDED loads its RUNPATH's versioned chain core by path; ld.so's name search never finds it"
 },
 {
  "id": "ort-census.dlopen-runpath-one-core",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "            if len(found) == 1:",
  "replace": "            if found:",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "two versioned cores in one RUNPATH name no one file, so the census cannot say which the importer opens"
 },
 {
  "id": "ort-census.dlopen-runpath-full-version",
  "target": "linux/scripts/06-packaging/ort_census_probe.py",
  "find": "VERSIONED_CORE = re.compile(r\"libonnxruntime\\.so\\.\\d+\\.\\d+\\.\\d+\")",
  "replace": "VERSIONED_CORE = re.compile(r\"libonnxruntime\\.so\\.\\d+(?:\\.\\d+)*\")",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "the amd bundle's plugin core libonnxruntime.so.1 sits beside the wheel's full-version core and is not a second one a dlopen user opens"
 },
 {
  "id": "package.ort-wheel-existing-text",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": " or target.read_bytes() != content",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "A repeated staging run must refuse a stale or changed license."
 },
 {
  "id": "package.ort-appimage-root-prefix",
  "target": "linux/scripts/06-packaging/ort-wheel-licenses.sh",
  "find": "  [ \"$prefix\" != . ] || prefix=''",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "An AppImage whose payload is at the root must still check both safe paths."
 },
 {
  "id": "package.pe-setup-requires-elf-lld",
  "target": "linux/scripts/ensure-pe-icon-test-tools.sh",
  "find": " || ! pe_icon_find_tool ld.lld >/dev/null",
  "replace": "",
  "test": "bash linux/scripts/tests/test-pe-icon-tool-setup.sh",
  "why": "Cross-architecture ELF fixtures require ld.lld even if lld-link is already installed."
 },
 {
  "id": "package.msi-require-media-cabinet",
  "target": "linux/scripts/verify_package_license.py",
  "find": "            if len(cabinets) != 1:\n                raise ValueError(\"MSI with multiple cabinets requires a Media-table cabinet mapping\")",
  "replace": "            if False:\n                raise ValueError(\"MSI with multiple cabinets requires a Media-table cabinet mapping\")",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "Preserve fail-closed File/Media cabinet selection and actual payload verification."
 },
 {
  "id": "package.msi-require-existing-cabinet",
  "target": "linux/scripts/verify_package_license.py",
  "find": "            if cabinet not in cabinets or not member or \"::\" in member:",
  "replace": "            if not member or \"::\" in member:",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "Preserve fail-closed File/Media cabinet selection and actual payload verification."
 },
 {
  "id": "package.msi-compound-listing",
  "target": "linux/scripts/verify_package_license.py",
  "find": "    selected = msi_cabinet_checks(sevenzip_member_names(path, compound=True), rules)",
  "replace": "    selected = msi_cabinet_checks(sevenzip_member_names(path), rules)",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "Preserve fail-closed File/Media cabinet selection and actual payload verification."
 },
 {
  "id": "package.msi-cabinet-failure",
  "target": "linux/scripts/verify_package_license.py",
  "find": "        subprocess.run([\"7z\", \"e\", \"-tCompound\", \"-so\", \"-spd\", \"--\", str(path), cabinet], stdout=stream, check=True)",
  "replace": "        subprocess.run([\"7z\", \"e\", \"-tCompound\", \"-so\", \"-spd\", \"--\", str(path), cabinet], stdout=stream, check=False)",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "Preserve fail-closed File/Media cabinet selection and actual payload verification."
 },
 {
  "id": "package.msi-duplicate-member",
  "target": "linux/scripts/verify_package_license.py",
  "find": "        if name.casefold() in seen:\n            raise ValueError(f\"duplicate MSI cabinet member: {name}\")",
  "replace": "        if False:\n            raise ValueError(f\"duplicate MSI cabinet member: {name}\")",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "Preserve fail-closed File/Media cabinet selection and actual payload verification."
 },
 {
  "id": "package.msi-map-pattern",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "    if ([IO.Path]::GetExtension($Path) -ieq '.msi') { $Pattern = Get-MsiCabinetPattern -Path $Path -FileId $Pattern }",
  "replace": "    $null = $Pattern",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-media-mutation.json",
  "why": "Preserve fail-closed File/Media cabinet selection and actual payload verification."
 },
 {
  "id": "package.msi-media-selection",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "    $eligible = @($Media | Where-Object { [int]$_.LastSequence -ge [int]$file[0].Sequence } | Sort-Object DiskId)",
  "replace": "    $eligible = @($Media | Where-Object { [int]$_.LastSequence -ge [int]$file[0].Sequence } | Sort-Object DiskId -Descending)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-media-mutation.json",
  "why": "Preserve fail-closed File/Media cabinet selection and actual payload verification."
 },
 {
  "id": "package.msi-media-ambiguous",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "        if ([int]$row.DiskId -le $previousDisk -or [int]$row.LastSequence -le $previousSequence) { throw 'MSI media boundaries are ambiguous or unordered' }",
  "replace": "        $null = $row",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-media-mutation.json",
  "why": "Preserve fail-closed File/Media cabinet selection and actual payload verification."
 },
 {
  "id": "package.msi-embedded-only",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "    if ($cabinet -notmatch '^#[^\\\\/:*?\\[\\]\\x00-\\x1f]+\\.cab$') { throw \"MSI media is not a safe embedded cabinet: $cabinet\" }",
  "replace": "    $null = $cabinet",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msi.LicenseMapping.Tests.ps1 -ResultFile logs/code-quality/msi-media-mutation.json",
  "why": "Preserve fail-closed File/Media cabinet selection and actual payload verification."
 },
 {
  "id": "windows-lane.python-ort-optional",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "    if (-not (Test-Path -LiteralPath $dir)) {\n        if ($RequiredProvider.Count -or $RequirePythonExtension -or $RequireDirectMl) { throw 'Python ONNX Runtime is required when a provider or extension is selected.' }\n        return ''\n    }",
  "replace": "    if (-not (Test-Path -LiteralPath $dir)) { throw 'Python ONNX Runtime is required.' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/python-ort-license-mutation.json",
  "why": "Check installed ONNX wheel texts and each completed Python package when ORT is present."
 },
 {
  "id": "windows-lane.python-ort-wheel-text",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "        if ([Convert]::ToBase64String($actual) -cne [Convert]::ToBase64String($texts[$name])) { throw \"Python ONNX Runtime text differs from matching wheel: $path\" }",
  "replace": "        $null = $actual",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/python-ort-license-mutation.json",
  "why": "Check installed ONNX wheel texts and each completed Python package when ORT is present."
 },
 {
  "id": "windows-lane.python-ort-archive-directory",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "        'archive' { return (@($ArchivePrefix.Trim('/'), $ArchiveDirectory.Trim('/'), $Name) | Where-Object { $_ }) -join '/' }",
  "replace": "        'archive' { return (@($ArchivePrefix.Trim('/'), 'licenses/onnxruntime', $Name) | Where-Object { $_ }) -join '/' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/python-ort-license-mutation.json",
  "why": "Check installed ONNX wheel texts and each completed Python package when ORT is present."
 },
 {
  "id": "windows-lane.python-ort-preflight",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "$ortLicenses = Resolve-PythonOrtLicenses -Bundle $Bundle -WheelDir $OrtWheelDir",
  "replace": "$ortLicenses = ''",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.PackageLicense.Tests.ps1 -ResultFile logs/code-quality/python-package-ort-mutation.json",
  "why": "Check installed ONNX wheel texts and each completed Python package when ORT is present."
 },
 {
  "id": "windows-lane.python-ort-zip",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    Assert-PythonAppArchiveLicenses -Path $zip -ArchivePrefix $stem",
  "replace": "    $null = $zip",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.PackageLicense.Tests.ps1 -ResultFile logs/code-quality/python-package-ort-mutation.json",
  "why": "Check installed ONNX wheel texts and each completed Python package when ORT is present."
 },
 {
  "id": "windows-lane.python-ort-msi",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    if ($ortLicenses) { Assert-OrtWheelLicensesInPackage -Path $msi -LicenseDirectory $ortLicenses -Format msi -WixPath $wxs }",
  "replace": "    $null = $msi",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.PackageLicense.Tests.ps1 -ResultFile logs/code-quality/python-package-ort-mutation.json",
  "why": "Check installed ONNX wheel texts and each completed Python package when ORT is present."
 },
 {
  "id": "windows-lane.python-ort-msix",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    Assert-PythonAppArchiveLicenses -Path $msix",
  "replace": "    $null = $msix",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.PackageLicense.Tests.ps1 -ResultFile logs/code-quality/python-package-ort-mutation.json",
  "why": "Check installed ONNX wheel texts and each completed Python package when ORT is present."
 },
 {
  "id": "windows-lane.python-ort-archive-gate",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    if ($ortLicenses) {\n        Assert-OrtWheelLicensesInPackage -Path $Path",
  "replace": "    if ($false) {\n        Assert-OrtWheelLicensesInPackage -Path $Path",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.PackageLicense.Tests.ps1 -ResultFile logs/code-quality/python-package-ort-mutation.json",
  "why": "Optional ONNX archive checks must execute when ONNX is present."
 },
 {
  "id": "windows-lane.python-ort-wheel-store",
  "target": "windows/scripts/modules/WindowsOrtLicense.Common.psm1",
  "find": "    if (-not $WheelDir) { $WheelDir = if ($env:ORT_CHAIN_WHEEL_DIR) { $env:ORT_CHAIN_WHEEL_DIR } else { Get-OrtChainWheelStore } }",
  "replace": "    if (-not $WheelDir) { $WheelDir = Get-OrtChainWheelStore }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.License.Tests.ps1 -ResultFile logs/code-quality/python-ort-license-mutation.json",
  "why": "Package verification uses the same explicit wheel-store precedence as bundle construction."
 },
 {
  "id": "lib.app-packaging-license-bootstrap",
  "target": "linux/scripts/lib/app-packaging-license.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/log-bootstrap.sh\" || return $?",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "The shared license module must import the common logging bootstrap."
 },
 {
  "id": "lib.pe-icon-tools-bootstrap",
  "target": "linux/scripts/lib/pe-icon-tools.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/log-bootstrap.sh\" || return $?",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "The shared PE tool module must import the common logging bootstrap."
 },
 {
  "id": "packaging.native-deb-gzip",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "dpkg-deb --root-owner-group -Zgzip --build \"$deb_root\"",
  "replace": "dpkg-deb --root-owner-group --build \"$deb_root\"",
  "test": "bash linux/scripts/tests/test-package-archive.sh",
  "why": "A real native DEB must retain gzip control and payload archives for older dpkg."
 },
 {
  "id": "packaging.python-deb-gzip",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "dpkg-deb --root-owner-group -Zgzip --build \"${root}\"",
  "replace": "dpkg-deb --root-owner-group --build \"${root}\"",
  "test": "bash linux/scripts/tests/test-python-app-package-licenses.sh",
  "why": "A real Python DEB must retain gzip control and payload archives for older dpkg."
 },
 {
  "id": "packaging.deb-control-gpu-call",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "  verify_gpu_package \"${output}\" \"opt/${APP_ID}\" || return $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-deb-control-rendering.sh",
  "why": "The Python DEB must verify the finished GPU payload before its license check."
 },
 {
  "id": "packaging.deb-control-gpu-failure",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "  verify_gpu_package \"${output}\" \"opt/${APP_ID}\" || return $?",
  "replace": "  verify_gpu_package \"${output}\" \"opt/${APP_ID}\" || true",
  "test": "bash linux/scripts/tests/test-deb-control-rendering.sh",
  "why": "A failed GPU payload verification must stop Python DEB packaging."
 },
 {
  "id": "packaging.deb-control-license-call",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "  verify_python_app_package_license \"${output}\" \"opt/${APP_ID}/LICENSE\" || return $?",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-deb-control-rendering.sh",
  "why": "The Debian control fixture must detect a removed license check."
 },
 {
  "id": "packaging.deb-control-license-failure",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "  verify_python_app_package_license \"${output}\" \"opt/${APP_ID}/LICENSE\" || return $?",
  "replace": "  verify_python_app_package_license \"${output}\" \"opt/${APP_ID}/LICENSE\" || true",
  "test": "bash linux/scripts/tests/test-deb-control-rendering.sh",
  "why": "A failed license check must preserve its status and stop packaging."
 },
 {
  "id": "lib.android-image-core-fallback",
  "target": "linux/scripts/03-media/build/iree/android/build-android.sh",
  "find": "  . /opt/scripts/core/logging.sh\n",
  "replace": "  . \"$(dirname \"${BASH_SOURCE[0]}\")/../../../../01-core/logging.sh\"\n",
  "test": "bash linux/scripts/tests/test-android-image-core-paths.sh",
  "why": "the image copies <lib>/android/ one level shallower, so a relative-only core source killed android-gstreamer on the 2026-10-27 chain"
 },
 {
  "id": "lib.cerbero-spandsp-redirect",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "cerbero_redirect_source_host SPANDSP-MIRROR https://www.soft-switch.org/downloads/spandsp/ https://gstreamer.freedesktop.org/src/mirror/\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cerbero-source-redirect.sh",
  "why": "soft-switch.org now serves an unrelated site's HTML, so android-gstreamer failed spandsp's checksum on every arch (2026-10-27)"
 },
 {
  "id": "lib.cerbero-redirect-rewrites",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "        sed -i \"s|${dead}|${live}|g\" \"${f}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cerbero-source-redirect.sh",
  "why": "a redirect that only counts the recipes leaves every dead URL in place"
 },
 {
  "id": "lib.cerbero-fetch-retries",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "    for attempt in 1 2 3; do\n        uv run ./cerbero-uninstalled",
  "replace": "    for attempt in 1; do\n        uv run ./cerbero-uninstalled",
  "test": "bash linux/scripts/tests/test-cerbero-fetch-retry.sh",
  "why": "one error page from sqlite.org under HTTP 200 stopped riscv64's android-gstreamer (2026-10-27)"
 },
 {
  "id": "lib.cerbero-curl-stall-timeout",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "    printf 'speed-time = 60\\nspeed-limit = 1024\\n' > \"${CURL_HOME}/.curlrc\"\n",
  "replace": "    printf 'speed-limit = 1024\\n' > \"${CURL_HOME}/.curlrc\"\n",
  "test": "bash linux/scripts/tests/test-cerbero-fetch-retry.sh",
  "why": "without speed-time curl applies no stall window, and a mirror that stops sending holds the android stage open for hours"
 },
 {
  "id": "lib.cerbero-fetch-before-package",
  "target": "linux/scripts/03-media/build/gstreamer/android/build-android-from-source.sh",
  "find": "    cerbero_fetch_package_retry || exit 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cerbero-fetch-retry.sh",
  "why": "without the fetch pass cerbero downloads inside package, where a failed checksum is fatal on the first try"
 },
 {
  "id": "lib.onnx-wheel-order-independent",
  "target": "linux/scripts/tests/test-onnx-cross-staging.sh",
  "find": "  actual=\"$(awk -F/ '{print $NF}' \"$1\" | LC_ALL=C sort)\" || return $?",
  "replace": "  actual=\"$(awk -F/ '{print $NF}' \"$1\")\" || return $?",
  "test": "bash linux/scripts/tests/test-onnx-cross-staging.sh",
  "why": "Both real filesystem enumeration orders must pass the same wheel-strip check."
 },
 {
  "id": "lib.onnx-wheel-exact-members",
  "target": "linux/scripts/tests/test-onnx-cross-staging.sh",
  "find": "  if [ \"$actual\" = $'module.so\\nmodule.so.1' ]; then return 0; fi",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-onnx-cross-staging.sh",
  "why": "A missing or repeated library must not satisfy the wheel-strip membership check."
 },
 {
  "id": "runtime-gates.preflight-checks-only-executed-installers",
  "target": "linux/scripts/lib-runtime-preflight.sh",
  "find": "  \"RUSTUP_INIT_SHA256 https://sh.rustup.rs\"\n)",
  "replace": "  \"RUSTUP_INIT_SHA256 https://sh.rustup.rs\"\n  \"UV_INSTALL_SH_SHA256 https://astral.sh/uv/install.sh\"\n)",
  "test": "bash linux/scripts/tests/test-runtime-input-preflight.sh",
  "why": "a check on an installer no runtime stage runs refused the 2026-10-27 lane over uv's rotation"
 },
 {
  "id": "lib.wsl-quality-shellcheck-tag-pin",
  "target": "linux/scripts/wsl-quality.sh",
  "find": "  [ \"${shellcheck_version}\" = \"${SHELLCHECK_VERSION#v}\" ] \\",
  "replace": "  [ \"${shellcheck_version}\" = \"${SHELLCHECK_VERSION}\" ] \\",
  "test": "bash linux/scripts/tests/test-wsl-quality.sh",
  "why": "the shellcheck pin is a release tag (v0.11.0) while --version prints the bare number, so check must compare without the v"
 },
 {
  "id": "sccache.level-hits-named",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "$(& $n $_ 'hits') hit(s)",
  "replace": "$(& $n $_ 'writes') hit(s)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.SccacheLevelHits.Tests.ps1 -ResultFile logs/code-quality/sccache-level-hits-mutation.json",
  "why": "the per-level line is the evidence that the shared S3 level served a compile, so each level's hits must be its own counter"
 },
 {
  "id": "lib.text-line-indexes-accept-blank-lines",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "[Parameter(Mandatory)][AllowEmptyCollection()][AllowEmptyString()][string[]]$Lines,",
  "replace": "[Parameter(Mandatory)][AllowEmptyCollection()][string[]]$Lines,",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TextLineIndexes.Tests.ps1 -ResultFile logs/code-quality/text-line-indexes-mutation.json",
  "why": "a mandatory string array rejects an empty element, and x265.pc's blank line failed the FFmpeg branch of a chain"
 },
 {
  "id": "gate-fixture.pester-target-guard-fails",
  "target": "linux/scripts/tests/test-mutation-pester-targets.sh",
  "find": "sys.exit(1 if found else 0)",
  "replace": "sys.exit(0)",
  "test": "bash linux/scripts/tests/test-mutation-pester-targets.sh",
  "why": "a recipe on a Pester-style suite skips on the Linux shards and fails every run; the guard must refuse it before CI does"
 },
 {
  "id": "lib.requirement-groups-accept-blank-lines",
  "target": "windows/scripts/modules/WindowsPythonApp.Common.psm1",
  "find": "param([Parameter(Mandatory)][AllowEmptyString()][string[]]$Lines)",
  "replace": "param([Parameter(Mandatory)][string[]]$Lines)",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only PythonApp.Cross.Tests.ps1 -ResultFile logs/code-quality/requirement-groups-mutation.json",
  "why": "a requirements export carries blank lines, which a mandatory string array would refuse"
 },
 {
  "id": "lib.genai-yvals-patch-unindented",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "'#ifdef __clang__', '#define _EMIT_STL_ERROR(NUMBER, MESSAGE)'",
  "replace": "'#ifdef __clang__', '    #define _EMIT_STL_ERROR(NUMBER, MESSAGE)'",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.GenaiClangStlPatch.Tests.ps1 -ResultFile logs/code-quality/genai-yvals-mutation.json",
  "why": "an indented replacement no longer matches the patch's own check, which stopped the amd64 chain's GenAI build"
 },
 {
  "id": "package.gpu-host-direct-only-closure",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "DIRECT_ONLY+=(\"${2:?}\")",
  "replace": "PROTECT+=(\"${2:?}\")",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "host runtime transitive dependencies must not be copied by an ldd walk"
 },
 {
  "id": "package.gpu-host-reject-sdk-root",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "case \"$(realpath \"${found}\")/\" in",
  "replace": "case \"/not-the-source/\" in",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "libraries from the host SDK tree must not silently enter a host-runtime bundle"
 },
 {
  "id": "package.gpu-host-unknown-provider-import",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "    ort_class=\"$(_ort_host_import_class \"${ort_kind}\" \"${ort_soname}\")\" || {\n      printf 'unexpected or invalid %s provider dependency: %s\\n' \"${ort_kind}\" \"${ort_soname}\" >&2; return 1;\n    }",
  "replace": "    ort_class=\"$(_ort_host_import_class \"${ort_kind}\" \"${ort_soname}\")\" || continue",
  "test": "bash linux/scripts/tests/test-ort-host-runtime.sh",
  "why": "a new unreviewed provider dependency cannot silently disappear from the host contract"
 },
 {
  "id": "package.gpu-host-reject-bundled-runtime",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "migraphx:libhsa-runtime*.so*",
  "replace": "migraphx:never-libhsa-runtime*.so*",
  "test": "bash linux/scripts/tests/test-ort-host-runtime.sh",
  "why": "the host-runtime option must reject an accidentally copied ROCm library"
 },
 {
  "id": "package.gpu-host-provider-required",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "*) err 'host GPU runtime requires CUDA or MIGraphX' ;;",
  "replace": "*) : ;;",
  "test": "bash linux/scripts/tests/test-python-app-bundle-license.sh",
  "why": "host GPU runtime mode cannot be enabled for a CPU bundle"
 },
 {
  "id": "package.gpu-host-artifact-name",
  "target": "linux/scripts/06-packaging/python-app-package.sh",
  "find": "ARTIFACT_ID=\"${APP_ID}-gpu-amd\"",
  "replace": "ARTIFACT_ID=\"${APP_ID}\"",
  "test": "bash linux/scripts/tests/test-python-app-package-licenses.sh",
  "why": "an AMD artifact must not collide with the CPU artifact"
 },
 {
  "id": "lib.litert-ty-uv-cache-container-local",
  "target": "windows/Dockerfile.media-builder",
  "find": "$env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'",
  "replace": "$env:UV_CACHE_DIR = 'C:\\bzl-repo-cache\\ty-uv-cache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.LitertUvCache.Tests.ps1 -ResultFile logs/code-quality/litert-ty-uv-cache-mutation.json",
  "why": "uv's renames into a cache mount an earlier RUN filled fail with os error 3, which stopped the amd64 chain's LiteRT stage"
 },
 {
  "id": "lib.tvm-rocm-llvm-targets-null-off-lane",
  "target": "windows/scripts/build/Build-TvmFromSource.ps1",
  "find": "    $tvmLlvmTargetsBuilt = $null",
  "replace": "    $tvmLlvmTargetsUnset = $null",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeTvmNullReturn.Tests.ps1 -ResultFile logs/code-quality/tvm-llvm-targets-mutation.json",
  "why": "off the rocm lane the variable is never set, and strict mode stopped the amd64 chain's TVM build on its return"
 },
 {
  "id": "lib.iree-host-tools-null-native",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "    $ireeHostBinDir = $null",
  "replace": "    $ireeHostBinDirUnset = $null",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeTvmNullReturn.Tests.ps1 -ResultFile logs/code-quality/iree-host-tools-mutation.json",
  "why": "a native build never sets the host-tool directory, and strict mode would stop the media-tvm stage on its return"
 },
 {
  "id": "python.packaging.cross-env-stays-off-the-syncs",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "VENV_SOURCES=\"$WORKSPACE_ROOT/.venv_packaging_sources\"\n",
  "replace": "[ -z \"${CROSS_TARGET}\" ] || packaging_cross_env \"${CROSS_TARGET}\"\nVENV_SOURCES=\"$WORKSPACE_ROOT/.venv_packaging_sources\"\n",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "the venv syncs would build their sdists with the riscv64 compiler and the host linker, so a C++ extension such as line-profiler fails to link (run 40613187784) and a C one installs a riscv64 module into the amd64 venv"
 },
 {
  "id": "python.packaging.cross-env-ends-with-the-wheel",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "    (\n      packaging_cross_env \"${CROSS_TARGET}\" || exit 1\n      _PYTHON_HOST_PLATFORM=\"${PYTHON_HOST_PLATFORM_TARGET}\" python_ci_cached_command \"${venv}/bin/python\" -m pip wheel . --no-deps -w dist\n    )\n",
  "replace": "    {\n      packaging_cross_env \"${CROSS_TARGET}\" || exit 1\n      _PYTHON_HOST_PLATFORM=\"${PYTHON_HOST_PLATFORM_TARGET}\" python_ci_cached_command \"${venv}/bin/python\" -m pip wheel . --no-deps -w dist\n    }\n",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "the first wheel's cross environment would outlive it, so the binary venv's sync builds its sdists for riscv64 again"
 },
 {
  "id": "windows-lane.crash-dump-stays-off-non-windows",
  "target": "cmake/CrashDump.cmake",
  "find": "  if(NOT WIN32)\n    return()\n  endif()\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cmake-crash-dump.sh",
  "why": "every Linux and macOS configure would warn about a missing Windows toolchain"
 },
 {
  "id": "windows-lane.crash-dump-needs-the-msvc-driver",
  "target": "cmake/CrashDump.cmake",
  "find": "  if(NOT MSVC)\n",
  "replace": "  if(FALSE)\n",
  "test": "bash linux/scripts/tests/test-cmake-crash-dump.sh",
  "why": "a MinGW build would compile __try and dbghelp code its compiler cannot build, and fail far from this call"
 },
 {
  "id": "windows-lane.crash-dump-compiles-into-the-target",
  "target": "cmake/CrashDump.cmake",
  "find": "  target_sources(\"${target}\" PRIVATE \"${_KATAGLYPHIS_CRASH_DUMP_SOURCE}\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cmake-crash-dump.sh",
  "why": "the call would look wired while the executable carries no handler, so a crash leaves no dump again"
 },
 {
  "id": "windows-lane.crash-dump-keeps-consumer-warnings-off",
  "target": "cmake/CrashDump.cmake",
  "find": "    PROPERTIES COMPILE_OPTIONS \"/w\"\n               SKIP_LINTING ON\n",
  "replace": "    PROPERTIES SKIP_LINTING ON\n",
  "test": "bash linux/scripts/tests/test-cmake-crash-dump.sh",
  "why": "a consumer's /WX and its warning set would fail its build on the hub's handler"
 },
 {
  "id": "windows-lane.crash-dump-release-writes-a-pdb",
  "target": "cmake/CrashDump.cmake",
  "find": "$<$<CONFIG:Release,MinSizeRel>:/DEBUG;/OPT:REF;/OPT:ICF>",
  "replace": "$<$<CONFIG:Release,MinSizeRel>:/OPT:REF;/OPT:ICF>",
  "test": "bash linux/scripts/tests/test-cmake-crash-dump.sh",
  "why": "a Release crash would print module+RVA frames that no PDB can name"
 },
 {
  "id": "windows-lane.crash-dump-executables-only",
  "target": "cmake/CrashDump.cmake",
  "find": "  if(NOT\n     _type\n     STREQUAL\n     \"EXECUTABLE\")\n",
  "replace": "  if(FALSE)\n",
  "test": "bash linux/scripts/tests/test-cmake-crash-dump.sh",
  "why": "a library would take the handler's static initializer into every executable that links it"
 },
 {
  "id": "consumer-inventory.submodule-cycle-is-refused",
  "target": "linux/scripts/verify_submodule_cycles.py",
  "find": "            if repo_key(url) == forbidden:\n",
  "replace": "            if False:\n",
  "test": "bash linux/scripts/tests/test-submodule-cycles.sh",
  "why": "a family repo that vendors the hub again passes, and every recursive clone loops as smile and awesome-beamer made it"
 },
 {
  "id": "consumer-inventory.submodule-cycle-walk-recurses",
  "target": "linux/scripts/verify_submodule_cycles.py",
  "find": "            pending.append((child, f\"{shown}/\"))\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-submodule-cycles.sh",
  "why": "only the hub's own .gitmodules is read, and the cycle sat two levels down"
 },
 {
  "id": "consumer-inventory.submodule-cycle-unread-fails",
  "target": "linux/scripts/verify_submodule_cycles.py",
  "find": "    if cycles or unchecked:\n",
  "replace": "    if cycles:\n",
  "test": "bash linux/scripts/tests/test-submodule-cycles.sh",
  "why": "a checkout without the nested submodules reads nothing below them and passes vacuously"
 },
 {
  "id": "consumer-inventory.submodule-cycle-url-spellings",
  "target": "linux/scripts/verify_submodule_cycles.py",
  "find": "    return (\n        f\"{match.group(1)}/{match.group(2)}\".lower() if match else url.strip().lower()\n    )\n",
  "replace": "    return f\"{match.group(1)}/{match.group(2)}\" if match else url.strip()\n",
  "test": "bash linux/scripts/tests/test-submodule-cycles.sh",
  "why": "an ssh or lowercase spelling of the hub's URL would slip past the comparison"
 },
 {
  "id": "lib.smoke-torchapp-census-passed",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": " -OrtCensusPath \"$torchAppCensus\" -Mode verify",
  "replace": " -Mode verify",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Smoke.TorchAppOrtVerify.Tests.ps1 -ResultFile logs/code-quality/smoke-torchapp-census-passed.json",
  "why": "the gate mounts windows/scripts alone, so the verifier looked for the census beside itself and the amd64 smoke gate failed"
 },
 {
  "id": "lib.smoke-torchapp-census-image-copy",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "$torchAppCensus = Resolve-SmokeCompanion -ScriptRoot $PSScriptRoot -Name 'ort-venv-census.py'",
  "replace": "$torchAppCensus = Join-Path $PSScriptRoot 'ort-venv-census.py'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Smoke.TorchAppOrtVerify.Tests.ps1 -ResultFile logs/code-quality/smoke-torchapp-census-image-copy.json",
  "why": "only the image's C:\\temp\\scripts copy exists in the gate, so a mount-only path fails every amd64 smoke run"
 },
 {
  "id": "lib.smoke-torchapp-verify-evidence",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "Where-Object { $_.Trim() } | Select-Object -Last 3) }",
  "replace": "Where-Object { $_.Trim() } | Select-Object -First 3) }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Smoke.TorchAppOrtVerify.Tests.ps1 -ResultFile logs/code-quality/smoke-torchapp-verify-evidence.json",
  "why": "the verifier's error is its last output, and a message without it hid a missing census behind a bare failed"
 },
 {
  "id": "lib.smoke-cmake-build-binds-its-directory",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "Assert-CmakeSmokeBuild -tmpDir2 $tmpDir2",
  "replace": "Assert-CmakeSmokeBuild -Directory $tmpDir2",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Smoke.ScriptStructure.Tests.ps1 -ResultFile logs/code-quality/smoke-cmake-build-binds.json",
  "why": "an undeclared name left the CMake smoke's directory empty, so section 15 ran no assertion and the amd64 smoke gate failed its floor"
 },
 {
  "id": "lib.smoke-functions-at-script-level",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "function Invoke-SmokeSection10 {",
  "replace": "function Invoke-SmokeSection10 { function Get-NestedSmokeProbe { }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Smoke.ScriptStructure.Tests.ps1 -ResultFile logs/code-quality/smoke-functions-at-script-level.json",
  "why": "a missing brace nested the OpenCV link smoke inside the CUDA helper, so section 10 called a function that did not exist"
 },
 {
  "id": "lib.cpython-pip-output-off-the-return-value",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "-m pip $argLine 2>&1\" | Out-Host",
  "replace": "-m pip $argLine 2>&1\"",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Pip.Tests.ps1 -ResultFile logs/code-quality/cpython-pip-output.json",
  "why": "pip's lines turned the TVM python plan into an array, and the arm64 media-tvm stage died on a missing PythonModule property"
 },
 {
  "id": "lib.lint-scriptblock-scope-leak-reads",
  "target": "windows/scripts/modules/WindowsLint.Common.psm1",
  "find": "$_.Extent.StartOffset -gt $command.Extent.EndOffset -and $leaked",
  "replace": "$false -and $leaked",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Lint.Diagnostics.Tests.ps1 -ResultFile logs/code-quality/lint-scope-leak-reads.json",
  "why": "the VVL build read $vvlPrefix after the Invoke-WithProcessEnvironment block that alone set it, and the arm64 merge died after 40 minutes"
 },
 {
  "id": "lib.lint-scriptblock-scope-leak-dot-sourcing",
  "target": "windows/scripts/modules/WindowsLint.Common.psm1",
  "find": "if ($dotSourcing -contains $command.GetCommandName() -or $command.InvocationOperator -eq 'Dot') { continue }",
  "replace": "if ($command.InvocationOperator -eq 'Dot') { continue }",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Lint.Diagnostics.Tests.ps1 -ResultFile logs/code-quality/lint-scope-leak-dot-sourcing.json",
  "why": "ForEach-Object runs its block in the caller's scope, so flagging it would bury the real findings"
 },
 {
  "id": "lib.lint-scriptblock-scope-leak-same-scope",
  "target": "windows/scripts/modules/WindowsLint.Common.psm1",
  "find": "-and (Get-LintEnclosingScope $_) -eq $scope } |",
  "replace": "} |",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Lint.Diagnostics.Tests.ps1 -ResultFile logs/code-quality/lint-scope-leak-same-scope.json",
  "why": "a later block that assigns the name itself reads its own variable, which flooded the first scan with 282 false findings"
 },
 {
  "id": "lib.resource-sampler-without-vmmem",
  "target": "windows/scripts/build/Build-ResourceSampler.ps1",
  "find": "$vmmemGB = if ($vmmemProcs) {",
  "replace": "$vmmemGB = if ($true) {",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildDriver.ResourceSampleRow.Tests.ps1 -ResultFile logs/code-quality/resource-sampler-without-vmmem.json",
  "why": "with no WSL VM running every sample threw on the empty vmmem sum, and whole chains left only sample-error rows"
 },
 {
  "id": "lib.bind-target-base-lacks",
  "target": "windows/Dockerfile.base",
  "find": "     windows\\scripts\\modules\\WindowsContainerImage.Common.psm1 `",
  "replace": "",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/bind-target-base-lacks.json",
  "why": "the nvidia sdk bind-mounted a module base lacked, and the directory it left made the final module COPY fail after five hours of chain"
 },
 {
  "id": "lib.nvidia-bootstrap-copied-not-mounted",
  "target": "windows/Dockerfile.nvidia",
  "find": "RUN & 'C:\\temp\\scripts\\Install-Cuda.ps1'",
  "replace": "RUN --mount=type=bind,source=scripts/modules/WindowsContainerImage.Bootstrap.psm1,target=C:\\temp\\scripts\\modules\\WindowsContainerImage.Bootstrap.psm1 & 'C:\\temp\\scripts\\Install-Cuda.ps1'",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only WindowsContainerImage.Bootstrap.Tests.ps1 -ResultFile logs/code-quality/nvidia-bootstrap-copied.json",
  "why": "the CUDA layer's bootstrap mount left a directory at the module path, and final's COPY windows\\scripts\\modules failed on it"
 },
 {
  "id": "release.collect-lone-upload",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  if [ -n \"$LONE\" ] && [ ! -d \"${artifacts}/${LONE}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a lone upload is extracted without its folder, so its files would never be collected"
 },
 {
  "id": "release.collect-loose-files-fail",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "      die \"files lie directly in ${artifacts}, outside any upload: name the lone upload with --lone-upload\"",
  "replace": "      true",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "files outside any upload folder would be dropped from the release without a word"
 },
 {
  "id": "release.publish-passes-lone-upload",
  "target": ".github/workflows/release-publish.yml",
  "find": "then lone=(--lone-upload \"${ARTIFACTS}\"); fi",
  "replace": "then lone=(); fi",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "a release whose artifacts input names one upload would collect nothing from it"
 },
 {
  "id": "lib.tvm-minimal-llvm-ninja-off-the-return-value",
  "target": "windows/scripts/build/Build-TvmFromSource.ps1",
  "find": "-LogFile $llvmBuildLog -Install -InstallConfig 'Release' | Out-Host",
  "replace": "-LogFile $llvmBuildLog -Install -InstallConfig 'Release'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.NinjaReturnLeak.Tests.ps1 -ResultFile logs/code-quality/tvm-minimal-llvm-ninja.json",
  "why": "the ROCm TVM branch returned ninja's whole log as its llvm-config path, and cmd.exe refused the resulting command line"
 },
 {
  "id": "lib.gst-vpx-cpp-std",
  "target": "windows/scripts/build/Build-GstreamerFromSource.ps1",
  "find": "        '-Dvpx:cpp_std=c++17',\n",
  "replace": "",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/gst-vpx-cpp-std.json",
  "why": "libwebm under the port's C++11 default fails on MSVC's STL 30 minutes into the merge stage"
 },
 {
  "id": "lib.iree-twin-defines-gil-off",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "        Add-IreeTwinFreeThreadedDefine -BuildDir $BuildDir\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeTwin.Tests.ps1 -ResultFile logs/code-quality/iree-twin-gil-define.json",
  "why": "without it the arm64 twin stops at Assert-NinjaFreeThreadedDefine, whose gate this does not relax"
 },
 {
  "id": "lib.iree-scratch-mount-path",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "$script:IreeBuildMount = 'C:\\iree-build'",
  "replace": "$script:IreeBuildMount = 'C:\\iree-build-elsewhere'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeScratch.Tests.ps1 -ResultFile logs/code-quality/iree-scratch-mutation.json",
  "why": "a path the RUN does not mount puts IREE back in the 20 GB scratch, where the compiler wheel found 0.3 GB free"
 },
 {
  "id": "lib.iree-scratch-cache-mounted",
  "target": "windows/Dockerfile.media-builder",
  "find": "    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeScratch.Tests.ps1 -ResultFile logs/code-quality/iree-scratch-mutation.json",
  "why": "an unmounted build dir is ordinary scratch again"
 },
 {
  "id": "lib.iree-scratch-mount-preferred",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "    if (-not (Test-Path -LiteralPath $script:IreeBuildMount -PathType Container)) { return Join-Path $SourceDir 'build' }\n",
  "replace": "    return Join-Path $SourceDir 'build'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeScratch.Tests.ps1 -ResultFile logs/code-quality/iree-scratch-mutation.json",
  "why": "a resolver that ignores the mount builds in the scratch however the RUN is wired"
 },
 {
  "id": "lib.iree-scratch-reset-before-configure",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "    Reset-SourceBuildDirectory -Path $script:IreeBuildMount\n    return $script:IreeBuildMount\n",
  "replace": "    return $script:IreeBuildMount\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeScratch.Tests.ps1 -ResultFile logs/code-quality/iree-scratch-mutation.json",
  "why": "a previous run's tree on the mount would reach this run's configure"
 },
 {
  "id": "lib.iree-scratch-clear-empties",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "-PathType Container) { Reset-SourceBuildDirectory -Path $script:IreeBuildMount }\n}",
  "replace": "-PathType Container) { }\n}",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeScratch.Tests.ps1 -ResultFile logs/code-quality/iree-scratch-mutation.json",
  "why": "a kept tree holds tens of GB of host disk in the cache store"
 },
 {
  "id": "lib.iree-scratch-clear-called",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "Remove-SourceBuildTree -Path $SourceDir\nClear-IreeBuildMount\n",
  "replace": "Remove-SourceBuildTree -Path $SourceDir\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeScratch.Tests.ps1 -ResultFile logs/code-quality/iree-scratch-mutation.json",
  "why": "a clear that never runs keeps the tree on the host"
 },
 {
  "id": "lib.diag-cudacache-repo-root",
  "target": "windows/scripts/diagnostics/Test-CudaCache.ps1",
  "find": "$repoRoot = Split-Path (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) -Parent",
  "replace": "$repoRoot = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Diagnostics.ModulePaths.Tests.ps1 -ResultFile logs/code-quality/diag-module-paths-mutation.json",
  "why": "a root one level short imports windows\\windows\\scripts\\modules and the CUDA cache proof never starts"
 },
 {
  "id": "lib.diag-rdna4-repo-root",
  "target": "windows/scripts/diagnostics/Test-Rdna4LayerLock.ps1",
  "find": "$repoRoot = Split-Path (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) -Parent",
  "replace": "$repoRoot = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Diagnostics.ModulePaths.Tests.ps1 -ResultFile logs/code-quality/diag-module-paths-mutation.json",
  "why": "a root one level short leaves the RDNA4 A/B without its modules"
 },
 {
  "id": "lib.cuda-probe-nonce-in-code",
  "target": "windows/scripts/diagnostics/verify-cuda-cache/Test-Cache.ps1",
  "find": "(\"__device__ const char cachetest_nonce[] = `\"$nonce`\";`n\" + ",
  "replace": "(\"// nonce: $nonce`n\" + ",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Diagnostics.CudaCacheProbe.Tests.ps1 -ResultFile logs/code-quality/cuda-probe-mutation.json",
  "why": "a comment nonce is stripped by preprocessing, so a warm cache hits twice and the probe proves no write"
 },
 {
  "id": "lib.cuda-probe-requires-miss",
  "target": "windows/scripts/diagnostics/verify-cuda-cache/Test-Cache.ps1",
  "find": "if ($misses -lt 1) { throw 'NO CACHE MISS on the nonce compile - the probe did not reach sccache' }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Diagnostics.CudaCacheProbe.Tests.ps1 -ResultFile logs/code-quality/cuda-probe-mutation.json",
  "why": "without the miss check two warm hits pass and the write path goes unproven"
 },
 {
  "id": "lib.smoke-finding-empty-if-result",
  "target": "windows/scripts/modules/WindowsSmokeTest.Common.psm1",
  "find": "{ ($null -eq $Finding) -or @($Finding).Count -eq 0 }",
  "replace": "{ @($Finding).Count -eq 0 }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Smoke.FindingVerdict.Tests.ps1 -ResultFile logs/code-quality/smoke-finding-mutation.json",
  "why": "an empty if/else result binds -Finding as $null, so the healthy TensorRT EP check failed with no finding named"
 },
 {
  "id": "lib.webgpu-static-plugin-args",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "'-Donnxruntime_USE_EP_API_ADAPTERS=ON', '-Donnxruntime_WEBGPU_STATIC_PLUGIN=ON',",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.WebGpuStaticPlugin.Tests.ps1 -ResultFile logs/code-quality/webgpu-static-plugin-mutation.json",
  "why": "without both switches the rocm ORT builds the legacy in-tree WebGPU EP again"
 },
 {
  "id": "lib.webgpu-static-plugin-gated",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "; onnxruntime_WEBGPU_STATIC_PLUGIN = 'ON'",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.WebGpuStaticPlugin.Tests.ps1 -ResultFile logs/code-quality/webgpu-static-plugin-mutation.json",
  "why": "a configure that dropped the static plugin would pass the WebGPU gate"
 },
 {
  "id": "lib.qnn-ep-ninja-msvc-only",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "Update-NinjaFile -NinjaFile (Join-Path $buildDir 'build.ninja') -OrtMsvcOnlyFlags\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtQnnEp.Tests.ps1 -ResultFile logs/code-quality/qnn-ep-mutation.json",
  "why": "the fork's /experimental:external and -WX stop clang-cl on the first TU that names them"
 },
 {
  "id": "lib.ninja-msvc-only-wx",
  "target": "windows/scripts/modules/WindowsSourceBuild.Patches.psm1",
  "find": ", '(?<=\\s)-WX(?=\\s)')",
  "replace": ")",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.PatchQuiet.Tests.ps1 -ResultFile logs/code-quality/ninja-msvc-only-mutation.json",
  "why": "without the -WX strip every unused-argument warning stops the ORT and QNN fork builds"
 },
 {
  "id": "lib.qnn-ep-pin-sha-required",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "    if (\"$Sha256\" -notmatch '^[0-9A-Fa-f]{64}$') { throw \"ORT_QNN_EP_SOURCE_SHA256='$Sha256' is not a 64-hex SHA256: refusing to fetch the QNN plugin unverified\" }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtQnnEp.Tests.ps1 -ResultFile logs/code-quality/qnn-ep-mutation.json",
  "why": "without the hash check the fork tarball downloads unverified"
 },
 {
  "id": "lib.qnn-ep-home-full-chain",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "    if ($hit.Count -eq 0) { throw \"the chain ORT at $OrtPrefix holds no $Name (Build-OnnxFromSource.ps1 runs first)\" }\n",
  "replace": "    if ($hit.Count -eq 0) { return $null }\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtQnnEp.Tests.ps1 -ResultFile logs/code-quality/qnn-ep-mutation.json",
  "why": "a partial --ort_home lets the fork's copy step fail or pick another ORT"
 },
 {
  "id": "lib.qnn-ep-foreign-core-bytes",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "-ne $sha[$file.Name]) { $found += $file.FullName }",
  "replace": "-eq 'never') { $found += $file.FullName }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtQnnEp.Tests.ps1 -ResultFile logs/code-quality/qnn-ep-mutation.json",
  "why": "an ORT core the fork built itself would ship beside the chain's"
 },
 {
  "id": "lib.qnn-ep-stage-dir",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "    $null = New-Item -ItemType Directory -Force -Path $Root\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtQnnEp.Tests.ps1 -ResultFile logs/code-quality/qnn-ep-mutation.json",
  "why": "the reset removes the plugin directory, and the copy then writes the DLL as a file named after it"
 },
 {
  "id": "lib.trt-ep-stage-dir",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "    if (Test-Path -LiteralPath $Root) { Remove-Item -LiteralPath $Root -Recurse -Force }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "a stage over the previous one keeps whatever the last build left beside the plugin"
 },
 {
  "id": "lib.qnn-ep-link-output",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "    $built = Get-Item -LiteralPath (Join-Path $BuildDir 'onnxruntime_providers_qnn.dll') -ErrorAction SilentlyContinue\n",
  "replace": "    $built = Get-ChildItem -LiteralPath $BuildDir -Recurse -Filter 'onnxruntime_providers_qnn.dll' | Select-Object -Last 1\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtQnnEp.Tests.ps1 -ResultFile logs/code-quality/qnn-ep-mutation.json",
  "why": "a recursive pick finds the fork's wheel-tree copy as well, and staging stops on two DLLs or takes the wrong one"
 },
 {
  "id": "lib.qnn-ep-module-exports",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "    $found = @(Get-OrtPluginEpExportGap -Path $Dll)\n",
  "replace": "    $found = @()\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtQnnEp.Tests.ps1 -ResultFile logs/code-quality/qnn-ep-mutation.json",
  "why": "a module without the plugin entry points cannot be registered, and the shared export gap must reach the finding"
 },
 {
  "id": "lib.qnn-smoke-no-in-tree-ep",
  "target": "windows/scripts/modules/WindowsSmokeTest.Common.psm1",
  "find": "-Name 'onnxruntime_providers_qnn.dll' | ForEach-Object",
  "replace": "-Name 'never-a-file.dll' | ForEach-Object",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtQnnEp.Tests.ps1 -ResultFile logs/code-quality/qnn-ep-mutation.json",
  "why": "an in-tree QNN EP left in the chain ORT would pass beside the plugin"
 },
 {
  "id": "lib.qnn-ep-in-ort-run",
  "target": "windows/Dockerfile.media-builder",
  "find": "-Until 'TensorRT plugin EP'",
  "replace": "-Until 'ONNX Runtime'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "the ORT RUN would stop before both plugin EPs build"
 },
 {
  "id": "lib.trt-ep-pin-sha-required",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "        if ($sha -notmatch '^[0-9A-Fa-f]{64}$') { throw \"$($row.Sha)='$sha' is not a 64-hex SHA256: refusing to fetch $($row.Name) unverified\" }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "an empty hash reaches Invoke-DownloadWithRetry as no check, and a seed downloads unverified"
 },
 {
  "id": "lib.trt-ep-seed-tag-drift",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "    $declaredSeeds = @($Declared.Keys | Where-Object { $_ -ne 'googletest' } | ForEach-Object { \"$_ $($Declared[$_])\" })\n",
  "replace": "    $declaredSeeds = $pinned\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "a plugin bump that moves a GIT_TAG would build against the old pinned seed"
 },
 {
  "id": "lib.trt-ep-seed-unseeded",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "Compare-Object -CaseSensitive",
  "replace": "Compare-Object",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "a repository spelled otherwise is another download, which the seed does not cover"
 },
 {
  "id": "lib.trt-ep-home-implib",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "    $lib = Get-OrtChainPrefixFile -OrtPrefix $OrtPrefix -Name 'onnxruntime.lib'\n",
  "replace": "    $lib = Get-OrtChainPrefixFile -OrtPrefix $OrtPrefix -Name 'onnxruntime.dll'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "the plugin links the chain's import library; a shim with the DLL instead links nothing or another ORT"
 },
 {
  "id": "lib.trt-ep-fetch-disconnected",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "        '-DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON', '-DCMAKE_POLICY_DEFAULT_CMP0170:STRING=NEW'",
  "replace": "        '-DCMAKE_POLICY_DEFAULT_CMP0170:STRING=NEW'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "a declaration the seed gate misses would clone its repository unverified instead of failing"
 },
 {
  "id": "lib.trt-ep-module-delay-import",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "            if ($imports -notcontains $trt) { \"$(Split-Path -Leaf $Dll) does not import $trt\" }",
  "replace": "            if ($false) { }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "a plugin linked against another TensorRT major would stage without a finding"
 },
 {
  "id": "lib.trt-ep-license-utf8",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "protobuf = @('LICENSE', 'third_party\\utf8_range\\LICENSE')",
  "replace": "protobuf = @('LICENSE')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "protobuf links its bundled utf8_range, whose MIT text must ship too"
 },
 {
  "id": "lib.trt-ep-g2-gate",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "Assert-ChainOrtOnly -Consumer 'tensorrt-ep' -OrtRoot $ortPrefix -TreeRoot $SourceDir -Shim $ortHome -Log $cfgLog -CmakeBuildDir $buildDir\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "without the stamp the image census reads the TensorRT plugin as an unregistered ORT consumer, and no gate proves it compiled against the chain"
 },
 {
  "id": "lib.trt-ep-census-contract",
  "target": "windows/scripts/modules/WindowsOrtProvenance.Common.psm1",
  "find": "        [pscustomobject]@{ Name = 'tensorrt-ep'; Pattern = @('onnxruntime_ep_tensorrt.dll') }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "the census would flag the stamped TensorRT plugin as UNREGISTERED"
 },
 {
  "id": "lib.trt-ep-media-core-stage",
  "target": "windows/scripts/build/Build-MediaCoreAll.ps1",
  "find": "    @{ Name = 'TensorRT plugin EP'; Script = 'Build-OrtTensorRtEpFromSource.ps1'; SourceDir = 'C:\\temp\\ort-trt-ep-src' }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "the nvidia image would ship no TensorRT EP at all, the in-tree one being gone"
 },
 {
  "id": "lib.trt-ep-driver-forward",
  "target": "windows/scripts/modules/WindowsBuildDriver.Common.psm1",
  "find": "'ORT_TENSORRT_EP_GSL_SHA256', 'ORT_TENSORRT_EP_FLATBUFFERS_VERSION'",
  "replace": "'ORT_TENSORRT_EP_FLATBUFFERS_VERSION'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "the stage would take the Dockerfile default and a versions.env bump would never reach it"
 },
 {
  "id": "lib.trt-ep-dockerfile-env",
  "target": "windows/Dockerfile.media-builder",
  "find": "    ORT_TENSORRT_EP_GSL_SHA256=\"${ORT_TENSORRT_EP_GSL_SHA256}\" `\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "the builder reads its pins from the environment; a pin the ARG declares but the ENV drops refuses the build"
 },
 {
  "id": "lib.plugin-ep-export-gap-bridge",
  "target": "windows/scripts/modules/WindowsTargetArch.Common.psm1",
  "find": "        if ($ForbidProviderBridge -and $exports -contains 'GetProvider') { \"$leaf exports GetProvider: the in-tree provider-bridge EP, not the plugin\" }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "a provider-bridge CUDA EP under the plugin's DLL name would pass every export check"
 },
 {
  "id": "lib.nvidia-smoke-in-tree-trt",
  "target": "windows/scripts/modules/WindowsSmokeTest.Common.psm1",
  "find": "        Get-OrtTreeDll -OrtRoot $OrtRoot -Name 'onnxruntime_providers_tensorrt.dll' | ForEach-Object { \"$($_.FullName) is an in-tree TensorRT EP in the chain ORT\" }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "an in-tree TensorRT EP back in the chain ORT would ship beside the plugin unnoticed"
 },
 {
  "id": "lib.nvidia-smoke-unexpected-trt",
  "target": "windows/scripts/modules/WindowsSmokeTest.Common.psm1",
  "find": "        if (-not $TensorRtStaged -and $trt) { \"$($trt.FullName) is staged although no TensorRT runtime is\" }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "a TensorRT plugin without its runtime fails only at the consumer's first session"
 },
 {
  "id": "lib.nvidia-smoke-build-info",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "-ExpectMatch 'trt=0 dml=\\d cudaplugin=1'",
  "replace": "-ExpectMatch 'trt=0'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "USE_CUDA lists CUDA either way, so only the build info tells a plugin build from a provider-bridge one"
 },
 {
  "id": "lib.ort-cuda-plugin-flag",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "'-Donnxruntime_USE_CUDA=ON', '-Donnxruntime_BUILD_CUDA_EP_AS_PLUGIN=ON', '-Donnxruntime_USE_TENSORRT=OFF'",
  "replace": "'-Donnxruntime_USE_CUDA=ON', '-Donnxruntime_USE_TENSORRT=OFF'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "the nvidia lane would build the legacy provider-bridge CUDA EP again"
 },
 {
  "id": "lib.ort-cuda-plugin-gate-call",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($cudaUsable) { Assert-OrtCudaPluginEp -OrtInstallDir $ortInstallDir }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "a CUDA EP that is not the plugin would be found only by the smoke, hours later"
 },
 {
  "id": "lib.ort-cuda-plugin-forbid-bridge",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "@(Get-OrtPluginEpExportGap -Path $dll -ForbidProviderBridge)",
  "replace": "@(Get-OrtPluginEpExportGap -Path $dll)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "a build exporting both ABIs would keep the provider bridge the plugin replaces"
 },
 {
  "id": "lib.ort-cuda-plugin-clangcl-fallback",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "-Replacement '$$<CXX_COMPILER_FRONTEND_VARIANT:MSVC>'",
  "replace": "-Replacement '$$<CXX_COMPILER_ID:MSVC>'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "on patch drift clang-cl would get GCC's -include again and stop on the first plugin TU"
 },
 {
  "id": "lib.g2-plugin-ep-binary-consumer",
  "target": "windows/scripts/modules/WindowsOrtProvenance.Build.psm1",
  "find": "(?:_(?!genai|extensions|ep_)[a-z0-9_]+)?",
  "replace": "(?:_(?!genai|extensions)[a-z0-9_]+)?",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "the TensorRT plugin's own onnxruntime_ep_tensorrt.dll would read as an ORT the chain does not build, and its G2 gate would always fail"
 },
 {
  "id": "lib.g2-plugin-ep-csharp-consumer",
  "target": "windows/scripts/modules/WindowsOrtProvenance.Build.psm1",
  "find": "microsoft\\.ml\\.onnxruntime(?!genai|\\.ep\\.)[a-z0-9.]*",
  "replace": "microsoft\\.ml\\.onnxruntime(?!genai)[a-z0-9.]*",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1 -ResultFile logs/code-quality/trt-ep-mutation.json",
  "why": "the plugin's C# package directory (Microsoft.ML.OnnxRuntime.EP.TensorRT) would read as a fetched NuGet ORT"
 },
 {
  "id": "lib.qnn-census-plugin-root",
  "target": "windows/scripts/modules/WindowsOrtProvenance.Common.psm1",
  "find": "return @('C:\\temp\\onnx-src', 'C:\\temp\\ort-qnn-ep-src')",
  "replace": "return @('C:\\temp\\onnx-src')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtQnnEp.Tests.ps1 -ResultFile logs/code-quality/qnn-ep-mutation.json",
  "why": "the census would call the plugin FOREIGN: its fork and ort_core build outside onnx-src"
 },
 {
  "id": "lib.iree-twin-names-stable-abi-lib",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "        $stableAbi + $abi3Off + @('-UNB_SUFFIX', '-UNB_SUFFIX_S')",
  "replace": "        $abi3Off + @('-UNB_SUFFIX', '-UNB_SUFFIX_S')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeTwin.Tests.ps1 -ResultFile logs/code-quality/iree-twin-stable-abi.json",
  "why": "the arm64 twin's configure stopped on missing Python3_SABI_LIBRARIES with python3t.lib staged"
 },
 {
  "id": "lib.iree-twin-cross-soabi",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": " + @(if ($Soabi) { \"-DSKBUILD_SOABI=$Soabi\" })",
  "replace": " + @(if ($Soabi) { \"-DPython3_SOABI=$Soabi\", \"-DPython_SOABI=$Soabi\" })",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeTwin.Tests.ps1 -ResultFile logs/code-quality/iree-twin-stable-abi.json",
  "why": "CMake 4.4.5's cross FindPython empties Python_SOABI, so only SKBUILD_SOABI reaches nanobind; the 2026-11-08 arm64 chain stopped on the FindPython spelling"
 },
 {
  "id": "lib.iree-twin-nanobind-ft-gated",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "    Assert-IreeTwinFreeThreadedNanobind -BuildDir $BuildDir\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeTwin.Tests.ps1 -ResultFile logs/code-quality/iree-twin-stable-abi.json",
  "why": "a twin whose nanobind is the GIL build would pack and fail only on the device"
 },
 {
  "id": "lib.iree-twin-nanobind-ft-pattern",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "-Pattern 'nanobind-static(-[a-z0-9]+)*-ft[\\\\/.]' -Quiet",
  "replace": "-Pattern 'nb_ft\\.cpp\\.obj' -Quiet",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeTwin.Tests.ps1 -ResultFile logs/code-quality/iree-twin-stable-abi.json",
  "why": "nb_ft.cpp is in the abi3 library too, so a file-name gate passes a GIL nanobind"
 },
 {
  "id": "lib.iree-genrule-python-covers-compiler",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "foreach ($tree in 'compiler', 'runtime', 'tests', 'samples') {",
  "replace": "foreach ($tree in 'runtime', 'tests', 'samples') {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeTwin.Tests.ps1 -ResultFile logs/code-quality/iree-genrule-python-compiler.json",
  "why": "IREE's plugin ABI genrule sits under compiler/; skipping it fails the build 7,100 edges in on 'python3 is not recognized'"
 },
 {
  "id": "lib.iree-genrule-python-refuses-other-shape",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": " -AssertGone '\"python3 ' `\n                    -Description 'IREE genrule:",
  "replace": " `\n                    -Description 'IREE genrule:",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeTwin.Tests.ps1 -ResultFile logs/code-quality/iree-genrule-python-shape.json",
  "why": "a genrule command of a new shape would otherwise pass this step and fail deep in the ninja run"
 },
 {
  "id": "lib.iree-rocm-bitcode-requires-both-libs",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "$missing = @('ocml.bc', 'ockl.bc' | Where-Object",
  "replace": "$missing = @('ocml.bc' | Where-Object",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeRocmBitcode.Tests.ps1 -ResultFile logs/code-quality/iree-rocm-bitcode-both.json",
  "why": "IREE's rocm target links ocml and ockl into every HIP executable; a layer without ockl would fail only when a model compiles"
 },
 {
  "id": "lib.iree-rocm-bitcode-option-still-exists",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "-notmatch 'set\\(IREE_TARGET_BACKEND_ROCM_DEVICE_BC_PATH\\s'",
  "replace": "-notmatch 'set\\('",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.IreeRocmBitcode.Tests.ps1 -ResultFile logs/code-quality/iree-rocm-bitcode-option.json",
  "why": "an IREE bump that drops the local-bitcode option would silently fall back to the deleted shark-infra download"
 },
 {
  "id": "lib.torch-rocm-hip-launcher",
  "target": "windows/scripts/build/Build-TorchRocmFromSource.ps1",
  "find": "foreach ($lang in 'C', 'CXX', 'HIP')",
  "replace": "foreach ($lang in 'C', 'CXX')",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Torch.RocmSourceBuild.Tests.ps1 -ResultFile logs/code-quality/torch-rocm-hip-launcher.json",
  "why": "without the HIP launcher the 262 ATen HIP kernels of the ROCm torch build compiled uncached on every run"
 },
 {
  "id": "lib.litert-eigen-prefetch-retries",
  "target": "windows/scripts/build/Build-LitertFromSource.ps1",
  "find": "[void](Invoke-GitClone -RepoUrl $repo -Tag $commit -SourceDir $Destination -MaxAttempts $MaxAttempts)",
  "replace": "[void](Invoke-GitClone -RepoUrl $repo -Tag $commit -SourceDir $Destination)",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.LitertEigen.Tests.ps1 -ResultFile logs/code-quality/litert-eigen-retries.json",
  "why": "GitLab shed load for minutes on 2026-10-29 and CMake's own three quick clone tries failed the LiteRT build"
 },
 {
  "id": "lib.litert-eigen-host-pass-override",
  "target": "windows/scripts/build/Build-LitertFromSource.ps1",
  "find": "'-DTFLITE_ENABLE_BENCHMARK_MODEL=OFF', $eigenSourceArg",
  "replace": "'-DTFLITE_ENABLE_BENCHMARK_MODEL=OFF'",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.LitertEigen.Tests.ps1 -ResultFile logs/code-quality/litert-eigen-host-pass.json",
  "why": "the arm64 lane's host flatc pass configures the same tflite tree and would clone Eigen from GitLab on its own"
 },
 {
  "id": "lib.hailort-externals-retry-budget",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "-SourceDir $dir -MaxAttempts ($ext['MaxAttempts'] ?? 3) | Out-Null",
  "replace": "-SourceDir $dir | Out-Null",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.LitertEigen.Tests.ps1 -ResultFile logs/code-quality/hailort-externals-retries.json",
  "why": "HailoRT's Eigen external clones from the same GitLab, and three tries within 30 s failed the media-core hailo branch on 2026-10-29"
 },
 {
  "id": "lib.hailort-gitlab-external-budget",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Commit = '3147391d946bb4b6c68edd901f2add6ac1f31f8c'; MaxAttempts = 8 }",
  "replace": "Commit = '3147391d946bb4b6c68edd901f2add6ac1f31f8c' }",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.LitertEigen.Tests.ps1 -ResultFile logs/code-quality/hailort-gitlab-budget.json",
  "why": "only the GitLab-hosted Eigen external needs minutes of retries; without its row's budget it falls back to three tries"
 },
 {
  "id": "vulkan.gcc-runtime-refuses-foreign-arch",
  "target": "linux/scripts/02-toolchain/vulkan.sh",
  "find": "  case \"$(elf_machine_name \"$(readlink -f \"$2\")\" 2>/dev/null || true)\" in *\"${want}\"*) return 0 ;; esac\n  return 1",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-vulkan-gcc-runtime-links.sh",
  "why": "the sdk stage linked the host's x86-64 libstdc++ into /usr/lib/aarch64-linux-gnu until the ELF machine check refused it"
 },
 {
  "id": "packaging.python-deb-search-order-direct",
  "target": "linux/scripts/06-packaging/python-app-deb-depends.py",
  "find": "if uncertain:\n                raise ValueError(f\"unproven earlier ELF search path for {name}: {path}\")",
  "replace": "if False and uncertain:\n                raise ValueError(f\"unproven earlier ELF search path for {name}: {path}\")",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "an earlier host search path must not be hidden by a later bundled candidate"
 },
 {
  "id": "packaging.python-deb-search-order-environment",
  "target": "linux/scripts/06-packaging/python-app-deb-depends.py",
  "find": "if environment_candidate and uncertain:",
  "replace": "if False and environment_candidate and uncertain:",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "legacy RPATH must not be treated as lower priority than a launcher library path"
 },
 {
  "id": "packaging.python-deb-reject-executable-library",
  "target": "linux/scripts/06-packaging/python-app-deb-depends.py",
  "find": "kind != 3 or not elf.dynamic_segments",
  "replace": "False or not elf.dynamic_segments",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "an executable named as a shared library aborts the loader rather than satisfying the dependency"
 },
 {
  "id": "packaging.python-deb-reject-pie-library",
  "target": "linux/scripts/06-packaging/python-app-deb-depends.py",
  "find": "value & 0x08000000",
  "replace": "value & 0",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "an ET_DYN position-independent executable cannot be loaded as a shared library"
 },
 {
  "id": "python-ci.gpu-attempt-package-name",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "unverified-gpu-{0}-packages-linux-{1}-attempt-{2}",
  "replace": "unverified-gpu-{0}-packages-linux-{1}",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "an attempt-scoped package must not reuse the previous attempt's name"
 },
 {
  "id": "python-ci.gpu-scope-package-name",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "unverified-gpu-{0}-packages-linux-{1}-attempt-{2}{3}",
  "replace": "unverified-gpu-{0}-packages-linux-{1}-attempt-{2}",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "overlapping scoped calls must not upload the same package name"
 },
 {
  "id": "python-ci.gpu-scope-report-name",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "unverified-gpu-{0}-test-reports-{1}-attempt-{2}{3}",
  "replace": "unverified-gpu-{0}-test-reports-{1}-attempt-{2}",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "always-uploaded reports must use the validated invocation scope"
 },
 {
  "id": "python-ci.gpu-scope-validator",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "          python3 -I \"$helper\"\n",
  "replace": "          true\n",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "nondefault scopes must be validated before package and report uploads"
 },
 {
  "id": "python-ci.gpu-scope-case-sensitive-default",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "if: ${{ steps.rows.outputs.scope-required == 'true' }}\n        id: scope\n",
  "replace": "if: ${{ inputs.gpu-invocation-scope != 'default' }}\n        id: scope\n",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "case-insensitive Actions comparisons must not skip scope validation for uppercase DEFAULT"
 },
 {
  "id": "python-ci.gpu-attempt-immutable-upload",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "overwrite: ${{ inputs.host-gpu-runtime && !inputs.gpu-attempt-artifacts }}\n          path: logs/test-results/",
  "replace": "overwrite: ${{ inputs.host-gpu-runtime }}\n          path: logs/test-results/",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "an attempt-scoped upload must not replace the previous artifact"
 },
 {
  "id": "python-ci.gpu-attempt-opt-in-guard",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "[ \"${GPU_ATTEMPT_ARTIFACTS:-false}\" = true ] && [ \"${HOST_GPU_RUNTIME:-false}\" != true ]",
  "replace": "[ \"${GPU_ATTEMPT_ARTIFACTS:-false}\" = true ] && [ \"${HOST_GPU_RUNTIME:-false}\" = true ]",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "attempt-scoped GPU uploads cannot silently be selected for a CPU build"
 },
 {
  "id": "packaging.gpu-receipt-file-hash",
  "target": "shared/python/gpu_artifact_receipt.py",
  "find": "if data[\"files\"] != hashes:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_gpu_artifact_receipt.py",
  "why": "a changed GPU package must not match the verified receipt"
 },
 {
  "id": "packaging.gpu-receipt-ci-identity",
  "target": "shared/python/gpu_artifact_receipt.py",
  "find": "if data[\"identity\"] != identity:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_gpu_artifact_receipt.py",
  "why": "a receipt from another run, attempt, artifact or check must not promote"
 },
 {
  "id": "packaging.gpu-receipt-windows-device-names",
  "target": "shared/python/gpu_artifact_receipt.py",
  "find": "for digit in \"\u00b9\u00b2\u00b3\"",
  "replace": "for digit in \"\"",
  "test": "python3 shared/python/tests/test_gpu_artifact_receipt.py",
  "why": "Windows COM and LPT aliases with superscript digits must not be accepted as portable names"
 },
 {
  "id": "packaging.gpu-stage-archive-hash",
  "target": "shared/python/stage_gpu_artifact.py",
  "find": "return digest.hexdigest()",
  "replace": "return 'b' * 64",
  "test": "python3 shared/python/tests/test_stage_gpu_artifact.py",
  "why": "an asserted archive digest must match the actual downloaded bytes"
 },
 {
  "id": "packaging.locked-files-digest",
  "target": "shared/python/verify_locked_files.py",
  "find": "not api[\"matches\"](path, expected[name])",
  "replace": "False",
  "test": "python3 shared/python/tests/test_verify_locked_files.py",
  "why": "model files and notices must match their locked digests"
 },
 {
  "id": "packaging.detector-parity-score",
  "target": "shared/python/compare_detector_parity.py",
  "find": "abs(item[\"score\"] - other[\"score\"]) <= MAX_SCORE_DELTA",
  "replace": "True",
  "test": "python3 shared/python/tests/test_compare_detector_parity.py",
  "why": "a GPU detector must reject scores that disagree with the CPU baseline"
 },
 {
  "id": "packaging.detector-pairwise-cpu-oracle",
  "target": "shared/python/compare_detector_parity.py",
  "find": "    if not pairwise:\n",
  "replace": "    if False:\n",
  "test": "python3 shared/python/tests/test_compare_detector_parity.py",
  "why": "default comparison must still reject an invalid CPU baseline"
 },
 {
  "id": "packaging.detector-pairwise-mode",
  "target": "shared/python/compare_detector_parity.py",
  "find": "    if not pairwise:\n",
  "replace": "    if True:\n",
  "test": "python3 shared/python/tests/test_compare_detector_parity.py",
  "why": "pairwise comparison must not impose the CPU-only oracle on a GPU result"
 },
 {
  "id": "packaging.gpu-invocation-scope-validation",
  "target": "shared/python/gpu_invocation_scope.py",
  "find": "[a-z][a-z0-9-]{0,31}",
  "replace": ".*",
  "test": "python3 shared/python/tests/test_gpu_invocation_scope.py",
  "why": "unsafe invocation scopes must not reach artifact names or output files"
 },
 {
  "id": "packaging.gpu-invocation-scope-isolation",
  "target": "shared/python/gpu_invocation_scope.py",
  "find": "return \"\" if scope == \"default\" else f\"-scope-{scope}\"",
  "replace": "return \"\"",
  "test": "python3 shared/python/tests/test_gpu_invocation_scope.py",
  "why": "distinct nondefault workflow calls must produce distinct suffixes"
 },
 {
  "id": "packaging.detector-parity-iou",
  "target": "shared/python/compare_detector_parity.py",
  "find": "iou(item[\"box\"], other[\"box\"]) >= MIN_IOU",
  "replace": "True",
  "test": "python3 shared/python/tests/test_compare_detector_parity.py",
  "why": "a GPU detector must reject boxes that disagree with the CPU baseline"
 },
 {
  "id": "packaging.detector-parity-gpu-only",
  "target": "shared/python/check_detector_parity.py",
  "find": "        device not in {\"cuda\", \"directml\"}",
  "replace": "        False",
  "test": "bash linux/scripts/tests/test-detector-parity.sh",
  "why": "the parity run compares a GPU with the CPU; a cpu device would compare the CPU with itself"
 },
 {
  "id": "packaging.detector-parity-photo-digest",
  "target": "shared/python/check_detector_parity.py",
  "find": "    if hashlib.sha256(fixture.read_bytes()).hexdigest() != FIXTURE_SHA256:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-detector-parity.sh",
  "why": "the expected detections belong to one photo; another photo makes every verdict meaningless"
 },
 {
  "id": "packaging.detector-parity-runtime-confined",
  "target": "shared/python/check_detector_parity.py",
  "find": "        raise ValueError(\"ONNX Runtime escapes the extracted package\")",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-detector-parity.sh",
  "why": "a runtime reached through a link is not the package's, so the run would prove another build"
 },
 {
  "id": "packaging.detector-parity-overrides-stripped",
  "target": "shared/python/check_detector_parity.py",
  "find": "            del env[key]",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-detector-parity.sh",
  "why": "an inherited KATAGLYPHIS_ or ORT_ override changes what the child runs, so CPU and GPU would differ by setting"
 },
 {
  "id": "packaging.detector-parity-directml-adapter",
  "target": "shared/python/check_detector_parity.py",
  "find": "        env[\"KATAGLYPHIS_DIRECTML_DEVICE_ID\"] = index",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-detector-parity.sh",
  "why": "DirectML picks adapter 0 by default; the verified adapter must be the one the child uses"
 },
 {
  "id": "packaging.gpu-stage-file-hash",
  "target": "shared/python/stage_gpu_artifact.py",
  "find": "if hashes is not None and digest.hexdigest() != hashes[item.filename]:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_stage_gpu_artifact.py",
  "why": "both receipts must match each package actually extracted from the archive"
 },
 {
  "id": "packaging.gpu-stage-two-receipts",
  "target": "shared/python/stage_gpu_artifact.py",
  "find": "if manifests[0] != manifests[1]:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_stage_gpu_artifact.py",
  "why": "the clean-host and GPU checks must describe the same package bytes"
 },
 {
  "id": "packaging.gpu-stage-no-replace",
  "target": "shared/python/stage_gpu_artifact.py",
  "find": "rename(-100, os.fsencode(source), -100, os.fsencode(target), 1)",
  "replace": "rename(-100, os.fsencode(source), -100, os.fsencode(target), 0)",
  "test": "python3 shared/python/tests/test_stage_gpu_artifact.py",
  "why": "an output created during verification must never be replaced"
 },
 {
  "id": "packaging.gpu-stage-check-identity",
  "target": "shared/python/stage_gpu_artifact.py",
  "find": "if data[\"identity\"] != expected:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_stage_gpu_artifact.py",
  "why": "receipts from another attempt or artifact must never approve these bytes"
 },
 {
  "id": "packaging.gpu-check-post-hash",
  "target": ".github/actions/clean-host-package-check/clean-host-gpu-receipt.sh",
  "find": "    python3 -I \"$python_root/gpu_artifact_receipt.py\" verify --directory \"$packages\" --receipt \"$before\" \\\n      --check before-check \"${identity[@]}\" \"${files[@]}\"",
  "replace": "    true",
  "test": "python3 shared/python/tests/test_clean_host_gpu_receipt.py",
  "why": "a check cannot approve packages changed after its pre-check snapshot"
 },
 {
  "id": "packaging.gpu-check-actual-profile",
  "target": ".github/actions/gpu-package-check/action.yml",
  "find": "bash -c \"$GPU_PROFILE_COMMAND\"",
  "replace": "true",
  "test": "python3 shared/python/tests/test_clean_host_gpu_receipt.py",
  "why": "the GPU action must execute its trusted hardware profile command"
 },
 {
  "id": "packaging.gpu-clean-check-finish",
  "target": ".github/actions/clean-host-package-check/action.yml",
  "find": "run: bash \"${GITHUB_ACTION_PATH}/clean-host-gpu-receipt.sh\" finish",
  "replace": "run: bash \"${GITHUB_ACTION_PATH}/clean-host-gpu-receipt.sh\" validate",
  "test": "python3 shared/python/tests/test_clean_host_gpu_receipt.py",
  "why": "the clean-host action must verify its pre-check hashes before emitting a receipt"
 },
 {
  "id": "packaging.ort-profile-reject-transfer-only",
  "target": "shared/python/verify_ort_profile.py",
  "find": "and not event[\"args\"][\"op_name\"].strip().casefold().startswith(\"memcpy\")",
  "replace": "and True",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "a GPU memory-transfer event must not prove model computation ran on the GPU"
 },
 {
  "id": "packaging.ort-profile-require-operator",
  "target": "shared/python/verify_ort_profile.py",
  "find": "and isinstance(event[\"args\"].get(\"op_name\"), str)\n        and event[\"args\"][\"op_name\"].strip()\n        and not event[\"args\"][\"op_name\"].strip().casefold().startswith(\"memcpy\")",
  "replace": "and True",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "provider events without an identified model operator cannot prove accelerated inference"
 },
 {
  "id": "packaging.ort-profile-cpu-accelerator-name",
  "target": "shared/python/verify_ort_profile.py",
  "find": "\"xnnpack\": \"XnnpackExecutionProvider\",",
  "replace": "\"xnnpack\": \"CPUExecutionProvider\",",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py -k test_cpu_accelerators_need_their_own_operators",
  "why": "a session that fell back to the CPU provider must not prove XNNPACK ran"
 },
 {
  "id": "packaging.ort-profile-migraphx-plugin-name",
  "target": "shared/python/verify_ort_profile.py",
  "find": "\"migraphx\": \"MIGraphX\",",
  "replace": "\"migraphx\": \"MIGraphXExecutionProvider\",",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "a profile proves the registered plugin by its own name; the removed in-tree provider's name must not pass"
 },
 {
  "id": "packaging.ort-profile-repeat-count",
  "target": "shared/python/verify_ort_profile.py",
  "find": "if len(runs) < minimum:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "one profiled inference cannot establish repeated GPU execution"
 },
 {
  "id": "packaging.ort-profile-each-run",
  "target": "shared/python/verify_ort_profile.py",
  "find": "if not any(",
  "replace": "if False and not any(",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "every repeated inference must contain a requested-provider model operator"
 },
 {
  "id": "packaging.ort-profile-sequential-runs",
  "target": "shared/python/verify_ort_profile.py",
  "find": "if previous[0] != current[0] or previous[2] > current[1]:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "repeated model runs must be non-overlapping and belong to one process"
 },
 {
  "id": "packaging.ort-profile-repeat-enforced",
  "target": "shared/python/verify_ort_profile.py",
  "find": "if args.min_runs is not None:\n            require_profiled_runs(",
  "replace": "if False:\n            require_profiled_runs(",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "the optional repeat contract must actually run when requested"
 },
 {
  "id": "lib.coverage-profile-leak-check-off",
  "target": "linux/scripts/lib/coverage.sh",
  "find": "    run_env=(ASAN_OPTIONS=detect_leaks=0)\n",
  "replace": "    run_env=(ASAN_OPTIONS=)\n",
  "test": "bash linux/scripts/tests/test-lib-coverage.sh",
  "why": "a coverage run with LeakSanitizer on fails at exit and writes no profile for a leaky but passing suite"
 },
 {
  "id": "lib.coverage-profile-must-exist",
  "target": "linux/scripts/lib/coverage.sh",
  "find": "  if [[ ! -f \"${profraw}\" ]]; then\n    err \"Profile data still not found",
  "replace": "  if false; then\n    err \"Profile data still not found",
  "test": "bash linux/scripts/tests/test-lib-coverage.sh",
  "why": "a suite that never wrote its profile would hand llvm-profdata a missing file and blame it"
 },
 {
  "id": "lib.coverage-profile-suite-status",
  "target": "linux/scripts/lib/coverage.sh",
  "find": "    return \"${suite_status}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lib-coverage.sh",
  "why": "a suite that failed but wrote its profile must not let a caller without errexit report coverage over failing tests"
 },
 {
  "id": "lib.coverage-report-sparse-merge",
  "target": "linux/scripts/lib/coverage.sh",
  "find": "  llvm-profdata merge -sparse \"${profraw}\" -o \"${profdata}\"\n",
  "replace": "  llvm-profdata merge \"${profraw}\" -o \"${profdata}\"\n",
  "test": "bash linux/scripts/tests/test-lib-coverage.sh",
  "why": "the merge flag is part of the consumer contract; a dense merge grows every profile a CI cache holds"
 },
 {
  "id": "lib.coverage-report-skips-empty-ignore",
  "target": "linux/scripts/lib/coverage.sh",
  "find": "    [[ -n \"${pattern}\" ]] || continue\n",
  "replace": "    true\n",
  "test": "bash linux/scripts/tests/test-lib-coverage.sh",
  "why": "an empty pattern becomes -ignore-filename-regex=, which matches every file and reports zero coverage"
 },
 {
  "id": "lib.coverage-report-html",
  "target": "linux/scripts/lib/coverage.sh",
  "find": "  if [[ -n \"${COVERAGE_LLVM_HTML_DIR:-}\" ]]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-lib-coverage.sh",
  "why": "COVERAGE_LLVM_HTML_DIR is how a consumer gets the browsable report; ignoring it uploads an empty artifact"
 },
 {
  "id": "lib.wasm32-rustup-status",
  "target": "linux/scripts/lib/rust-toolchain.sh",
  "find": "    rustup target add wasm32-unknown-unknown\n    return $?\n",
  "replace": "    rustup target add wasm32-unknown-unknown\n    return 0\n",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "a failed rustup must reach the caller, or the wasm build fails later on a missing std"
 },
 {
  "id": "lib.wasm32-std-probe",
  "target": "linux/scripts/lib/rust-toolchain.sh",
  "find": "     && [ -d \"${libdir}\" ]; then",
  "replace": "     && true; then",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "--print target-libdir names the directory even when it is absent; only its existence proves the std"
 },
 {
  "id": "lib.wasm-bindgen-lock-crlf",
  "target": "linux/scripts/lib/rust-toolchain.sh",
  "find": "  tr -d '\\r' <\"$1\" | awk",
  "replace": "  cat \"$1\" | awk",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "a CRLF checkout's name line ends in \\r, so the exact match finds no wasm-bindgen and the CLI cannot be pinned"
 },
 {
  "id": "lib.wasm-bindgen-skips-the-locked-version",
  "target": "linux/scripts/lib/rust-toolchain.sh",
  "find": "  if [ \"${have}\" = \"${want}\" ]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "a cargo install on every call costs minutes, though PATH already runs the version the lock pins"
 },
 {
  "id": "lib.wasm-bindgen-installs-the-locked-version",
  "target": "linux/scripts/lib/rust-toolchain.sh",
  "find": "cargo install --locked wasm-bindgen-cli --version \"${want}\" || return $?",
  "replace": "cargo install --locked wasm-bindgen-cli || return $?",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "an unpinned install takes crates.io's newest wasm-bindgen-cli, which refuses a module the lock's wasm-bindgen built"
 },
 {
  "id": "lib.wasm-bindgen-install-status",
  "target": "linux/scripts/lib/rust-toolchain.sh",
  "find": "--version \"${want}\" || return $?\n",
  "replace": "--version \"${want}\" || true\n",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "a failed install must reach the caller with cargo's status, not as the later PATH-mismatch warning"
 },
 {
  "id": "lib.wasm-bindgen-checks-path-after-install",
  "target": "linux/scripts/lib/rust-toolchain.sh",
  "find": "  if [ \"${have}\" != \"${want}\" ]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "cargo installs into CARGO_HOME/bin; a PATH without it still runs the old CLI and the bindgen step fails later and less clearly"
 },
 {
  "id": "lib.wasm-bindgen-no-version-fails",
  "target": "linux/scripts/lib/rust-toolchain.sh",
  "find": "  if [ -z \"${want}\" ]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "an empty version from a lock without wasm-bindgen must stop before cargo install --version \"\""
 },
 {
  "id": "lib.wasm-opt-default-level",
  "target": "linux/scripts/lib/wasm-opt.sh",
  "find": "  local level=\"${3:--Oz}\"\n",
  "replace": "  local level=\"${3:--O2}\"\n",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "consumers rely on -Oz for the web bundle size they publish"
 },
 {
  "id": "lib.wasm-opt-retry-failure-fatal",
  "target": "linux/scripts/lib/wasm-opt.sh",
  "find": "      || err \"wasm-opt failed for ${input}\"\n",
  "replace": "      || true\n",
  "test": "bash linux/scripts/tests/test-lib-wasm-tools.sh",
  "why": "a wasm-opt that failed twice would leave the unoptimised or no output behind a green step"
 },
 {
  "id": "lib.compile-db-missing-fails",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  if [[ ! -f \"${compile_db_path}\" ]]; then\n    err \"Missing ${compile_db_path}.",
  "replace": "  if false; then\n    err \"Missing ${compile_db_path}.",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "clang-tidy without a compilation database lints nothing and passes"
 },
 {
  "id": "lib.compile-db-remaps-workspace",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  if grep -qF \"${workspace}\" \"${compile_db_path}\"; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "a database written in the container names /workspace paths that do not exist on the host"
 },
 {
  "id": "lib.compile-db-remaps-joined-options",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "local options='I|L|F|B|",
  "replace": "local options='L|F|B|",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "an -I/workspace/... left in a command string names a directory the host does not have, so clang-tidy reports missing headers"
 },
 {
  "id": "lib.compile-db-remap-token-end",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "trail=\"([\\\"'\\\\[:space:]/:,]|\\$)\"",
  "replace": "trail=\"()\"",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "a path that merely starts with the workspace, such as /workspace2, is a different tree and must not move"
 },
 {
  "id": "lib.compile-db-remap-neighbours",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": " -e 'ta' ",
  "replace": " ",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "two paths sharing one separator would leave the second as a container path"
 },
 {
  "id": "lib.compile-db-remap-literal-workspace",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "from=\"$(printf '%s' \"$1\" | sed -E 's/[][\\\\.^$*+?(){}|#]/\\\\&/g')\"",
  "replace": "from=\"$1\"",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "a configured workspace is a path, not a pattern; a dot in it would rewrite other trees"
 },
 {
  "id": "lib.compile-db-remap-literal-root",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "to=\"$(printf '%s' \"$2\" | sed -E 's/[\\\\&#]/\\\\&/g')\"",
  "replace": "to=\"$2\"",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "an & or # in the project root would corrupt every remapped path or break the sed program"
 },
 {
  "id": "lib.compile-db-drops-absent-toolchain",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "    if [[ -n \"${toolchain_probe}\" && -n \"${toolchain_prefix}\" && ! -d \"${toolchain_probe}\" ]]; then\n",
  "replace": "    if false; then\n",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "a --gcc-toolchain pointing at a container-only path makes clang fail every file on the host"
 },
 {
  "id": "lib.compile-db-rpath-takes-its-separator",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "[[:space:]]?-Wl,-rpath,",
  "replace": "-Wl,-rpath,",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "dropping the rpath flag without its separator leaves a double space in the command"
 },
 {
  "id": "lib.compile-db-cleanup-removes",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "    rm -rf \"${CODE_QUALITY_COMPILE_DB_TEMP_DIR}\"\n    CODE_QUALITY_COMPILE_DB_TEMP_DIR=\"\"\n",
  "replace": "    true\n    CODE_QUALITY_COMPILE_DB_TEMP_DIR=\"\"\n",
  "test": "bash linux/scripts/tests/test-lib-compile-db.sh",
  "why": "each lint run would leave its remapped database copy in TMPDIR"
 },
 {
  "id": "chain-status.dry-run-stage-guard-reclaims-nothing",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  if is_dry_run; then return 0; fi\n  local completed_stage=\"${1:-}\"\n",
  "replace": "  local completed_stage=\"${1:-}\"\n",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a low-disk dry run would evict cache exports and prune images on the host that only asked for a plan"
 },
 {
  "id": "lib.ctest-main-prepares-env",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "  ctest_run_prepare_env\n  ctest_run_execute\n",
  "replace": "  ctest_run_execute\n",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "without the safe.directory step git refuses the bind-mounted tree and tests that call git fail"
 },
 {
  "id": "lib.ctest-run-default-timeout",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "  CTEST_TIMEOUT=\"${CTEST_TIMEOUT:-${CTEST_RUN_DEFAULT_TIMEOUT:-1500}}\"",
  "replace": "  CTEST_TIMEOUT=\"${CTEST_TIMEOUT:-${CTEST_RUN_DEFAULT_TIMEOUT:-0}}\"",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "without a default a hung C++ test ends at the lane's 60 to 150 minute limit, without its name"
 },
 {
  "id": "lib.ctest-run-caller-timeout-wins",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": " && \" ${CTEST_RUN_PASSTHROUGH[*]:-} \" != *\" --timeout \"* ]]; then",
  "replace": " ]]; then",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "a caller's own --timeout after -- must be the one ctest applies, not a second competing one"
 },
 {
  "id": "lib.docs-main-stages-svg",
  "target": "linux/scripts/lib/docs-build.sh",
  "find": "  docs_build_copy_static_svg || return $?\n  docs_build_run_generator || return $?\n",
  "replace": "  docs_build_run_generator || return $?\n",
  "test": "bash linux/scripts/tests/test-lib-docs-build.sh",
  "why": "diagrams built elsewhere never reach _static and the published pages show broken images"
 },
 {
  "id": "lib.docs-main-runs-sphinx",
  "target": "linux/scripts/lib/docs-build.sh",
  "find": "  docs_build_sphinx || return $?\n  info \"Documentation build completed successfully\"\n",
  "replace": "  info \"Documentation build completed successfully\"\n",
  "test": "bash linux/scripts/tests/test-lib-docs-build.sh",
  "why": "the pipeline would report a finished build without running Sphinx"
 },
 {
  "id": "lib.docs-main-stops-on-failed-sphinx",
  "target": "linux/scripts/lib/docs-build.sh",
  "find": "SPHINXOPTS=\"${sphinxopts}\" make \"${target}\") || return $?",
  "replace": "SPHINXOPTS=\"${sphinxopts}\" make \"${target}\")",
  "test": "bash linux/scripts/tests/test-lib-docs-build.sh",
  "why": "a failed make under a caller without errexit would still report a finished documentation build"
 },
 {
  "id": "lib.docs-main-stops-on-failed-sidebars",
  "target": "linux/scripts/lib/docs-build.sh",
  "find": "docs_build_check_sidebars || return $?",
  "replace": "docs_build_check_sidebars",
  "test": "bash linux/scripts/tests/test-lib-docs-build.sh",
  "why": "a failed sidebar click would be overwritten by the next target's status"
 },
 {
  "id": "lib.docs-main-stops-on-failed-venv-create",
  "target": "linux/scripts/lib/docs-build.sh",
  "find": "\"${create_script}\") || return $?",
  "replace": "\"${create_script}\")",
  "test": "bash linux/scripts/tests/test-lib-docs-build.sh",
  "why": "Sphinx from a stale or missing venv is not the pinned docs toolchain"
 },
 {
  "id": "lib.docs-main-stops-on-failed-install",
  "target": "linux/scripts/lib/docs-build.sh",
  "find": "\"${install_script}\") || return $?",
  "replace": "\"${install_script}\")",
  "test": "bash linux/scripts/tests/test-lib-docs-build.sh",
  "why": "Sphinx over a failed requirements install is not the pinned docs toolchain"
 },
 {
  "id": "lib.docs-main-stops-on-failed-staging",
  "target": "linux/scripts/lib/docs-build.sh",
  "find": "  docs_build_copy_static_svg || return $?\n",
  "replace": "  docs_build_copy_static_svg\n",
  "test": "bash linux/scripts/tests/test-lib-docs-build.sh",
  "why": "an SVG set that failed to copy publishes pages with broken images"
 },
 {
  "id": "lib.docs-main-stops-on-failed-generator",
  "target": "linux/scripts/lib/docs-build.sh",
  "find": "  docs_build_run_generator || return $?\n",
  "replace": "  docs_build_run_generator\n",
  "test": "bash linux/scripts/tests/test-lib-docs-build.sh",
  "why": "a failed diagram generator publishes pages with stale or missing diagrams"
 },
 {
  "id": "lib.app-runner-loader-path",
  "target": "linux/scripts/lib/app-runner.sh",
  "find": "  export LD_LIBRARY_PATH=\"${ABS_BUILD_DIR}:${ABS_BUILD_DIR}/bin:${LD_LIBRARY_PATH:-}\"\n",
  "replace": "  export LD_LIBRARY_PATH=\"${LD_LIBRARY_PATH:-}\"\n",
  "test": "bash linux/scripts/tests/test-lib-app-runner.sh",
  "why": "the app would load an installed copy of the project's libraries, or none, instead of the build's"
 },
 {
  "id": "lib.app-runner-work-dir",
  "target": "linux/scripts/lib/app-runner.sh",
  "find": "  cd \"${WORK_DIR}\" || err \"Cannot enter working directory: ${WORK_DIR}\"\n",
  "replace": "  : || err \"Cannot enter working directory: ${WORK_DIR}\"\n",
  "test": "bash linux/scripts/tests/test-lib-app-runner.sh",
  "why": "apps resolve shaders and assets relative to the project root; started elsewhere they find none"
 },
 {
  "id": "lib.cmake-main-env-failure-stops",
  "target": "linux/scripts/lib/cmake-build.sh",
  "find": "  cmake_build_prepare_env || return $?\n",
  "replace": "  cmake_build_prepare_env\n",
  "test": "bash linux/scripts/tests/test-lib-cmake-build.sh",
  "why": "a rejected linker or cache setting must stop the build, not configure it with the image defaults"
 },
 {
  "id": "lib.agentic-init-log-dir",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "    local log_dir=\"${repo_root}/logs/agentic-loop\"\n",
  "replace": "    local log_dir=\"${repo_root}/logs\"\n",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "consumers upload and ignore logs/agentic-loop; a log written elsewhere is lost or committed"
 },
 {
  "id": "lib.agentic-complete-lists-fixes",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "    if [[ \"$exit_code\" -ne 0 ]]; then\n        log \"The loop exited with errors.",
  "replace": "    if false; then\n        log \"The loop exited with errors.",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "a failed loop would end without the checklist that names its usual causes"
 },
 {
  "id": "lib.agentic-matrix-name-fallback",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": " // .buildConfigurations.${platform}[$index] // empty",
  "replace": " // empty",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "older loop configs list buildConfigurations only; their entries would lose their names"
 },
 {
  "id": "lib.agentic-commit-refusal-read",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "    if ! out=\"$(git -C \"$repo_root\" commit -q -m \"$message\" 2>&1)\"; then",
  "replace": "    if ! out=\"$(git -C \"$repo_root\" commit -q -m \"$message\" 2>&1 || true)\"; then",
  "test": "bash linux/scripts/tests/test-agentic-phases.sh",
  "why": "a refused commit read as success lets every later task pile onto it, silently"
 },
 {
  "id": "lib.agentic-binary-left-out",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "        if [[ \"$nuls\" -gt 0 || \"$kib\" -gt \"$AGENTIC_STAGE_MAX_KIB\" ]]; then",
  "replace": "        if [[ \"$kib\" -gt \"$AGENTIC_STAGE_MAX_KIB\" ]]; then",
  "test": "bash linux/scripts/tests/test-agentic-phases.sh",
  "why": "a core file or a binary test output must not be committed by the loop"
 },
 {
  "id": "lib.agentic-large-left-out",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "        if [[ \"$nuls\" -gt 0 || \"$kib\" -gt \"$AGENTIC_STAGE_MAX_KIB\" ]]; then",
  "replace": "        if [[ \"$nuls\" -gt 0 ]]; then",
  "test": "bash linux/scripts/tests/test-agentic-phases.sh",
  "why": "a new file over the large-files limit stops the next push; the loop must not commit it"
 },
 {
  "id": "lib.agentic-refusal-stops-drain",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "            if ! _agentic_after_task_phases \"$matrix_count\"; then",
  "replace": "            if ! _agentic_after_task_phases \"$matrix_count\" && false; then",
  "test": "bash linux/scripts/tests/test-agentic-loop.sh",
  "why": "a refused commit must stop the queue drain with exit 1, not run the next task"
 },
 {
  "id": "lib.agentic-commit-gate-holds",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "    if [[ \"$gate\" -eq 0 ]]; then\n        invoke_git_auto_commit",
  "replace": "    if true; then\n        invoke_git_auto_commit",
  "test": "bash linux/scripts/tests/test-agentic-phases.sh",
  "why": "a task whose gate failed must stay uncommitted; committing it anyway makes the gate decorative"
 },
 {
  "id": "lib.agentic-commit-gate-capped",
  "target": "linux/scripts/lib/agentic-loop.sh",
  "find": "    [[ \"${_AL[consecutive_gate_failures]}\" -lt \"${_AL[max_consecutive_gate_failures]}\" ]] || return 2",
  "replace": "    true",
  "test": "bash linux/scripts/tests/test-agentic-phases.sh",
  "why": "a gate that keeps failing must stop the queue, as the build failure cap does, not hold tasks forever"
 },
 {
  "id": "packaging.parity-files-normalised",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "  normalize_find_output \"${native_file}\" > \"${native_file}.clean\"\n",
  "replace": "  cp \"${native_file}\" \"${native_file}.clean\"\n",
  "test": "bash linux/scripts/tests/test-verify-parity-checks.sh",
  "why": "build logs and caches differ between any two images; unfiltered, every tree comparison fails"
 },
 {
  "id": "packaging.parity-libs-missing-warns",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "    warn \"Cannot list shared libs from cross image\"\n    return 0\n",
  "replace": "    warn \"Cannot list shared libs from cross image\"\n    return 1\n",
  "test": "bash linux/scripts/tests/test-verify-parity-checks.sh",
  "why": "an image without the scanned prefixes is not a parity failure; the check is advisory there"
 },
 {
  "id": "packaging.parity-libs-version-folded",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "  container_exec_strip \"${NATIVE_IMAGE}\" \"${libs_cmd}\" 2>/dev/null \\\n    | sed -E 's/\\.so\\.[0-9.]+$/.so.X/'",
  "replace": "  container_exec_strip \"${NATIVE_IMAGE}\" \"${libs_cmd}\" 2>/dev/null \\\n    | sed -E 's/^$//'",
  "test": "bash linux/scripts/tests/test-verify-parity-checks.sh",
  "why": "a patch-level soname difference is not a missing library; unfolded, every pin bump fails parity"
 },
 {
  "id": "packaging.parity-packages-normalised",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "  normalize_package_list \"${native_file}\" > \"${native_file}.norm\"\n",
  "replace": "  cp \"${native_file}\" \"${native_file}.norm\"\n",
  "test": "bash linux/scripts/tests/test-verify-parity-checks.sh",
  "why": "the architecture column always differs between a native and a cross image"
 },
 {
  "id": "packaging.parity-python-system-fallback",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "    container_exec_strip \"${CROSS_IMAGE}\" 'pip list --format=columns 2>/dev/null || pip3 list --format=columns' \\\n",
  "replace": "    false \\\n",
  "test": "bash linux/scripts/tests/test-verify-parity-checks.sh",
  "why": "an image without the venv still has a system pip; skipping it hides its packages from the comparison"
 },
 {
  "id": "packaging.bundle-tar-prepares-workspace",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  app_packaging_prepare_workspace \"$matrix_arch\"\n  app_packaging_package_bundle_outputs_tar \"$bundle_source_dir\"",
  "replace": "  app_packaging_package_bundle_outputs_tar \"$bundle_source_dir\"",
  "test": "bash linux/scripts/tests/test-app-packaging-api.sh",
  "why": "a stale obj tree and hosted pub cache from an earlier arch leak into the next package"
 },
 {
  "id": "packaging.apk-tar-source",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "\"build/app/outputs/flutter-apk\"",
  "replace": "\"build/app/outputs/apk\"",
  "test": "bash linux/scripts/tests/test-app-packaging-api.sh",
  "why": "flutter build apk writes build/app/outputs/flutter-apk; any other path packages nothing"
 },
 {
  "id": "packaging.runtime-dbus-for-flatpak",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "    dbus-run-session -- \"$@\"\n",
  "replace": "    \"$@\"\n",
  "test": "bash linux/scripts/tests/test-app-packaging-api.sh",
  "why": "flatpak-builder needs a session bus, which a CI container does not start"
 },
 {
  "id": "flutter.pin-exports-sha",
  "target": "linux/scripts/05-frameworks/flutter/flutter-pin.sh",
  "find": "  export FLUTTER_SDK_SHA256=\"$pinned_sha\"\n",
  "replace": "  export FLUTTER_SDK_SHA256=\"\"\n",
  "test": "bash linux/scripts/tests/test-flutter-lane-api.sh",
  "why": "the version and the tarball sha are one pin; a version alone downloads an unverified SDK"
 },
 {
  "id": "flutter.pin-needs-both-halves",
  "target": "linux/scripts/05-frameworks/flutter/flutter-pin.sh",
  "find": "  if [ -z \"$pinned_version\" ] || [ -z \"$pinned_sha\" ]; then\n",
  "replace": "  if [ -z \"$pinned_version\" ]; then\n",
  "test": "bash linux/scripts/tests/test-flutter-lane-api.sh",
  "why": "half a pin fails later as a bare checksum error that names neither file"
 },
 {
  "id": "flutter.lane-sdk-first-on-path",
  "target": "linux/scripts/05-frameworks/flutter/lane-prologue.sh",
  "find": "    *) export PATH=\"${flutter_dir}/bin:${PATH}\" ;;\n",
  "replace": "    *) export PATH=\"${PATH}:${flutter_dir}/bin\" ;;\n",
  "test": "bash linux/scripts/tests/test-flutter-lane-api.sh",
  "why": "another flutter earlier on PATH would build with a toolchain the image does not ship"
 },
 {
  "id": "flutter.lane-pub-cache-in-repo",
  "target": "linux/scripts/05-frameworks/flutter/lane-prologue.sh",
  "find": "  export PUB_CACHE=\"${PUB_CACHE:-${repo_root}/.pub-cache}\"\n",
  "replace": "  export PUB_CACHE=\"${PUB_CACHE:-${HOME}/.pub-cache}\"\n",
  "test": "bash linux/scripts/tests/test-flutter-lane-api.sh",
  "why": "a root-owned HOME refuses the cache, and phases of one run could not share packages"
 },
 {
  "id": "flutter.web-build-release",
  "target": "linux/scripts/05-frameworks/flutter/lane-prologue.sh",
  "find": "  local -a args=(build web --release)\n",
  "replace": "  local -a args=(build web)\n",
  "test": "bash linux/scripts/tests/test-flutter-lane-api.sh",
  "why": "a debug web build is several times larger and is what the sites would publish"
 },
 {
  "id": "lint-gates.ifs-comma-split",
  "target": "linux/scripts/renovate-fleet.sh",
  "find": "    IFS=',' read -r -a want <<<\"${SKIP}\"\n",
  "replace": "    for want in ${SKIP//,/ }; do :; done\n",
  "test": "bash linux/scripts/tests/test-ifs-safety.sh",
  "why": "under the scripts' IFS=$'\\n\\t' a ${list//,/ } loop runs once with the whole list as one item"
 },
 {
  "id": "lint-gates.pipefail-nm-grep-q",
  "target": "linux/scripts/06-packaging/smoke-media.sh",
  "find": "      _lite_c_syms=\"$(nm -D --defined-only \"${lite_c_lib}\" 2>/dev/null || true)\"\n",
  "replace": "      _lite_c_syms=\"$(nm -D --defined-only \"${lite_c_lib}\" | grep -q TfLiteModelCreate && echo TfLiteModelCreate)\"\n",
  "test": "bash linux/scripts/tests/test-pipefail-safety.sh",
  "why": "under pipefail nm loses the pipe when grep -q matches early, and a present symbol reads as missing"
 },
 {
  "id": "lint-gates.uv-venv-python",
  "target": "linux/scripts/build-docs.sh",
  "find": "  uv venv --offline --quiet --python \"${python}\" \"${VENV_DIR}\"\n",
  "replace": "  uv venv --offline --quiet \"${VENV_DIR}\"\n",
  "test": "bash linux/scripts/tests/test-invocation-lints.sh",
  "why": "a venv without --python seeds from whatever interpreter uv finds first"
 },
 {
  "id": "lint-gates.force-reinstall-no-deps",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  uv pip install --no-deps --force-reinstall \"${_ow[@]}\"\n",
  "replace": "  uv pip install --force-reinstall \"${_ow[@]}\"\n",
  "test": "bash linux/scripts/tests/test-invocation-lints.sh",
  "why": "a force-reinstall that resolves dependencies floats them off the lock"
 },
 {
  "id": "runtime-smoke.gate-builds-wrapper-smoke",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "    --target wrapper-smoke \\\n",
  "replace": "    --target package-image \\\n",
  "test": "bash linux/scripts/tests/test-runtime-smoke-gate.sh",
  "why": "the gate must build the smoke target; the package target proves nothing about the shipped wrapper"
 },
 {
  "id": "runtime-smoke.gate-failure-propagates",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "    . || return 1\n\n  log \"[smoke] wrapper-smoke gate PASSED",
  "replace": "    . || true\n\n  log \"[smoke] wrapper-smoke gate PASSED",
  "test": "bash linux/scripts/tests/test-runtime-smoke-gate.sh",
  "why": "a failed smoke must stop the arch before anything is pushed"
 },
 {
  "id": "runtime-smoke.gate-skip-only-when-asked",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "  if [ \"${WRAPPER_SMOKE_GATE:-1}\" = \"0\" ]; then\n    log \"[smoke] wrapper-smoke gate skipped",
  "replace": "  if true; then\n    log \"[smoke] wrapper-smoke gate skipped",
  "test": "bash linux/scripts/tests/test-runtime-smoke-gate.sh",
  "why": "the gate is on unless WRAPPER_SMOKE_GATE=0 says otherwise"
 },
 {
  "id": "artifact-parity.relocation-fails",
  "target": "linux/scripts/verify-artifact-copy-parity.sh",
  "find": "    echo \"FAIL: ${failures} undocumented artifact COPY relocation(s).\"\n    exit 1\n",
  "replace": "    echo \"FAIL: ${failures} undocumented artifact COPY relocation(s).\"\n    true\n",
  "test": "bash linux/scripts/tests/test-artifact-copy-completeness.sh",
  "why": "an artifact copied to another path than it was built at ships where nothing looks for it"
 },
 {
  "id": "code-size.json-drops-a-count",
  "target": "linux/scripts/verify_code_size.py",
  "find": "              \"oversized_functions\": sum(c > LIMIT for c in longest.values()),",
  "replace": "              \"oversized_functions\": sum(c > LIMIT for c in longest.values()) - 1,",
  "test": "bash linux/scripts/tests/test-scanner-json.sh -k SizeJson",
  "why": "the JSON total must equal the oversized-function count the text verdict prints"
 },
 {
  "id": "code-size.json-leaves-text-alone",
  "target": "linux/scripts/verify_code_size.py",
  "find": "    if args.json:\n        totals, per_file = _size_counts(longest, file_lengths)",
  "replace": "    if args.json:\n        print(f\"json: {args.json}\")\n        totals, per_file = _size_counts(longest, file_lengths)",
  "test": "bash linux/scripts/tests/test-scanner-json.sh -k SizeJson",
  "why": "--json must leave stdout, stderr and the exit status byte-identical"
 },
 {
  "id": "code-size.extra-never-fatal",
  "target": "linux/scripts/verify_code_size.py",
  "find": "                              **sections)\n    return rc\n",
  "replace": "                              **sections)\n    return rc or int(extra is not None)\n",
  "test": "bash linux/scripts/tests/test-scanner-json.sh -k SizeJson",
  "why": "report-only Rust, Dart and C/C++ units must never change the exit status"
 },
 {
  "id": "code-complexity.json-drops-a-count",
  "target": "linux/scripts/verify_code_complexity.py",
  "find": "        row[\"over_limit\"] += cc > CC_LIMIT or nest > NEST_LIMIT",
  "replace": "        row[\"over_limit\"] += cc > CC_LIMIT",
  "test": "bash linux/scripts/tests/test-scanner-json.sh -k ComplexityJson",
  "why": "the JSON over_limit total must count nesting offenders as the text verdict does"
 },
 {
  "id": "scanner-extras.dupes-json-drops-a-count",
  "target": "docs/scripts/code_dupes_extra.py",
  "find": "\"findings\": len(findings),",
  "replace": "\"findings\": len(findings) - 1,",
  "test": "bash linux/scripts/tests/test-scanner-json.sh -k DupesJson",
  "why": "the JSON findings total must equal the copied-block count the text verdict prints"
 },
 {
  "id": "code-dupes.extra-never-fatal",
  "target": "docs/scripts/verify_code_dupes.py",
  "find": "        code_dupes_extra.finish(args, files, texts, per_file, findings, allowed, allow, suppressed)\n    return verdict",
  "replace": "        code_dupes_extra.finish(args, files, texts, per_file, findings, allowed, allow, suppressed)\n        return 1\n    return verdict",
  "test": "bash linux/scripts/tests/test-scanner-json.sh -k DupesJson",
  "why": "report-only Python duplicate pairs must never change the exit status"
 },
 {
  "id": "hub-reuse.json-drops-a-count",
  "target": "docs/scripts/verify_hub_reuse.py",
  "find": "    totals = {\"pairs\": len(findings),",
  "replace": "    totals = {\"pairs\": len(findings) - 1,",
  "test": "bash linux/scripts/tests/test-scanner-json.sh -k HubReuseJson",
  "why": "the JSON pair total must equal the overlapping-pair count the text verdict prints"
 },
 {
  "id": "scanner-extras.rust-nested-comment",
  "target": "linux/scripts/lang_units.py",
  "find": "    \"nested\": lambda t, m: _block_end(t, m, True),",
  "replace": "    \"nested\": lambda t, m: _block_end(t, m, False),",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "a brace inside a nested Rust or Dart block comment must stay blank"
 },
 {
  "id": "scanner-extras.rust-lifetime",
  "target": "linux/scripts/lang_units.py",
  "find": "    return lit.end() if lit else m.end()",
  "replace": "    return lit.end() if lit else _line_end(text, m)",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "a Rust lifetime is code, not the start of a char literal"
 },
 {
  "id": "scanner-extras.dart-interpolation",
  "target": "linux/scripts/lang_units.py",
  "find": "        elif text.startswith(\"${\", k):\n            k = _interp_end(text, k + 2)",
  "replace": "        elif False:\n            k = _interp_end(text, k + 2)",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "quotes nested in a Dart ${} interpolation must not end the outer string"
 },
 {
  "id": "scanner-extras.dart-getter",
  "target": "linux/scripts/lang_units.py",
  "find": "    return (m.group(1), m.start(1)) if m else c_like_name(header)",
  "replace": "    return c_like_name(header)",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "a Dart getter body has no parameter list but is still a function"
 },
 {
  "id": "scanner-extras.cpp-member-init",
  "target": "linux/scripts/lang_units.py",
  "find": "\"c-cpp\": _c_member_init}",
  "replace": "\"c-cpp\": lambda _h: False}",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "a brace member initialiser must not be taken for the constructor body"
 },
 {
  "id": "scanner-extras.cpp-init-double-colon",
  "target": "linux/scripts/lang_units.py",
  "find": "INIT_TAIL = re.compile(r\"(?<!:):(?!:)(?:[^;:]|::)*[\\w>]\\s*$\")",
  "replace": "INIT_TAIL = re.compile(r\":[^;]*[\\w>]\\s*$\")",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "the `::` of a trailing return type must not read as a member initialiser list"
 },
 {
  "id": "scanner-extras.cpp-init-after-params",
  "target": "linux/scripts/lang_units.py",
  "find": "INIT_TAIL.search(header, found[2] + 1)",
  "replace": "INIT_TAIL.search(header)",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "an access label's colon before the parameter list starts no member initialiser"
 },
 {
  "id": "scanner-extras.cpp-raw-string",
  "target": "linux/scripts/lang_units.py",
  "find": "    \"craw\": lambda t, m: _raw_end(t, m.end(), \")\" + m.group(\"delim\") + '\"'),",
  "replace": "    \"craw\": lambda t, m: m.end(),",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "braces inside a C++ raw string must stay blank"
 },
 {
  "id": "scanner-extras.cpp-char-literal",
  "target": "linux/scripts/lang_units.py",
  "find": "    \"cchr\": lambda t, m: _char_end(t, m, _C_CHAR),",
  "replace": "    \"cchr\": lambda t, m: m.end(),",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "a brace char literal must stay blank"
 },
 {
  "id": "scanner-extras.scopes-descended",
  "target": "linux/scripts/lang_units.py",
  "find": "if named else (\"scope\", \"\", i))",
  "replace": "if named else (\"inner\", \"\", i))",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "functions inside a namespace, class or impl body must be found"
 },
 {
  "id": "scanner-extras.python-masked",
  "target": "linux/scripts/lang_units.py",
  "find": "        lines = _python_masked(text)",
  "replace": "        lines = text.split(\"\\n\")",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "Python comments and docstrings must not count as duplicated code"
 },
 {
  "id": "scanner-extras.python-decorators",
  "target": "linux/scripts/lang_units.py",
  "find": "spans = {min([d.lineno for d in n.decorator_list] + [n.lineno]):",
  "replace": "spans = {n.lineno:",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "a decorator belongs to its function's unit"
 },
 {
  "id": "workflow-lint.sha-pin-checker",
  "target": "linux/scripts/verify_workflow_conventions.py",
  "find": "    \"sha-pin\": check_sha_pin,\n",
  "replace": "    \"sha-pin\": lambda rel, doc: [],\n",
  "test": "bash linux/scripts/tests/test-workflow-sha-pin.sh",
  "why": "an armed sha-pin that grades nothing lets actions/checkout@v7 through"
 },
 {
  "id": "workflow-lint.sha-pin-census-exempt",
  "target": "linux/scripts/verify_workflow_conventions.py",
  "find": "if check not in live and check not in CENSUS_EXEMPT and check != PARSE",
  "replace": "if check not in live and check != PARSE",
  "test": "bash linux/scripts/tests/test-workflow-sha-pin.sh",
  "why": "without the exemption every consumer that never armed sha-pin turns red for want of a census row"
 },
 {
  "id": "workflow-lint.sha-pin-full-sha",
  "target": "linux/scripts/verify_workflow_conventions.py",
  "find": "SHA_REF = re.compile(r\"^[^@\\s]+@[0-9a-f]{40}$\")",
  "replace": "SHA_REF = re.compile(r\"^[^@\\s]+@[0-9a-f]{7,40}$\")",
  "test": "bash linux/scripts/tests/test-workflow-sha-pin.sh",
  "why": "an abbreviated SHA can collide with a later commit, so only the full 40 hex digits pin"
 },
 {
  "id": "workflow-lint.sha-pin-composite",
  "target": "linux/scripts/verify_workflow_conventions.py",
  "find": "if is_action and name in (\"job-timeout\", \"permissions\", \"run-filter\"):",
  "replace": "if is_action and name in (\"job-timeout\", \"permissions\", \"run-filter\", \"sha-pin\"):",
  "test": "bash linux/scripts/tests/test-workflow-sha-pin.sh",
  "why": "the hub's composite actions run inside every consumer job, so their uses: lines need the same pin"
 },
 {
  "id": "security-audit.new-high-blocks",
  "target": "linux/scripts/security_audit.py",
  "find": "blocking = [f for f in findings if args.mode == \"gate\" and f.severity in BLOCKING and not f.in_base]",
  "replace": "blocking = []",
  "test": "bash linux/scripts/tests/test-security-audit.sh -k push",
  "why": "push mode exists so a commit cannot add a HIGH advisory such as hydra-core 1.3.7"
 },
 {
  "id": "security-audit.known-finding-passes",
  "target": "linux/scripts/security_audit.py",
  "find": "and f.severity in BLOCKING and not f.in_base]",
  "replace": "and f.severity in BLOCKING]",
  "test": "bash linux/scripts/tests/test-security-audit.sh -k push",
  "why": "an advisory published after a pin landed is not the commit's doing; blocking it turns every push red"
 },
 {
  "id": "security-audit.unknown-severity-high",
  "target": "linux/scripts/security_audit.py",
  "find": "    except ValueError:\n        return \"HIGH\"",
  "replace": "    except ValueError:\n        return \"LOW\"",
  "test": "bash linux/scripts/tests/test-security-audit.sh -k severity",
  "why": "an advisory nobody scored may be critical, so it must block like a HIGH one"
 },
 {
  "id": "security-audit.unread-lockfile",
  "target": "linux/scripts/security_audit.py",
  "find": "    if unread:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-security-audit.sh -k kinds",
  "why": "a lockfile the scanner never reported was graded by nothing and must not read as clean"
 },
 {
  "id": "security-audit.missing-scanner-fails",
  "target": "linux/scripts/security-audit.sh",
  "find": "[ -x \"${OSV_SCANNER}\" ] || err \"osv-scanner ${OSV_SCANNER} is not an executable file\"",
  "replace": "[ -x \"${OSV_SCANNER}\" ] || { printf '{\"findings\": []}\\n' > \"${OUTPUT}\"; exit 0; }",
  "test": "bash linux/scripts/tests/test-security-audit.sh -k scanner",
  "why": "a missing scanner reported as zero findings is the false green this audit must never print"
 },
 {
  "id": "security-audit.every-lockfile-kind",
  "target": "linux/scripts/security-audit.sh",
  "find": "LOCKFILE_NAMES=(uv.lock Cargo.lock pubspec.lock package-lock.json)",
  "replace": "LOCKFILE_NAMES=(uv.lock Cargo.lock package-lock.json)",
  "test": "bash linux/scripts/tests/test-security-audit.sh -k kinds",
  "why": "a dropped lockfile kind leaves a whole ecosystem unscanned while the audit stays green"
 },
 {
  "id": "python.ci-tests-bench-failure-fails-the-leg",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "      TEST_EXIT=\"$bench_status\"\n",
  "replace": "      :\n",
  "test": "bash linux/scripts/tests/test-python-ci-bench.sh",
  "why": "a benchmark suite that fails while the leg stays green is the hidden failure the gate replaces"
 },
 {
  "id": "python.ci-tests-missing-bench-skips-visibly",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "    info \"No bench/ directory; benchmark suite skipped\"\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-python-ci-bench.sh",
  "why": "a skipped suite must say so, or a deleted bench/ reads like a passing one"
 },
 {
  "id": "python.ci-tests-bench-runs-the-directory",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "(cd \"$WORKSPACE_ROOT\" && uv_run pytest bench/) || bench_status=$?",
  "replace": "(cd \"$WORKSPACE_ROOT\" && uv_run pytest bench/demo_pytest_benchmark.py) || bench_status=$?",
  "test": "bash linux/scripts/tests/test-python-ci-bench.sh",
  "why": "one named demo file leaves every other benchmark in bench/ unrun"
 },
 {
  "id": "quality-report.comparison-removed",
  "target": "linux/scripts/quality_report_compare.py",
  "find": "        before = (baseline or {}).get(metric.name)\n",
  "replace": "        before = None\n",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k Grading",
  "why": "a record must be graded against its baseline"
 },
 {
  "id": "quality-report.direction-inverted",
  "target": "linux/scripts/quality_report_compare.py",
  "find": "    worse = now > old if metric.better == LOWER else now < old",
  "replace": "    worse = now < old if metric.better == LOWER else now > old",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k Grading",
  "why": "a lower-is-better metric that rises must regress"
 },
 {
  "id": "quality-report.incomplete-as-ok",
  "target": "linux/scripts/quality_report_compare.py",
  "find": "            return \"incomplete\"",
  "replace": "            return \"ok\"",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k Grading",
  "why": "a failed collector must make the verdict incomplete, never ok"
 },
 {
  "id": "quality-report.set-as-count",
  "target": "linux/scripts/quality_report_compare.py",
  "find": "    if metric.members is not None and isinstance(members, list):",
  "replace": "    if metric.members is None and isinstance(members, list):",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k Grading",
  "why": "a new set member must regress even when the count holds"
 },
 {
  "id": "quality-report.queue-left-empty",
  "target": "linux/scripts/quality_report_compare.py",
  "find": "        items = sorted(metric.items, key=lambda i: (-i.weight, i.path, i.line))[:QUEUE_DEPTH]",
  "replace": "        items = []",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k Grading",
  "why": "a nonzero lower-is-better metric must queue its located items"
 },
 {
  "id": "quality-report.missing-junit-as-zero",
  "target": "linux/scripts/quality_report_artifacts.py",
  "find": "        raise github.Unavailable(f\"no file matches {', '.join(source.paths)}\")",
  "replace": "        return [], \"checkout\"",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_absent_artifact",
  "why": "an absent JUnit file is not collected, never zero skips"
 },
 {
  "id": "quality-report.member-keyed-by-line",
  "target": "linux/scripts/quality_report_text.py",
  "find": "        members = keyed([(f\"{rel}|{slug}\", text) for rel, _n, text in rows])",
  "replace": "        members = keyed([(f\"{rel}|{slug}|{_n}\", text) for rel, _n, text in rows])",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_moved_set_member_holds",
  "why": "a suppression whose line moved must hold, so its key carries no line number"
 },
 {
  "id": "quality-report.dupes-items-dropped",
  "target": "docs/scripts/code_dupes_extra.py",
  "find": "items=pair_items(per_file.values()), **sections)",
  "replace": "items=[], **sections)",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_added_duplicate_regresses_and_queues",
  "why": "the duplication record must locate each pair so the queue can name it"
 },
 {
  "id": "quality-report.workflow-crash-passes",
  "target": ".github/workflows/code-quality-report.yml",
  "find": "            1) grep -q '^quality-report: verdict=regressed ' logs/code-quality/quality-report.txt ;;",
  "replace": "            1) true ;;",
  "test": "bash linux/scripts/tests/test-code-quality-report-workflow.sh -k grade",
  "why": "a quality-report crash that exits 1 must fail the job, not pass as a regression"
 },
 {
  "id": "quality-report.perf-spread-ignored",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "    limit = max(MIN_LIMIT, SPREAD_FACTOR * old.spread())",
  "replace": "    limit = MIN_LIMIT",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_limit_is_three_spreads",
  "why": "a noisy baseline widens the limit to three times its spread"
 },
 {
  "id": "quality-report.perf-direction-inverted",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "    worse = ratio > 1 + limit if metric.better == LOWER else ratio < 1 - limit",
  "replace": "    worse = ratio < 1 - limit if metric.better == LOWER else ratio > 1 + limit",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_fewer_tokens_per_second_regresses",
  "why": "a higher-is-better rate that drops must regress"
 },
 {
  "id": "quality-report.perf-dirty-tree-measured",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "    if git(root, \"status\", \"--porcelain\"):",
  "replace": "    if git(root, \"status\", \"--porcelain\") == \"dirty\":",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_dirty_tree_is_refused",
  "why": "a measurement must belong to a commit"
 },
 {
  "id": "quality-report.perf-busy-host-measured",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "    if (load := load_average()) > MAX_LOAD:",
  "replace": "    if (load := load_average()) > MAX_LOAD * 10:",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_busy_host_is_refused",
  "why": "a loaded host must not record or grade latencies"
 },
 {
  "id": "quality-report.perf-running-chain-measured",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "    if os.path.exists(chain_pidfile()):",
  "replace": "    if os.path.exists(chain_pidfile() + \".absent\"):",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_running_chain_is_refused",
  "why": "an image chain on the host makes every figure meaningless"
 },
 {
  "id": "quality-report.perf-noisy-baseline-written",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "m.status == COLLECTED and m.spread() > MAX_BASELINE_SPREAD]",
  "replace": "m.status == COLLECTED and m.spread() > 1]",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_noisy_update_is_refused",
  "why": "a baseline whose spread exceeds 5 % must not be written"
 },
 {
  "id": "quality-report.perf-first-run-graded",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "        return statistics.median(self.samples)",
  "replace": "        return self.samples[0]",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_one_outlier_run_holds",
  "why": "the graded figure is the median of the runs, so one outlier run holds"
 },
 {
  "id": "quality-report.perf-fewer-runs",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "RUNS = 20\n",
  "replace": "RUNS = 5\n",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_update_writes_twenty_samples",
  "why": "the baseline stores 20 raw samples per metric"
 },
 {
  "id": "quality-report.perf-missing-baseline-ok",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "        return None, [f\"no baseline for {model!r}; record one with --update-baseline\"]",
  "replace": "        return None, []",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_missing_baseline_is_incomplete",
  "why": "a CPU without a baseline is incomplete, never ok"
 },
 {
  "id": "quality-report.perf-unavailable-as-failure",
  "target": "linux/scripts/quality_report_perf_run.py",
  "find": "            return {\"status\": \"not-collected\", \"reason\": answer}",
  "replace": "            return {\"status\": \"failed\", \"reason\": answer}",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_unavailable_provider_is_not_collected",
  "why": "an unavailable provider is not collected, not a failed run"
 },
 {
  "id": "quality-report.perf-zero-accepted",
  "target": "linux/scripts/quality_report_perf_run.py",
  "find": "                or not math.isfinite(value) or value <= 0:",
  "replace": "                or not math.isfinite(value):",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_zero_value_is_incomplete",
  "why": "a zero latency or rate is a broken command, not a figure"
 },
 {
  "id": "quality-report.perf-cpus-unpinned",
  "target": "linux/scripts/quality_report_perf_run.py",
  "find": "    chosen = allowed[:max(1, count)]",
  "replace": "    chosen = allowed",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_update_writes_twenty_samples",
  "why": "the runs use at most the declared number of CPUs"
 },
 {
  "id": "quality-report.perf-container-user",
  "target": "linux/scripts/quality_report_perf.py",
  "find": "root, \"--user\", \"0:0\",",
  "replace": "root,",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_image_runs_as",
  "why": "container root maps to the host user; the image's own uid cannot write the rootless bind mount"
 },
 {
  "id": "quality-report.perf-genai-threads-ignored",
  "target": "linux/scripts/lib/genai-model-threads.py",
  "find": "    session[\"intra_op_num_threads\"] = args.threads\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_copy_fixes",
  "why": "an unpinned GenAI session oversubscribes the pinned CPUs and its latency spread refuses every baseline"
 },
 {
  "id": "bench-history.doubling-passes",
  "target": "linux/scripts/bench-history.py",
  "find": "            return cell, f\"{name} {change}\"",
  "replace": "            return cell, None",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k criterion",
  "why": "a gated metric that doubled against enough history must fail the run"
 },
 {
  "id": "bench-history.short-history-fails",
  "target": "linux/scripts/bench-history.py",
  "find": "        if len(earlier) >= MIN_HISTORY_TO_FAIL:",
  "replace": "        if earlier:",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k criterion",
  "why": "fewer than MIN_HISTORY_TO_FAIL earlier results only warn, so one odd runner is no yardstick"
 },
 {
  "id": "bench-history.direction-inverted",
  "target": "linux/scripts/bench-history.py",
  "find": "    return ratio >= FAIL_RATIO if rule.direction == \"lower\" else ratio <= 1 / FAIL_RATIO",
  "replace": "    return ratio >= FAIL_RATIO if rule.direction == \"higher\" else ratio <= 1 / FAIL_RATIO",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k criterion",
  "why": "a higher-is-better metric fails when it halves, a lower-is-better one when it doubles"
 },
 {
  "id": "bench-history.missing-result-passes",
  "target": "linux/scripts/bench-history.py",
  "find": "            raise InputError(f\"{path}: missing or empty\")",
  "replace": "            return {}",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k inputs",
  "why": "a missing or empty result file must fail, not print an empty table"
 },
 {
  "id": "bench-history.failed-record-counted",
  "target": "linux/scripts/bench-history.py",
  "find": "        if doc.get(\"verdict\", \"ok\") != \"ok\":",
  "replace": "        if doc.get(\"verdict\", \"ok\") == \"never\":",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k criterion",
  "why": "a stored failed run must not pull the median towards its own slowdown"
 },
 {
  "id": "bench-history.expired-artifact-read",
  "target": "linux/scripts/bench-history.py",
  "find": "            if not isinstance(run, dict) or row.get(\"expired\") or row.get(\"name\") != f\"{ARTIFACT_PREFIX}{key}\":",
  "replace": "            if not isinstance(run, dict) or row.get(\"name\") != f\"{ARTIFACT_PREFIX}{key}\":",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch",
  "why": "an expired artifact cannot be downloaded and must not be chosen"
 },
 {
  "id": "bench-history.other-branch-read",
  "target": "linux/scripts/bench-history.py",
  "find": "            if run.get(\"head_branch\") == branch and run_id not in (\"\", current) and newer:",
  "replace": "            if run_id not in (\"\", current) and newer:",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch",
  "why": "only default-branch results form the history, never a PR branch's"
 },
 {
  "id": "bench-history.mean-not-median",
  "target": "linux/scripts/bench-history.py",
  "find": "    median = statistics.median(earlier)",
  "replace": "    median = statistics.fmean(earlier)",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch",
  "why": "the yardstick is the median, which one outlier run cannot move"
 },
 {
  "id": "bench-history.keep-ignored",
  "target": "linux/scripts/bench-history.py",
  "find": "    chosen = _candidates(slug, args.key, branch, args.pages)[: args.keep]",
  "replace": "    chosen = _candidates(slug, args.key, branch, args.pages)",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch",
  "why": "--keep bounds the history to the newest results"
 },
 {
  "id": "bench-history.short-retention",
  "target": ".github/actions/bench-history/action.yml",
  "find": "        retention-days: 90",
  "replace": "        retention-days: 7",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k action",
  "why": "a weekly series must outlive the cache's 7-day eviction"
 },
 {
  "id": "fleet-health.regression-is-graded",
  "target": "linux/scripts/fleet-health.py",
  "find": "    if isinstance(change, list) or change > 0:\n        return \"regressed\"",
  "replace": "    if False:\n        return \"regressed\"",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a new suppression site or a higher count must print REGRESSED and exit 1, or the weekly run hides every slip"
 },
 {
  "id": "fleet-health.improvement-is-graded",
  "target": "linux/scripts/fleet-health.py",
  "find": "return \"improved\" if change < 0 else \"held\"",
  "replace": "return \"held\"",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "an improvement graded held leaves the owner no record of the debt paid down"
 },
 {
  "id": "fleet-health.held-is-held",
  "target": "linux/scripts/fleet-health.py",
  "find": "return \"improved\" if change < 0 else \"held\"",
  "replace": "return \"improved\" if change < 0 else \"new\"",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "an unchanged code metric must read held against its baseline, never as ungraded"
 },
 {
  "id": "fleet-health.external-is-never-graded",
  "target": "linux/scripts/fleet-health.py",
  "find": "    if now.get(\"class\") in UNGRADED:\n        return \"moved\"",
  "replace": "    if False:\n        return \"moved\"",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "GitHub state and CI timings move without a commit; grading them would turn upstream noise into regressions"
 },
 {
  "id": "fleet-health.new-advisory-regresses",
  "target": "linux/scripts/fleet-health.py",
  "find": "UNGRADED = frozenset({gh.EXTERNAL, gh.REPORT})",
  "replace": "UNGRADED = frozenset({gh.EXTERNAL, gh.REPORT, gh.ADVISORY})",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a new HIGH or CRITICAL advisory id is the one external change that must exit 1"
 },
 {
  "id": "fleet-health.not-collected-is-never-held",
  "target": "linux/scripts/fleet-health.py",
  "find": "        return now.get(\"status\", gh.NOT_COLLECTED)",
  "replace": "        return \"held\"",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a metric GitHub refused to show is unknown; grading it held would hide the gap"
 },
 {
  "id": "fleet-health.failed-is-incomplete",
  "target": "linux/scripts/fleet-health.py",
  "find": "verdict = (\"incomplete\" if problems or rows.get(gh.FAILED) else",
  "replace": "verdict = (\"incomplete\" if problems else",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a missing checkout or an exhausted 5xx means nothing was measured, which must exit 2 rather than read ok"
 },
 {
  "id": "fleet-health.incomplete-wins-over-regressed",
  "target": "linux/scripts/fleet-health.py",
  "find": "verdict = (\"incomplete\" if problems or rows.get(gh.FAILED) else\n               \"regressed\" if rows.get(\"regressed\") else \"ok\")",
  "replace": "verdict = (\"regressed\" if rows.get(\"regressed\") else\n               \"incomplete\" if problems or rows.get(gh.FAILED) else \"ok\")",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "exit 2 wins over 1, so a broken measurement fails the workflow even when a regression also printed"
 },
 {
  "id": "fleet-health.malformed-compare-is-incomplete",
  "target": "linux/scripts/fleet-health.py",
  "find": "        problems.append(str(exc))\n        return {}, f\"none ({exc})\"",
  "replace": "        return {}, f\"none ({exc})\"",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a baseline that cannot be read would turn every metric new and every regression invisible"
 },
 {
  "id": "fleet-health.first-run-has-no-baseline",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "        return None, f\"none (no successful {WORKFLOW} run carries {RECORD} yet)\"",
  "replace": "        raise Failed(\"no previous record\")",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "the first scheduled run has no earlier artifact and must still succeed"
 },
 {
  "id": "fleet-health.missing-token-is-not-collected",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "    if not token:\n        raise NotCollected(\"no token: set FLEET_HEALTH_TOKEN or log in with gh\")",
  "replace": "    if not token:\n        raise Failed(\"no token\")",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "the workflow runs without FLEET_HEALTH_TOKEN by design; that must leave alerts not collected, not fail the run"
 },
 {
  "id": "fleet-health.refusal-is-not-collected",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "        if error.code in UNREADABLE:\n            raise NotCollected",
  "replace": "        if False:\n            raise NotCollected",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a 403 from an alert endpoint means no permission, not a broken measurement"
 },
 {
  "id": "fleet-health.exhausted-5xx-fails",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "        raise Failed(f\"HTTP {error.code} for {what} after the client's retries\") from None",
  "replace": "        raise NotCollected(f\"HTTP {error.code} for {what}\") from None",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a 5xx that outlives the bounded retry is a failed measurement and must exit 2"
 },
 {
  "id": "fleet-health.missing-checkout-refused",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "    if head.returncode != 0 or len(top) != 2 or not os.path.samefile(top[0], co.path):",
  "replace": "    if len(top) == 2 and not os.path.samefile(top[0], co.path):",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a repo absent from --local-root must be refused, not measured as an empty tree"
 },
 {
  "id": "fleet-health.dirty-checkout-refused",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "    if status.returncode != 0 or status.stdout.strip():",
  "replace": "    if status.returncode != 0:",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "uncommitted edits would be graded as if a commit carried them"
 },
 {
  "id": "fleet-health.stale-checkout-refused",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "    if behind != \"0\":",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a checkout behind origin/develop measures an old tree and reports it as today"
 },
 {
  "id": "fleet-health.shared-facts-compare-rows",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "rec(len(variants) - 1, \"row sets\"",
  "replace": "rec(0, \"row sets\"",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "the DEIM and SmolLM2 rows have one owner; a drifted copy must regress the shared-facts metric"
 },
 {
  "id": "fleet-health.absent-lock-not-collected",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "        if absent:\n            present",
  "replace": "        if False:\n            present",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "llm.lock does not exist everywhere yet; an absent file is not collected, never a drift and never agreement"
 },
 {
  "id": "fleet-health.artifact-metrics-from-lane",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "            metrics[name] = {**row, \"source\": f\"{row.get('source', '')} ({where})\"}",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "artifact metrics come from the same-SHA lane record; without it they stay not collected"
 },
 {
  "id": "fleet-health.issue-is-labelled-fleet-health",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "{\"title\": title, \"body\": text, \"labels\": [ISSUE_LABEL]}",
  "replace": "{\"title\": title, \"body\": text, \"labels\": [develop_red.LABEL]}",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a regression issue under develop-red would be closed by develop_red.py and block every push"
 },
 {
  "id": "fleet-health.issue-closes-after-a-clean-run",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "    for issue in found:\n        client.call(\"POST\"",
  "replace": "    for issue in []:\n        client.call(\"POST\"",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "the issue must close after the next run without a regression, or it outlives its cause"
 },
 {
  "id": "fleet-health.lane-debt-from-newest-green",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "    green = next((r for r in runs if r[\"conclusion\"] == \"success\"), None)",
  "replace": "    green = next((r for r in reversed(runs) if r[\"conclusion\"] == \"success\"), None)",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "the debt counts from the newest green head; an older one overstates what the lane has not run on"
 },
 {
  "id": "fleet-health.lane-without-green-not-collected",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "    if green is None:\n        return gap(",
  "replace": "    if False:\n        return gap(",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a lane with no green run has no head to count from; a value there is invented"
 },
 {
  "id": "fleet-health.rerun-retry-actor-left-out",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "             and (r.get(\"triggering_actor\") or {}).get(\"login\") != RETRY_ACTOR]",
  "replace": "]",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "the retry workflow reruns a disk refusal on purpose; counting it reads infrastructure as flakiness"
 },
 {
  "id": "fleet-health.contract-digest-drift-counted",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "        metrics[name] = {**rec(len(digests) - 1, \"digests\", LOWER, CODE, source),",
  "replace": "        metrics[name] = {**rec(0, \"digests\", LOWER, CODE, source),",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "two repos testing against different contract files is the drift this row exists to show"
 },
 {
  "id": "fleet-health.contract-absent-not-collected",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "        if unmeasured or absent:",
  "replace": "        if unmeasured:",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a repo without the contract is not a repo that agrees; it must not read as 0"
 },
 {
  "id": "fleet-health.contract-lock-row-read",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "                if len(cols) >= 2 and not cols[0].startswith(\"#\") and cols[1] == name:",
  "replace": "                if False:",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "OrchestrANT holds the contracts as lock rows only; without them it reads as absent"
 },
 {
  "id": "fleet-health.sibling-pin-lag-read",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "            ahead = get(client, f\"/repos/{OWNER}/{sibling}/compare/{pin}...develop\")[\"ahead_by\"]",
  "replace": "            ahead = 0",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "OmniAccelerANT's OxidANT and AccelerANTgine gitlinks lag silently without this row"
 },
 {
  "id": "fleet-health.sibling-pins-found",
  "target": "linux/scripts/fleet_health_tree.py",
  "find": "    return {s: pin for s in SIBLINGS if s != co.repo and (pin := gitlink(co, f\"third_party/{s}\"))}",
  "replace": "    return {}",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a gitlink nobody reads cannot show its lag"
 },
 {
  "id": "fleet-health.bench-sample-stale",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "\"stale\": days > BENCH_STALE_DAYS}}",
  "replace": "\"stale\": False}}",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "an on-request lane whose history stopped moving must read stale after two weeks"
 },
 {
  "id": "fleet-health.image-lag-compares-runs",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "              if tag_of.get(name, \"latest\") in published and when < published[tag_of.get(name, \"latest\")]]",
  "replace": "              if False]",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a lane that has not run since its image was published has the new image untried"
 },
 {
  "id": "fleet-health.image-lag-not-collected-without-scope",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "    if not published:\n        return gap(",
  "replace": "    if False:\n        return gap(",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "without read:packages there are no dates; 0 lanes would read as all lanes current"
 },
 {
  "id": "fleet-health.lane-debt-refusal-stays-in-its-row",
  "target": "linux/scripts/fleet_health_github.py",
  "find": "    except NotCollected as exc:\n        # A head from before a history rewrite",
  "replace": "    except KeyError as exc:\n        # A head from before a history rewrite",
  "test": "bash linux/scripts/tests/test-fleet-health.sh",
  "why": "a 404 for one compare took every ci row of three repos down on 2026-11-19; it must stay in the debt row"
 },
 {
  "id": "python.static-ty-uses-quality-environment",
  "target": "linux/scripts/python-static.sh",
  "find": "  ty_env_flags=(--extra-search-path \"$site\")",
  "replace": "  ty_env_flags=()",
  "test": "bash linux/scripts/tests/test-python-static.sh",
  "why": "without the locked environment ty cannot resolve pytest in caller tests and reports each import"
 },
 {
  "id": "python.static-ty-searches-docs-theme",
  "target": "linux/scripts/python-static.sh",
  "find": "    ty_env_flags+=(--extra-search-path \"$theme\")",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-python-static.sh",
  "why": "a caller's docs/conf.py imports the pinned theme, which is in no installed environment"
 },
 {
  "id": "python.static-lane-fetches-docs-theme",
  "target": ".github/workflows/python-static.yml",
  "find": "          git -C \"${hub}\" submodule update --init --depth 1 -- third_party/DocumANTation\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-static-workflow.sh -k contract",
  "why": "the caller checkout does not recurse into the hub, so its theme is absent unless the lane fetches it"
 },
 {
  "id": "python.static-quality-report-fetches-docs-theme",
  "target": ".github/workflows/code-quality-report.yml",
  "find": "          git -C \"${hub}\" submodule update --init --depth 1 -- third_party/DocumANTation || exit 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-code-quality-report-workflow.sh -k grade",
  "why": "quality-report.sh counts ty diagnostics through python-static.sh, which resolves docs/conf.py's theme only from the fetched DocumANTation"
 },
 {
  "id": "packaging.ort-package-proof-library-escape",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "case \"$resolved/\" in \"$1/\"*) return 0 ;; esac",
  "replace": "return 0",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "a library or notice outside the package must not be proven through a symlink"
 },
 {
  "id": "packaging.ort-package-proof-provider-link",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "[ ! -L \"$file\" ] || { printf 'ORT provider is a symlink",
  "replace": "true || { printf 'ORT provider is a symlink",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "a provider alias can hide which provider the package loads"
 },
 {
  "id": "packaging.ort-package-proof-core-alias",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "[[ \"${resolved##*/}\" =~ ^libonnxruntime\\.so(\\.[0-9]+)*$ ]] ||",
  "replace": "true ||",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "the core name must not resolve to another component"
 },
 {
  "id": "packaging.ort-package-proof-required",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "[ -f \"$lib/$name\" ] ||",
  "replace": "true ||",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "a package without its selected provider must fail"
 },
 {
  "id": "packaging.ort-package-proof-reject-invalid",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "[ \"$skip_invalid\" = 1 ] && continue",
  "replace": "continue",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "the strict caller refuses a dangling ORT entry"
 },
 {
  "id": "packaging.ort-package-proof-reject-links",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "[ \"$1\" = 1 ] || [ ! -L \"$2\" ] ||",
  "replace": "true ||",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "the no-link caller refuses a linked ORT library"
 },
 {
  "id": "packaging.ort-package-proof-notice-bytes",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "cmp \"$notice\" \"$proof_dir/$name\" || return 1",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "a changed notice must not pass"
 },
 {
  "id": "packaging.ort-package-proof-notice-link",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "[ -f \"$notice\" ] && [ ! -L \"$notice\" ] ||",
  "replace": "true ||",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "a linked or missing notice must not pass"
 },
 {
  "id": "packaging.ort-appimage-uses-package-proof",
  "target": "linux/scripts/06-packaging/verify-ort-appimage-payload.sh",
  "find": "  ort_package_verify_notices \"$root\" \"${root}/${notice_dir}\" proven/licenses/onnxruntime\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-appimage-payload.sh",
  "why": "the AppImage check must compare its notices with the matched wheel"
 },
 {
  "id": "agents-drift.section5-workflow",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    for rel in tracked(root, [\".github/workflows/*.yml\"]):\n        name = os.path.basename(rel)\n        if not names(name, body):",
  "replace": "    for rel in tracked(root, [\".github/workflows/*.yml\"]):\n        name = os.path.basename(rel)\n        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "a workflow section 5 omits must fail"
 },
 {
  "id": "agents-drift.section5-script",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    for name in console_scripts(root):\n        if not names(name, body):",
  "replace": "    for name in console_scripts(root):\n        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "a console script section 5 omits must fail"
 },
 {
  "id": "agents-drift.section5-reads-section5",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    body = sections(agents).get(\"5\", \"\")",
  "replace": "    body = agents",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "a name elsewhere in AGENTS.md is not section 5 naming it"
 },
 {
  "id": "agents-drift.fence-is-no-heading",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        match = None if fenced else NUMBERED.match(line)",
  "replace": "        match = NUMBERED.match(line)",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "a heading-shaped line in a code fence must not open a section"
 },
 {
  "id": "agents-drift.whole-names-only",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    return re.search(rf\"(?<![\\w-]){re.escape(name)}(?![\\w-])\", text) is not None",
  "replace": "    return name in text",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "xci2.yml must not name ci2.yml"
 },
 {
  "id": "agents-drift.pyproject-scripts",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        found.update(toml_doc(root, rel).get(\"project\", {}).get(\"scripts\", {}))",
  "replace": "        toml_doc(root, rel)",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "pyproject console scripts are console scripts"
 },
 {
  "id": "agents-drift.cargo-bins",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        found.update(_cargo_bins(root, rel))",
  "replace": "        toml_doc(root, rel)",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "Cargo binaries are console scripts"
 },
 {
  "id": "agents-drift.cmake-installed",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    found.update(_cmake_installed(root))",
  "replace": "    _cmake_installed(root)",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "installed CMake executables are console scripts"
 },
 {
  "id": "agents-drift.cmake-only-installed",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "                for name in executables & installed}",
  "replace": "                for name in executables}",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "an executable nothing installs is an internal tool"
 },
 {
  "id": "agents-drift.cmake-variables",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    expanded = {CMAKE_REF.sub(lambda m: variables.get(m.group(1), m.group(0)), name)",
  "replace": "    expanded = {CMAKE_REF.sub(lambda m: m.group(0), name)",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "a target built from ${PROJECT_NAME} must still count"
 },
 {
  "id": "agents-drift.section1-unit",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        if not any(names(name, body) for name in unit):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section1",
  "why": "a unit section 1 omits must fail"
 },
 {
  "id": "agents-drift.section1-reads-section1",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    body = sections(agents).get(\"1\", \"\")",
  "replace": "    body = agents",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section1",
  "why": "a unit named elsewhere is not named by section 1"
 },
 {
  "id": "agents-drift.section1-python",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        if rel.count(\"/\") == 1:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section1",
  "why": "top-level Python packages count"
 },
 {
  "id": "agents-drift.section1-crates",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "            yield (directory, package) if directory else (package,)",
  "replace": "            continue",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section1",
  "why": "crates count"
 },
 {
  "id": "agents-drift.section1-dart",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        if directory and directory.count(\"/\") <= 1:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section1",
  "why": "Dart packages count"
 },
 {
  "id": "agents-drift.section1-src",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        if len(parts) > 2:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section1",
  "why": "Src modules count"
 },
 {
  "id": "agents-drift.headings",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    if [line for line in have if line in wanted] != wanted:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh headings",
  "why": "missing or reordered headings must fail"
 },
 {
  "id": "agents-drift.headings-order",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    if [line for line in have if line in wanted] != wanted:",
  "replace": "    if not set(wanted) <= set(have):",
  "test": "bash linux/scripts/tests/test-agents-drift.sh headings",
  "why": "a reordered set of headings must fail"
 },
 {
  "id": "agents-drift.duplicate-line",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        if line in first:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh duplicates",
  "why": "a repeated long line must fail"
 },
 {
  "id": "agents-drift.duplicate-limit-low",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "DUPLICATE_MIN = 41",
  "replace": "DUPLICATE_MIN = 42",
  "test": "bash linux/scripts/tests/test-agents-drift.sh duplicates",
  "why": "a 41-character repeat is longer than 40"
 },
 {
  "id": "agents-drift.duplicate-limit-high",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "DUPLICATE_MIN = 41",
  "replace": "DUPLICATE_MIN = 40",
  "test": "bash linux/scripts/tests/test-agents-drift.sh duplicates",
  "why": "a 40-character repeat is not longer than 40"
 },
 {
  "id": "agents-drift.docs-page",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        if page != listing and not _listed(page, source, text):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh docs",
  "why": "a page the build list omits must fail"
 },
 {
  "id": "agents-drift.docs-stem-is-exact",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    entry = re.compile(rf\"^\\s*(?:.*<)?{re.escape(stem)}>?\\s*$\", re.MULTILINE)\n    return entry.search(build_list) is not None",
  "replace": "    return stem in build_list",
  "test": "bash linux/scripts/tests/test-agents-drift.sh docs",
  "why": "a page named new is not listed by a line naming newer"
 },
 {
  "id": "agents-drift.docs-config-required",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        raise gate_scope.ScopeError(f\"no {CONFIG}: it declares the docs build list this gate reads\")",
  "replace": "        return",
  "test": "bash linux/scripts/tests/test-agents-drift.sh docs",
  "why": "no declared build list is unusable, not clean"
 },
 {
  "id": "agents-drift.docs-list-required",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        raise gate_scope.ScopeError(f\"{CONFIG} names a docs build list that does not exist: {listing}\")",
  "replace": "        return",
  "test": "bash linux/scripts/tests/test-agents-drift.sh docs",
  "why": "a declared build list that is gone is unusable, not clean"
 },
 {
  "id": "agents-drift.docs-page-posix",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    below = posixpath.relpath(page, source)",
  "replace": "    below = os.path.relpath(page, source)",
  "test": "bash linux/scripts/tests/test-agents-drift.sh docs",
  "why": "os.path.relpath gives backslashes on Windows, so a nested toctree entry looks unlisted"
 },
 {
  "id": "agents-drift.backlog-lai",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        if lai.startswith(f\"LAI-{letter}\") and not names(lai, backlog):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh backlog",
  "why": "an open ID of this repo must be in BACKLOG.md"
 },
 {
  "id": "agents-drift.backlog-letter",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        if lai.startswith(f\"LAI-{letter}\") and not names(lai, backlog):",
  "replace": "        if lai not in backlog:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh backlog",
  "why": "another repo's letter is not owed here"
 },
 {
  "id": "agents-drift.lai-done-closed",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        if \"Done \" in line:\n            continue",
  "replace": "        if False:\n            continue",
  "test": "bash linux/scripts/tests/test-agents-drift.sh backlog",
  "why": "a Done row is not open"
 },
 {
  "id": "agents-drift.lai-id-cell-only",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "            if ID_CELL.match(cell):",
  "replace": "            if LAI_ID.search(cell):",
  "test": "bash linux/scripts/tests/test-agents-drift.sh backlog",
  "why": "an ID mentioned in another row's prose opens nothing"
 },
 {
  "id": "agents-drift.json-totals",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "\"totals\": {\"findings\": len(findings), \"checks\": checks},",
  "replace": "\"totals\": {\"findings\": 0, \"checks\": checks},",
  "test": "bash linux/scripts/tests/test-agents-drift.sh json",
  "why": "quality-report reads totals.findings"
 },
 {
  "id": "agents-drift.exit-code",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    return 1 if findings else 0",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-agents-drift.sh basic docs",
  "why": "findings must fail the gate"
 },
 {
  "id": "agents-drift.hub-scope",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "        findings = grade(root, args.hub, gate_scope.is_hub(root, HUB))",
  "replace": "        findings = grade(root, args.hub, False)",
  "test": "bash linux/scripts/tests/test-agents-drift.sh hub",
  "why": "the hub's rulebook has no numbered sections to hold"
 },
 {
  "id": "agents-drift.hub-duplicates",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    findings = list(check_duplicates(agents))\n    if duplicates_only:",
  "replace": "    findings = []\n    if duplicates_only:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh hub",
  "why": "preflight's duplicate-line check must run over the hub"
 },
 {
  "id": "agents-drift.lint-flag-grades",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  _lint_gates_hub_python --root \"${_LINT_GATES_ROOT}\"\n}\n\n# Pure Python",
  "replace": "  _lint_gates_hub_python\n}\n\n# Pure Python",
  "test": "bash linux/scripts/tests/test-agents-drift.sh lintgates",
  "why": "without --root it grades the hub and passes every consumer"
 },
 {
  "id": "agents-drift.lint-flag-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    run_gate \"agents drift\" _lint_gates_agents_drift\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-agents-drift.sh lintgates",
  "why": "the flag must reach the gate"
 },
 {
  "id": "agents-drift.lint-flag-default-off",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "_LINT_GATES_AGENTS_DRIFT=0\n",
  "replace": "_LINT_GATES_AGENTS_DRIFT=1\n",
  "test": "bash linux/scripts/tests/test-agents-drift.sh lintgates",
  "why": "other consumers have no six-section AGENTS.md"
 },
 {
  "id": "lint-gates.agents-drift-input-off",
  "target": ".github/workflows/lint-gates.yml",
  "find": "      agents-drift:\n        description: >-\n          Pass --agents-drift: hold AGENTS.md, the docs build list and BACKLOG.md\n          to the tree. Needs the six-section AGENTS.md and quality-report.toml.\n        type: boolean\n        default: false\n",
  "replace": "      agents-drift:\n        description: >-\n          Pass --agents-drift: hold AGENTS.md, the docs build list and BACKLOG.md\n          to the tree. Needs the six-section AGENTS.md and quality-report.toml.\n        type: boolean\n        default: true\n",
  "test": "bash linux/scripts/tests/test-lint-gates-workflow.sh",
  "why": "every other caller stays off until it opts in"
 },
 {
  "id": "lint-gates.agents-drift-passes-flag",
  "target": ".github/workflows/lint-gates.yml",
  "find": "          if [ \"${LINT_AGENTS_DRIFT}\" = 'true' ]; then args+=(--agents-drift); fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lint-gates-workflow.sh",
  "why": "the input must reach the aggregator"
 },
 {
  "id": "quality-report.agents-drift-no-agents-md",
  "target": "linux/scripts/quality_report_text.py",
  "find": "        return missing(\"agents_drift_findings\", \"findings\", LOWER, CODE, source, \"no AGENTS.md\")\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_agents_drift_without_agents_md_is_not_collected",
  "why": "a tree without AGENTS.md has nothing to measure, so it is not-collected rather than a failed collector"
 },
 {
  "id": "quality-report.agents-drift-counts-findings",
  "target": "linux/scripts/quality_report_text.py",
  "find": "        return Metric(\"agents_drift_findings\", total(doc, \"findings\"), \"findings\", LOWER, CODE,",
  "replace": "        return Metric(\"agents_drift_findings\", 0, \"findings\", LOWER, CODE,",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_agents_drift_is_measured_with_its_rows",
  "why": "the metric must carry the gate's own count"
 },
 {
  "id": "agents-drift.cargo-claimed-main",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    claimed = any(row.get(\"path\") == \"src/main.rs\" for row in bins)\n",
  "replace": "    claimed = False\n",
  "test": "bash linux/scripts/tests/test-agents-drift.sh section5",
  "why": "a binary that does not exist cannot be owed a name"
 },
 {
  "id": "parity.cell-per-feature",
  "target": "linux/scripts/parity_manifest.py",
  "find": "            if feature not in row:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh parity",
  "why": "every target owes a cell for every feature"
 },
 {
  "id": "parity.test-tracked",
  "target": "linux/scripts/parity_manifest.py",
  "find": "    if path not in tracked:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh parity",
  "why": "a test that is no tracked file proves nothing"
 },
 {
  "id": "parity.test-text",
  "target": "linux/scripts/parity_manifest.py",
  "find": "    if text and text not in _read(root, path):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh parity",
  "why": "a named test must be in its file"
 },
 {
  "id": "parity.gap-open",
  "target": "linux/scripts/parity_manifest.py",
  "find": "        if row not in open_ids:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh parity",
  "why": "a gap must wait on an open row"
 },
 {
  "id": "parity.ticked-closed",
  "target": "linux/scripts/parity_manifest.py",
  "find": "        if not line.lstrip().startswith(\"- [x]\"):",
  "replace": "        if True:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh parity",
  "why": "a ticked row is closed"
 },
 {
  "id": "parity.na-approved",
  "target": "linux/scripts/parity_manifest.py",
  "find": "        if set(cell) != {\"na\", \"approved\"} or not APPROVED.match(str(cell[\"approved\"])):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh parity",
  "why": "an n/a needs a dated approval"
 },
 {
  "id": "parity.matrix-compared",
  "target": "linux/scripts/parity_manifest.py",
  "find": "    elif have != want:",
  "replace": "    elif False:",
  "test": "bash linux/scripts/tests/test-agents-drift.sh parity",
  "why": "a page cell the manifest contradicts must fail"
 },
 {
  "id": "agents-drift.parity-wired",
  "target": "linux/scripts/verify_agents_drift.py",
  "find": "    findings += check_parity(root)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-agents-drift.sh parity",
  "why": "the drift gate runs the parity checks"
 },
 {
  "id": "gate-fixture.harness-section-unknown-pick",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "if ! _t_listed \"_section_${name}\" \"${names[@]}\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "a recipe picking a renamed section must fail, not prove only what the other picks ran"
 },
 {
  "id": "gate-fixture.harness-section-stray-argument",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "if [ \"$1\" != -k ] || [ \"$#\" -lt 2 ]; then",
  "replace": "if [ \"$#\" -lt 2 ]; then",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "an argument that is no pick must not read as a section name"
 },
 {
  "id": "gate-fixture.harness-section-pick-narrows",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "if [ \"${#picks[@]}\" -eq 0 ] || _t_listed \"${name#_section_}\" \"${picks[@]}\"; then \"${name}\"; fi",
  "replace": "\"${name}\"",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "a pick that runs everything makes every narrow recipe pay for the whole suite"
 },
 {
  "id": "gate-fixture.harness-section-default-runs-all",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "if [ \"${#picks[@]}\" -eq 0 ] || _t_listed",
  "replace": "if _t_listed",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "preflight runs suites without arguments, so that run must keep every section"
 },
 {
  "id": "windows-lane.harness-suite-failed-assertion",
  "target": "windows/scripts/tests/Invoke-HarnessSuite.ps1",
  "find": "if ($failed.Count -gt 0 -or $results.Count -eq 0) { exit 1 }",
  "replace": "if ($results.Count -eq 0) { exit 1 }",
  "test": "bash linux/scripts/tests/test-harness-suite-driver.sh -k failed",
  "why": "every recipe on this driver needs a failed assertion to fail the run"
 },
 {
  "id": "windows-lane.harness-suite-empty",
  "target": "windows/scripts/tests/Invoke-HarnessSuite.ps1",
  "find": "if ($failed.Count -gt 0 -or $results.Count -eq 0) { exit 1 }",
  "replace": "if ($failed.Count -gt 0) { exit 1 }",
  "test": "bash linux/scripts/tests/test-harness-suite-driver.sh -k empty",
  "why": "a suite that ran no assertion proves nothing and must not pass"
 },
 {
  "id": "windows-lane.harness-suite-top-level-error",
  "target": "windows/scripts/tests/Invoke-HarnessSuite.ps1",
  "find": "$ErrorActionPreference = 'Stop'",
  "replace": "$ErrorActionPreference = 'Continue'",
  "test": "bash linux/scripts/tests/test-harness-suite-driver.sh -k error",
  "why": "an error outside any assertion means the suite did not finish, whatever passed before it"
 },
 {
  "id": "gst.knob-order-debug-logs-in-function",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "save_logs() {\n  echo \"Collecting logs to ${LOG_DIR}...\"\n  cp -a /tmp/meson-compile.log \"${LOG_DIR}/\" 2>/dev/null || true\n  cp -a builddir/meson-logs/* \"${LOG_DIR}/\" 2>/dev/null || true\n  cp -a /tmp/meson-setup.log \"${LOG_DIR}/\" 2>/dev/null || true\n  cp -a /tmp/meson-setup-fallback.log \"${LOG_DIR}/\" 2>/dev/null || true\n  cp -a /tmp/gstreamer-debug-info.log \"${LOG_DIR}/\" 2>/dev/null || true\n  ls -la \"${LOG_DIR}\" || true\n  echo \"Logs preserved in ${LOG_DIR}\"\n}\n\n: \"${GSTREAMER_DEBUG_LOGS:=false}\"\n",
  "replace": "save_logs() {\n  : \"${GSTREAMER_DEBUG_LOGS:=false}\"\n  echo \"Collecting logs to ${LOG_DIR}...\"\n  cp -a /tmp/meson-compile.log \"${LOG_DIR}/\" 2>/dev/null || true\n  cp -a builddir/meson-logs/* \"${LOG_DIR}/\" 2>/dev/null || true\n  cp -a /tmp/meson-setup.log \"${LOG_DIR}/\" 2>/dev/null || true\n  cp -a /tmp/meson-setup-fallback.log \"${LOG_DIR}/\" 2>/dev/null || true\n  cp -a /tmp/gstreamer-debug-info.log \"${LOG_DIR}/\" 2>/dev/null || true\n  ls -la \"${LOG_DIR}\" || true\n  echo \"Logs preserved in ${LOG_DIR}\"\n}\n\n",
  "test": "python3 linux/scripts/verify_knob_order.py",
  "why": "the 2026-10-27 GStreamer stop: the top-level read runs before the function holding the default"
 },
 {
  "id": "gst.knob-order-cargo-dir-in-one-wrapper",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": ": \"${GSTREAMER_CARGO_HOST_TOOLCHAIN_DIR:=/tmp/gstreamer-cargo-host-toolchain}\"\n\nif cross_build_is_active && \\\n   command -v cross_target_python_dev_ready >/dev/null 2>&1 && \\\n   ! cross_target_python_dev_ready; then\n  GSTREAMER_ENABLE_PYTHON_BINDINGS=false\n  echo \"Target Python development files are not staged for $(cross_target_triplet 2>/dev/null || echo target); disabling gst-python in cross mode\"\nfi\n\nexport GSTREAMER_ENABLE_PYTHON_BINDINGS\n\nappend_meson_arg() {\n  local arg=\"$1\"\n  # Space-padded on both sides, so this matches whole tokens only, never a prefix.\n  case \" ${EXTRA_MESON_ARGS} \" in\n    *\" ${arg} \"*)\n      ;;\n    *)\n      EXTRA_MESON_ARGS=\"${EXTRA_MESON_ARGS} ${arg}\"\n      ;;\n  esac\n}\n\n# Called again after the monorepo setup so these args survive an externally supplied MESON_ARGS.\nenforce_gst_rs_meson_args() {\n  append_meson_arg \"-Dpython-exe=${HOST_PYTHON}\"\n  if [ \"${GSTREAMER_ENABLE_PYTHON_BINDINGS}\" = \"true\" ]; then\n    append_meson_arg \"-Dgst-python:python-exe=${HOST_PYTHON}\"\n  fi\n  # auto skips a plugin whose system dep is missing; enabled aborts meson on the first one (webrtcbin2 needs unpackaged rice-proto).\n  if [ \"${GST_RS_BUILD_ALL:-true}\" = \"true\" ]; then\n    append_meson_arg \"-Dgst-plugins-rs:auto_plugin_features=auto\"\n  else\n    append_meson_arg \"-Dgst-plugins-rs:auto_plugin_features=enabled\"\n  fi\n  [ \"${GST_RS_BUILD_ALL:-true}\" = \"true\" ] || append_meson_arg \"-Dgst-plugins-rs:burn=disabled\"\n  # whisper stays enabled unless explicitly disabled via MESON_ARGS.\n  append_meson_arg \"-Dgst-plugins-rs:sodium-source=built-in\"\n}\n\nresolve_host_gcc_for_cargo() {\n  resolve_host_compiler_for_lang c\n}\n\nprepare_cargo_host_linker_wrapper() {\n",
  "replace": "\nif cross_build_is_active && \\\n   command -v cross_target_python_dev_ready >/dev/null 2>&1 && \\\n   ! cross_target_python_dev_ready; then\n  GSTREAMER_ENABLE_PYTHON_BINDINGS=false\n  echo \"Target Python development files are not staged for $(cross_target_triplet 2>/dev/null || echo target); disabling gst-python in cross mode\"\nfi\n\nexport GSTREAMER_ENABLE_PYTHON_BINDINGS\n\nappend_meson_arg() {\n  local arg=\"$1\"\n  # Space-padded on both sides, so this matches whole tokens only, never a prefix.\n  case \" ${EXTRA_MESON_ARGS} \" in\n    *\" ${arg} \"*)\n      ;;\n    *)\n      EXTRA_MESON_ARGS=\"${EXTRA_MESON_ARGS} ${arg}\"\n      ;;\n  esac\n}\n\n# Called again after the monorepo setup so these args survive an externally supplied MESON_ARGS.\nenforce_gst_rs_meson_args() {\n  append_meson_arg \"-Dpython-exe=${HOST_PYTHON}\"\n  if [ \"${GSTREAMER_ENABLE_PYTHON_BINDINGS}\" = \"true\" ]; then\n    append_meson_arg \"-Dgst-python:python-exe=${HOST_PYTHON}\"\n  fi\n  # auto skips a plugin whose system dep is missing; enabled aborts meson on the first one (webrtcbin2 needs unpackaged rice-proto).\n  if [ \"${GST_RS_BUILD_ALL:-true}\" = \"true\" ]; then\n    append_meson_arg \"-Dgst-plugins-rs:auto_plugin_features=auto\"\n  else\n    append_meson_arg \"-Dgst-plugins-rs:auto_plugin_features=enabled\"\n  fi\n  [ \"${GST_RS_BUILD_ALL:-true}\" = \"true\" ] || append_meson_arg \"-Dgst-plugins-rs:burn=disabled\"\n  # whisper stays enabled unless explicitly disabled via MESON_ARGS.\n  append_meson_arg \"-Dgst-plugins-rs:sodium-source=built-in\"\n}\n\nresolve_host_gcc_for_cargo() {\n  resolve_host_compiler_for_lang c\n}\n\nprepare_cargo_host_linker_wrapper() {\n  : \"${GSTREAMER_CARGO_HOST_TOOLCHAIN_DIR:=/tmp/gstreamer-cargo-host-toolchain}\"\n",
  "test": "python3 linux/scripts/verify_knob_order.py",
  "why": "the other 2026-10-27 stop: the C++ callback runs with the default only in the C wrapper"
 },
 {
  "id": "knob-order.reads-unguarded",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "elif not m.group(\"op\").startswith(GUARDED):",
  "replace": "elif False:",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "${X} is the abort this gate exists for"
 },
 {
  "id": "knob-order.guarded-forms-are-reads",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "GUARDED = (\":-\", \":+\", \":=\", \":?\", \"-\", \"+\", \"=\", \"?\")",
  "replace": "GUARDED = (\"\\0\",)",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "${X:-} cannot abort; flagging it buries real rows"
 },
 {
  "id": "knob-order.arm-exit-counts",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "        if head in ABORTS and self.frames:\n            self.frames[-1].dead = True\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "an arm that leaves constrains nothing after the compound"
 },
 {
  "id": "knob-order.if-without-else-holds",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "return set.intersection(*self.arms) | self.entry if self.complete and self.arms else set(self.entry)",
  "replace": "return set.intersection(*self.arms) | self.entry if self.arms else set(self.entry)",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "a compound with no else may run no arm at all"
 },
 {
  "id": "knob-order.early-return-ignored",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "return self.defined.intersection(*self.returned) if self.returned else self.defined",
  "replace": "return self.defined",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "return 0 skips a later default on that path"
 },
 {
  "id": "knob-order.subshell-leaks",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "        for m in SUBST_CALL.finditer(stmt.code):\n            self.walker.visit(m.group(1), self.defined)\n",
  "replace": "        for m in SUBST_CALL.finditer(stmt.code):\n            self.defined = self.defined | self.walker.visit(m.group(1), self.defined)\n",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "an assignment in $(f) dies with the child shell"
 },
 {
  "id": "knob-order.guard-operator-ignored",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "        if piece in (\"&&\", \"||\"):\n            return True\n",
  "replace": "        if piece in (\"&&\", \"||\"):\n            return conditional\n",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "a default behind && does not run on the false path"
 },
 {
  "id": "knob-order.substitution-operator-is-a-guard",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "pieces = SPLIT.split(mask_substitutions(stmt.code))",
  "replace": "pieces = SPLIT.split(stmt.code)",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "separators inside $(...) belong to the child shell"
 },
 {
  "id": "knob-order.callback-not-walked",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "        for word in WORD.findall(text):\n            if word != head:\n                self.walker.visit(word, self.defined)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "a function named as an argument runs at this call, as the GStreamer callbacks did"
 },
 {
  "id": "knob-order.helpers-as-entries",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "for name in sorted(self.p.bodies, key=self.mentioned):",
  "replace": "for name in self.p.bodies:",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "a helper walked ahead of its only caller reports a read its caller made safe"
 },
 {
  "id": "knob-order.call-defines-nothing",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "self.defined = self.defined | added | self.own | binds",
  "replace": "self.defined = self.defined | self.own | binds",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "a default in a called function holds after the call"
 },
 {
  "id": "knob-order.default-defines-nothing",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "self.defined = self.defined | added | self.own | binds",
  "replace": "self.defined = self.defined | added | binds",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "the default itself is the definition"
 },
 {
  "id": "knob-order.export-defines",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "keep = m.group(1) not in (\"export\", \"readonly\")",
  "replace": "keep = True",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "export X leaves X unset"
 },
 {
  "id": "knob-order.emptiness-test-ignored",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "        self.tested.update(EMPTY_TEST.findall(stmt.live))\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "a read behind [ -n \"${X:-}\" ] is safe, the sccache-s3-level shape"
 },
 {
  "id": "knob-order.tree-scope",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "SKIP_PART = \"/tests/\"",
  "replace": "SKIP_PART = \"/\"",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "a scan that visits nothing cannot fail"
 },
 {
  "id": "knob-order.root-ignored",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "tops = SCAN if gate_scope.is_hub(root, ROOT) else None",
  "replace": "tops = SCAN",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "a consumer tree must be graded, not filtered to the hub layout"
 },
 {
  "id": "knob-order.verdict",
  "target": "linux/scripts/verify_knob_order.py",
  "find": "    return 1 if found else 0\n",
  "replace": "    return 0\n",
  "test": "bash linux/scripts/tests/test-knob-order.sh",
  "why": "rows without a failing status are a report, not a gate"
 },
 {
  "id": "lib.clang-jobs-locale-digits",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": "  local LC_ALL=C\n",
  "replace": "",
  "test": "env LC_ALL=en_US.UTF-8 bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "under a UTF-8 collation [0-9] accepts digits ninja rejects"
 },
 {
  "id": "lib.clang-jobs-defined-default",
  "target": "linux/scripts/02-toolchain/build-clang.sh",
  "find": ": \"${CLANG_BUILD_MB_PER_JOB:=2000}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-clang-job-policy.sh",
  "why": "the default budget is one definition, read by the job mapper"
 },
 {
  "id": "lib.verified-installer-uv-versioned-url",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "\"https://astral.sh/uv/${uv_install_version}/install.sh\"",
  "replace": "\"https://astral.sh/uv/install.sh\"",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "the unversioned URL installs the newest uv and rotates with every release, so no hash can pin it"
 },
 {
  "id": "lib.verified-installer-uv-version-required",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "[ -n \"$uv_install_version\" ] || die \"uv_ensure_installed: no UV_VERSION",
  "replace": "[ -n \"$uv_install_version\" ] || info \"uv_ensure_installed: no UV_VERSION",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "without a pin the URL has no version in it; that must stop before any download"
 },
 {
  "id": "lib.verified-installer-uv-version-result",
  "target": "linux/scripts/01-core/python_uv.sh",
  "find": "|| die \"uv_ensure_installed: the installer did not leave uv",
  "replace": "|| info \"uv_ensure_installed: the installer did not leave uv",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "a shadowing or wrong uv after the install is not the pin; the hash only covers the script"
 },
 {
  "id": "lib.verified-installer-action-pinned",
  "target": ".github/actions/install-deps/action.yml",
  "find": "bash -c 'source \"$1\" && uv_ensure_installed' _ \"${GITHUB_ACTION_PATH}/../../../linux/scripts/01-core/python_uv.sh\"",
  "replace": "curl -LsSf https://astral.sh/uv/install.sh | sh",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "the composite action must take the pinned installer, not pipe the moving URL into sh"
 },
 {
  "id": "lib.bump-uv-installer-pair",
  "target": "docs/scripts/bump_tools.py",
  "find": "        extras[\"UV_INSTALL_SH_SHA256\"] = bv.asset_sha256(\"astral-sh/uv\", tag, \"uv-installer.sh\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "UV_VERSION moved without its installer digest makes every fresh uv install refuse"
 },
 {
  "id": "lib.flutter-pin-windows-commit",
  "target": "windows/scripts/modules/WindowsFlutterPin.Common.psm1",
  "find": "if ($pin.Commit -and $head -ne $pin.Commit) {",
  "replace": "if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only WindowsFlutterPin.Common.Tests.ps1",
  "why": "a moved tag must not install as the pinned Flutter; does not prove the commit's content beyond git's own hash"
 },
 {
  "id": "lib.flutter-pin-windows-clone-failure",
  "target": "windows/scripts/modules/WindowsFlutterPin.Common.psm1",
  "find": "if ($LASTEXITCODE) { throw \"cloning Flutter",
  "replace": "if ($false) { throw \"cloning Flutter",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only WindowsFlutterPin.Common.Tests.ps1",
  "why": "a missing tag must fail at the clone, under its own name"
 },
 {
  "id": "lib.flutter-pin-windows-half-pin",
  "target": "windows/scripts/modules/WindowsFlutterPin.Common.psm1",
  "find": "(Join-Path $CoreDir 'tool-pins.env')",
  "replace": "(Join-Path $CoreDir 'versions.env')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only WindowsFlutterPin.Common.Tests.ps1",
  "why": "the commit lives in tool-pins.env, so a move of either key cannot re-key the compiler image; reading the wrong file must not resolve"
 },
 {
  "id": "lib.bump-flutter-commit-pair",
  "target": "docs/scripts/bump_tools.py",
  "find": "        extras[\"FLUTTER_COMMIT\"] = rel[\"hash\"]\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "FLUTTER_VERSION moved without its commit makes every Windows Flutter install refuse"
 },
 {
  "id": "lib.bump-android-ndk-stable-channel",
  "target": "docs/scripts/bump_tools.py",
  "find": "        if '<channelRef ref=\"channel-0\"/>' in m.group(2)\n",
  "replace": "        if m.group(2) is not None\n",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "a beta on channel-1 must never become the NDK pin"
 },
 {
  "id": "lib.bump-litecore-sha-pair",
  "target": "docs/scripts/bump_tools.py",
  "find": "        extras[\"LITECORE_SHA256\"] = bv.sha256_of_url(_LITECORE_URL.format(v=v))\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "a LiteCore bump without its sha is an unverified download that still looks pinned"
 },
 {
  "id": "lib.bump-qnn-sdk-served",
  "target": "docs/scripts/bump_tools.py",
  "find": "    if v != cur and not bv.artifact_exists(url):\n        raise RuntimeError(f\"QAIRT {v} is not served at {url}\")\n",
  "replace": "    if v != cur and not bv.artifact_exists(url):\n        pass\n",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "a version LiteRT names but the software center does not serve would pin a 404"
 },
 {
  "id": "lib.qnn-community-zip-fetched",
  "target": "linux/scripts/01-core/qnn-sdk.sh",
  "find": "        zip=\"$(qnn_pinned_community_zip)\"\n",
  "replace": "        zip=\"\"\n",
  "test": "bash linux/scripts/tests/test-qnn-community-zip.sh",
  "why": "without the fetch an empty drop dir silently builds the arm64 image without QNN"
 },
 {
  "id": "lib.qnn-community-sha-required",
  "target": "linux/scripts/01-core/qnn-sdk.sh",
  "find": "    [ -n \"${sha}\" ] || err \"QNN: QNN_SDK_VERSION=${version} without QNN_SDK_ZIP_SHA256 -- a pin moves with its sha (bump_versions.py spec_qnn_sdk)\"\n",
  "replace": "    sha=\"${sha:-0}\"\n",
  "test": "bash linux/scripts/tests/test-qnn-community-zip.sh",
  "why": "a pinned version without its checksum would be downloaded unverified"
 },
 {
  "id": "windows-lane.qnn-community-zip-fetched",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "    & $Fetch (Get-QnnCommunityZipUrl -Version $Version) $dest $ExpectedSha256\n",
  "replace": "    $null = $Fetch\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.QnnCommunityZip.Tests.ps1 -ResultFile logs/code-quality/qnn-community-zip-mutation.json",
  "why": "without the fetch the cache dir stays empty and the lane silently builds the Windows image without the QNN EP"
 },
 {
  "id": "lib.litecore-verified-download",
  "target": "linux/scripts/03-media/build/litert/android/build-android.sh",
  "find": "download_verified_file \"${litecore_url}\" \"${LITECORE_SHA256}\" \"${litecore_root}/litecore.tar.gz\" \\\n",
  "replace": "download_file \"${litecore_url}\" \"${litecore_root}/litecore.tar.gz\" \\\n",
  "test": "bash linux/scripts/tests/test-litecore-pin.sh",
  "why": "an unverified fetch would accept Samsung's next silent re-pack and skip the mirror"
 },
 {
  "id": "renovate.pin-sweep-rides-the-report",
  "target": "linux/scripts/renovate-local.sh",
  "find": "  report) run_report; report_default_submodules; report_lock_maintenance; report_pin_sweep; report_pin_coverage ;;\n",
  "replace": "  report) run_report; report_default_submodules; report_lock_maintenance; report_pin_coverage ;;\n",
  "test": "bash linux/scripts/tests/test-renovate-pin-sweep.sh",
  "why": "a report that skips the sweep calls a stale vendor pin current"
 },
 {
  "id": "renovate.no-bump-is-local",
  "target": "linux/scripts/renovate-cli.sh",
  "find": "    local:--no-bump) assign_renovate_options BUMP 0 ;;\n",
  "replace": "    fleet:--no-bump) assign_renovate_options BUMP 0 ;;\n",
  "test": "bash linux/scripts/tests/test-renovate-cli.sh",
  "why": "the opt-out belongs to the hub driver that runs the sweep"
 },
 {
  "id": "lib.iree-host-once-no-lock",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    if ! flock -w \"${IREE_HOST_LOCK_WAIT_SECS:-14400}\" \"${lock}\"; then",
  "replace": "    if ! true; then",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k shared",
  "why": "without the lock both lanes compile at once, the waste this exists to end"
 },
 {
  "id": "lib.iree-host-once-lock-leaks-to-children",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    _iree_build_host_stage {lock}>&- || rc=$?",
  "replace": "    _iree_build_host_stage || rc=$?",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k lock",
  "why": "an sccache server the build starts would hold the lock for its whole life"
 },
 {
  "id": "lib.iree-host-once-no-restore",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    if _iree_host_stage_restore \"${entry}\"; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k shared",
  "why": "without the restore every lane still compiles"
 },
 {
  "id": "lib.iree-host-once-failed-build-publishes",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    if [ \"${rc}\" -eq 0 ]; then\n        _iree_host_stage_publish",
  "replace": "    if true; then\n        _iree_host_stage_publish",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k failure",
  "why": "a failed build's tree must never reach the next lane"
 },
 {
  "id": "lib.iree-host-once-failure-swallowed",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    exec {lock}>&-\n    return \"${rc}\"",
  "replace": "    exec {lock}>&-\n    return 0",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k failure",
  "why": "a failed host stage must stop this lane too"
 },
 {
  "id": "lib.iree-host-once-entry-tools-unchecked",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "        [ -x \"${host_install}/bin/${tool}\" ] || { warn \"IREE host cache entry ${entry} lacks ${tool}; rebuilding\"; return 1; }",
  "replace": "        :",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k failure",
  "why": "an entry that lost a tool fails hours later in stage 2"
 },
 {
  "id": "lib.iree-host-once-key-ignores-pin",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "printf '%s\\n' \"${IREE_VERSION:-}\" \"${IREE_CROSS_BUILD_COMPILER}\" \"$(uname -m)\"",
  "replace": "printf '%s\\n' \"${IREE_CROSS_BUILD_COMPILER}\" \"$(uname -m)\"",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k key",
  "why": "a lane must not reuse another IREE pin's tools"
 },
 {
  "id": "lib.iree-host-once-key-ignores-mode",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "\"${IREE_VERSION:-}\" \"${IREE_CROSS_BUILD_COMPILER}\" \"$(uname -m)\"",
  "replace": "\"${IREE_VERSION:-}\" \"$(uname -m)\"",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k key",
  "why": "the compiler mode decides which tools exist"
 },
 {
  "id": "lib.iree-host-once-key-ignores-compiler",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "        \"${host_cc}\" --version\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k key",
  "why": "another compiler is another build"
 },
 {
  "id": "lib.iree-host-once-switch-ignored",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "      off) _iree_build_host_stage; return $? ;;",
  "replace": "      off) ;;",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k switch",
  "why": "off must restore the old per-lane build"
 },
 {
  "id": "lib.iree-host-once-typo-accepted",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "      *) warn \"IREE_HOST_CACHE must be on or off, not ${IREE_HOST_CACHE}\"; return 2 ;;",
  "replace": "      *) ;;",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k switch",
  "why": "a typo would silently keep the shared path"
 },
 {
  "id": "lib.iree-host-once-unusable-cache-fatal",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "        warn \"IREE host cache ${cache} is not usable; this lane builds its own host stage\"\n        _iree_build_host_stage\n        return $?",
  "replace": "        return 1",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k switch",
  "why": "an unusable mount costs speed, not the build"
 },
 {
  "id": "lib.iree-host-once-lock-timeout-fatal",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "        warn \"IREE host stage: another lane held ${entry}.lock too long; this lane builds its own\"\n        exec {lock}>&-\n        _iree_build_host_stage\n        return $?",
  "replace": "        exec {lock}>&-\n        return 1",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k lock",
  "why": "a stuck lock costs speed, not the build"
 },
 {
  "id": "lib.iree-host-once-cross-path-unwired",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "        _iree_build_host_stage_once || return 1",
  "replace": "        _iree_build_host_stage || return 1",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k wiring",
  "why": "the once path must be the one the cross build takes"
 },
 {
  "id": "lib.iree-host-once-mount",
  "target": "linux/Dockerfile.media",
  "find": "--mount=type=cache,target=/var/cache/iree-host,id=iree-host ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-iree-host-once.sh -k wiring",
  "why": "without the mount each lane has its own cache and compiles anyway"
 },
 {
  "id": "chain-status.arch-pipeline-typo-passes",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "    *) warn \"CROSS_ARCH_PIPELINE must be 0 or 1, not ${CROSS_ARCH_PIPELINE}\"; return 2 ;;",
  "replace": "    *) ;;",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k validate",
  "why": "a typo must stop the chain at its start, not choose a path silently"
 },
 {
  "id": "chain-status.arch-pipeline-parallel-stages-ignored",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  if [ \"${PARALLEL_STAGES:-all}\" != \"all\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k validate",
  "why": "PARALLEL_STAGES names a join this mode does not have"
 },
 {
  "id": "chain-status.arch-pipeline-default-on",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  if [ \"${CROSS_ARCH_PIPELINE:-0}\" = \"1\" ]; then return 0; fi",
  "replace": "  if [ \"${CROSS_ARCH_PIPELINE:-1}\" = \"1\" ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k validate",
  "why": "the mode is opt-in until a chain has proved it"
 },
 {
  "id": "chain-status.arch-pipeline-lane-failure-swallowed",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "    cross_stage_run \"${stage}\" \"${arch}\" || { warn \"[arch-pipeline] arch=${arch} stage=${stage} failed\"; return 1; }",
  "replace": "    cross_stage_run \"${stage}\" \"${arch}\" || warn \"[arch-pipeline] arch=${arch} stage=${stage} failed\"",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "a lane must not build on a stage that failed"
 },
 {
  "id": "chain-status.arch-pipeline-run-verdict-lost",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "\"${MAX_PARALLEL_ARCHS}\" \"${arches[@]}\" || rc=1",
  "replace": "\"${MAX_PARALLEL_ARCHS}\" \"${arches[@]}\" || true",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "a failed arch must fail the chain"
 },
 {
  "id": "chain-status.arch-pipeline-status-ok-regardless",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "      [ -f \"${state}/done.${stage}.${arch}\" ] || status=failed",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "the status file must not claim a stage an arch did not finish"
 },
 {
  "id": "chain-status.arch-pipeline-stage-order",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  for stage in \"${stages[@]}\"; do\n    log \"[arch-pipeline] arch=${arch} stage=${stage} start\"",
  "replace": "  for stage in \"${stages[0]}\"; do\n    log \"[arch-pipeline] arch=${arch} stage=${stage} start\"",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "a lane runs every stage, in graph order"
 },
 {
  "id": "chain-status.arch-pipeline-parallel-not-forced",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  PARALLEL_ARCHS=1\n  run_parallel",
  "replace": "  run_parallel",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "without it the serial loop runs one arch to the end, then the next"
 },
 {
  "id": "chain-status.arch-pipeline-parallel-not-restored",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  PARALLEL_ARCHS=\"${saved}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "the runtime stage reads the operator's own value"
 },
 {
  "id": "chain-status.arch-pipeline-reclaim-unlocked",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  flock \"${lock}\" || { exec {lock}>&-; return 0; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k disk",
  "why": "two lanes evicting at once race on the same directory"
 },
 {
  "id": "chain-status.arch-pipeline-dry-run-reclaims",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  is_dry_run && return 0\n  _disk_guard_positive_integer \"${threshold}\" || return 0",
  "replace": "  _disk_guard_positive_integer \"${threshold}\" || return 0",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k disk",
  "why": "a dry run removes nothing"
 },
 {
  "id": "chain-status.arch-pipeline-lever-ignores-running",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "    [ -f \"${state}/lane-done.${arch}\" ] || continue\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k disk",
  "why": "a removal under a running build is the 2026-09-06 failure"
 },
 {
  "id": "chain-status.arch-pipeline-lever-takes-last-stage",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  unset 'stages[-1]'\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k disk",
  "why": "the runtime lane reads the finished arch's last stage"
 },
 {
  "id": "chain-status.arch-pipeline-lever-ignores-switch",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  [ \"${CROSS_IMAGE_PRUNE:-1}\" != \"0\" ] || return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k disk",
  "why": "CROSS_IMAGE_PRUNE=0 is the operator's off switch"
 },
 {
  "id": "chain-status.arch-pipeline-lever-runs-past-target",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "    [ -n \"${free_gb}\" ] && [ \"${free_gb}\" -lt \"${target}\" ] || return 0\n    if _disk_guard_nerdctl",
  "replace": "    if _disk_guard_nerdctl",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k disk",
  "why": "measure after each removal; shared layers make a nominal size meaningless"
 },
 {
  "id": "chain-status.arch-pipeline-export-kept",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  export CROSS_NO_LOCAL_CACHE_EXPORT=1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k disk",
  "why": "a lane that cannot free space must stop adding cache exports"
 },
 {
  "id": "chain-status.arch-pipeline-driver-unwired",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "    if chain_arch_pipeline_takes \"${stage}\"; then continue; fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k driver",
  "why": "the switch must reach the stage loop"
 },
 {
  "id": "chain-status.arch-pipeline-driver-unvalidated",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  chain_arch_pipeline_validate || exit 2\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k driver",
  "why": "an unknown value must stop the driver before it builds"
 },
 {
  "id": "chain-status.arch-pipeline-reclaim-rereads",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  _chain_lane_below \"${bc_dir}\" \"${threshold}\" || return 0\n  free_gb=\"$(_disk_guard_free_gb \"${bc_dir}\")\"\n  protected=",
  "replace": "  free_gb=\"$(_disk_guard_free_gb \"${bc_dir}\")\"\n  protected=",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k disk",
  "why": "the lane before it may have freed enough; a second reclaim would evict for nothing"
 },
 {
  "id": "chain-status.arch-pipeline-runs-twice",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  [ \"${_CHAIN_PIPELINE_RAN:-0}\" -eq 0 ] || return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "the first per-arch stage runs them all; the others must not repeat it"
 },
 {
  "id": "chain-status.arch-pipeline-failure-continues",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  chain_arch_pipeline_run || err \"the arch pipeline failed for one or more arches; every stage it reached is pushed, so re-run with --from-stage\"\n",
  "replace": "  chain_arch_pipeline_run || true\n",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "the runtime stage must not start on an arch that failed"
 },
 {
  "id": "chain-status.arch-pipeline-takes-shared",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  cross_stage_is_per_arch \"$1\" || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "base and compiler are the stage loop's"
 },
 {
  "id": "chain-status.arch-pipeline-no-joined-guard",
  "target": "linux/scripts/lib-chain-arch-pipeline.sh",
  "find": "  _chain_stage_disk_guard \"$(_chain_arch_pipeline_stages | tail -1)\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-arch-pipeline.sh -k order",
  "why": "the runtime lane's disk target is applied only by this guard"
 },
 {
  "id": "lib.asset-mirror-miss-logs-only-its-line",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "    22:*\"error: 404\"*) ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "curl's error line before every miss makes a log search for error hit each pinned download that falls back upstream"
 },
 {
  "id": "lib.asset-mirror-other-failures-keep-the-reason",
  "target": "linux/scripts/01-core/downloads.sh",
  "find": "    *) [ -z \"${curl_output}\" ] || printf '%s\\n' \"${curl_output}\" >&2 ;;\n",
  "replace": "    *) ;;\n",
  "test": "bash linux/scripts/tests/test-asset-mirror.sh",
  "why": "a 403 from a bad key or a dead mirror would look like an ordinary miss"
 },
 {
  "id": "python-ci.image-leg-refuses-outside-image",
  "target": "linux/scripts/ci-image-leg.sh",
  "find": "if [ -z \"${mm}\" ] || ! command -v \"python${leg}\" >/dev/null 2>&1; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ci-image-leg.sh",
  "why": "outside the image uv would download an unpinned interpreter; does not prove a real image ships both"
 },
 {
  "id": "python-ci.image-leg-binds-uv",
  "target": "linux/scripts/ci-image-leg.sh",
  "find": "export UV_PYTHON_DOWNLOADS=never UV_PROJECT_ENVIRONMENT=\"${venv}\" UV_PYTHON=\"${venv}/bin/python\"",
  "replace": "export UV_PYTHON_DOWNLOADS=never",
  "test": "bash linux/scripts/tests/test-ci-image-leg.sh",
  "why": "unbound, uv run picks its own environment and interpreter instead of the leg's"
 },
 {
  "id": "python-ci.image-leg-picks-its-interpreter",
  "target": "linux/scripts/ci-image-leg.sh",
  "find": "pinnedt) leg=\"${mm}t\" ;;",
  "replace": "pinnedt) leg=\"${mm}\" ;;",
  "test": "bash linux/scripts/tests/test-ci-image-leg.sh",
  "why": "a free-threaded leg on the GIL build would prove nothing about X.Yt"
 },
 {
  "id": "python-ci.image-leg-keeps-status",
  "target": "linux/scripts/ci-image-leg.sh",
  "find": "exec \"$@\"",
  "replace": "\"$@\" || true",
  "test": "bash linux/scripts/tests/test-ci-image-leg.sh",
  "why": "a failing check must fail the leg"
 },
 {
  "id": "actions.disk-cleanup-floor",
  "target": ".github/actions/prepare-linux-ci-host/select-disk-cleanup.sh",
  "find": "if [ \"${free_gb}\" -lt \"${floor}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-select-disk-cleanup.sh",
  "why": "a small runner must get the full cleanup before the pull fills its disk; does not prove the floor still fits the image"
 },
 {
  "id": "actions.disk-cleanup-unreadable",
  "target": ".github/actions/prepare-linux-ci-host/select-disk-cleanup.sh",
  "find": "[ -n \"${free_gb}\" ] || { printf '::error::cannot read the free space of %s\\n' \"${path}\" >&2; exit 1; }",
  "replace": "[ -n \"${free_gb}\" ] || free_gb=999",
  "test": "bash linux/scripts/tests/test-select-disk-cleanup.sh",
  "why": "an unreadable disk must not pass as plenty"
 },
 {
  "id": "actions.disk-cleanup-wired-full",
  "target": ".github/actions/prepare-linux-ci-host/action.yml",
  "find": "if: steps.disk-cleanup.outputs.mode == 'true'",
  "replace": "if: inputs.free-disk-space == 'true'",
  "test": "bash linux/scripts/tests/test-select-disk-cleanup.sh",
  "why": "the selected mode must drive the full cleanup, or the floor changes nothing"
 },
 {
  "id": "actions.disk-cleanup-floor-default",
  "target": ".github/actions/prepare-linux-ci-host/action.yml",
  "find": "    default: '100'\n  min-free-gb:\n",
  "replace": "    default: '90'\n  min-free-gb:\n",
  "test": "bash linux/scripts/tests/test-select-disk-cleanup.sh",
  "why": "at 90 GB the fast cleanup left build jobs out of disk beside the x86-64-v3 image; does not prove 100 still fits it"
 },
 {
  "id": "actions.free-disk-after-pull-reported",
  "target": ".github/actions/prepare-linux-ci-host/action.yml",
  "find": "    - name: Report the free disk after the pull\n      shell: bash\n      run: |\n        echo \"free disk after the image pull (df -BG /): $(df -BG / | tail -n 1)\" || true\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-select-disk-cleanup.sh",
  "why": "the next floor is sized from the free disk after the pull; does not prove the step runs on a real runner"
 },
 {
  "id": "disk-guard.release-stale-refuses-under-a-build",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if _disk_guard_build_in_flight; then\n    _disk_guard_log \"[disk-buildkit] ${in_use} layer",
  "replace": "  if false; then\n    _disk_guard_log \"[disk-buildkit] ${in_use} layer",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "restarting buildkitd under a live solve kills the build; does not see a build driven by another user or tool"
 },
 {
  "id": "disk-guard.release-stale-failed-probe-is-a-build",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  if [ \"${rc}\" -eq 1 ]; then return 1; fi\n  return 0\n",
  "replace": "  if [ \"${rc}\" -ne 0 ]; then return 1; fi\n  return 0\n",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a broken process probe must not read as nothing running"
 },
 {
  "id": "disk-guard.release-stale-once-per-run",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  _DISK_GUARD_BUILDKIT_RESTARTS=1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "a second restart frees nothing and costs the daemon's warm state"
 },
 {
  "id": "disk-guard.release-stale-needs-records-in-use",
  "target": "linux/scripts/01-core/disk-guard.sh",
  "find": "  case \"${in_use}\" in ''|0|*[!0-9]*) return 0 ;; esac\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-disk-guard.sh",
  "why": "with nothing in use a restart cannot help"
 },
 {
  "id": "disk-guard.release-stale-at-lane-entry",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "  _disk_guard_release_stale_records \"${bc_dir}\" \"${need}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-disk-threshold-policies.sh",
  "why": "the lane entry is where the stopped chain's records refused a resume"
 },
 {
  "id": "disk-guard.runtime-start-counts-the-lane-once",
  "target": "linux/scripts/01-core/chain-storage.sh",
  "find": "    [ \"${FROM_STAGE}\" != runtime ] || combined=\"${rt_lane_gb}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-storage-sdk-refactors.sh",
  "why": "a --from-stage runtime run warned of 535 GB for a 415 GB lane"
 },
 {
  "id": "lib.deb-symbols-malformed-line-accepted",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "        if match is None or not current:\n            raise ValueError(f\"malformed symbols line in {origin}: {line!r}\")\n",
  "replace": "        if match is None or not current:\n            continue\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "a parse warning must not pass as a clean scan, the metadata-review finding"
 },
 {
  "id": "lib.deb-symbols-malformed-header-accepted",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "            if len(parts) != 2:\n                raise ValueError(f\"malformed symbols header in {origin}: {line!r}\")\n",
  "replace": "            if len(parts) != 2:\n                continue\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "a header with no template must not pass"
 },
 {
  "id": "lib.deb-symbols-string-order",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "        if not best or version_newer(version, best):\n",
  "replace": "        if not best or version > best:\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "string order puts 9 above 13.1 and ignores epochs"
 },
 {
  "id": "lib.deb-symbols-oldest-order",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "        if not best or version_newer(best, version):\n",
  "replace": "        if not best or version_newer(version, best):\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "a node exists from its first version, not its newest symbol"
 },
 {
  "id": "lib.deb-symbols-compare-error-ignored",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "    if result.returncode not in (0, 1):\n        raise ValueError(f\"dpkg cannot compare {left} and {right}\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "a dpkg failure must not read as an order"
 },
 {
  "id": "lib.deb-symbols-missing-node-unversioned",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "            raise ValueError(f\"{origin} lists no version node {node} for {soname}\")\n",
  "replace": "            continue\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "metadata missing a needed node cannot vouch for a minimum"
 },
 {
  "id": "lib.deb-symbols-template-ignored",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "    if entry is None or entry[0] != f\"{owner} #MINVER#\":\n",
  "replace": "    if entry is None:\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "a custom template means this minimum is not the whole dependency"
 },
 {
  "id": "lib.deb-symbols-silent-unversioned",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "        print(f\"deb-depends: {owner} installs no symbols file; its Depends stays unversioned\", file=sys.stderr)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "an unversioned result must say so in the build log"
 },
 {
  "id": "lib.deb-symbols-version-zero-is-a-bound",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "    return minimums - {\"0\"}\n",
  "replace": "    return minimums\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "version 0 is Debian's mark for no minimum"
 },
 {
  "id": "lib.deb-symbols-base-node-counted",
  "target": "linux/scripts/06-packaging/python_app_deb_symbols.py",
  "find": "        if node and node != \"Base\":\n",
  "replace": "        if node:\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "@Base is no version node"
 },
 {
  "id": "lib.deb-symbols-host-scope-lost",
  "target": "linux/scripts/06-packaging/python-app-deb-depends.py",
  "find": "                if soname in host:\n                    nodes.setdefault(soname, set()).update(wanted)\n",
  "replace": "                nodes.setdefault(soname, set()).update(wanted)\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "an ELF that gets the soname from the bundle must not raise the host package's minimum"
 },
 {
  "id": "lib.deb-symbols-bound-not-emitted",
  "target": "linux/scripts/06-packaging/python-app-deb-depends.py",
  "find": "        packages.add(f\"{owner} (>= {bound})\" if bound else owner)\n",
  "replace": "        packages.add(owner)\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "an unversioned Depends is the CON188 failure: dpkg configures, then the loader fails"
 },
 {
  "id": "lib.site-link-pool-never-runs",
  "target": "linux/scripts/verify_site_links.py",
  "find": "        if jobs > 1 and len(paths) > 1:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "the pool is the point of the knob"
 },
 {
  "id": "lib.site-link-pool-always-runs",
  "target": "linux/scripts/verify_site_links.py",
  "find": "        if jobs > 1 and len(paths) > 1:\n",
  "replace": "        if len(paths) > 1:\n",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "1 is the documented way back to one process"
 },
 {
  "id": "lib.site-link-jobs-unvalidated",
  "target": "linux/scripts/verify_site_links.py",
  "find": "    if not value.isascii() or not value.isdigit() or int(value) < 1:\n        raise ValueError(f\"SITE_LINK_JOBS={value} is not a positive integer\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a typo must not reach the pool as a traceback"
 },
 {
  "id": "lib.secret-scan-side-by-side-in-turn",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "xargs -0 -r -n 2 -P \"${jobs}\" bash",
  "replace": "xargs -0 -r -n 2 -P 1 bash",
  "test": "bash linux/scripts/tests/test-lint-gates-secret-jobs.sh",
  "why": "the scans must overlap, or the knob changes nothing"
 },
 {
  "id": "lib.secret-scan-side-by-side-verdict-lost",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    [ \"$(cat \"${work}/${index}.rc\" 2>/dev/null || echo missing)\" = 0 ] || rc=1\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-lint-gates-secret-jobs.sh",
  "why": "a found secret must still fail the gate when its scan ran beside others"
 },
 {
  "id": "lib.secret-scan-side-by-side-missing-status-passes",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "\"${work}/${index}.rc\" 2>/dev/null || echo missing)\" = 0 ]",
  "replace": "\"${work}/${index}.rc\" 2>/dev/null || echo 0)\" = 0 ]",
  "test": "bash linux/scripts/tests/test-lint-gates-secret-jobs.sh",
  "why": "a scan that died before writing its status has graded nothing"
 },
 {
  "id": "lib.secret-scan-side-by-side-report-dropped",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    cat \"${work}/${index}.log\" 2>/dev/null || true\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lint-gates-secret-jobs.sh",
  "why": "the finding is in the scan's output"
 },
 {
  "id": "lib.secret-scan-side-by-side-jobs-unvalidated",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    ''|*[!0-9]*|0) printf 'LINT_GATES_SECRET_JOBS=%s is not a positive integer\\n' \"${jobs}\" >&2; return 2 ;;\n",
  "replace": "    ''|*[!0-9]*|0) jobs=1 ;;\n",
  "test": "bash linux/scripts/tests/test-lint-gates-secret-jobs.sh",
  "why": "a typo is not a parallelism choice"
 },
 {
  "id": "lib.secret-scan-side-by-side-cap-ignored",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "xargs -0 -r -n 2 -P \"${jobs}\" bash",
  "replace": "xargs -0 -r -n 2 -P 0 bash",
  "test": "bash linux/scripts/tests/test-lint-gates-secret-jobs.sh",
  "why": "1 must run the scans in turn"
 },
 {
  "id": "python-ci.image-leg-absolute-venv",
  "target": "linux/scripts/ci-image-leg.sh",
  "find": "venv=\"$(realpath -m \"$2\")\"",
  "replace": "venv=\"$2\"",
  "test": "bash linux/scripts/tests/test-ci-image-leg.sh",
  "why": "a relative UV_PYTHON breaks as soon as the command changes directory"
 },
 {
  "id": "script-tests.leftovers-fail",
  "target": "linux/scripts/tests/run-tests.sh",
  "find": "    if [ -n \"${_left}\" ]; then\n",
  "replace": "    if false; then\n",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "a suite that leaves trees behind must fail by name, or a tmpfs /tmp fills with RAM again"
 },
 {
  "id": "script-tests.private-tmpdir",
  "target": "linux/scripts/tests/run-tests.sh",
  "find": "  oj_add env \"TMPDIR=${_RUN_TMP}/${#SUITE_NAMES[@]}\" bash \"${suite}\"\n",
  "replace": "  oj_add bash \"${suite}\"\n",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "without a TMPDIR of its own a suite's leak lands where nothing can attribute it"
 },
 {
  "id": "script-tests.removes-its-root",
  "target": "linux/scripts/tests/run-tests.sh",
  "find": "trap 'oj_reap; rm -rf \"${_RUN_TMP}\"' EXIT\n",
  "replace": "trap 'oj_reap' EXIT\n",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "the runner's own root must not become the leak it exists to catch"
 },
 {
  "id": "lib.t-mktemp-registers",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  printf '%s\\n' \"${path}\" >> \"${_T_TMP_REGISTRY}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "an unregistered tree is a plain mktemp leak"
 },
 {
  "id": "lib.t-mktemp-own-shell-only",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  [ \"${BASHPID}\" = \"$$\" ] || return 0\n  [ -f \"${_T_TMP_REGISTRY}\" ] || return 0\n",
  "replace": "  [ -f \"${_T_TMP_REGISTRY}\" ] || return 0\n",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "a subshell's summary would delete the trees the suite is still using"
 },
 {
  "id": "lib.t-mktemp-removed-at-exit",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "trap _t_tmp_cleanup EXIT\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "a suite that ends without a summary would leave its trees"
 },
 {
  "id": "lib.t-mktemp-removed-at-summary",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "  _t_tmp_cleanup\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "most suites set their own EXIT trap, which replaces the harness's"
 },
 {
  "id": "python.ci-tests-bench-no-switch",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "            -e FREE_THREADED_SYNC_EXTRAS=${{ inputs.free-threaded-extras }}\n",
  "replace": "            -e PYTHON_BENCH_GATE=0\n            -e FREE_THREADED_SYNC_EXTRAS=${{ inputs.free-threaded-extras }}\n",
  "test": "bash linux/scripts/tests/test-python-ci-bench.sh",
  "why": "no caller may turn the benchmark gate off again; an older pinned ci_tests.sh would honour it"
 },
 {
  "id": "actions.disk-refusal-stops-before-pull",
  "target": ".github/actions/prepare-linux-ci-host/select-disk-cleanup.sh",
  "find": "if [ \"${free_gb}\" -lt \"${min_free}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-select-disk-cleanup.sh",
  "why": "a runner that cannot fit the image must stop before the pull; does not prove 45 still fits the image"
 },
 {
  "id": "actions.disk-refusal-names-free-and-floor",
  "target": ".github/actions/prepare-linux-ci-host/select-disk-cleanup.sh",
  "find": "::error title=runner-disk-refusal::%sG free on this runner, floor %sG (min-free-gb)",
  "replace": "::error title=runner-disk-refusal::too little disk %s %s",
  "test": "bash linux/scripts/tests/test-select-disk-cleanup.sh",
  "why": "the message must name the free space and the floor"
 },
 {
  "id": "actions.disk-refusal-keeps-status",
  "target": ".github/actions/prepare-linux-ci-host/action.yml",
  "find": "        mode=\"$(bash \"${GITHUB_ACTION_PATH}/select-disk-cleanup.sh\" \"${FREE_DISK_SPACE}\" \"${FAST_FLOOR_GB}\" \"${MIN_FREE_GB}\")\"\n        echo \"mode=${mode}\" >> \"${GITHUB_OUTPUT}\"\n",
  "replace": "        echo \"mode=$(bash \"${GITHUB_ACTION_PATH}/select-disk-cleanup.sh\" \"${FREE_DISK_SPACE}\" \"${FAST_FLOOR_GB}\" \"${MIN_FREE_GB}\")\" >> \"${GITHUB_OUTPUT}\"\n",
  "test": "bash linux/scripts/tests/test-select-disk-cleanup.sh",
  "why": "inside echo's substitution a refusal's exit status is lost and the pull goes on"
 },
 {
  "id": "actions.disk-refusal-marker-exact",
  "target": ".github/actions/retry-disk-refusal/retry-disk-refusal.sh",
  "find": "grep -qxF -e 'runner-disk-refusal'",
  "replace": "grep -qF -e 'runner-disk-refusal'",
  "test": "bash linux/scripts/tests/test-retry-disk-refusal.sh",
  "why": "a failure whose title only mentions the marker must not re-run"
 },
 {
  "id": "actions.disk-refusal-one-job-endpoint",
  "target": ".github/actions/retry-disk-refusal/retry-disk-refusal.sh",
  "find": "\"repos/${REPO}/actions/jobs/${refused%% *}/rerun\"",
  "replace": "\"repos/${REPO}/actions/runs/${RUN_ID}/rerun-failed-jobs\"",
  "test": "bash linux/scripts/tests/test-retry-disk-refusal.sh",
  "why": "rerun-failed-jobs would also re-run a genuine test failure beside the refusal"
 },
 {
  "id": "actions.disk-refusal-attempt-cap",
  "target": ".github/actions/retry-disk-refusal/retry-disk-refusal.sh",
  "find": "if [ \"${RUN_ATTEMPT}\" -ge \"${MAX_ATTEMPTS}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-retry-disk-refusal.sh",
  "why": "an unbounded retry could spin on a fleet of small runners"
 },
 {
  "id": "actions.disk-refusal-api-failure-is-loud",
  "target": ".github/actions/retry-disk-refusal/retry-disk-refusal.sh",
  "find": "gh api -X POST \"repos/${REPO}/actions/jobs/${refused%% *}/rerun\" >/dev/null",
  "replace": "gh api -X POST \"repos/${REPO}/actions/jobs/${refused%% *}/rerun\" >/dev/null || true",
  "test": "bash linux/scripts/tests/test-retry-disk-refusal.sh",
  "why": "a refused re-run must fail the retry job, not claim it started"
 },
 {
  "id": "actions.disk-refusal-proof-off-develop",
  "target": ".github/workflows/disk-refusal-selftest.yml",
  "find": "PROVE: ${{ inputs.prove && github.ref != 'refs/heads/develop' }}",
  "replace": "PROVE: ${{ inputs.prove }}",
  "test": "bash linux/scripts/tests/test-select-disk-cleanup.sh",
  "why": "a proof on develop opens a develop-red issue that blocks every hub push; this reads the file, not a real dispatch"
 },
 {
  "id": "mutations.push-delegates-chrome",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "\"${_ranges[@]}\" --delegate-chrome ${PREPUSH",
  "replace": "\"${_ranges[@]}\" ${PREPUSH",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "Chrome suites stall on the build host until their 300 s timeout fails the push; CI proves them"
 },
 {
  "id": "mutations.push-doc-numbers-run",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "bash linux/scripts/tests/test-doc-numbers.sh >\"${_log}\" 2>&1 || {",
  "replace": "true >\"${_log}\" 2>&1 || {",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "a rebase changes the derived numbers with no commit hook firing; this landed a red develop"
 },
 {
  "id": "mutations.push-doc-numbers-abort",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "  echo \"pre-push: derived doc numbers are STALE -- run: bash linux/scripts/tests/test-doc-numbers.sh --update\" >&2\n  exit 1",
  "replace": "  echo \"pre-push: derived doc numbers are STALE -- run: bash linux/scripts/tests/test-doc-numbers.sh --update\" >&2\n  exit 0",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "printed and let through, a stale number reaches CI"
 },
 {
  "id": "mutations.push-comment-size-runs",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "${_PY} linux/scripts/verify_comment_size.py || {",
  "replace": "true || {",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "a two-line comment landed past --no-verify; this is the cheap check that sees it"
 },
 {
  "id": "mutations.push-comment-size-aborts",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "docs/code-quality-tooling.md#comment-size-comment-size\" >&2\n  exit 1",
  "replace": "docs/code-quality-tooling.md#comment-size-comment-size\" >&2\n  exit 0",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "printed and let through, the block reaches CI"
 },
 {
  "id": "mutations.push-every-ref",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "_ranges+=(\"--push-range\" \"${_rsha}...${_lsha}\") ;;",
  "replace": "_ranges=(\"--push-range\" \"${_rsha}...${_lsha}\") ;;",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "a push of two refs must grade both"
 },
 {
  "id": "mutations.push-delete-proves-nothing",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "case \"${_lsha}\" in *[!0]*) ;; *) continue ;; esac",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "a deleted ref has no local commits, and its all-zero sha makes the range fail"
 },
 {
  "id": "mutations.push-new-ref-counts-from-develop",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "then echo origin/develop; else echo origin/main; fi",
  "replace": "then echo origin/main; else echo origin/main; fi",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "a new ref graded from main re-proves hundreds of entries it did not add"
 },
 {
  "id": "mutations.push-names-uncommitted",
  "target": "linux/host-config/git-hooks/pre-push",
  "find": "if [ \"${_dirty}\" -gt 0 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-prepush-hook.sh",
  "why": "the checks read the working tree, so a run over uncommitted bytes must say so"
 },
 {
  "id": "mutations.gate-push-range-selects",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if args.push_range:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "a push scope ignored falls through to every entry, Chrome suites and backlog included"
 },
 {
  "id": "mutations.gate-shard-cannot-delegate",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if args.delegate_chrome and args.shard:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "CI is the proof delegation points at; a delegating shard would shrink it silently"
 },
 {
  "id": "mutations.gate-delegates-on-the-flag-only",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    if args.delegate_chrome:",
  "replace": "    if True:",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "delegating without the flag would drop Chrome entries from CI, the only proof left"
 },
 {
  "id": "mutations.gate-reports-coverage",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    say(coverage_line(proved,",
  "replace": "    (coverage_line(proved,",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "a sample that does not print its coverage reads as a full proof"
 },
 {
  "id": "mutations.gate-whole-claim-is-earned",
  "target": "docs/scripts/verify_mutations.py",
  "find": "    elif rc == 0 and proved == total:",
  "replace": "    elif rc == 0:",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "a subset must not close on 'every recorded mutation is caught'"
 },
 {
  "id": "mutations.preflight-never-delegates",
  "target": "linux/scripts/preflight.sh",
  "find": "docs/scripts/verify_mutations.py \\\n  ${PREFLIGHT_MUTATION_SHARD:+",
  "replace": "docs/scripts/verify_mutations.py --delegate-chrome \\\n  ${PREFLIGHT_MUTATION_SHARD:+",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "preflight is how CI proves every entry; a delegating slug would point the delegation at nothing"
 },
 {
  "id": "mutations.push-diff-failure-is-fatal",
  "target": "docs/scripts/mutation_push.py",
  "find": "    if out.returncode != 0:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "an unreadable range reads as an empty diff, and an empty diff reads as nothing to prove"
 },
 {
  "id": "mutations.push-range-shape",
  "target": "docs/scripts/mutation_push.py",
  "find": "        if not _RANGE.fullmatch(spec):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "one ref alone is a tree diff against the working tree, not what the push adds"
 },
 {
  "id": "mutations.push-selects-changed-recipes",
  "target": "docs/scripts/mutation_push.py",
  "find": "        if rel in files:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "a new recipe on old code touches no target and no test, so it would wait for CI to bite"
 },
 {
  "id": "mutations.push-selects-edited-recipes",
  "target": "docs/scripts/mutation_push.py",
  "find": "if known.get(e[\"id\"]) != e}",
  "replace": "if e[\"id\"] not in known}",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "an edited recipe proves a new mutant as much as an added one does"
 },
 {
  "id": "mutations.push-chrome-marker-harness",
  "target": "docs/scripts/mutation_push.py",
  "find": "r\"\\bt_skip_unless_chrome\\b|\\bfindChrome\\(\"",
  "replace": "r\"\\bfindChrome\\(\"",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "suites asking through the harness are the common shape; missed, they stall the host"
 },
 {
  "id": "mutations.push-chrome-marker-node",
  "target": "docs/scripts/mutation_push.py",
  "find": "r\"\\bt_skip_unless_chrome\\b|\\bfindChrome\\(\"",
  "replace": "r\"\\bt_skip_unless_chrome\\b\"",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "the WebGPU suite asks through node's findChrome and stalls just the same"
 },
 {
  "id": "mutations.push-delegated-count",
  "target": "docs/scripts/mutation_push.py",
  "find": "    lines = [f\"  delegated {n} entr(ies) to CI, {why}: {cmd}\" for cmd, n in sorted(counts.items())]",
  "replace": "    lines = []",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "a delegation without its count is coverage silently lost"
 },
 {
  "id": "mutations.push-delegated-by-hand",
  "target": "docs/scripts/mutation_push.py",
  "find": "    lines.append('  by hand:",
  "replace": "    str('  by hand:",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "the delegated proof must be runnable before CI answers"
 },
 {
  "id": "mutations.push-whole-needs-every-entry",
  "target": "docs/scripts/mutation_push.py",
  "find": "    if proved == total:",
  "replace": "    if proved == selected:",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "a push proving all it selected is still a sample of the manifest"
 },
 {
  "id": "deepstream.sbsa-pinned-bytes",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "[ \"${have}\" = \"${!key:-}\" ] || echo \"${dir}/${f} is not the pinned ${key} (sha256 ${have})\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a staged SBSA library with other bytes than the pin must be refused, never shipped"
 },
 {
  "id": "deepstream.cross-multiarch-headers",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  DS_CROSS_SYSFLAGS=\"-idirafter /usr/include/${multiarch} -idirafter /usr/include -L/usr/lib/${multiarch}\"\n",
  "replace": "  DS_CROSS_SYSFLAGS=\"-L/usr/lib/${multiarch}\"\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "without the -idirafter pair the cross GCC (sysroot /usr/<triplet>) never sees apt's :arm64 headers and the SBSA civetweb build dies on zconf.h"
 },
 {
  "id": "deepstream.sbsa-lib-install-dir",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  local -a mk=(make -C \"${src}/${dir}\" -j\"${jobs}\" \"CUDA_VER=${DS_CUDA_VER}\" \"CXX=${cxx}\" \"CC=${cc}\" \"LIB_INSTALL_DIR=${lib_dir}\"\n",
  "replace": "  local -a mk=(make -C \"${src}/${dir}\" -j\"${jobs}\" \"CUDA_VER=${DS_CUDA_VER}\" \"CXX=${cxx}\" \"CC=${cc}\"\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "without the explicit lib dir the aarch64 Makefiles install into L4T's tegra dir, which the SBSA image does not have"
 },
 {
  "id": "deepstream.build-dir-stable",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  tmp=\"${TMPDIR:-/tmp}/deepstream-build\"; rm -rf \"${tmp}\"; mkdir -p \"${tmp}\"\n",
  "replace": "  tmp=\"$(mktemp -d \"${TMPDIR:-/tmp}/deepstream.XXXXXX\")\"\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a random build dir changes every preprocessed line marker, so sccache misses every DeepStream compile on every run"
 },
 {
  "id": "deepstream.plugin-dir-multiarch-link",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  gst_dir=\"${GSTREAMER_PREFIX:-/opt/gstreamer}/lib/multiarch/gstreamer-1.0\"\n",
  "replace": "  gst_dir=\"${GSTREAMER_PREFIX:-/opt/gstreamer}/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/gstreamer-1.0\"\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the cross-built arm64 GStreamer has no lib/<triplet> dir, so the triplet form fails the arm64 package stage on a directory that does not exist"
 },
 {
  "id": "deepstream.sbsa-trt-sdk-before-sysflags",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  [ -z \"${DS_TARGET_DEVICE:-}\" ] || { DS_CROSS_CC=\"${CC} ${DS_TRT_LINK_FLAGS} ${DS_CROSS_SYSFLAGS}\"; DS_CROSS_CXX=\"${CXX} ${DS_TRT_LINK_FLAGS} ${DS_CROSS_SYSFLAGS}\"; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "with the sysflags' -L/usr/lib/<triplet> first, the cross components link the image's TensorRT 11 instead of DeepStream's 10"
 },
 {
  "id": "deepstream.sbsa-runpaths-set",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "    if ! grep -qE 'RUNPATH|RPATH' <<<\"${dyn}\"; then patchelf --set-rpath \"\\$ORIGIN:${root}/lib\" \"${f}\"; n=$((n + 1)); fi\n",
  "replace": "    if ! grep -qE 'RUNPATH|RPATH' <<<\"${dyn}\"; then n=$((n + 1)); fi\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "without the RUNPATH the Jetson .deb's files resolve none of DeepStream's own libraries, which are kept off ld.so.conf"
 },
 {
  "id": "deepstream.sbsa-vpi-excused",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "find": "[ \"$(dsv_arch)\" != arm64 ] || DSV_ALLOWED_MISSING+=(\"${DSV_ALLOWED_MISSING_ARM64[@]}\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the three VPI consumers of the Jetson .deb cannot resolve on the SBSA route; unexcused they fail the closure gate on every arm64 package stage"
 },
 {
  "id": "deepstream.sbsa-bufferpool-soname",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "    case \"${f}\" in *.so.1.0.0) cp \"${dir}/${f}\" \"${lib}/${f}\" ;; *) cp \"${dir}/${f}\" \"${lib}/${f}.1.0.0\"; f=\"${f}.1.0.0\" ;; esac\n",
  "replace": "    cp \"${dir}/${f}\" \"${lib}/${f}\"\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "staged under its bare name, libnvdsbufferpool.so resolves for nothing that NEEDs its SONAME, and four plugins fail to register on every arm64 package stage"
 },
 {
  "id": "deepstream.sbsa-bare-cuda-needs",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "      [ -z \"${soname}\" ] || patchelf --replace-needed \"${bare}\" \"${soname}\" \"${f}\"\n",
  "replace": "      :\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a bare CUDA NEEDED (libcufft.so, libcublas.so, libnppi*.so) names a dev link the package stage does not ship; unrewritten it stays BROKEN in the closure"
 },
 {
  "id": "deepstream.sbsa-origin-runpath",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "patchelf --set-rpath \"\\$ORIGIN:${root}/lib\" \"${f}\"",
  "replace": "patchelf --set-rpath \"${root}/lib\" \"${f}\"",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "without $ORIGIN libnvdsgst_deepstream_bins.so resolves none of the nine sibling plugins it NEEDs: nine BROKEN closure rows on every arm64 package stage"
 },
 {
  "id": "deepstream.sbsa-host-cuda-sonames",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  for d in \"$2\" \"$3\"; do\n",
  "replace": "  for d in \"$2\"; do\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the staged arm64 runtime holds cudart's dev link only; without the host toolkit libcufft.so, libcublas.so and libnppi*.so stay bare and BROKEN"
 },
 {
  "id": "deepstream.sbsa-amd64-excuses",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "find": "[ \"$(dsv_arch)\" != amd64 ] || DSV_ALLOWED_MISSING+=(\"${DSV_ALLOWED_MISSING_AMD64[@]}\")\n",
  "replace": "DSV_ALLOWED_MISSING+=(\"${DSV_ALLOWED_MISSING_AMD64[@]}\")\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the Jetson .deb ships no UCX plugin and no Maxine helper; excused on arm64 too, those entries fail the closure gate as stale"
 },
 {
  "id": "deepstream.dsexample-literal-gcc-patched",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "  sed -i 's/^\\tgcc /\\t$(CC) /' \"$1\"\n",
  "replace": "  true\n",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "a sub-make that still spells gcc builds an x86-64 object into the arm64 plugin's archive"
 },
 {
  "id": "cuda-stack.apt-lists-keyed-by-target",
  "target": "linux/Dockerfile.nvidia",
  "find": "LABEL kataglyphis.step=cuda-repo\nRUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core,target=/tmp/core-scripts,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH}-${TARGET_ARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH}-${TARGET_ARCH} \\\n",
  "replace": "LABEL kataglyphis.step=cuda-repo\nRUN --mount=type=secret,id=asset_mirror,required=false --mount=type=bind,source=linux/scripts/01-core,target=/tmp/core-scripts,ro \\\n    --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH}-${TARGET_ARCH} \\\n    --mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-lib-${TARGETARCH} \\\n",
  "test": "bash linux/scripts/tests/test-cuda-cross-sbsa.sh",
  "why": "an apt list cache keyed by the build arch alone is shared by the amd64 and the arm64 (sbsa) lane, and one lane's apt-get update erases the other's cross repo lists"
 },
 {
  "id": "cuda-stack.installer-refreshes-apt-lists",
  "target": "linux/scripts/01-core/install-cuda-stack.sh",
  "find": "apt-get update -qq\napt-get install -y --no-install-recommends \\\n    cuda-toolkit-${CUDA_VERSION_MAJOR_MINOR} \\\n",
  "replace": "apt-get install -y --no-install-recommends \\\n    cuda-toolkit-${CUDA_VERSION_MAJOR_MINOR} \\\n",
  "test": "bash linux/scripts/tests/test-cuda-cross-sbsa.sh",
  "why": "the apt lists sit in a cache mount BuildKit's cache key ignores; a cached repo RUN leaves a fresh mount empty and the install must refresh the lists itself"
 },
 {
  "id": "deepstream.sbsa-missing-file",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "if [ ! -f \"${dir}/${f}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "an unstaged SBSA library must name the staging script, not fall through to a sha256sum of nothing"
 },
 {
  "id": "deepstream.trt-pin-arm64",
  "target": "linux/scripts/05-frameworks/deepstream.sh",
  "find": "[ \"$(ds_arch)\" != arm64 ] || key=\"DEEPSTREAM_TRT_$1_ARM64_SHA256\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the arm64 route must verify the sbsa debs against their own pins, not amd64's"
 },
 {
  "id": "deepstream.elements-by-arch",
  "target": "linux/scripts/05-frameworks/deepstream-verify.sh",
  "find": "[ \"${e}\" = nvv4l2decoder ] && [ \"$(dsv_arch)\" != amd64 ] && continue",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "the SBSA route has no nvv4l2decoder; demanding it would fail every arm64 package"
 },
 {
  "id": "deepstream.chain-route-predicate",
  "target": "linux/scripts/01-core/build-helpers.sh",
  "find": "arm64) [ -f \"${dir}/libnvbufsurface.so.1.0.0\" ] && [ -f \"${dir}/libnvbufsurftransform.so.1.0.0\" ] && [ -f \"${dir}/libnvdsbufferpool.so\" ] && [ -f \"${dir}/libgstnvdsseimeta.so.1.0.0\" ] ;;",
  "replace": "arm64) return 0 ;;",
  "test": "bash linux/scripts/tests/test-deepstream.sh",
  "why": "an arm64 media stage without the staged libraries must get ENABLE_DEEPSTREAM=false, or the build dies hours in"
 },
 {
  "id": "docs-site.hub-docs-lock-version-drift-named",
  "target": "linux/scripts/build-docs.sh",
  "find": "  if [ \"${dynamic}\" = \"${locked}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-build-docs.sh",
  "why": "a theme version the lock records differently reads as a missing setuptools, offline, and has been chased as one"
 },
 {
  "id": "lib.genai-guidance-off",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "    '-DUSE_GUIDANCE=ON'\n",
  "replace": "    '-DUSE_GUIDANCE=OFF'\n",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.GenaiGuidance.Tests.ps1 -ResultFile logs/code-quality/genai-guidance-mutation.json",
  "why": "json_schema answers unsupported on Windows when GenAI builds without llguidance"
 },
 {
  "id": "lib.genai-guidance-marker-dropped",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "foreach ($mark in 'Error creating llg_tokenizer', 'toktrie') {",
  "replace": "foreach ($mark in @()) {",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.GenaiGuidance.Tests.ps1 -ResultFile logs/code-quality/genai-guidance-mutation.json",
  "why": "without the byte check a build that configured guidance but linked none passes on the cross lane, where no smoke runs"
 },
 {
  "id": "lib.genai-guidance-gate-silent",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "if ($genaiGuidance.Count -gt 0) { throw \"GenAI llguidance gate: $($genaiGuidance -join '; ')\" }",
  "replace": "if ($genaiGuidance.Count -gt 0) { Write-Warning \"GenAI llguidance gate: $($genaiGuidance -join '; ')\" }",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.GenaiGuidance.Tests.ps1 -ResultFile logs/code-quality/genai-guidance-mutation.json",
  "why": "a warning inside a green stage is how a missing feature ships"
 },
 {
  "id": "genai-guidance.not-requested",
  "target": "windows/scripts/build/genai-guidance-smoke.py",
  "find": "        params.set_guidance(\"json_schema\", json.dumps(schema))\n",
  "replace": "        pass\n",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.GenaiGuidance.Tests.ps1 -ResultFile logs/code-quality/genai-guidance-mutation.json",
  "why": "a smoke that never asks for the schema would prove nothing about the mask"
 },
 {
  "id": "genai-guidance.schema-unchecked",
  "target": "windows/scripts/build/genai-guidance-smoke.py",
  "find": "    if json.loads(answer) != json.loads(expected):\n",
  "replace": "    if False:\n",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.GenaiGuidance.Tests.ps1 -ResultFile logs/code-quality/genai-guidance-mutation.json",
  "why": "valid JSON that breaks the schema must not print the sentinel"
 },
 {
  "id": "genai-guidance.control-unchecked",
  "target": "windows/scripts/build/genai-guidance-smoke.py",
  "find": "        if control != oracle[\"continuation\"]:\n",
  "replace": "        if False:\n",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.GenaiGuidance.Tests.ps1 -ResultFile logs/code-quality/genai-guidance-mutation.json",
  "why": "if the model already emits the answer, the constrained run proves nothing"
 },
 {
  "id": "provenance.meson-directory-from-record",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "    $directory = Get-MesonSubprojectDirectory -Dll $Dll -SourceDir $SourceDir\n",
  "replace": "    $directory = Join-Path $SourceDir \"subprojects\\\\$(if ($Wrap.ContainsKey($sub)) { $Wrap[$sub].Directory } else { $sub })\"\n",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/provenance.meson-directory-from-record.json",
  "why": "provisioning extracts libffi away from its wrap's directory key, so the wrap's name fails the gate after a full GStreamer build"
 },
 {
  "id": "provenance.defects-reported-together",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "if ($files.Count -eq 0) { $defects.Add(\"$($origin.Key) ($($origin.Directory)) has no license or notice file; $($full) cannot ship without one\"); continue }",
  "replace": "if ($files.Count -eq 0) { throw \"$($origin.Key) has no license or notice file\" }",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/provenance.defects-reported-together.json",
  "why": "each defect reported alone costs a further half-hour build"
 },
 {
  "id": "provenance.libffi-identity-is-the-pin",
  "target": "windows/scripts/build/Build-GstreamerFromSource.ps1",
  "find": "        $libffi.Url = Get-GstLibffiArchiveUrl -Version $libffiVer\n",
  "replace": "",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/provenance.libffi-identity-is-the-pin.json",
  "why": "the manifest would name the release of the bundled wrap, not the pinned port the build ships"
 },
 {
  "id": "provenance.smoke-empty-finding-list",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "-Filter 'nvfatbin*.dll' -File -ErrorAction SilentlyContinue | ForEach-Object Name)",
  "replace": "-Filter 'nvfatbin*.dll' -File -ErrorAction SilentlyContinue).Name",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/smoke-empty-finding-list.json",
  "why": "the healthy empty list throws under strict mode and fails the smoke gate at the end of a chain"
 },
 {
  "id": "provenance.msvc-runtime-recorded",
  "target": "windows/scripts/build/Build-GstreamerFromSource.ps1",
  "find": "    foreach ($entry in @(Get-MsvcRuntimeProvenanceEntry -Root $resolvedInstallDir -NoticeDir $noticeDir -GetVsInstallDir { Get-VisualStudioInstallPath })) { $entries.Add($entry) }\n",
  "replace": "",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/msvc-runtime-provenance.json",
  "why": "the arm64 plugins import the runtime from bin, and the closure gate fails a DLL the manifest omits"
 },
 {
  "id": "provenance.msvc-runtime-needs-text",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "    if ($texts.Count -eq 0) { throw \"no Licenses\\<lcid>\\Redist.txt under $vsDir, so the staged MSVC runtime cannot ship with its notice\" }\n",
  "replace": "",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/msvc-runtime-provenance.json",
  "why": "a runtime with no notice is what the manifest exists to refuse"
 },
 {
  "id": "provenance.bytes-unchecked",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "elseif ((Get-FileHash -LiteralPath $full -Algorithm SHA256).Hash -ine $Entry.sha256) {",
  "replace": "elseif ($false) {",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/native-provenance-mutation.json",
  "why": "a replaced DLL would keep its old license claim"
 },
 {
  "id": "provenance.notice-optional",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "if (@($Entry.notices).Count -eq 0) { $found += \"$name has no notice text\" }",
  "replace": "if ($false) { $found += \"$name has no notice text\" }",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/native-provenance-mutation.json",
  "why": "a DLL with no license text is what the consumer gate rejects"
 },
 {
  "id": "provenance.unsafe-path",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "if (@($Path -split '[\\\\/]') -contains '..') { return 'climbs out of the root' }",
  "replace": "if ($false) { return 'climbs out of the root' }",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/native-provenance-mutation.json",
  "why": "a manifest must not vouch for a file outside its root"
 },
 {
  "id": "provenance.closure-gap-ignored",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "$seen.Keys | Where-Object { $_ -notin $listed } | Sort-Object",
  "replace": "$seen.Keys | Where-Object { $false } | Sort-Object",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/native-provenance-mutation.json",
  "why": "an unlisted imported DLL is the failure CON184 reports"
 },
 {
  "id": "provenance.import-lib-listed",
  "target": "windows/scripts/modules/WindowsNativeProvenance.Common.psm1",
  "find": "if (\"$installed\" -imatch '\\.dll$') {",
  "replace": "if ($true) {",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Native.Provenance.Tests.ps1 -ResultFile logs/code-quality/native-provenance-mutation.json",
  "why": "an import library is not a shipped runtime DLL"
 },
 {
  "id": "dml-matmul.wrong-passes",
  "target": "windows/scripts/modules/WindowsOrtDmlCheck.Common.psm1",
  "find": "return & $verdict 'Wrong' \"DirectML returned",
  "replace": "return & $verdict 'Pass' \"DirectML returned",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.DmlMatMul.Tests.ps1 -ResultFile logs/code-quality/dml-matmul-mutation.json",
  "why": "the wrong answer is the whole point of this gate"
 },
 {
  "id": "dml-matmul.crash-passes",
  "target": "windows/scripts/modules/WindowsOrtDmlCheck.Common.psm1",
  "find": "if ($ExitCode -ne 0) { return & $verdict 'ProbeFailed'",
  "replace": "if ($false) { return & $verdict 'ProbeFailed'",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.DmlMatMul.Tests.ps1 -ResultFile logs/code-quality/dml-matmul-mutation.json",
  "why": "a crashed probe must not read as a result"
 },
 {
  "id": "dml-matmul.control-unchecked",
  "target": "windows/scripts/modules/WindowsOrtDmlCheck.Common.psm1",
  "find": "return & $verdict 'ProbeFailed' \"the CPU control returned",
  "replace": "return & $verdict 'NoAdapter' \"the CPU control returned",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Ort.DmlMatMul.Tests.ps1 -ResultFile logs/code-quality/dml-matmul-mutation.json",
  "why": "a broken control would turn the gate into a skip"
 },
 {
  "id": "lib.genai-guidance-outputs-kept",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "-Filter 'llguidance*' -File | Remove-Item -Force",
  "replace": "-Filter 'llguidance*' -File | Out-Null",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.GenaiGuidance.Tests.ps1 -ResultFile logs/code-quality/genai-guidance-mutation.json",
  "why": "the install would ship 38 MB of Corrosion outputs nothing imports, and the gate would then fail the stage"
 },
 {
  "id": "sdist-compiler.msvc-build-passes",
  "target": "windows/scripts/modules/WindowsSdistCompiler.Common.psm1",
  "find": "if ($msvc.Count) { throw",
  "replace": "if ($false) { throw",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only TorchApp.SdistCompiler.Tests.ps1 -ResultFile logs/code-quality/sdist-compiler-mutation.json",
  "why": "an MSVC-linked sdist is the failure this gate exists for"
 },
 {
  "id": "sdist-compiler.lib-unset",
  "target": "windows/scripts/modules/WindowsSdistCompiler.Common.psm1",
  "find": "LIB = $VsLib; ",
  "replace": "",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only TorchApp.SdistCompiler.Tests.ps1 -ResultFile logs/code-quality/sdist-compiler-mutation.json",
  "why": "lld-link finds an explicit system library only through LIB"
 },
 {
  "id": "sdist-compiler.gate-skipped",
  "target": "windows/scripts/modules/WindowsSdistCompiler.Common.psm1",
  "find": "if ($SitePackages) { Assert-ClangClSdistBuild",
  "replace": "if ($false) { Assert-ClangClSdistBuild",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only TorchApp.SdistCompiler.Tests.ps1 -ResultFile logs/code-quality/sdist-compiler-mutation.json",
  "why": "a lane that grades nothing cannot notice a bypassed shim"
 },
 {
  "id": "sdist-compiler.lane-packaging-unshimmed",
  "target": "windows/scripts/python/Invoke-CiPackaging.ps1",
  "find": "Invoke-WithClangClSdist -LogInfo $script:UvLogInfo -Script {",
  "replace": "& {",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only TorchApp.SdistCompiler.Tests.ps1 -ResultFile logs/code-quality/sdist-compiler-mutation.json",
  "why": "the free-threaded build would fall back to the VS compiler"
 },
 {
  "id": "sdist-compiler.lane-ci-unshimmed",
  "target": "windows/scripts/python/Invoke-PythonCiBuild.ps1",
  "find": "Invoke-WithClangClSdist -BuiltOutput $syncOut -SitePackages (Join-Path $envPath 'Lib\\site-packages') -LogInfo $script:UvLogInfo -Script {",
  "replace": "& {",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only TorchApp.SdistCompiler.Tests.ps1 -ResultFile logs/code-quality/sdist-compiler-mutation.json",
  "why": "a test leg would build sdists with the VS compiler"
 },
 {
  "id": "variant-chain.failed-push-ignored",
  "target": "windows/scripts/modules/WindowsBkVariantChain.Common.psm1",
  "find": "@($Push | Where-Object { $_.Process.HasExited -and $_.Process.ExitCode -ne 0 } |",
  "replace": "@($Push | Where-Object { $false } |",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Driver.VariantChain.Tests.ps1 -ResultFile logs/code-quality/variant-chain-mutation.json",
  "why": "a failed upload must fail the run"
 },
 {
  "id": "variant-chain.rocm-off-amd64",
  "target": "windows/scripts/modules/WindowsBkVariantChain.Common.psm1",
  "find": "if ($TargetArch -ne 'amd64' -and $Variant -contains 'rocm') { throw",
  "replace": "if ($false) { throw",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Driver.VariantChain.Tests.ps1 -ResultFile logs/code-quality/variant-chain-mutation.json",
  "why": "rocm is amd64-only, and must be refused before any variant builds"
 },
 {
  "id": "variant-chain.bad-chain-id",
  "target": "windows/scripts/modules/WindowsBkVariantChain.Common.psm1",
  "find": "if ($Request.ChainId -notmatch '^\\d{8}-\\d{6}$') { throw",
  "replace": "if ($false) { throw",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Driver.VariantChain.Tests.ps1 -ResultFile logs/code-quality/variant-chain-mutation.json",
  "why": "the id names the logs a push child joins"
 },
 {
  "id": "provenance.onnxinference-exit-ignored",
  "target": "windows/scripts/modules/WindowsGstPlugins.Common.psm1",
  "find": "    if ($run.ExitCode -ne 0) {",
  "replace": "    if ($false) {",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Gst.OnnxInferenceRun.Tests.ps1 -ResultFile logs/code-quality/gst-onnxinference-mutation.json",
  "why": "a pipeline that fails must not read as a passed inference"
 },
 {
  "id": "lib.gst-onnx-diagnosis-orc-off",
  "target": "windows/scripts/modules/WindowsGstPlugins.Common.psm1",
  "find": "Environment = @{ ORC_CODE = 'backup' }",
  "replace": "Environment = @{ ORC_CODE = 'jit' }",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Gst.OnnxInferenceRun.Tests.ps1 -ResultFile logs/code-quality/gst-onnxinference-mutation.json",
  "why": "the ORC probe would run with the JIT on and say nothing about ORC"
 },
 {
  "id": "lib.gst-onnx-probe-restores-env",
  "target": "windows/scripts/modules/WindowsGstPlugins.Common.psm1",
  "find": "    return Invoke-WithProcessEnvironment -Environment $Environment -ScriptBlock $launch",
  "replace": "    foreach ($n in @($Environment.Keys)) { Set-Item -LiteralPath \"Env:$n\" -Value $Environment[$n] }; return & $launch",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Gst.OnnxInferenceRun.Tests.ps1 -ResultFile logs/code-quality/gst-onnxinference-mutation.json",
  "why": "a probe's ORC_CODE or GST_DEBUG would leak into every later gate step"
 },
 {
  "id": "boot.genai-model-named-for-wheel-smoke",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    '  export ORCHESTRANT_SMOKE_GENAI_MODEL=\"$d/tiny-genai\"' \\\n",
  "replace": "    '  ORCHESTRANT_SMOKE_GENAI_MODEL=\"$d/tiny-genai\"' \\\n",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "an unexported name never reaches orchestrant.smoke, whose GenAI check then only warns and the amd64 floor goes red"
 },
 {
  "id": "lib.sccache-evict-reads-whole-list",
  "target": "linux/sccache-s3/sccache-s3-evict",
  "find": "  free > 0 { print \"rm",
  "replace": "  { if (free <= 0) exit; print \"rm",
  "test": "bash linux/scripts/tests/test-sccache-evict.sh",
  "why": "an awk that leaves early kills sort with SIGPIPE, pipefail ends the script before any delete, and the bucket grows past its cap on a disk shared with Nextcloud"
 },
 {
  "id": "lib.sccache-evict-waits-for-resync",
  "target": "linux/sccache-s3/sccache-s3-evict",
  "find": "[ \"$QUEUE\" -gt 1000 ] && SHORT=0",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-sccache-evict.sh",
  "why": "space a resync is still freeing would be deleted for again on every run, emptying the cache for a shortfall that is already solved"
 },
 {
  "id": "lib.sccache-evict-keeps-floor",
  "target": "linux/sccache-s3/sccache-s3-evict",
  "find": "[ \"$DISK_TARGET\" -lt \"$FLOOR\" ] && DISK_TARGET=$FLOOR",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-sccache-evict.sh",
  "why": "a disk filled by something else would delete the whole cache without freeing enough to matter"
 },
 {
  "id": "lib.sccache-evict-shrinks-for-disk",
  "target": "linux/sccache-s3/sccache-s3-evict",
  "find": "[ \"$DISK_TARGET\" -lt \"$TARGET\" ] && TARGET=$DISK_TARGET",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-sccache-evict.sh",
  "why": "under the cap with little free space the bucket would keep its size while the shared disk fills"
 },
 {
  "id": "host.trt-url-tensorrt11-scheme",
  "target": "windows/scripts/host/Install-Tensorrt.ps1",
  "find": "zip/TensorRT-Enterprise-$Version-Windows-amd64-cuda-$Cuda-Release-external.zip",
  "replace": "tensorrt-$Version.Windows10.x86_64.cuda-$Cuda.zip",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Host.TensorRtAcquisition.Tests.ps1 -ResultFile logs/code-quality/trt-acquisition-mutation.json",
  "why": "the pre-11 file names 404 on every run, so the lane never had TensorRT"
 },
 {
  "id": "host.trt-missing-throws",
  "target": "windows/scripts/host/Install-Tensorrt.ps1",
  "find": "        throw \"TensorRT $Version could not be downloaded",
  "replace": "        return $null\n        throw \"TensorRT $Version could not be downloaded",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Host.TensorRtAcquisition.Tests.ps1 -ResultFile logs/code-quality/trt-acquisition-mutation.json",
  "why": "a failed download that returns quietly ships a CUDA-only nvidia image"
 },
 {
  "id": "smoke.trt-required-expect-gpu",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "-Condition { $script:tensorRtStaged } -FailMessage 'caller passed -ExpectGpu but TENSORRT_ROOT is empty",
  "replace": "-Condition { $true } -FailMessage 'caller passed -ExpectGpu but TENSORRT_ROOT is empty",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Host.TensorRtAcquisition.Tests.ps1 -ResultFile logs/code-quality/trt-acquisition-mutation.json",
  "why": "the smoke gate must reject an nvidia image that lost TensorRT"
 },
 {
  "id": "lib.ort-cuda-launcher-no-exemption",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "        Write-Host 'NVIDIA GPU detected: enabling the CUDA plugin EP + cuDNN'\n",
  "replace": "        Write-Host 'NVIDIA GPU detected: enabling the CUDA plugin EP + cuDNN'\n        $gpuArgs += '-DCMAKE_PROJECT_onnxruntime_INCLUDE=C:/x/sccache-ptx-exempt.cmake'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtCudaLauncher.Tests.ps1 -ResultFile logs/code-quality/ort-cuda-launcher-mutation.json",
  "why": "a per-target exemption puts ORT's LLM kernels back on bare nvcc, the one uncached CUDA compile"
 },
 {
  "id": "sccache.ptx-only-pass-runs-uncached",
  "target": "shared/upstream/sccache/patches/0001-ptxas-ptx-verify-noncacheable.patch",
  "find": "+                    Cacheable::No\n",
  "replace": "+                    Cacheable::Yes\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtCudaLauncher.Tests.ps1 -ResultFile logs/code-quality/ort-cuda-launcher-mutation.json",
  "why": "without the fix a PTX-only gencode aborts nvcc under sccache with Missing cubin file output"
 },
 {
  "id": "msvc-notice.gate-requires-notice",
  "target": "windows/scripts/modules/WindowsMsvcRuntimeNotice.Common.psm1",
  "find": "    if ($notices.Count -ne 1) { throw",
  "replace": "    if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msvc.RuntimeNotice.Tests.ps1 -ResultFile logs/code-quality/msvc-notice-mutation.json",
  "why": "a package that carries the MSVC runtime without its notice breaks the redistribution terms"
 },
 {
  "id": "msvc-notice.staged-with-runtime",
  "target": "windows/scripts/modules/WindowsMsvcRuntimeNotice.Common.psm1",
  "find": "    if ($dlls.Count -eq 0) { return $null }\n",
  "replace": "    return $null\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msvc.RuntimeNotice.Tests.ps1 -ResultFile logs/code-quality/msvc-notice-mutation.json",
  "why": "a bundle that carries the runtime must get Redist.txt and the end-user notice"
 },
 {
  "id": "msvc-notice.portable-bundle-gate",
  "target": "windows/scripts/modules/WindowsCrossBundle.Common.psm1",
  "find": "{ & $PackageCheck $installer.FullName $redist | Out-Host }",
  "replace": "{ }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msvc.RuntimeNotice.Tests.ps1 -ResultFile logs/code-quality/msvc-notice-mutation.json",
  "why": "a CPack MSI or ZIP must be checked for the notice before it is copied out"
 },
 {
  "id": "cmake-msvc-notice.installs-redist",
  "target": "cmake/CPackCommon.cmake",
  "find": "  install(FILES \"${_text}\" DESTINATION licenses/msvc-runtime)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cmake-windows-arch.sh",
  "why": "a CPack package that installs the MSVC runtime must install its Redist.txt"
 },
 {
  "id": "onnx-ep-tensorrt.declared-name-lowercased",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "GIT_TAG[[:space:]]+\"?([^[:space:]\")]+).*/\\L\\1\\E \\2 \\3/p'",
  "replace": "GIT_TAG[[:space:]]+\"?([^[:space:]\")]+).*/\\L\\1 \\2 \\3/p'",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "lower-casing past the name turns GSL.git into gsl.git and the seed gate refuses a correct pin (the second in-image run)"
 },
 {
  "id": "onnx-ep-tensorrt.tensorrt-major-required",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "  [ -n \"${major}\" ] || { printf 'ERROR: TENSORRT_VERSION is not set; the plugin needs its major for the library names\\n' >&2; return 1; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "without the major the shim links libnvinfer.so. and the configure fails later with a worse message"
 },
 {
  "id": "onnx-ep-tensorrt.verify-needs-tensorrt-link",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "  readelf -d -W \"$1\" 2>/dev/null | grep -E \"NEEDED.*\\[libnvinfer\\.so\\.${major:-[0-9]+}\\]\" >/dev/null \\\n    || { printf 'ERROR: %s does not link libnvinfer.so.%s\\n' \"$1\" \"${major:-N}\" >&2; rc=1; }\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "a module that does not link TensorRT is not the TensorRT EP, whatever it exports"
 },
 {
  "id": "onnx-ep-tensorrt.skip-leaves-placeholder",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "    plugin_ep_skip \"${TRTEP_OUTPUT_DIR}\" \"Skipping the TensorRT plugin EP",
  "replace": "    echo \"Skipping the TensorRT plugin EP",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "without the empty tree the media merge's COPY --from=onnxruntime fails on every chain that does not build the plugin"
 },
 {
  "id": "onnx-ep-tensorrt.cuda-ep-is-plugin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native-nvidia.sh",
  "find": "  --cmake_extra_defines onnxruntime_BUILD_CUDA_EP_AS_PLUGIN=ON\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "without the define ORT builds the legacy CUDA EP under the same file name, and only the exports gate downstream would notice"
 },
 {
  "id": "onnx-ep-tensorrt.cuda-plugin-exports-asserted",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native-nvidia.sh",
  "find": "  [ \"${syms}\" = \"CreateEpFactories ReleaseEpFactory \" ] || err",
  "replace": "  [ -n \"${syms}\" ] || err",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "a legacy module exports GetProvider and would pass a presence check; the build must read the entry points"
 },
 {
  "id": "onnx-ep-tensorrt.gpu-prefix-refuses-in-tree-provider",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "    refuse_in_tree_provider \"${PREFIX}\" 'libonnxruntime_providers_tensorrt.so*' /usr/local/lib/onnxruntime-ep-tensorrt\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "an in-tree TensorRT EP beside the plugin is a second TensorRT EP the census and consumers would find"
 },
 {
  "id": "onnx-ep-tensorrt.verify-stage-fatal-on-nvidia",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "    if [ \"${ENABLE_NVIDIA:-false}\" != \"true\" ] || [ \"${ENABLE_TENSORRT:-true}\" = \"false\" ]; then\n      echo \"SKIP [${STAGE}]: no plugin TensorRT EP",
  "replace": "    if true; then\n      echo \"SKIP [${STAGE}]: no plugin TensorRT EP",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "an nvidia image with TensorRT and no plugin must fail its verify stage, hours before the runtime gate"
 },
 {
  "id": "onnx-ep-tensorrt.merge-copy-present",
  "target": "linux/Dockerfile.media",
  "find": "COPY --link --from=onnxruntime /usr/local/lib/onnxruntime-ep-tensorrt /usr/local/lib/onnxruntime-ep-tensorrt\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "the plugin is built and verified in the onnxruntime branch; only this COPY carries it into the merged media image"
 },
 {
  "id": "onnx-ep-tensorrt.plugin-call-present",
  "target": "linux/Dockerfile.media",
  "find": "    bash /opt/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh build; bash /opt/scripts/03-media/runtime/verify-media-artifacts.sh onnxruntime-ep-tensorrt; \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "without the call no chain builds the plugin, and only the nvidia runtime gate would notice, hours in"
 },
 {
  "id": "onnx-ep-tensorrt.census-contract-entry",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": " \\\n    'tensorrt-ep|libonnxruntime_ep_tensorrt.so|/usr/local/lib/onnxruntime-ep-tensorrt/ort-provenance/tensorrt-ep.json'\n",
  "replace": "\n",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "the plugin imports the chain ORT; without its contract entry the image census reports it UNREGISTERED"
 },
 {
  "id": "gpu-runtime.cuda-plugin-exports-read",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "  if [ \"$(_gpur \"${probe}\" CUDAEP_EXPORTS)\" = 2 ] && [ \"$(_gpur \"${probe}\" CUDAEP_BRIDGE)\" = 0 ]; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "the legacy CUDA EP carries the plugin's file name; only its exports tell the published :latest-nvidia from the plugin build"
 },
 {
  "id": "gpu-runtime.cuda-plugin-wheel-registers",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "  if [ \"$(_gpur \"${probe}\" ORTBUILD)\" = \"cuda-plugin-ep=1\" ]; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "a wheel built without the plugin registers nothing on import; Python consumers would find no CUDA EP"
 },
 {
  "id": "gpu-runtime.no-in-tree-provider",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "  while IFS= read -r f; do [ -z \"${f}\" ] || echo \"BAD an in-tree ORT provider ships: ${f} (the TensorRT and MIGraphX EPs are plugins)\"; done <<< \"$(_gpur \"${probe}\" ORTINTREE)\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "a shipped in-tree TensorRT or MIGraphX EP is a second EP the plugin move removed"
 },
 {
  "id": "gpu-runtime.trt-plugin-absent-without-tensorrt",
  "target": "linux/scripts/06-packaging/check-gpu-runtime.sh",
  "find": "    case \"$(_gpur \"${probe}\" TRTEP_SO)\" in \"\"|\"<absent>\") ;; *) echo \"BAD a plugin TensorRT EP ships without TensorRT: $(_gpur \"${probe}\" TRTEP_SO)\" ;; esac\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gpu-runtime-check.sh",
  "why": "a plugin that needs libnvinfer.so.11 in an image without it fails at the consumer's registration call"
 },
 {
  "id": "onnx-ep-amdgpu.exports-grep-reads-whole-table",
  "target": "linux/scripts/03-media/build/onnxruntime/build/plugin-ep-exports.sh",
  "find": "  readelf --dyn-syms -W \"$1\" 2>/dev/null | grep -E \" $2(@@[A-Za-z0-9_.]+)?$\" >/dev/null\n",
  "replace": "  readelf --dyn-syms -W \"$1\" 2>/dev/null | grep -qE \" $2(@@[A-Za-z0-9_.]+)?$\"\n",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "grep -q closes the pipe at the first match; readelf dies of SIGPIPE and pipefail fails the 4000-symbol TensorRT plugin (the third in-image run)"
 },
 {
  "id": "onnx-ep-tensorrt.verify-stage-reads-exports",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "    if plugin_ep_module_has_export \"${so}\" \"${sym}\"; then pass_check \"${label} exports ${sym}\"\n",
  "replace": "    if true; then pass_check \"${label} exports ${sym}\"\n",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "the verify stage must read the module's entry points through the shared probe; a pass without reading would wave the legacy CUDA EP through"
 },
 {
  "id": "provenance.plugin-ep-module-is-a-consumer",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": "  case \"${1,,}\" in *onnxruntime[-_.]genai* | *onnxruntime[-_.]extensions* | *onnxruntime[-_.]ep[-_.]*) return 0 ;; esac\n",
  "replace": "  case \"${1,,}\" in *onnxruntime[-_.]genai* | *onnxruntime[-_.]extensions*) return 0 ;; esac\n",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "libonnxruntime_ep_tensorrt.so is a plugin that imports ORT; read as 'an ORT binary the chain does not build' it fails its own G2 (the third in-image run)"
 },
 {
  "id": "provenance.plugin-ep-csharp-package-is-a-consumer",
  "target": "linux/scripts/03-media/ort-provenance.sh",
  "find": " ! -iname 'microsoft.ml.onnxruntime.ep.*' \\) \\) -printf 'D\\t%p\\n' \\) \\\n",
  "replace": " \\) \\) -printf 'D\\t%p\\n' \\) \\\n",
  "test": "bash linux/scripts/tests/test-ort-provenance-build.sh",
  "why": "the plugin's own csharp/Microsoft.ML.OnnxRuntime.EP.TensorRT dir is not fetched ORT content"
 },
 {
  "id": "packaging.plugin-module-is-the-image-copy",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  cmp -s \"$1\" \"${ort_image}\" && return 0\n",
  "replace": "  return 0\n",
  "test": "bash linux/scripts/tests/test-ort-host-runtime.sh",
  "why": "no wheel carries the plugin MIGraphX EP; without the byte comparison a bundle could ship any module under its name"
 },
 {
  "id": "packaging.plugin-core-import-stays-in-bundle",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "    migraphx:libonnxruntime.so.1) printf 'system\\n' ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-host-runtime.sh",
  "why": "the plugin links the bundled chain ORT; read as a host import it would be listed as a requirement, or fail closed"
 },
 {
  "id": "packaging.python-bundle-copies-plugin",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "  cp -L \"${plugin_module}\" \"$(ort_python_provider_file \"${site_packages}/onnxruntime/capi\" migraphx)\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-app-bundle-license.sh",
  "why": "an AMD bundle without the plugin module has no GPU EP at all; the self-test and the package proof must see it beside the core"
 },
 {
  "id": "packaging.selftest-registered-plugin-required",
  "target": "linux/scripts/06-packaging/python-app-selftest.py",
  "find": "    if not name or name in registered:\n        return \"\"\n",
  "replace": "    return \"\"\n",
  "test": "bash linux/scripts/tests/test-python-app-selftest.sh",
  "why": "a plugin EP is never in onnxruntime's available list; registration is the only fact the self-test can prove"
 },
 {
  "id": "packaging.selftest-deviceless-bundle-module",
  "target": "linux/scripts/06-packaging/python-app-selftest.py",
  "find": "deviceless_error in error and root.rstrip(\"/\") + \"/\" in error",
  "replace": "deviceless_error in error",
  "test": "bash linux/scripts/tests/test-python-app-selftest.sh",
  "why": "inside the ROCm image the image's module reaching HIP proves nothing about the bundle's copy"
 },
 {
  "id": "packaging.selftest-deviceless-reason",
  "target": "linux/scripts/06-packaging/python-app-selftest.py",
  "find": "if deviceless_error and root and deviceless_error in error and ",
  "replace": "if deviceless_error and root and ",
  "test": "bash linux/scripts/tests/test-python-app-selftest.sh",
  "why": "an undefined symbol or a missing file is a broken module, not a missing GPU"
 },
 {
  "id": "packaging.selftest-deviceless-root",
  "target": "linux/scripts/06-packaging/python-app-selftest.py",
  "find": "if deviceless_error and root and ",
  "replace": "if deviceless_error and ",
  "test": "bash linux/scripts/tests/test-python-app-selftest.sh",
  "why": "without --root any module path would pass as the bundle's"
 },
 {
  "id": "packaging.deviceless-only-without-device",
  "target": "linux/scripts/06-packaging/python-app-cli.sh",
  "find": "  if [ \"${1:-}\" != MIGraphX ] || [ -c \"${2:-/dev/kfd}\" ]; then return 0; fi\n",
  "replace": "  if [ \"${1:-}\" != MIGraphX ]; then return 0; fi\n",
  "test": "bash linux/scripts/tests/test-python-app-cli.sh",
  "why": "a host with the GPU must still register the EP; the stand-in is for hosts without one"
 },
 {
  "id": "packaging.selftest-deviceless-args-passed",
  "target": "linux/scripts/06-packaging/python-app-cli.sh",
  "find": "    while IFS= read -r line; do args+=(\"${line}\"); done < <(python_app_deviceless_args \"${provider}\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-app-cli.sh",
  "why": "without the flag a hosted AMD build fails at a registration no runner without a GPU can make"
 },
 {
  "id": "packaging.selftest-bundle-amd-module",
  "target": "linux/scripts/06-packaging/python-app-cli.sh",
  "find": "  (unset ORT_AMDGPU_EP_ROOT; python3 \"${selftest}\" \"${args[@]}\" -- \"$@\")\n",
  "replace": "  (python3 \"${selftest}\" \"${args[@]}\" -- \"$@\")\n",
  "test": "bash linux/scripts/tests/test-python-app-cli.sh",
  "why": "inside the ROCm image the variable names the image's module, so the self-test would prove that one instead"
 },
 {
  "id": "packaging.selftest-plugin-root-cleared",
  "target": "linux/scripts/06-packaging/python-app-selftest.py",
  "find": ", env={**os.environ, \"ORT_AMDGPU_EP_ROOT\": \"\"})\n",
  "replace": ")\n",
  "test": "bash linux/scripts/tests/test-python-app-selftest.sh",
  "why": "the rocm image sets ORT_AMDGPU_EP_ROOT, so an inherited value makes every package check register the image's module"
 },
 {
  "id": "packaging.provider-requirement-flag",
  "target": "linux/scripts/06-packaging/python-app-cli.sh",
  "find": "  case \"$1\" in MIGraphX) printf -- '--require-registered-plugin' ;; *) printf -- '--require-available-provider' ;; esac\n",
  "replace": "  printf -- '--require-available-provider'\n",
  "test": "bash linux/scripts/tests/test-python-app-package-licenses.sh",
  "why": "requiring the plugin EP as 'available' fails every AMD package: ORT's compile-time list never names it"
 },
 {
  "id": "packaging.gpu-package-plugin-proof",
  "target": "linux/scripts/06-packaging/verify-python-gpu-package.py",
  "find": "        prove_plugin(capi)\n",
  "replace": "",
  "test": "python3 -m unittest linux/scripts/tests/test-python-gpu-package.py",
  "why": "the wheel proof skips the plugin module; without its own proof a finished package could carry any bytes under its name"
 },
 {
  "id": "packaging.appimage-plugin-proof",
  "target": "linux/scripts/06-packaging/verify-ort-appimage-payload.sh",
  "find": "  [ \"$kind\" != migraphx ] || ort_assert_plugin_module \"${lib}/${ORT_AMDGPU_EP_MODULE}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-appimage-payload.sh",
  "why": "the collector's libonnxruntime* glob never reaches the plugin; the image copy is its only proof"
 },
 {
  "id": "onnx-ep-tensorrt.in-tree-refusal-reads-the-prefix",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "  if find \"$1/lib\" -maxdepth 1 -name \"$2\" -print -quit 2>/dev/null | grep -q .; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "the shared refusal must look at the prefix; a helper that never finds anything lets an in-tree provider ship beside its plugin"
 },
 {
  "id": "packaging.plugin-module-not-a-host-sdk-library",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  [ \"${ort_name}\" != \"${ORT_AMDGPU_EP_MODULE}\" ] || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-host-runtime.sh",
  "why": "libmigraphx-ep.so matches the MIGraphX SDK glob by name; refusing it as a host library fails every AMD bundle and AppImage (the first in-image run)"
 },
 {
  "id": "onnx-ep-tensorrt.verify-stage-refuses-legacy-bridge",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "  if plugin_ep_module_has_export \"$1\" GetProvider; then fail_check \"$2 exports the legacy GetProvider bridge: the in-tree EP, not the plugin\"\n",
  "replace": "  if false; then fail_check \"$2 exports the legacy GetProvider bridge: the in-tree EP, not the plugin\"\n",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "ORT 1.31.1's in-tree CUDA module exports CreateEpFactories and ReleaseEpFactory as well; a stage that reads only those waves the legacy EP through"
 },
 {
  "id": "onnx-ep-tensorrt.cross-target-tensorrt-root",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "  TENSORRT_HOME=\"${CUDA_CROSS_TENSORRT_HOME}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "a cross build that keeps the host's TENSORRT_HOME links the host's x86_64 libnvinfer into an arm64 module"
 },
 {
  "id": "lib.arm64-export-shared-module",
  "target": "windows/scripts/build/Export-Arm64Bundle.ps1",
  "find": "'WindowsScripts.Shared.psm1', 'WindowsArm64Acceptance.Common.psm1', ",
  "replace": "'WindowsArm64Acceptance.Common.psm1', ",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.ExportArm64Modules.Tests.ps1 -ResultFile logs/code-quality/export-arm64-mutation.json",
  "why": "the device gate cannot import its GStreamer probes when their required shared sibling is omitted"
 },
 {
  "id": "lib.arm64-export-ort-core",
  "target": "windows/scripts/build/Export-Arm64Bundle.ps1",
  "find": "$files = @(Copy-ChainOrtBeside -OnnxRoot $chain -Destination (Join-Path $StageRoot 'bin'))",
  "replace": "$files = @()",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.ExportArm64Runtime.Tests.ps1 -ResultFile logs/code-quality/export-arm64-ort-mutation.json",
  "why": "a client host loads its older System32 ORT when the export omits the chain DLL beside gst-launch"
 },
 {
  "id": "lib.arm64-export-ort-duplicate",
  "target": "windows/scripts/build/Export-Arm64Bundle.ps1",
  "find": "if (Test-Path -LiteralPath (Join-Path $BundleRoot $relative)) {",
  "replace": "if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.ExportArm64Runtime.Tests.ps1 -ResultFile logs/code-quality/export-arm64-ort-mutation.json",
  "why": "two archive members with the same runtime DLL path leave extraction precedence ambiguous"
 },
 {
  "id": "lib.arm64-acceptance-digest",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($Digest -cnotmatch '\\Asha256:[0-9a-f]{64}\\z')",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "malformed candidate input must fail before a pull"
 },
 {
  "id": "lib.arm64-acceptance-platform",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($Metadata.Os -cne 'windows' -or $Metadata.Architecture -cne 'amd64')",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "the cross payload runs in a Windows amd64 container, not a native arm64 container"
 },
 {
  "id": "lib.arm64-acceptance-config",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($Metadata.Id -cnotmatch '\\Asha256:[0-9a-f]{64}\\z')",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "an export receipt must name a real image config digest"
 },
 {
  "id": "lib.arm64-acceptance-repository",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($digests.Count -ne 1)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "ambiguous pulled repository digests cannot prove one exported image"
 },
 {
  "id": "lib.arm64-acceptance-candidate",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($Image.Contains('@') -and $Image -cne $digests[0])",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "the pulled image must match the requested immutable candidate"
 },
 {
  "id": "lib.arm64-acceptance-revision",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($revision -cnotmatch '\\A[0-9a-f]{7,40}\\z')",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "an image without a source revision cannot supply the required provenance"
 },
 {
  "id": "lib.arm64-acceptance-ci",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($receipt.SchemaVersion -ne 1 -or $receipt.HubCommit -cne $HubCommit -or $receipt.RunId -cne $RunId -or $receipt.RunAttempt -cne $RunAttempt)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "another CI source, run or attempt must not accept this bundle"
 },
 {
  "id": "lib.arm64-acceptance-image",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($receipt.RequestedImage -cne $Image -or ($Image.Contains('@') -and $receipt.Image -cne $Image))",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "the device job must grade the image selected by its export job"
 },
 {
  "id": "lib.arm64-acceptance-zip",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($receipt.BundleSha256 -cne $hash)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "changed ZIP bytes must fail before device execution"
 },
 {
  "id": "lib.arm64-acceptance-status",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "if ($code -ne 0) { throw \"the ARM64 bundle gate exited $code\" }",
  "replace": "if ($false) { throw \"the ARM64 bundle gate exited $code\" }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "a nonzero device status must keep the enclosing CI step red"
 },
 {
  "id": "lib.arm64-acceptance-verdict",
  "target": "windows/scripts/modules/WindowsArm64Acceptance.Common.psm1",
  "find": "Passed = ($code -eq 0)",
  "replace": "Passed = $true",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64Acceptance.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-mutation.json",
  "why": "a failed or throwing device gate must never emit a passed receipt"
 },
 {
  "id": "lib.arm64-acceptance-workflow-image",
  "target": ".github/workflows/windows-arm64.yml",
  "find": "          checkout: 'false'\n          submodules: 'false'\n          image-arm64: ${{ steps.image.outputs.ref }}",
  "replace": "          checkout: 'false'\n          submodules: 'false'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64AcceptanceWiring.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-wiring-mutation.json",
  "why": "the pull and export actions must consume the same selected candidate image"
 },
 {
  "id": "lib.arm64-acceptance-workflow-gate",
  "target": ".github/workflows/windows-arm64.yml",
  "find": "-Gate { & ./Test-Arm64Bundle.ps1 -ZipPath ./bundle.zip }",
  "replace": "-Gate { }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.Arm64AcceptanceWiring.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-wiring-mutation.json",
  "why": "an empty callback must not replace the actual device gate and its default assertion floor"
 },
 {
  "id": "lib.arm64-acceptance-export",
  "target": "windows/scripts/build/Export-Arm64Bundle.ps1",
  "find": "'WindowsArm64Acceptance.Common.psm1', ",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.ExportArm64Modules.Tests.ps1 -ResultFile logs/code-quality/arm64-acceptance-export-mutation.json",
  "why": "the device job must receive the receipt checker beside its exported gate"
 },
 {
  "id": "probe.app-venv-plugin-amd-call",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "    verify_ort_plugin_library ORT_AMDGPU_EP_ROOT libmigraphx-ep.so || return $?\n",
  "replace": "    :\n",
  "test": "LC_ALL=C bash linux/scripts/tests/test-app-venv-plugin-eps.sh",
  "why": "the AMD wrapper must fail when its selected plugin is absent even though the chain ORT wheel is CPU-only"
 },
 {
  "id": "probe.app-venv-plugin-tensorrt-call",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "      verify_ort_plugin_library ORT_TENSORRT_EP_ROOT libonnxruntime_ep_tensorrt.so || return $?\n",
  "replace": "      :\n",
  "test": "LC_ALL=C bash linux/scripts/tests/test-app-venv-plugin-eps.sh",
  "why": "TensorRT-enabled NVIDIA wrappers must require the separate plugin rather than an in-tree provider"
 },
 {
  "id": "probe.app-venv-plugin-create-export",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "for export in (\"CreateEpFactories\", \"ReleaseEpFactory\"):\n",
  "replace": "for export in (\"ReleaseEpFactory\",):\n",
  "test": "LC_ALL=C bash linux/scripts/tests/test-app-venv-plugin-eps.sh",
  "why": "native loading alone cannot prove the factory-creation export exists"
 },
 {
  "id": "probe.app-venv-plugin-release-export",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "for export in (\"CreateEpFactories\", \"ReleaseEpFactory\"):\n",
  "replace": "for export in (\"CreateEpFactories\",):\n",
  "test": "LC_ALL=C bash linux/scripts/tests/test-app-venv-plugin-eps.sh",
  "why": "a module without the factory-release export is not a complete plugin"
 },
 {
  "id": "probe.app-venv-plugin-selected-module",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "library = ctypes.CDLL(str(path))\n",
  "replace": "library = ctypes.CDLL(str(path.with_name(\"libmigraphx-ep.so\")))\n",
  "test": "LC_ALL=C bash linux/scripts/tests/test-app-venv-plugin-eps.sh",
  "why": "the build must load the exact selected module, never a successful neighboring plugin as a fallback"
 },
 {
  "id": "probe.app-venv-plugin-cpu-core",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "assert 'CPUExecutionProvider' in providers, 'ERROR: the chain CPU ONNX Runtime has no CPUExecutionProvider!'",
  "replace": "print('CPU ORT check removed')",
  "test": "LC_ALL=C bash linux/scripts/tests/test-app-venv-plugin-eps.sh",
  "why": "the AMD wrapper must still import and verify the chain CPU ORT alongside its separate GPU plugin"
 },
 {
  "id": "lib.wheelhouse-receipt-locale",
  "target": "linux/scripts/tests/wheelhouse_manifest_tests.py",
  "find": "                        LC_ALL=\"C.UTF-8\",",
  "replace": "                        LC_ALL=os.environ[\"LC_ALL\"],",
  "test": "bash linux/scripts/tests/test-wheelhouse-manifest.sh",
  "why": "raw diagnostic receipts must remain identical under C and UTF-8 parent locales without normalizing the recorded bytes"
 },
 {
  "id": "ordered-jobs.fixture-clears-parent-jobs",
  "target": "linux/scripts/tests/test-run-tests.sh",
  "find": "out=\"$(env -u RUN_TESTS_JOBS MEET=",
  "replace": "out=\"$(env MEET=",
  "test": "bash linux/scripts/tests/test-run-tests.sh",
  "why": "an inherited worker cap must not select the copied fixture runner default or hide its scheduling mutation"
 },
 {
  "id": "mutations.private-test-cache",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        env[\"XDG_CACHE_HOME\"] = cache\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-mutation-cache.sh",
  "why": "concurrent Unix test commands must not write the same PowerShell startup cache"
 },
 {
  "id": "mutations.test-cache-forwarded",
  "target": "docs/scripts/verify_mutations.py",
  "find": "stdout=subprocess.PIPE, env=env,",
  "replace": "stdout=subprocess.PIPE, env=None,",
  "test": "bash linux/scripts/tests/test-mutation-cache.sh",
  "why": "the subprocess must receive its private cache environment while caller HOME and raw statuses survive"
 },
 {
  "id": "host.proof-owned-cleanup",
  "target": "linux/scripts/owned_containers.py",
  "find": "f\"label={self.label}={self.run_id}\"",
  "replace": "\"status=exited\"",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Only the unique run label may select containers for cleanup; a name collision must preserve foreign containers."
 },
 {
  "id": "host.proof-readonly-source",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "f\"{source}:/source:ro\"",
  "replace": "f\"{source}:/source:rw\"",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A writable report bind must not expose the preserved source through a writable alias."
 },
 {
  "id": "host.proof-raw-worker-status",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "return status if status else int(cleaned != 0 or not captured)",
  "replace": "return 0",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Worker failure statuses and failed cleanup must reach the caller."
 },
 {
  "id": "host.proof-cleanup-verdict",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "\"passed\" if status == 0 and cleaned == 0 and captured else \"failed\"",
  "replace": "\"passed\" if status == 0 and captured else \"failed\"",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A failed container cleanup cannot be recorded as a passed preflight."
 },
 {
  "id": "host.proof-created-container",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "if status == 0 and not (args.output / \"container.cid\").is_file():",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "An engine success without created-container evidence cannot prove a preflight."
 },
 {
  "id": "host.proof-explicit-image",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "if [ -z \"${IMAGE}\" ]; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "An explicitly selected immutable image must reach the existing runner without falling back to the CI default."
 },
 {
  "id": "host.proof-nerdctl-apparmor",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "if [ \"${ENGINE##*/}\" = nerdctl ]; then COMMON+=(--security-opt apparmor=unconfined); fi",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Manual nerdctl probes retain the host AppArmor setting used by the build lane."
 },
 {
  "id": "host.proof-native-cleanup",
  "target": "linux/scripts/probe-ort-plugin.sh",
  "find": "trap cleanup EXIT",
  "replace": "trap : EXIT",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Extracting the production verifier must preserve the native probe cleanup trap and final raw status."
 },
 {
  "id": "host.proof-running-unit",
  "target": "linux/scripts/watch-build-units.py",
  "find": "return retained or (unit.get(\"ActiveState\") in (\"inactive\", \"failed\") and (ended or failed))",
  "replace": "return unit.get(\"Result\") == \"success\" or ended or failed",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "An active unit's initial Result=success is not a completed build."
 },
 {
  "id": "runtime-push.plan-platform",
  "target": "linux/scripts/image-acceptance.py",
  "find": "plan[\"platform\"] = platform",
  "replace": "plan[\"platform\"] = \"linux/amd64\"",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "Platform plans retain every consumer while selecting the requested target."
 },
 {
  "id": "runtime-push.plan-platform-validation",
  "target": "linux/scripts/image-acceptance.py",
  "find": "if not supported_platform(platform):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "Unsupported platform selection must fail before creating a destination."
 },
 {
  "id": "runtime-push.plan-no-replace",
  "target": "linux/scripts/image-acceptance.py",
  "find": "destination.open(\"x\", encoding=\"utf-8\")",
  "replace": "destination.open(\"w\", encoding=\"utf-8\")",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "A replay plan is evidence and must not overwrite an existing artifact."
 },
 {
  "id": "host.proof-shared-value-options",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "if [ -n \"${CI_IMAGE_VALUE_OPTIONS[$1]:-}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The existing runner must retain all value-option boundaries and refuse missing or empty inputs before invoking the engine."
 },
 {
  "id": "host.run-image-volume-reaches-run",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "for volume in \"${VOLUMES[@]}\"; do ARGS+=(--mount \"type=volume,source=${volume%%:*},target=${volume#*:}\"); done",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A named volume is the only way a cache outlives the run; each --volume must reach the engine as a volume mount."
 },
 {
  "id": "host.run-image-volume-shape-refused",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "[[ \"${2-}\" =~ ^[A-Za-z0-9][A-Za-z0-9_.-]*:/[^,:]*$ ]] || die \"--volume",
  "replace": "[ -n \"${2-}\" ] || die \"--volume",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A value without a name, with a relative path or with a comma would become another mount than the one asked for."
 },
 {
  "id": "host.run-image-env-reaches-run",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "for pair in \"${ENVS[@]}\"; do ARGS+=(-e \"${pair}\"); done",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Each --env must reach the container, an empty value too."
 },
 {
  "id": "host.run-image-env-shape-refused",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "[[ \"${2-}\" =~ ^[A-Za-z_][A-Za-z0-9_]*= ]] || die \"--env",
  "replace": "[ -n \"${2-}\" ] || die \"--env",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A bare NAME would copy the host's value into the container, which the option does not promise."
 },
 {
  "id": "host.run-image-privileged",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "[ \"${PRIVILEGED}\" -eq 0 ] || ARGS+=(--privileged)",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The consumers' lanes run privileged; a local run that asks for it must get it, and one that does not must not."
 },
 {
  "id": "host.run-image-rootless-runs-as-root",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "  USER_SPEC=0:0\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Under a rootless engine on Linux any user but root cannot write the bind-mounted checkout."
 },
 {
  "id": "host.run-image-rootless-tar-owners",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "ENVS+=(TAR_OPTIONS=--no-same-owner)",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "As root GNU tar restores an archive's owners, and one beyond the subuid range fails the extraction."
 },
 {
  "id": "host.run-image-rootless-keeps-callers-tar",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "[[ \" ${ENVS[*]%%=*} \" == *\" TAR_OPTIONS \"* ]] || ENVS+=",
  "replace": "ENVS+=",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A TAR_OPTIONS the caller passed is the caller's choice; the default must not follow it and win."
 },
 {
  "id": "host.run-image-rootful-keeps-image-user",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "== *rootless* ]]; then",
  "replace": "== * ]]; then",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A rootful engine and CI run the image's own user; only a rootless one gets root."
 },
 {
  "id": "host.run-image-rootless-keeps-callers-user",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "if [ -z \"${USER_SPEC}\" ] && [ \"$(uname -s)\" = Linux ]",
  "replace": "if [ \"$(uname -s)\" = Linux ]",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "An explicit --user is kept under a rootless engine too."
 },
 {
  "id": "host.run-image-age-line",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "printf 'run-in-ci-image.sh: image %s, %s%s\\n' \"${IMAGE}\" \"${AGE}\" \"${LIMITS}\" >&2",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A month-old local image looked like broken code; every run names the image and its creation date on stderr."
 },
 {
  "id": "host.run-image-volume-handed-to-user",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "  *) hand_volumes_to \"${RUN_USER}\" ;;",
  "replace": "  *) : ;;",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A new named volume is root's; a run under another user could not write its cache."
 },
 {
  "id": "host.run-image-root-needs-no-handing",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "  ''|0|0:*|root|root:*) ;;",
  "replace": "  '') ;;",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A run as root owns every volume already; a second container start for it is waste."
 },
 {
  "id": "host.run-image-user-from-local-copy",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "  RUN_USER=\"$(engine_says image inspect --format '{{.Config.User}}' \"${IMAGE}\")\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Without --user the image's own user runs, and a volume must be handed to that user."
 },
 {
  "id": "host.run-image-pull-before-image-user",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "[ -n \"${CREATED}\" ] || engine pull",
  "replace": "true || engine pull",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Only a local copy names the image's user; without one the helper pulls before it asks."
 },
 {
  "id": "host.run-image-memory-reaches-run",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "[ -z \"${MEMORY}\" ] || ARGS+=(--memory \"${MEMORY}\" --memory-swap \"${MEMORY}\")",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-limits.sh",
  "why": "A build at the WSL VM's cap swapped the VM until the Windows host froze; the cap must reach the container."
 },
 {
  "id": "host.run-image-memory-shape-refused",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "[ -z \"${MEMORY}\" ] || [[ \"${MEMORY}\" =~ ^[1-9][0-9]*[kmgKMG]?$ ]] || die",
  "replace": "[ -z \"${MEMORY}\" ] || true || die",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-limits.sh",
  "why": "A malformed size reached the engine as an error after the image check; it is refused first."
 },
 {
  "id": "host.run-image-exit-status",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "exec_engine() { MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL='*' exec \"${ENGINE_CMD[@]}\" \"$@\"; }",
  "replace": "exec_engine() { MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL='*' \"${ENGINE_CMD[@]}\" \"$@\" || exit 1; }",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-limits.sh",
  "why": "A container killed at its memory cap exits 137; a runner that flattens it to 1 hides the cap behind an ordinary failure."
 },
 {
  "id": "host.run-image-stale-copy-pulled",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "if [ -n \"${AGE_DAYS}\" ] && [ \"${RUN_IN_CI_IMAGE_MAX_AGE_DAYS}\" -gt 0 ] && [ \"${AGE_DAYS}\" -gt \"${RUN_IN_CI_IMAGE_MAX_AGE_DAYS}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-age.sh",
  "why": "A three-week-old local :latest graded a branch with another toolchain than CI's; a copy over the limit is pulled."
 },
 {
  "id": "host.run-image-failed-pull-runs-old-copy",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "  if engine pull \"${ON_PLATFORM[@]}\" \"${IMAGE}\" >&2; then",
  "replace": "  engine pull \"${ON_PLATFORM[@]}\" \"${IMAGE}\" >&2 || die \"could not pull ${IMAGE}\"; if true; then",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-age.sh",
  "why": "An offline host must still build on its old copy; a failed refresh warns instead of stopping the run."
 },
 {
  "id": "host.run-image-wsl-rancher-engine",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "  ENGINE_CMD=(wsl.exe -d \"${RUN_IN_CI_IMAGE_WSL_DISTRO}\" -e nerdctl)",
  "replace": "  ENGINE_CMD=(nerdctl)",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-wsl.sh",
  "why": "On a Windows host the nerdctl on PATH holds no Linux images; they run in Rancher's WSL distro."
 },
 {
  "id": "host.run-image-wsl-drive-lowercase",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "\"${drive,,}\" \"${path#?:}\"",
  "replace": "\"${drive}\" \"${path#?:}\"",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-wsl.sh",
  "why": "WSL mounts drive C: at /mnt/c; /mnt/C binds an empty directory."
 },
 {
  "id": "host.run-image-empty-workspace",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "bash -lc \"${EMPTY_CHECK}; git config",
  "replace": "bash -lc \"git config",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-wsl.sh",
  "why": "An engine that cannot see the checkout binds an empty /workspace without an error, and the run tests nothing."
 },
 {
  "id": "host.run-image-trusts-submodules",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "git config --global --add safe.directory '*'",
  "replace": "git config --global --add safe.directory /workspace",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-wsl.sh",
  "why": "A Windows-drive checkout is root-owned to uid 1001, submodules too; trusting only /workspace fails every gate reading a submodule."
 },
 {
  "id": "host.run-image-refuses-worktree",
  "target": "linux/scripts/run-in-ci-image.sh",
  "find": "if [ -f \"${REPO_ROOT}/.git\" ] && grep -q '^gitdir: .*/worktrees/' \"${REPO_ROOT}/.git\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-run-in-ci-image-wsl.sh",
  "why": "A worktree's gitdir is a host path the container cannot open; without the refusal every git gate fails as not a checkout."
 },
 {
  "id": "quality-report.perf-engine-security-option",
  "target": "linux/scripts/tests/quality_report_perf_tests.py",
  "find": "    --name|--platform|--security-opt) shift 2 ;;",
  "replace": "    --name|--platform) shift 2 ;;",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh",
  "why": "The perf fixture must parse the real shared runner security pair before mapping its image command, without changing production AppArmor or uid behavior."
 },
 {
  "id": "host.proof-unobserved-command-status",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "    status: int | None = None\n",
  "replace": "    status: int | None = 1\n",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "An interrupted proof must not invent a raw exit status for a command whose result was never observed."
 },
 {
  "id": "host.proof-interruption-status",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "        interrupted_status = error.code if isinstance(error.code, int) else 1\n",
  "replace": "        interrupted_status = None\n",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The original interruption code must remain visible after owned-container cleanup and report-mode restoration."
 },
 {
  "id": "onnx-ep-qnn.configure-retry-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  qnnep_configure \"${HOST_PYTHON_BIN}\" -S \"${QNNEP_SRC}/tools/ci_build/build.py\" \"${args[@]}\" --update",
  "replace": "  \"${HOST_PYTHON_BIN}\" -S \"${QNNEP_SRC}/tools/ci_build/build.py\" \"${args[@]}\" --update",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "a transient configure fetch must be retried before compilation"
 },
 {
  "id": "onnx-ep-qnn.configure-attempt-bound",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "if retry 3 10 \"QNN plugin EP configure\"",
  "replace": "if retry 1 10 \"QNN plugin EP configure\"",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "the final allowed successful configure attempt must be reached"
 },
 {
  "id": "onnx-ep-qnn.configure-raw-exhaustion",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  fi\n  return \"${qnnep_configure_status}\"\n}\n\n# The fork",
  "replace": "  fi\n  return 1\n}\n\n# The fork",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "exhausted retries retain the external configure command's raw status"
 },
 {
  "id": "onnx-ep-qnn.configure-fatal-exhaustion",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  fi\n  return \"${qnnep_configure_status}\"\n}\n\n# The fork",
  "replace": "  fi\n  return 0\n}\n\n# The fork",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "failed configuration cannot continue to headers or compilation"
 },
 {
  "id": "onnx-ep-qnn.configure-argv-boundaries",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  \"$@\" || qnnep_configure_status=$?\n",
  "replace": "  $@ || qnnep_configure_status=$?\n",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "retry dispatch preserves script and SDK paths containing spaces"
 },
 {
  "id": "onnx-ep-qnn.configure-log-retention",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  \"${HOST_PYTHON_BIN}\" -S \"${QNNEP_SRC}/tools/ci_build/build.py\" \"${args[@]}\" --build 2>&1 | tee -a \"${work}/build.log\"\n",
  "replace": "  \"${HOST_PYTHON_BIN}\" -S \"${QNNEP_SRC}/tools/ci_build/build.py\" \"${args[@]}\" --build 2>&1 | tee \"${work}/build.log\"\n",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "the compile append must preserve all configure attempts and stderr"
 },
 {
  "id": "onnx-ep-qnn.compile-not-retried",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  \"${HOST_PYTHON_BIN}\" -S \"${QNNEP_SRC}/tools/ci_build/build.py\" \"${args[@]}\" --build 2>&1 | tee -a \"${work}/build.log\"\n",
  "replace": "  qnnep_configure \"${HOST_PYTHON_BIN}\" -S \"${QNNEP_SRC}/tools/ci_build/build.py\" \"${args[@]}\" --build 2>&1 | tee -a \"${work}/build.log\"\n",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "only configuration retries; a compiler failure retains its single raw verdict"
 },
 {
  "id": "onnx-ep-qnn.configure-retry-delay",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "if retry 3 10 \"QNN plugin EP configure\"",
  "replace": "if retry 3 0 \"QNN plugin EP configure\"",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "bounded configure retries retain the shared ten-second delay"
 },
 {
  "id": "image-acceptance.cleanup-presence-verdict",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    if name in (probe.stdout or \"\").splitlines():\n",
  "replace": "    if False and name in (probe.stdout or \"\").splitlines():\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "A successful removal exit cannot pass while the engine still reports the exact acceptance container."
 },
 {
  "id": "image-acceptance.cleanup-probe-required",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    probe.check_returncode()\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "A failed container-list query cannot prove absence, even after a successful consumer command."
 },
 {
  "id": "image-acceptance.cleanup-name-boundary",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    if name in (probe.stdout or \"\").splitlines():\n",
  "replace": "    if name in (probe.stdout or \"\"):\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "A neighboring container with a longer name must not turn an already completed removal into failure."
 },
 {
  "id": "image-acceptance.cleanup-owner-wiring",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    finally:\n        remove_container(args, name, log)\n",
  "replace": "    finally:\n        pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "The ownership helper container requires the same verified removal as its consumer."
 },
 {
  "id": "image-acceptance.cleanup-remove-raw-log",
  "target": "linux/scripts/image-acceptance.py",
  "find": "\"remove_exit_status\": removed.returncode",
  "replace": "\"remove_exit_status\": 0",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "Preserve the actual removal status when auto-removal makes its nonzero result harmless."
 },
 {
  "id": "image-acceptance.cleanup-probe-raw-log",
  "target": "linux/scripts/image-acceptance.py",
  "find": "\"probe_exit_status\": probe.returncode",
  "replace": "\"probe_exit_status\": 0",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "Retain the failed absence probe's raw status alongside the removal result."
 },
 {
  "id": "image-acceptance.ownership-raw-log",
  "target": "linux/scripts/image-acceptance.py",
  "find": "f\"\\nacceptance ownership exit: {result.returncode}\\n\"",
  "replace": "\"\\nacceptance ownership exit: 0\\n\"",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "A second cleanup failure must not erase the ownership command's actual failure from its log."
 },
 {
  "id": "image-acceptance.cleanup-consumer-catches-verdict",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    except (OSError, subprocess.SubprocessError, ValueError) as error:\n        row[\"container_cleanup_error\"]",
  "replace": "    except (OSError, subprocess.SubprocessError) as error:\n        row[\"container_cleanup_error\"]",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "A failed absence assertion must retain consumer status and evidence while ownership cleanup still runs."
 },
 {
  "id": "image-acceptance.cleanup-owner-catches-verdict",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        except (OSError, subprocess.SubprocessError, ValueError) as error:\n            row[\"ownership_error\"]",
  "replace": "        except (OSError, subprocess.SubprocessError) as error:\n            row[\"ownership_error\"]",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "An ownership-container absence failure must remain recorded in the failed receipt."
 },
 {
  "id": "image-acceptance.cleanup-removal-diagnostics",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        stream.write((removed.stdout or \"\") + (removed.stderr or \"\"))\n",
  "replace": "        stream.write(removed.stdout or \"\")\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "Preserve removal stderr as well as its status before reporting the final cleanup verdict."
 },
 {
  "id": "image-acceptance.cleanup-probe-diagnostics",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        stream.write((probe.stdout or \"\") + (probe.stderr or \"\"))\n",
  "replace": "        stream.write(probe.stdout or \"\")\n",
  "test": "bash linux/scripts/tests/test-image-acceptance.sh",
  "why": "A failed engine query needs its original stderr in the retained consumer log."
 },
 {
  "id": "lint-gates.mutation-staleness-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  run_gate \"mutation staleness\" _lint_gates_mutation_staleness\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "a gate function nothing registers runs in no consumer and in no lint lane"
 },
 {
  "id": "lint-gates.mutation-staleness-verdict",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "--root \"${_LINT_GATES_ROOT}\" --stale-check 2>&1)\"; then",
  "replace": "--root \"${_LINT_GATES_ROOT}\" --stale-check 2>&1)\" || true; then",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "a stale recipe must fail the gates, or the consumer's mutation lane finds it after the push"
 },
 {
  "id": "lint-gates.mutation-staleness-direct-children",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "':(glob)scripts/linux/tests/*mutations*.json'",
  "replace": "'scripts/linux/tests/*mutations*.json'",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "without the glob magic a star crosses directories, and a suite's fixture manifest is stale on purpose"
 },
 {
  "id": "lint-gates.staged-large-files",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    run_gate \"large files\" _lint_gates_large_files\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k commit",
  "why": "a staged binary over the ratchet's limit must stop the commit, not wait for the push"
 },
 {
  "id": "lint-gates.staged-secrets-read-the-index",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "_LINT_GATES_ROOT=\"${work}/tree\" _lint_gates_secret_scan_all",
  "replace": "_lint_gates_secret_scan_all",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k commit",
  "why": "the commit carries the staged blob; a scan of the working tree passes a secret that was staged and then edited away"
 },
 {
  "id": "lint-gates.staged-index-of-the-commit",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    export GIT_INDEX_FILE=\"${_LINT_GATES_INDEX}\"\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k commit",
  "why": "git commit -a builds its index in a lock file; the plain index shows nothing staged for it"
 },
 {
  "id": "lint-gates.staged-vendored-subtree-skipped",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  case \"$1\" in */*/*) return 1 ;; esac",
  "replace": "  case \"$1\" in */*/*) return 0 ;; esac",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k commit",
  "why": "a vendored subtree is graded by its own repository; scanning it here stops commits over another project's fixtures"
 },
 {
  "id": "lint-gates.tree-secrets-skip-ignored",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "ls-files -z -co --exclude-standard",
  "replace": "ls-files -z -co",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "CON286: an ignored virtualenv inside a tracked directory is no file a commit takes, and reading it failed the gate on a dev host while CI's fresh checkout passed"
 },
 {
  "id": "lint-gates.tree-secrets-read-untracked",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "ls-files -z -co --exclude-standard",
  "replace": "ls-files -z -c --exclude-standard",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "CON286: an untracked file that is not ignored is what git add -A commits next, so the push must read it"
 },
 {
  "id": "lint-gates.tree-secrets-read-the-copy",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "_LINT_GATES_ROOT=\"${work}/tree\" _lint_gates_secret_scan_all",
  "replace": "_lint_gates_secret_scan_all",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "CON286: the scope directories in the working tree hold the ignored files the copy leaves out, so scanning them brings the dev-host failure back"
 },
 {
  "id": "lint-gates.tree-secrets-files-only",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    if [ -f \"${_LINT_GATES_ROOT}/${path}\" ]; then printf '%s\\0' \"${path}\"; fi",
  "replace": "    printf '%s\\0' \"${path}\"",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "CON286: a tracked file deleted from the working tree stops the copy, and a nested repository's directory would be copied whole"
 },
 {
  "id": "lint-gates.tree-secrets-empty-refuses",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    if [ \"${empty}\" = pass ]; then",
  "replace": "    if true; then",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "a tree gate with nothing left to scan reported green over nothing; only the staged gate may pass a commit with no file to scan"
 },
 {
  "id": "lint-gates.index-file-must-exist",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    [ -f \"${_LINT_GATES_INDEX}\" ] || _lint_gates_die \"--index: no such file: ${_LINT_GATES_INDEX}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lint-gates.sh",
  "why": "git reads a missing index as an empty one, so a wrong path would pass every commit"
 },
 {
  "id": "lint-gates.hook-notice-silent-in-ci",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  [ -z \"${CI:-}\" ] || return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k notice",
  "why": "a runner has no hooks by design; the line there is noise in every lint log"
 },
 {
  "id": "lint-gates.hook-notice-only-when-unset",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  if [ -z \"${set_to}\" ]; then\n",
  "replace": "  if true; then\n",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k notice",
  "why": "a clone with hooks, the template's or its own, must not be told to set them"
 },
 {
  "id": "lint-gates.hook-notice-printed",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "    run_gate \"code duplication report\" _lint_gates_code_dupes report\n  fi\n  _lint_gates_hook_notice\n",
  "replace": "    run_gate \"code duplication report\" _lint_gates_code_dupes report\n  fi\n",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k notice",
  "why": "a clone without hooks runs the gates only when someone remembers; the full run is where it must say so"
 },
 {
  "id": "lint-gates.hook-notice-hub-line",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  [ \"${hub}\" != \"${_LINT_GATES_ROOT}\" ] || line=\"make hooks\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k notice",
  "why": "the consumer pair is not the hub's; the hub's clone is sent to make hooks"
 },
 {
  "id": "lint-gates.hook-push-stops",
  "target": "shared/linux/templates/git-hooks/pre-push",
  "find": "or 'git push --no-verify' if you know why\" >&2\n  exit 1",
  "replace": "or 'git push --no-verify' if you know why\" >&2\n  exit 0",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k push",
  "why": "a failure that is printed and pushed anyway is the fault this hook was built for"
 },
 {
  "id": "lint-gates.hook-push-prefers-the-wrapper",
  "target": "shared/linux/templates/git-hooks/pre-push",
  "find": "if [ -f scripts/linux/run-lint-gates.sh ]; then\n  _gates=(scripts/linux/run-lint-gates.sh)",
  "replace": "if false; then\n  _gates=(scripts/linux/run-lint-gates.sh)",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k push",
  "why": "the bare aggregator drops the wrapper's --ratchets and --agents-drift, so the push would check less than CI"
 },
 {
  "id": "lint-gates.hook-push-delete-checks-nothing",
  "target": "shared/linux/templates/git-hooks/pre-push",
  "find": "  if [ \"${_live}\" -eq 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k push",
  "why": "a deleted branch carries no commit; minutes of gates for it teach --no-verify"
 },
 {
  "id": "lint-gates.hook-push-extension-runs",
  "target": "shared/linux/templates/git-hooks/pre-push",
  "find": "if [ -f \"${_extra}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k extension",
  "why": "the extension point is how a repo runs its script suites before a push; unread, a red suite reaches CI"
 },
 {
  "id": "lint-gates.hook-push-extension-stops",
  "target": "shared/linux/templates/git-hooks/pre-push",
  "find": "FAILED (exit ${_rc}), the push is stopped\" >&2\n    exit 1",
  "replace": "FAILED (exit ${_rc}), the push is stopped\" >&2\n    exit 0",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k extension",
  "why": "a failing extension must stop the push, not print and continue"
 },
 {
  "id": "lint-gates.hook-push-clears-git-env",
  "target": "shared/linux/templates/git-hooks/pre-push",
  "find": "unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX",
  "replace": ": unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k extension",
  "why": "with git's hook state inherited, a fixture's git call acts on the repository being pushed"
 },
 {
  "id": "lint-gates.hook-commit-stops",
  "target": "shared/linux/templates/git-hooks/pre-commit",
  "find": "and run the gates before the push\" >&2\n  exit 1",
  "replace": "and run the gates before the push\" >&2\n  exit 0",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k commit",
  "why": "a refusal that is printed and committed anyway stops nothing"
 },
 {
  "id": "lint-gates.hook-commit-prefers-the-wrapper",
  "target": "shared/linux/templates/git-hooks/pre-commit",
  "find": "if [ -f scripts/linux/run-lint-gates.sh ]; then\n  _gates=(scripts/linux/run-lint-gates.sh --staged)",
  "replace": "if false; then\n  _gates=(scripts/linux/run-lint-gates.sh --staged)",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k commit",
  "why": "the bare aggregator has no --ratchets, so the large-file check never ran and a 19 MB core file reached a commit"
 },
 {
  "id": "lint-gates.hook-commit-hands-over-the-index",
  "target": "shared/linux/templates/git-hooks/pre-commit",
  "find": "if [ -n \"${_index}\" ]; then _gates+=(--index \"${_index}\"); fi",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k commit",
  "why": "without the index git handed the hook, git commit -a is checked against nothing"
 },
 {
  "id": "lint-gates.hook-commit-staged-only",
  "target": "shared/linux/templates/git-hooks/pre-commit",
  "find": "  _gates=(scripts/linux/run-lint-gates.sh --staged)",
  "replace": "  _gates=(scripts/linux/run-lint-gates.sh)",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k commit",
  "why": "the full gates on every commit take minutes and teach --no-verify"
 },
 {
  "id": "lint-gates.index-needs-staged",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  [ -z \"${_LINT_GATES_INDEX}\" ] || _lint_gates_die \"--index belongs to --staged; the full gates read the working tree\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh -k notice",
  "why": "the full gates read the working tree; an --index there is ignored in silence, so a caller who meant the staged checks gets the wrong ones"
 },
 {
  "id": "lib.trt-ep-protobuf-rc-frontend",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "                '\"$<$<COMPILE_LANGUAGE:C,CXX>:' + $option.Value + '>\"'",
  "replace": "                '\"' + $option.Value + '\"'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "resource compilation must not inherit protobuf's C/C++ options, while C and C++ retain them"
 },
 {
  "id": "lib.trt-ep-protobuf-rc-postcondition",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "        $scoped = [regex]::Matches($uncommented, 'add_compile_options\\(\\s*\"\\$<\\$<COMPILE_LANGUAGE:C,CXX>:/').Count -eq 4 -and\n            $remaining -notmatch 'add_compile_options\\(\\s*[^)\\s]' -and\n            $uncommented -notmatch 'add_definitions\\(\\s*/' -and\n            $uncommented.Contains('add_compile_options(\"$<$<COMPILE_LANGUAGE:C,CXX>:/bigobj>\")')",
  "replace": "        $scoped = $true",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "missing or partial compiler-option scope must fail before TensorRT configuration"
 },
 {
  "id": "lib.trt-ep-protobuf-rc-call",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "Repair-OrtTensorRtProtobufRc -SeedRoot $roots['protobuf']\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "the repair must execute against the selected seed before the TensorRT CMake configure"
 },
 {
  "id": "lib.trt-ep-protobuf-rc-seed",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "Repair-OrtTensorRtProtobufRc -SeedRoot $roots['protobuf']\n",
  "replace": "Repair-OrtTensorRtProtobufRc -SeedRoot $roots['onnx']\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "patching another FetchContent seed leaves protobuf's resource command broken"
 },
 {
  "id": "lib.trt-ep-protobuf-rc-unknown-option",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "                if ($option.Value -notmatch '^/(MP|utf-8|wd\\d+|bigobj)$') { throw \"Unexpected protobuf compiler option: $($option.Value)\" }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "a new upstream compiler option requires explicit review while the existing bigobj contract still passes"
 },
 {
  "id": "lib.trt-ep-protobuf-rc-unconditional",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "Repair-OrtTensorRtProtobufRc -SeedRoot $roots['protobuf']\n",
  "replace": "if ($true) { Repair-OrtTensorRtProtobufRc -SeedRoot $roots['protobuf'] }\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "the protobuf repair is required, so an enclosing conditional must fail the shared AST assertion"
 },
 {
  "id": "lib.trt-ep-protobuf-rc-order",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "Repair-OrtTensorRtProtobufRc -SeedRoot $roots['protobuf']\n$epSource = $roots['onnxruntime-ep-tensorrt']\n$declared = Get-OrtTensorRtEpDeclaration -CMakeText ([IO.File]::ReadAllText((Join-Path $epSource 'CMakeLists.txt')))\n$seedGap = @(Get-OrtTensorRtEpSeedGap -Declared $declared -Pin $pins)\nif ($seedGap.Count -gt 0) { throw \"TensorRT plugin EP: FetchContent would download unpinned: $($seedGap -join '; ')\" }\n$ortHome = New-OrtTensorRtEpHome -OrtPrefix $ortPrefix -Path (Join-Path $SourceDir 'ort-home')\nWrite-Host \"TensorRT plugin EP $($pins[0].Version.Substring(0, 12)): TensorRT $trtMajor SDK $trtSdk, chain ORT $ortPrefix\"\n\nSwitch-BuildPhase '2. configure (ORT_HOME over the chain ORT, every FetchContent seeded)'\n$py = Initialize-ToolchainPythonEnvironment\n$buildDir = Join-Path $SourceDir 'build'\n$seedRoots = [ordered]@{}\nforeach ($name in @($roots.Keys | Where-Object { $_ -ne 'onnxruntime-ep-tensorrt' })) { $seedRoots[$name] = $roots[$name] }\n$trtArgs = Get-OrtTensorRtEpCmakeArgs -OrtHome $ortHome -TensorRtSdk $trtSdk -TrtMajor $trtMajor -CudaRoot $gpuEnv.CudaRoot -Python $py.Exe -SeedRoot $seedRoots\n$cfgLog = Invoke-CmakeConfigureLogged -LogName 'ort-trt-ep-configure.log' -SourceDir $epSource -BuildDir $buildDir -InstallPrefix $epDir -BuildType $BuildType -ExtraArgs $trtArgs\n",
  "replace": "$epSource = $roots['onnxruntime-ep-tensorrt']\n$declared = Get-OrtTensorRtEpDeclaration -CMakeText ([IO.File]::ReadAllText((Join-Path $epSource 'CMakeLists.txt')))\n$seedGap = @(Get-OrtTensorRtEpSeedGap -Declared $declared -Pin $pins)\nif ($seedGap.Count -gt 0) { throw \"TensorRT plugin EP: FetchContent would download unpinned: $($seedGap -join '; ')\" }\n$ortHome = New-OrtTensorRtEpHome -OrtPrefix $ortPrefix -Path (Join-Path $SourceDir 'ort-home')\nWrite-Host \"TensorRT plugin EP $($pins[0].Version.Substring(0, 12)): TensorRT $trtMajor SDK $trtSdk, chain ORT $ortPrefix\"\n\nSwitch-BuildPhase '2. configure (ORT_HOME over the chain ORT, every FetchContent seeded)'\n$py = Initialize-ToolchainPythonEnvironment\n$buildDir = Join-Path $SourceDir 'build'\n$seedRoots = [ordered]@{}\nforeach ($name in @($roots.Keys | Where-Object { $_ -ne 'onnxruntime-ep-tensorrt' })) { $seedRoots[$name] = $roots[$name] }\n$trtArgs = Get-OrtTensorRtEpCmakeArgs -OrtHome $ortHome -TensorRtSdk $trtSdk -TrtMajor $trtMajor -CudaRoot $gpuEnv.CudaRoot -Python $py.Exe -SeedRoot $seedRoots\n$cfgLog = Invoke-CmakeConfigureLogged -LogName 'ort-trt-ep-configure.log' -SourceDir $epSource -BuildDir $buildDir -InstallPrefix $epDir -BuildType $BuildType -ExtraArgs $trtArgs\nRepair-OrtTensorRtProtobufRc -SeedRoot $roots['protobuf']\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "the repair must precede the actual TensorRT configure; running it afterward cannot repair emitted RC commands"
 },
 {
  "id": "lib.trt-ep-protobuf-rc-mixed-options",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "            $remaining -notmatch 'add_compile_options\\(\\s*[^)\\s]' -and\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "Every argument in an already-scoped compiler-option block must be validated; four valid prefixes do not exclude an appended bare option."
 },
 {
  "id": "lib.ort-plugin-ep-cxx-exceptions",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "    $cxx = (@('/EHsc', '/WX-',",
  "replace": "    $cxx = (@('/WX-',",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "The shared plugin CMake policy replaces the platform flags, so it must retain exception handling required by the ORT C++ API."
 },
 {
  "id": "lib.ort-cuda-standard-joined",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "    $fixed = $Text.Replace('SHELL:--std c++20', 'SHELL:-std=c++20')",
  "replace": "    $fixed = $Text.Replace('SHELL:--std c++20', 'SHELL:--std c++20')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCudaStandard.Tests.ps1",
  "why": "Both selected CUDA generator branches need a joined standard option while keeping C++20 and the warning/architecture policy."
 },
 {
  "id": "lib.ort-cuda-standard-postcondition",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ([regex]::Matches($fixed, 'SHELL:-std=c\\+\\+20>').Count -ne 2 -or $fixed -match 'SHELL:--std\\b')",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCudaStandard.Tests.ps1",
  "why": "Missing or changed upstream standard blocks must fail before an incomplete source rewrite is written."
 },
 {
  "id": "lib.ort-cuda-standard-call",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "        $null = Edit-SourceFile -Path (Join-Path $SourceDir 'cmake/onnxruntime_providers_cuda_plugin.cmake') -Require -Quiet -Description 'ORT CUDA standard option' -Transform ${function:ConvertTo-OrtCudaStandardText}\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCudaStandard.Tests.ps1",
  "why": "A standalone repair that never runs for the selected ONNX source does not fix the actual CUDA compiler command."
 },
 {
  "id": "lib.ort-cuda-standard-remainder",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": " -or $fixed -match 'SHELL:--std\\b'",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCudaStandard.Tests.ps1",
  "why": "Two valid normalized options do not excuse an additional separated long option; whitespace variants must fail atomically."
 },
 {
  "id": "lib.harness-match-count-verdict",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "    Assert-Equal $Expected ([regex]::Matches($Actual, $Pattern).Count) $Message\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.TextFixtures.Tests.ps1",
  "why": "A wrong expected count must fail; an assertion-free regex counter cannot pass."
 },
 {
  "id": "lib.harness-match-count-pattern",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "[regex]::Matches($Actual, $Pattern).Count",
  "replace": "[regex]::Matches($Actual, [regex]::Escape($Pattern)).Count",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.TextFixtures.Tests.ps1",
  "why": "Callers select regular expressions, so the shared counter must not silently treat them as literals."
 },
 {
  "id": "lib.trt-ep-protobuf-rc-comment-parenthesis",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "        $pattern = '(?m)^(?<indent>[ \\t]*)add_definitions\\((?<options>\\s*/(?:(?>#[^\\r\\n]*)|[^#)])*)\\)'",
  "replace": "        $pattern = '(?m)^(?<indent>[ \\t]*)add_definitions\\((?<options>\\s*/[^)]*)\\)'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "A closing parenthesis inside a protobuf warning comment cannot terminate the real compiler-option block."
 },
 {
  "id": "lib.trt-ep-protobuf-rc-comment-bytes",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "                if ($option.Groups['comment'].Success) { return $option.Value }",
  "replace": "                if ($option.Groups['comment'].Success) { return $option.Value.Replace('/bigobj', '/lost-comment') }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "Compiler-like text inside comments remains unchanged while the real options are language-scoped."
 },
 {
  "id": "lib.trt-ep-protobuf-rc-comment-command",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "^(?<indent>[ \\t]*)add_definitions",
  "replace": "(?<indent>[ \\t]*)add_definitions",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "A commented add_definitions example is not a compiler command and must not be rewritten or rejected as an option."
 },
 {
  "id": "lib.trt-ep-protobuf-rc-atomic-refusal",
  "target": "windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1",
  "find": "        if (-not $scoped) { throw 'TensorRT protobuf compiler-option scope is not verified.' }",
  "replace": "        if (-not $scoped) { [IO.File]::WriteAllText($path, $text); throw 'TensorRT protobuf compiler-option scope is not verified.' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtTensorRtEp.Tests.ps1",
  "why": "A rejected partial option layout leaves the original bytes unchanged, including when some valid blocks could be transformed."
 },
 {
  "id": "lib.harness-file-unchanged-comparison",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "    Assert-Equal $fileUnchangedBeforeHash (Get-FileHash -LiteralPath $FileUnchangedPath -Algorithm SHA256 -ErrorAction Stop).Hash $FileUnchangedReason",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.FileUnchanged.Tests.ps1",
  "why": "Changed source bytes must fail even when the operation itself succeeds."
 },
 {
  "id": "lib.harness-file-unchanged-operation",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "    $null = & $FileUnchangedAction",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.FileUnchanged.Tests.ps1",
  "why": "The shared byte assertion executes its operation exactly once and preserves operation failures."
 },
 {
  "id": "lib.harness-file-unchanged-literal-path",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "function Assert-FileUnchanged {\n    # Distinct local names preserve the callback's caller-visible bindings.\n    param(\n        [Parameter(Mandatory)][Alias('Path')][string]$FileUnchangedPath,\n        [Parameter(Mandatory)][Alias('Action')][scriptblock]$FileUnchangedAction,\n        [Alias('Reason')][string]$FileUnchangedReason = ''\n    )\n    $fileUnchangedBeforeHash = (Get-FileHash -LiteralPath $FileUnchangedPath -Algorithm SHA256 -ErrorAction Stop).Hash\n    $null = & $FileUnchangedAction\n    Assert-Equal $fileUnchangedBeforeHash (Get-FileHash -LiteralPath $FileUnchangedPath -Algorithm SHA256 -ErrorAction Stop).Hash $FileUnchangedReason\n}",
  "replace": "function Assert-FileUnchanged {\n    # Distinct local names preserve the callback's caller-visible bindings.\n    param(\n        [Parameter(Mandatory)][Alias('Path')][string]$FileUnchangedPath,\n        [Parameter(Mandatory)][Alias('Action')][scriptblock]$FileUnchangedAction,\n        [Alias('Reason')][string]$FileUnchangedReason = ''\n    )\n    $fileUnchangedBeforeHash = (Get-FileHash -Path $FileUnchangedPath -Algorithm SHA256 -ErrorAction Stop).Hash\n    $null = & $FileUnchangedAction\n    Assert-Equal $fileUnchangedBeforeHash (Get-FileHash -Path $FileUnchangedPath -Algorithm SHA256 -ErrorAction Stop).Hash $FileUnchangedReason\n}",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.FileUnchanged.Tests.ps1",
  "why": "Bracketed fixture names identify literal files; an unchanged wildcard sibling cannot mask changed bytes."
 },
 {
  "id": "lib.harness-ast-function-name",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "FunctionDefinitionAst] -and $node.Name -eq $Name",
  "replace": "FunctionDefinitionAst]",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.Ast.Tests.ps1",
  "why": "The function query selects one name; every definition must not pass for it."
 },
 {
  "id": "lib.harness-ast-function-nested",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "$node.Name -eq $Name\n    }, $true)",
  "replace": "$node.Name -eq $Name\n    }, $false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.Ast.Tests.ps1",
  "why": "A function defined inside another one is still a definition of that name."
 },
 {
  "id": "lib.harness-ast-assignment-left",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "AssignmentStatementAst] -and $node.Left.Extent.Text -eq $Left",
  "replace": "AssignmentStatementAst]",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.Ast.Tests.ps1",
  "why": "The assignment query selects one left-hand side, scope prefix included."
 },
 {
  "id": "lib.harness-ast-assignment-nested",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "$node.Left.Extent.Text -eq $Left\n    }, $true)",
  "replace": "$node.Left.Extent.Text -eq $Left\n    }, $false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.Ast.Tests.ps1",
  "why": "An assignment inside a function body still assigns that variable."
 },
 {
  "id": "lib.harness-ast-query-export",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "Export-ModuleMember -Function Get-TestAstFunction, Get-TestAstAssignment",
  "replace": "Export-ModuleMember -Function Get-TestAstFunction",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.Ast.Tests.ps1",
  "why": "Consumer suites import both queries by name."
 },
 {
  "id": "lib.harness-function-definition-first",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "@(Get-TestAstFunction -Ast $ast -Name $name) | Select-Object -First 1",
  "replace": "@(Get-TestAstFunction -Ast $ast -Name $name) | Select-Object -Last 1",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.Ast.Tests.ps1",
  "why": "Get-ScriptFunctionDefinition lifts the first definition of a name, as it did before it shared the query."
 },
 {
  "id": "lib.trt-ep-cross-cxx-before-cuda",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "  setup_linux_cross_env || return $?\n  cuda_cross_load || err \"cuda_cross_load failed\"",
  "replace": "  cuda_cross_load || err \"cuda_cross_load failed\"\n  setup_linux_cross_env || return $?",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "CUDAHOSTCXX must capture the selected target CXX before CMake reads its higher-priority environment setting"
 },
 {
  "id": "lib.trt-ep-cross-setup-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "  setup_linux_cross_env || return $?",
  "replace": "  setup_linux_cross_env || true",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "a failed target compiler setup must retain its raw status and stop before publishing a native CUDA host compiler"
 },
 {
  "id": "lib.trt-ep-native-cross-guard",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "trtep_enter_cross_env() {\n  cuda_cross_active || return 0",
  "replace": "trtep_enter_cross_env() {\n  cuda_cross_active || return 1",
  "test": "bash linux/scripts/tests/test-tensorrt-plugin-ep.sh",
  "why": "native TensorRT builds must retain their compiler environment and return success without entering cross setup"
 },
 {
  "id": "lib.ort-cuda-standard-linux-patch",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "002-cuda-dynamic-sparse-attention-cstdint.patch 003-cuda-standard-sccache.patch",
  "replace": "002-cuda-dynamic-sparse-attention-cstdint.patch",
  "test": "bash linux/scripts/tests/test-onnx-cuda-standard.sh",
  "why": "Both pinned CUDA source branches must be patched through the actual GPU policy."
 },
 {
  "id": "lib.ort-cuda-standard-linux-count",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "[ \"$(grep -cF 'SHELL:-std=c++20>' \"$1\")\" = 2 ]",
  "replace": "[ \"$(grep -cF 'SHELL:-std=c++20>' \"$1\")\" = 1 ]",
  "test": "bash linux/scripts/tests/test-onnx-cuda-standard.sh",
  "why": "The gate requires exactly the two upstream branches."
 },
 {
  "id": "lib.ort-cuda-standard-linux-remainder",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "! grep -F 'SHELL:--std' \"$1\" >/dev/null || return 1",
  "replace": "return 0",
  "test": "bash linux/scripts/tests/test-onnx-cuda-standard.sh",
  "why": "A remaining separated or equal long option must fail even beside two joined options."
 },
 {
  "id": "lib.ort-cuda-standard-linux-postcondition",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "ort_cuda_standard_options_ok \"${ORT_SRC_DIR}/cmake/onnxruntime_providers_cuda_plugin.cmake\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-onnx-cuda-standard.sh",
  "why": "The real patch pipeline must invoke its drift postcondition before configuration."
 },
 {
  "id": "lib.plugin-closure-inspector-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "  if [ \"${rc}\" -ne 0 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "A failed native inspector cannot produce a resolved closure verdict."
 },
 {
  "id": "lib.trt-closure-callback",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "mgxep_closure_ok \"$1\" trtep_closure_report",
  "replace": "mgxep_closure_ok \"$1\"",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "The actual TensorRT gate must select its target-loader callback."
 },
 {
  "id": "lib.trt-closure-cross-selection",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "|| ! cuda_cross_active; then",
  "replace": "|| true; then",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "A foreign module cannot be graded by native ldd."
 },
 {
  "id": "lib.trt-closure-descriptor-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "  cuda_cross_load || return $?",
  "replace": "  cuda_cross_load || true",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "Descriptor failure stops before loader execution and retains its status."
 },
 {
  "id": "lib.trt-closure-runner-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "runner=\"$(cross_target_qemu_runner)\" || return $?",
  "replace": "runner=\"$(cross_target_qemu_runner)\" || true",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "A failed target-runner lookup remains fatal with its raw status."
 },
 {
  "id": "lib.trt-closure-c-runtime-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "loader=\"$(\"${CC}\" -print-file-name=ld-linux-aarch64.so.1)\" || return $?",
  "replace": "loader=\"$(\"${CC}\" -print-file-name=ld-linux-aarch64.so.1)\" || true",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "Failed target-loader discovery cannot turn into a later unrelated verdict."
 },
 {
  "id": "lib.trt-closure-cxx-runtime-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "cxxrt=\"$(\"${CXX}\" -print-file-name=libstdc++.so.6)\" || return $?",
  "replace": "cxxrt=\"$(\"${CXX}\" -print-file-name=libstdc++.so.6)\" || true",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "Failed target C++ runtime discovery preserves its raw failure."
 },
 {
  "id": "lib.trt-closure-runtime-file",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "case \"${file}\" in /*) [ -f \"${file}\" ] && continue ;; esac",
  "replace": "continue",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "An unresolved compiler filename is not a target runtime file."
 },
 {
  "id": "lib.trt-closure-target",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "[ \"${CUDA_CROSS_TARGET_ARCH}\" = arm64 ] ||",
  "replace": "true ||",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "The SBSA loader selection must refuse unsupported target architectures."
 },
 {
  "id": "lib.trt-closure-bound",
  "target": "linux/scripts/03-media/build/onnxruntime/build/37-build-tensorrt-plugin-ep.sh",
  "find": "timeout --kill-after=5s 60s \"${runner}\"",
  "replace": "\"${runner}\"",
  "test": "bash linux/scripts/tests/test-tensorrt-closure.sh",
  "why": "Target-loader inspection remains bounded and preserves every argument boundary."
 },
 {
  "id": "lib.smoke-cudnn-header",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "-Filter 'cudnn.h'",
  "replace": "-Filter 'cudnn*.h'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Smoke.Cudnn.Tests.ps1",
  "why": "An auxiliary header cannot replace the required cuDNN public header."
 },
 {
  "id": "lib.smoke-cudnn-library",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "-Filter 'cudnn.lib'",
  "replace": "-Filter 'cudnn*.lib'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Smoke.Cudnn.Tests.ps1",
  "why": "An auxiliary import library cannot replace the required cuDNN main library."
 },
 {
  "id": "lib.smoke-cudnn-dll",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "-Filter 'cudnn64_*.dll'",
  "replace": "-Filter 'cudnn*.dll'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Smoke.Cudnn.Tests.ps1",
  "why": "An auxiliary runtime cannot replace the required versioned cuDNN main DLL."
 },
 {
  "id": "lib.smoke-cudnn-required",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "throw 'cuDNN link+run requires cudnn.h, cudnn.lib, cudnn64_*.dll and CUDA_ROOT.'",
  "replace": "Skip-Test 'cuDNN link+run requires cudnn.h, cudnn.lib, cudnn64_*.dll and CUDA_ROOT.'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Smoke.Cudnn.Tests.ps1",
  "why": "Missing cuDNN development inputs must fail rather than become an allowed skip."
 },
 {
  "id": "lib.smoke-cudnn-cross",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "Assert-NativeLinkRun @cudnnProbe -CrossLinkOnly",
  "replace": "Assert-NativeLinkRun @cudnnProbe",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Smoke.Cudnn.Tests.ps1",
  "why": "The cross lane must retain its link-only and PE-machine assertion policy."
 },
 {
  "id": "lib.smoke-cudnn-native-call",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "Assert-NativeLinkRun @cudnnProbe -Name 'cuDNN links + host API works (cudnnGetVersion)' -ExpectMatch 'cudnn' -FailMessage 'cuDNN did not compile/link/run (cudnnGetVersion) -- header/lib/DLL mismatch or missing dependent DLL'",
  "replace": "if ($false) { Assert-NativeLinkRun @cudnnProbe -Name 'cuDNN links + host API works (cudnnGetVersion)' -ExpectMatch 'cudnn' -FailMessage 'cuDNN did not compile/link/run (cudnnGetVersion) -- header/lib/DLL mismatch or missing dependent DLL' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Smoke.Cudnn.Tests.ps1",
  "why": "A healthy SDK must execute the native cuDNN host API control."
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-node-required",
  "target": "windows/scripts/build/Build-OrtAmdgpuEpFromSource.ps1",
  "find": "@('001-node-compute-info-lifetime.patch', '002-kernel-registry-lifetime.patch')",
  "replace": "@('002-kernel-registry-lifetime.patch')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "the node cleanup correction must be applied, not silently omitted"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-registry-required",
  "target": "windows/scripts/build/Build-OrtAmdgpuEpFromSource.ps1",
  "find": "@('001-node-compute-info-lifetime.patch', '002-kernel-registry-lifetime.patch')",
  "replace": "@('001-node-compute-info-lifetime.patch')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "the registry ownership correction must be applied, not silently omitted"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-fatal-patch",
  "target": "windows/scripts/build/Build-OrtAmdgpuEpFromSource.ps1",
  "find": "        Invoke-RequiredSourcePatch -SourceDir $SourceDir -PatchFile (Join-Path $PatchDir $name)",
  "replace": "        try { Invoke-RequiredSourcePatch -SourceDir $SourceDir -PatchFile (Join-Path $PatchDir $name) } catch { Write-Warning $_ }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "missing and stale patches must stop the source build"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-before-configure",
  "target": "windows/scripts/build/Build-OrtAmdgpuEpFromSource.ps1",
  "find": "    Invoke-OrtAmdgpuEpSourcePatch -SourceDir $epRoot -PatchDir $PatchDir",
  "replace": "    Write-Verbose 'lifetime corrections omitted'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "the real primary source must receive both corrections before seed/configure work"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-entry-selection",
  "target": "windows/scripts/build/Build-OrtAmdgpuEpFromSource.ps1",
  "find": "$seeds = Initialize-OrtAmdgpuEpSeeds -WorkDir $WorkDir -PatchDir $PatchDir",
  "replace": "$seeds = Initialize-OrtAmdgpuEpSeeds -WorkDir $WorkDir -PatchDir ''",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "the selected mounted patch directory must reach the source initializer"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-callback-adjustment",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+            API_CALL_S(NodeComputeInfo, static_cast<NodeComputeInfo*>(this_), CreateState, compute_context, *compute_state);",
  "replace": "+            API_CALL_S(NodeComputeInfo, this_, CreateState, compute_context, *compute_state);",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "every callback must adjust the nonzero C base offset introduced by virtual ownership"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-typed-release",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+        delete static_cast<NodeComputeInfoBase*>(info);",
  "replace": "+        delete info;",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "deleting the original C base must not survive in the patched source"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-registry-owner",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/002-kernel-registry-lifetime.patch",
  "find": "+    mutable Ort::KernelRegistry kernel_registry_{nullptr};",
  "replace": "+    mutable OrtKernelRegistry* kernel_registry_{};",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "the cached registry needs its releasing owner"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-registry-lock",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/002-kernel-registry-lifetime.patch",
  "find": "+        const std::lock_guard lock{kernel_registry_mutex_};",
  "replace": "+        (void)kernel_registry_mutex_;",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "parallel registry creation must remain synchronized"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-node-mount",
  "target": "windows/Dockerfile.rocm-migraphx",
  "find": "    --mount=type=bind,source=linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch,target=C:\\bkmnt\\ort-amdgpu-patches\\001-node-compute-info-lifetime.patch,readonly `\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "the EP RUN must carry its selected node patch as a narrow read-only mount"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-registry-mount",
  "target": "windows/Dockerfile.rocm-migraphx",
  "find": "    --mount=type=bind,source=linux/scripts/03-media/build/onnxruntime/build/patches/002-kernel-registry-lifetime.patch,target=C:\\bkmnt\\ort-amdgpu-patches\\002-kernel-registry-lifetime.patch,readonly `\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "the EP RUN must carry its selected registry patch as a narrow read-only mount"
 },
 {
  "id": "onnx-ep-amdgpu.windows-lifetime-mounted-selection",
  "target": "windows/Dockerfile.rocm-migraphx",
  "find": "-PatchDir 'C:\\bkmnt\\ort-amdgpu-patches'",
  "replace": "-PatchDir 'C:\\bkmnt\\wrong-patches'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OrtAmdgpuLifetime.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/amdgpu-lifetime-mutation.json",
  "why": "the EP invocation must use the directory populated by the two file mounts"
 },
 {
  "id": "windows-lane.call-assertions-recorded-argument-index",
  "target": "windows/scripts/tests/WindowsHarness.CallAssertions.psm1",
  "find": "$call[$ArgumentIndex]",
  "replace": "$call[0]",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.CallAssertions.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/call-assertions-mutation.json",
  "why": "recorded argument projections must preserve the requested argument boundary"
 },
 {
  "id": "windows-lane.call-assertions-recorded-count",
  "target": "windows/scripts/tests/WindowsHarness.CallAssertions.psm1",
  "find": "    Assert-Equal $Expected.Count $Actual.Count $CountReason",
  "replace": "    Write-Verbose 'sequence count omitted'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.CallAssertions.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/call-assertions-mutation.json",
  "why": "sequence assertions must reject extra and missing entries"
 },
 {
  "id": "windows-lane.call-assertions-recorded-values",
  "target": "windows/scripts/tests/WindowsHarness.CallAssertions.psm1",
  "find": "        Assert-Equal $Expected[$index] $Actual[$index] \"$EntryReason $index\"",
  "replace": "        Write-Verbose 'sequence value assertion omitted'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.CallAssertions.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/call-assertions-mutation.json",
  "why": "every recorded sequence entry must be compared in its original order"
 },
 {
  "id": "windows-lane.call-assertions-source-order",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "        Assert-TestAstOrder -Before $commandMap[$Order[$mapOrderIndex - 1]] -After $commandMap[$Order[$mapOrderIndex]]",
  "replace": "        Write-Verbose 'source order omitted'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.CallAssertions.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/call-assertions-mutation.json",
  "why": "source call order assertions must reject a reversed sequence"
 },
 {
  "id": "windows-lane.call-assertions-source-uniqueness",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "        Assert-Equal 1 $selectedCommands.Count ($CountReason -f $commandName)",
  "replace": "        Write-Verbose 'call uniqueness omitted'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.CallAssertions.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/call-assertions-mutation.json",
  "why": "a repeated selected source call must fail before source-order verification"
 },
 {
  "id": "windows-lane.child-diagnostic-ansi",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "-replace '\\x1b\\[[0-9;]*m', ''",
  "replace": "-replace 'NO_ANSI_MATCH', ''",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.CallAssertions.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/native-fixture-mutation.json",
  "why": "captured child diagnostics must remove ANSI escapes without changing their words"
 },
 {
  "id": "windows-lane.child-diagnostic-continuations",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "-replace '\\s*\\n\\s*(\\|\\s*)*', ' '",
  "replace": "-replace 'NO_GUTTER_MATCH', ' '",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.CallAssertions.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/native-fixture-mutation.json",
  "why": "wrapped PowerShell continuation gutters must not alter the expected refusal text"
 },
 {
  "id": "windows-lane.torch-refusal-normalization",
  "target": "windows/scripts/tests/WindowsTorchRocm.RefusalFixture.psm1",
  "find": "Assert-Match $Pattern (ConvertTo-TestDiagnosticText -Output @($Result.Out)) $Why",
  "replace": "Assert-Match $Pattern $Result.Out $Why",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Torch.Rocm.Refusal.Tests.ps1",
  "why": "a supplied wrapped refusal must still enforce the exact reason, failing status and absent download cache"
 },
 {
  "id": "uv-chain-ort.census-fixture-twins",
  "target": "windows/scripts/tests/Uv.CensusPath.Tests.ps1",
  "find": "`$env:PYTHON_WHEELS_FREE_THREADED = `$null; `$env:PYTHON_WHEELS_CP314T = `$null",
  "replace": "Write-Verbose 'inherited twin stores retained'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Uv.CensusPath.Tests.ps1",
  "why": "the staged-census fixture must isolate its path assertion from inherited free-threaded stores"
 },
 {
  "id": "uv-chain-ort.census-fixture-copy-directory",
  "target": "windows/scripts/tests/Uv.CensusPath.Tests.ps1",
  "find": "if ($dest -match '[\\\\/]$')",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Uv.CensusPath.Tests.ps1",
  "why": "a trailing directory separator must append the census filename after host path conversion"
 },
 {
  "id": "image-acceptance.ci-native-host",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if sys.platform != \"linux\" or native != target:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "a foreign or unknown host must not claim native sanitizer coverage"
 },
 {
  "id": "image-acceptance.ci-complete-sources",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if not isinstance(proof[\"sources\"], list) or len(proof[\"sources\"]) != len(plan[\"consumers\"]):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "all consumer sources are required before any acceptance work begins"
 },
 {
  "id": "image-acceptance.ci-clean-hub",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if api[\"git\"](hub, \"rev-parse\", \"HEAD\") != revision or api[\"git\"](hub, \"status\", \"--porcelain\"):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "the frozen tooling checkout must be exact and clean both before and after consumers"
 },
 {
  "id": "image-acceptance.ci-immutable-image",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    api[\"image_parts\"](proof[\"image\"])\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "moving image tags must refuse before running or exporting bindings"
 },
 {
  "id": "image-acceptance.ci-immutable-hub",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if not isinstance(proof[\"hub_revision\"], str) or not api[\"SHA\"].fullmatch(proof[\"hub_revision\"]):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "moving tooling refs must never reach GitHub outputs"
 },
 {
  "id": "image-acceptance.ci-immutable-consumer",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if not isinstance(source[\"revision\"], str) or not api[\"SHA\"].fullmatch(source[\"revision\"]):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "consumer source revisions must be immutable before cloning or testing"
 },
 {
  "id": "image-acceptance.ci-source-order",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if (source[\"name\"], source[\"repository\"]) != (spec[\"name\"], spec[\"repository\"]):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "source identities must bind to the complete original consumer order"
 },
 {
  "id": "image-acceptance.ci-proof-schema",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if not isinstance(proof, dict) or set(proof) != {\"schema_version\", \"hub_revision\", \"image\", \"platform\", \"sources\"} or proof[\"schema_version\"] != 1:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "unreviewed command or timeout fields cannot enter the proof contract"
 },
 {
  "id": "image-acceptance.ci-source-schema",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if not isinstance(source, dict) or set(source) != {\"name\", \"repository\", \"revision\", \"submodules\", \"data_locks\"}:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "source snapshots cannot carry replacement consumer commands"
 },
 {
  "id": "image-acceptance.ci-complete-plan",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if selected != {**api[\"read_plan\"](api[\"DEFAULT_PLAN\"]), \"platform\": proof[\"platform\"]}:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "the generated plan may change only platform, never commands or timeouts"
 },
 {
  "id": "image-acceptance.ci-receipt-validation",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    api[\"validate_receipt\"](receipt, proof[\"image\"], plan)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "a failed or incomplete real receipt cannot become passed job metadata"
 },
 {
  "id": "image-acceptance.ci-receipt-hub",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if receipt[\"hub_revision\"] != proof[\"hub_revision\"]:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "a valid receipt for another tooling commit must still refuse"
 },
 {
  "id": "image-acceptance.ci-receipt-sources",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if actual != expected:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "a complete receipt must still match every frozen consumer revision"
 },
 {
  "id": "image-acceptance.ci-checked-engine-query",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    clean = probe[\"exit_code\"] == 0 and not probe[\"stdout\"].strip()\n",
  "replace": "    clean = True\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "failed queries and reported leftover containers cannot produce a passed native job"
 },
 {
  "id": "image-acceptance.ci-engine-transport",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "        return {\"exit_code\": None, \"stdout\": \"\", \"stderr\": str(error)}\n",
  "replace": "        return {\"exit_code\": 0, \"stdout\": \"\", \"stderr\": \"\"}\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "engine transport errors retain failed metadata instead of inventing an empty successful query"
 },
 {
  "id": "image-acceptance.ci-no-overwrite",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    output.mkdir(parents=True, exist_ok=False)\n",
  "replace": "    output.mkdir(parents=True, exist_ok=True)\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "a new native proof must not overwrite an existing receipt or evidence directory"
 },
 {
  "id": "image-acceptance.ci-frozen-snapshot",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "            snapshot = api[\"source_snapshot\"](output / \"consumers\" / spec[\"name\"], spec, source)\n",
  "replace": "            snapshot = api[\"source_snapshot\"](output / \"consumers\" / spec[\"name\"], spec, {**source, \"revision\": \"d\" * 40})\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "prepared source snapshots must use the requested immutable revisions"
 },
 {
  "id": "python-types.native-image-proof-strict-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "replace": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "the isolated type fixture must detect removing the native proof driver from mandatory checks"
 },
 {
  "id": "python-types.native-image-proof-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "replace": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "the isolated type fixture must detect removing the native proof driver from mandatory checks"
 },
 {
  "id": "image-acceptance.ci-source-lock-structure",
  "target": "linux/scripts/image-acceptance-ci.py",
  "find": "    if not isinstance(source[\"submodules\"], str) or not isinstance(source[\"data_locks\"], dict):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-ci.sh",
  "why": "recursive submodule state and data-lock maps must retain their required types before any work"
 },
 {
  "id": "probe.opencv-cuda-cache-wrapper-argument",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "\"-DCUDA_NVCC_EXECUTABLE=${BASH_SOURCE[0]}\"",
  "replace": "\"-DCUDA_NVCC_EXECUTABLE=/bare/nvcc\"",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "The classic FindCUDA executable must use the preserved wrapper; the modern launcher alone does not intercept it."
 },
 {
  "id": "probe.opencv-cuda-cache-rule-verdict",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "            rc=1",
  "replace": "            rc=0",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "One bare nvcc rule must fail the complete configure gate even when another generated rule is correct."
 },
 {
  "id": "probe.opencv-cuda-cache-empty-rules",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "if [ \"${count}\" -eq 0 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "An enabled CUDA cache cannot be verified from an empty generated-rule tree."
 },
 {
  "id": "probe.opencv-cuda-cache-argv",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "\"${OPENCV_CUDA_CACHE_NVCC:?missing real OpenCV nvcc}\" \"$@\"",
  "replace": "\"${OPENCV_CUDA_CACHE_NVCC:?missing real OpenCV nvcc}\" \"$*\"",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "The legacy compiler wrapper preserves every argument boundary, including compiler paths with spaces."
 },
 {
  "id": "probe.opencv-cuda-cache-selected-call",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "opencv_cuda_cache_args _ocmcd_out \"${_cuda_launcher}\"",
  "replace": " : _ocmcd_out \"${_cuda_launcher}\"",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "The selected sccache-class launcher must reach the classic FindCUDA arguments and child environment."
 },
 {
  "id": "probe.opencv-cuda-cache-configure-call",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "    opencv_cuda_cache_assert \"${build_dir}\"",
  "replace": "    : \"${build_dir}\"",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "OpenCV must run the cache wiring verdict after configuration; a detached helper proves nothing."
 },
 {
  "id": "probe.opencv-cuda-cache-repeat-hits",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "    assert repeat[\"cache_hits\"][\"counts\"].get(name, 0) >= minimum, (\"repeat\", name, repeat)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "A forced repeat needs CUDA, device, PTX and CUBIN cache hits for every requested architecture."
 },
 {
  "id": "probe.opencv-cuda-cache-cold-misses",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "    assert cold[\"cache_misses\"][\"counts\"].get(name, 0) >= minimum, (\"cold\", name, cold)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "The private cold pass must actually fill each compilation category before reuse is claimed."
 },
 {
  "id": "probe.opencv-cuda-cache-repeat-misses",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "assert sum(repeat[\"cache_misses\"][\"counts\"].values()) == 0, repeat",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "A repeat containing a cache miss does not satisfy the local complete-reuse proof."
 },
 {
  "id": "probe.opencv-cuda-cache-errors",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "    assert sum(phase[\"cache_errors\"][\"counts\"].values()) == 0, phase",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "Cache errors cannot be hidden by positive CUDA hit counts."
 },
 {
  "id": "probe.opencv-cuda-cache-refusals",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "        assert phase[name] == 0, (name, phase)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "Compiler failures, write errors, parser refusals and forced recaches remain fatal in either phase."
 },
 {
  "id": "lib.onnx-webgpu-static-plugin-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "build_args_ref+=(--use_webgpu static_plugin --use_external_dawn)",
  "replace": "build_args_ref+=(--use_webgpu --use_external_dawn)",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "The native build must select the pinned CLI static_plugin mode, which enables EP API adapters as well as static plugin compilation."
 },
 {
  "id": "probe.opencv-cuda-cache-environment",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "    export CUDA_NVCC_EXECUTABLE=\"${BASH_SOURCE[0]}\"",
  "replace": "    : \"${BASH_SOURCE[0]}\"",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "Pinned FindCUDA must recover the wrapper from the environment after its legitimate toolkit-root cache invalidation."
 },
 {
  "id": "probe.opencv-cuda-cache-no-optimized-gate",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "    python3 -I - \"$@\"",
  "replace": "    python3 - \"$@\"",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "PYTHONOPTIMIZE must not turn the counter gate into an assertion-free pass."
 },
 {
  "id": "probe.opencv-cuda-cache-dependency-reason",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "    assert phase[\"requests_not_cacheable\"] == 1 and phase[\"not_cached\"] == {\"-M\": 1}, phase",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "Only the actual single dependency-only -M scan is expected; another count or refusal reason must fail."
 },
 {
  "id": "probe.opencv-cuda-cache-internal-driver",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "    assert phase[\"non_cacheable_compilations\"] == 1, phase",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "The one intentional outer nvcc driver must stay separately counted; extra internal bypasses fail."
 },
 {
  "id": "probe.opencv-cuda-cache-configured-path",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "        printf 'ERROR: OpenCV FindCUDA did not retain its nvcc cache wrapper\\n' >&2\n        return 1",
  "replace": "        printf 'ERROR: OpenCV FindCUDA did not retain its nvcc cache wrapper\\n' >&2\n        return 0",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "A wrong configured nvcc must fail even when generated fixture rules contain the correct wrapper."
 },
 {
  "id": "lib.onnx-webgpu-config-use-webgpu",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "\"onnxruntime_USE_WEBGPU=${want}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "Each actual configured Boolean is mandatory; legacy in-tree WebGPU, missing adapters or a wrong Dawn mode must fail."
 },
 {
  "id": "lib.onnx-webgpu-config-use-ep-api-adapters",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "\"onnxruntime_USE_EP_API_ADAPTERS=${want}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "Each actual configured Boolean is mandatory; legacy in-tree WebGPU, missing adapters or a wrong Dawn mode must fail."
 },
 {
  "id": "lib.onnx-webgpu-config-webgpu-static-plugin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "\"onnxruntime_WEBGPU_STATIC_PLUGIN=${want}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "Each actual configured Boolean is mandatory; legacy in-tree WebGPU, missing adapters or a wrong Dawn mode must fail."
 },
 {
  "id": "lib.onnx-webgpu-config-use-external-dawn",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "\"onnxruntime_USE_EXTERNAL_DAWN=${dawn}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "Each actual configured Boolean is mandatory; legacy in-tree WebGPU, missing adapters or a wrong Dawn mode must fail."
 },
 {
  "id": "lib.onnx-webgpu-config-verdict",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "      _cce_rc=1",
  "replace": "      _cce_rc=0",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "A mismatched configured option must propagate failure even when all remaining options are correct."
 },
 {
  "id": "lib.onnx-webgpu-config-optout",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "    want=OFF\n    if onnx_webgpu_enabled_for_target; then want=ON; fi",
  "replace": "    want=ON\n    if onnx_webgpu_enabled_for_target; then want=ON; fi",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "Native and cross opt-outs prove every configured switch is OFF rather than silently retaining a previous enabled build."
 },
 {
  "id": "lib.onnx-webgpu-config-missing-cache",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "    printf 'ERROR: [CMAKE] %s has no CMakeCache.txt; configured entries are unverified\\n' \"${_cce_cache%/*}\" >&2\n    return 1",
  "replace": "    printf 'ERROR: [CMAKE] %s has no CMakeCache.txt; configured entries are unverified\\n' \"${_cce_cache%/*}\" >&2\n    return 0",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "No configure cache is no proof; absence must fail instead of reporting an assertion-free pass."
 },
 {
  "id": "lib.onnx-webgpu-config-cpu-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  assert_onnx_webgpu_static_plugin \"${build_dir}/${config}\" || exit 1",
  "replace": "  : \"${build_dir}/${config}\" || exit 1",
  "test": "bash linux/scripts/tests/test-onnx-native-lifecycle.sh",
  "why": "The CPU build must reject a configured mismatch before collecting or publishing output."
 },
 {
  "id": "lib.onnx-webgpu-config-nvidia-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native-nvidia.sh",
  "find": "assert_onnx_webgpu_static_plugin \"${NATIVE_GPU_BUILD_DIR}/${NATIVE_CPU_CONFIG}\" || exit 1",
  "replace": ": \"${NATIVE_GPU_BUILD_DIR}/${NATIVE_CPU_CONFIG}\" || exit 1",
  "test": "bash linux/scripts/tests/test-onnx-native-lifecycle.sh",
  "why": "The actual NVIDIA script tail must reject a configured mismatch while retaining its raw build failure status."
 },
 {
  "id": "lib.onnx-webgpu-config-free-threaded-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "    assert_onnx_webgpu_static_plugin \"${build_dir}/${config}\"",
  "replace": "    : \"${build_dir}/${config}\"",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "A free-threaded reconfiguration gets its own verdict before a wheel can be retagged or stored."
 },
 {
  "id": "lib.onnx-webgpu-free-threaded-build-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "    \"${ORT_SRC_DIR}/build.sh\" \"${_oft_args[@]}\" --cmake_extra_defines \"${ft_defines[@]}\" || exit $?",
  "replace": "    \"${ORT_SRC_DIR}/build.sh\" \"${_oft_args[@]}\" --cmake_extra_defines \"${ft_defines[@]}\"",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "The added verdict must not mask a failed build inside a conditionally invoked subshell."
 },
 {
  "id": "lib.onnx-webgpu-wasm-asyncify-plugin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "--use_webgpu static_plugin --use_webnn \"$@\" --target onnxruntime_webassembly",
  "replace": "--use_webgpu --use_webnn \"$@\" --target onnxruntime_webassembly",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "The common C++ WebGPU flavor driver must retain static_plugin for both Asyncify and JSPI."
 },
 {
  "id": "lib.onnx-webgpu-wasm-jspi-plugin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "  run_webgpu_flavor_pass \"Pass 4: WebGPU (JSPI)\" jspi JSPI_COMMON_ARGS --enable_wasm_jspi",
  "replace": "  run_webgpu_flavor_pass \"Pass 4: WebGPU (JSPI)\" jspi JSPI_COMMON_ARGS",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "The JSPI flavor must retain its JSPI flag while reusing the common static-plugin build and its own exception policy."
 },
 {
  "id": "lib.onnx-webgpu-wasm-config-verdict",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "  if \"$@\" && assert_onnx_webgpu_static_plugin \"${BUILD_DIR}/${WASM_CONFIG}\" ON OFF; then",
  "replace": "  if \"$@\"; then",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "A successful builder with legacy WebGPU flags cannot be collected as a passing plugin flavor; preserve ORT_WEB_REQUIRED and optional failure policy."
 },
 {
  "id": "probe.opencv-cuda-cache-launcher-env",
  "target": "linux/scripts/02-toolchain/probe-opencv-cuda-cache.sh",
  "find": "compiler_cache_launcher_env 2>/dev/null || true",
  "replace": "compiler_cache_launcher_env",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "The real compiler probe carries the canonical guarded environment setup immediately before resolving the launcher."
 },
 {
  "id": "lib.onnx-webgpu-wasm-cache-epoch",
  "target": "linux/Dockerfile.media",
  "find": "id=onnxruntime-web-shared-${ONNXRUNTIME_VERSION}-${ONNXRUNTIME_WASM_BUILD_TYPE}-${ORT_WASM_WEBGPU_FLAVORS}-wgpu4,sharing=locked",
  "replace": "id=onnxruntime-web-shared-${ONNXRUNTIME_VERSION}-${ONNXRUNTIME_WASM_BUILD_TYPE}-${ORT_WASM_WEBGPU_FLAVORS}-wgpu3,sharing=locked",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "Changing the compiled WebGPU ABI must not reuse already completed WASM assets from the legacy in-tree EP cache."
 },
 {
  "id": "lib.onnx-webgpu-wasm-build-type-key",
  "target": "linux/Dockerfile.media",
  "find": "id=onnxruntime-web-shared-${ONNXRUNTIME_VERSION}-${ONNXRUNTIME_WASM_BUILD_TYPE}-${ORT_WASM_WEBGPU_FLAVORS}-wgpu4,sharing=locked",
  "replace": "id=onnxruntime-web-shared-${ONNXRUNTIME_VERSION}-${ORT_WASM_WEBGPU_FLAVORS}-wgpu4,sharing=locked",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "Completed Debug and Release WASM assets must not share an artifact-cache identity."
 },
 {
  "id": "lib.cmake-configured-bool-type",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "bool) _cce_pattern=BOOL",
  "replace": "bool) _cce_pattern='[A-Z]*'",
  "test": "bash linux/scripts/tests/test-cmake-compiler-cache-pin.sh",
  "why": "Boolean feature checks require the declared BOOL type; launcher checks keep their broader legacy types."
 },
 {
  "id": "lib.onnx-webgpu-requires-cmake-reader",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "stage_qnn_runtime apply_shared_library_action cmake_assert_configured_entries; do",
  "replace": "stage_qnn_runtime apply_shared_library_action; do",
  "test": "bash linux/scripts/tests/test-onnx-build-summary.sh",
  "why": "A missing shared CMake-reader API must fail at bootstrap before compilation begins."
 },
 {
  "id": "lib.cmake-configured-first-value-policy",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "_cce_got=\"${_cce_got%%$'\\n'*}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-cmake-compiler-cache-pin.sh",
  "why": "The shared reader must retain the existing first-value launcher policy while Boolean consumers reject duplicate values."
 },
 {
  "id": "lib.cmake-configured-keeps-wrapper-scope",
  "target": "linux/scripts/01-core/cmake-cache-linker.sh",
  "find": "  case \"${_cce_mode}\" in first) _cce_pattern='[A-Z]*' ;; bool) _cce_pattern=BOOL ;; *) return 2 ;; esac",
  "replace": "  local mode=\"${_cce_mode}\"\n  case \"${_cce_mode}\" in first) _cce_pattern='[A-Z]*' ;; bool) _cce_pattern=BOOL ;; *) return 2 ;; esac",
  "test": "bash linux/scripts/tests/test-cmake-compiler-cache-pin.sh",
  "why": "A shared CMake reader must not hide caller configuration observed by a supplied shell tool wrapper."
 },
 {
  "id": "lib.webgpu-build-proof-typed-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "if entries != [f\"{name}:{kind}={value}\"]:",
  "replace": "if not entries:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "Missing, duplicate, mistyped or disabled entries cannot bind a selected native mode."
 },
 {
  "id": "lib.webgpu-build-proof-all-flags",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "\"onnxruntime_USE_EP_API_ADAPTERS\",",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "The adapter flag belongs to the mode proof independently of the WebGPU enable flag."
 },
 {
  "id": "lib.webgpu-build-proof-elf-products",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "if header != b\"\\x7fELF\":",
  "replace": "if False and header != b\"\\x7fELF\":",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "Text or empty products cannot become valid native or Python build receipts."
 },
 {
  "id": "lib.webgpu-build-proof-prefix-boundary",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "relative = library.relative_to(prefix.resolve())",
  "replace": "relative = Path(library.name)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "A symlink to a foreign core must not bind that file to this prefix."
 },
 {
  "id": "lib.webgpu-build-proof-native-hash",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "return {\"kind\": \"native-core\", \"path\": relative.as_posix(), \"sha256\": digest}",
  "replace": "return {\"kind\": \"native-core\", \"path\": relative.as_posix(), \"sha256\": \"0\" * 64}",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "The core digest must describe its actual bytes."
 },
 {
  "id": "lib.webgpu-build-proof-python-hash",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "\"member\": entry.filename, \"sha256\": digest}]",
  "replace": "\"member\": entry.filename, \"sha256\": \"0\" * 64}]",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "Native core hashes cannot stand in for separately linked Python extensions."
 },
 {
  "id": "lib.webgpu-build-proof-unique-wheel",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "if len(wheels) != 1:",
  "replace": "if len(wheels) == 0:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "Ambiguous staged ORT wheels cannot select an arbitrary product."
 },
 {
  "id": "lib.webgpu-build-proof-unique-extension",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "if len(entries) != 1:",
  "replace": "if len(entries) == 0:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "Duplicate wheel members cannot choose arbitrary extension bytes."
 },
 {
  "id": "lib.webgpu-build-proof-wheel-abi",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "if free_threaded != (phase == \"free-threaded\"):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "A GIL wheel cannot be recorded as the FT linker product or the reverse."
 },
 {
  "id": "lib.webgpu-build-proof-explicit-no-wheel",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "if phase != \"gil\" or wheels:",
  "replace": "if phase != \"gil\":",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "An explicit no-wheel build cannot silently discard a staged Python product."
 },
 {
  "id": "lib.webgpu-build-proof-ft-source",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "previous.get(\"source\") != source",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "FT must extend the same source revision and ref as the native/GIL build."
 },
 {
  "id": "lib.webgpu-build-proof-ft-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "phases[\"gil\"].get(\"configured_flags\") != flags",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "FT must not silently change the GIL WebGPU selection."
 },
 {
  "id": "lib.webgpu-build-proof-ft-once",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "set(phases) != {\"gil\"}",
  "replace": "\"gil\" not in phases",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "A repeated FT phase cannot overwrite an earlier bound product."
 },
 {
  "id": "lib.webgpu-build-proof-retained-gil-bytes",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "if phases[\"gil\"].get(\"products\") != expected_products:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "Native/GIL products must retain the bytes recorded before FT reconfiguration."
 },
 {
  "id": "lib.webgpu-build-proof-source-identity",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "not re.fullmatch(r\"[a-f0-9]{40}\", args.source_revision)",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "A short or malformed Git identity cannot become a source receipt."
 },
 {
  "id": "lib.webgpu-build-proof-native-product-required",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py",
  "find": "products.insert(0, native_product(args.prefix))",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "A GIL build receipt also binds the separately shipped native core."
 },
 {
  "id": "lib.webgpu-build-proof-cpu-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native.sh",
  "find": "record_onnx_webgpu_build_products \"${NATIVE_CPU_BUILD_DIR}/${NATIVE_CPU_CONFIG}\" \"${NATIVE_CPU_OUTPUT_DIR}\" gil BUILD_ARGS \\\n  || err \"ONNX Runtime: the native/GIL WebGPU build proof failed\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "Both production tails must bind GIL outputs before the FT pass changes their configured tree."
 },
 {
  "id": "lib.webgpu-build-proof-nvidia-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native-nvidia.sh",
  "find": "record_onnx_webgpu_build_products \"${NATIVE_GPU_BUILD_DIR}/${NATIVE_CPU_CONFIG}\" \"${NATIVE_GPU_OUTPUT_DIR}\" gil BUILD_ARGS \\\n  || err \"ONNX Runtime: the native/GIL WebGPU build proof failed\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "Both production tails must bind GIL outputs before the FT pass changes their configured tree."
 },
 {
  "id": "lib.webgpu-build-proof-ft-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  record_onnx_webgpu_build_products \"${build_dir}/${config}\" \"${output_dir}\" free-threaded \"$4\" \\\n    || err \"ONNX Runtime: the free-threaded WebGPU build proof failed\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "The real FT pass must record its own final wheel."
 },
 {
  "id": "lib.webgpu-build-proof-ft-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "|| err \"ONNX Runtime: the free-threaded WebGPU build proof failed\"",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "An unsuccessful FT receipt cannot report a successful build."
 },
 {
  "id": "lib.webgpu-build-proof-wrapper-mode-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "assert_onnx_webgpu_static_plugin \"${config_dir}\" || return $?",
  "replace": "assert_onnx_webgpu_static_plugin \"${config_dir}\" || true",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "The shared recorder must retain the configured gate failure before writing any receipt."
 },
 {
  "id": "lib.webgpu-build-proof-wrapper-git-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "revision=\"$(git -C \"${ORT_SRC_DIR}\" rev-parse --verify HEAD)\" || return $?",
  "replace": "revision=\"$(git -C \"${ORT_SRC_DIR}\" rev-parse --verify HEAD)\" || true",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "A failed source lookup retains its raw status instead of becoming another command result."
 },
 {
  "id": "lib.webgpu-build-proof-required-companion",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "\"${_owbp_options[@]}\"\n",
  "replace": "\"${_owbp_options[@]}\" || return 0\n",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-build-proof.sh",
  "why": "A missing recorder or failed publication cannot fall back to success."
 },
 {
  "id": "ort-census.webgpu-delivery-required-api",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "if not all(callable(getattr(module, name, None)) for name in exports):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "A present file with the wrong API cannot satisfy a canonical companion."
 },
 {
  "id": "ort-census.webgpu-delivery-loader-bytes",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "if data != elf.loader_bytes(address + position, length):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Section-only original bytes cannot conceal changed data used by the loader."
 },
 {
  "id": "ort-census.webgpu-delivery-allocated-bytes",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "digest.update(data)",
  "replace": "digest.update(b\"\")",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Rewritten code or data must retain their actual compiled bytes."
 },
 {
  "id": "ort-census.webgpu-delivery-symbol-name",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "table_string(strings, name).hex()",
  "replace": "\"\"",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Dynamic symbol names remain protected while string offsets and section indices normalize."
 },
 {
  "id": "ort-census.webgpu-delivery-elf-identity",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "body = [identity, [(name.hex(), value) for name, value in sorted(sections.items())]]",
  "replace": "body = [None, [(name.hex(), value) for name, value in sorted(sections.items())]]",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Identical section bytes from another ELF machine cannot become this product."
 },
 {
  "id": "ort-census.webgpu-delivery-source-identity",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "not re.fullmatch(r\"[a-f0-9]{40}\", source.get(\"revision\", \"\"))",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Delivery requires the full source identity already bound at build time."
 },
 {
  "id": "ort-census.webgpu-delivery-native-core",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "if build_api().native_product(prefix) not in receipt[\"phases\"][\"gil\"][\"products\"]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "The native core must retain its proved bytes while Python wheels are rewritten."
 },
 {
  "id": "ort-census.webgpu-delivery-configured-mode",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "if flags not in (dict.fromkeys(build_api().FLAGS, \"ON\"), dict.fromkeys(build_api().FLAGS, \"OFF\")):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Mixed or untyped flag sets cannot bind a native static-plugin mode."
 },
 {
  "id": "ort-census.webgpu-delivery-delivery-history",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "if hop[\"from\"] != current or hop[\"build_binding_sha256\"] != build_binding(receipt):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Every delivered hash must retain a continuous path from its original build product."
 },
 {
  "id": "ort-census.webgpu-delivery-native-only",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "if rows or lines:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "A native-only build cannot acquire a Python delivery proof from an unrelated wheel."
 },
 {
  "id": "ort-census.webgpu-delivery-unique-binding",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "if len(matches) != 1 or len(rows) != len(lines):",
  "replace": "if not matches or len(rows) != len(lines):",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Duplicate manifest bindings cannot select an arbitrary original row."
 },
 {
  "id": "ort-census.webgpu-delivery-pending-manifest",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "pending[\"manifest_sha256\"] != manifest_sha",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "A pending check binds the original manifest bytes before follow can publish."
 },
 {
  "id": "ort-census.webgpu-delivery-pending-product",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "pending[\"product\"] != before",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "The original product authorized by precheck cannot be replaced during rewriting."
 },
 {
  "id": "ort-census.webgpu-delivery-pending-mode",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "pending[\"build_binding_sha256\"] != binding",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Changing mode or source after precheck cannot inherit its authorization."
 },
 {
  "id": "ort-census.webgpu-delivery-pending-directory",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "pending[\"directory\"] != str(wheels.resolve())",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Follow cannot switch to another wheelhouse after precheck."
 },
 {
  "id": "ort-census.webgpu-delivery-content-continuity",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "if allocated != pending[\"allocated_sha256\"]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Allowed metadata rewrites cannot silently replace compiled ORT code, data or symbols."
 },
 {
  "id": "ort-census.webgpu-delivery-prepare-call",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "        prepare_delivery(mode, Path(manifest), rows, out[manifest], Path(wheels), stem, proof_updates)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "The real check/follow transport must execute WebGPU delivery validation."
 },
 {
  "id": "ort-census.webgpu-delivery-publication-call",
  "target": "linux/scripts/03-media/runtime/repair-wheels.sh",
  "find": "publish_deliveries(proof_updates)\n",
  "replace": "pass\n",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "A raw manifest update cannot replace the associated checked delivery receipt."
 },
 {
  "id": "ort-census.webgpu-delivery-mount-build",
  "target": "linux/Dockerfile.media",
  "find": "    --mount=type=bind,source=linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py,target=/opt/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py,readonly \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Every required canonical companion must reach the media rewrite RUN."
 },
 {
  "id": "ort-census.webgpu-delivery-mount-elf",
  "target": "linux/Dockerfile.media",
  "find": "    --mount=type=bind,source=linux/scripts/06-packaging/python-app-deb-depends.py,target=/opt/scripts/06-packaging/python-app-deb-depends.py,readonly \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Every required canonical companion must reach the media rewrite RUN."
 },
 {
  "id": "ort-census.webgpu-delivery-mount-symbols",
  "target": "linux/Dockerfile.media",
  "find": "    --mount=type=bind,source=linux/scripts/06-packaging/python_app_deb_symbols.py,target=/opt/scripts/06-packaging/python_app_deb_symbols.py,readonly \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Every required canonical companion must reach the media rewrite RUN."
 },
 {
  "id": "ort-census.webgpu-delivery-copy-build",
  "target": "linux/Dockerfile.package",
  "find": "COPY --chmod=755 linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py /opt/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-build-proof.py\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "The shipped proof module must retain its required source APIs in the package layout."
 },
 {
  "id": "ort-census.webgpu-delivery-copy-elf",
  "target": "linux/Dockerfile.package",
  "find": "COPY --chmod=644 linux/scripts/06-packaging/python-app-deb-depends.py linux/scripts/06-packaging/python_app_deb_symbols.py /opt/scripts/06-packaging/\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "The shipped proof module must retain its required source APIs in the package layout."
 },
 {
  "id": "wheels.media-finalize-driver",
  "target": "linux/Dockerfile.media",
  "find": "    bash /opt/scripts/03-media/runtime/finalize-media.sh\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-media-finalize.sh",
  "why": "The media RUN must execute the preserved complete finalization pipeline."
 },
 {
  "id": "wheels.media-finalize-raw-status",
  "target": "linux/scripts/03-media/runtime/finalize-media.sh",
  "find": "    bash /opt/scripts/03-media/runtime/collect-artifacts.sh && \\\n",
  "replace": "    { bash /opt/scripts/03-media/runtime/collect-artifacts.sh || true; } && \\\n",
  "test": "bash linux/scripts/tests/test-media-finalize.sh",
  "why": "A failed phase keeps its raw status and cannot reach later phases."
 },
 {
  "id": "wheels.media-finalize-env-failure",
  "target": "linux/scripts/03-media/runtime/finalize-media.sh",
  "find": "    source /opt/scripts/03-media/runtime/media-env.sh\n",
  "replace": "    source /opt/scripts/03-media/runtime/media-env.sh || true\n",
  "test": "bash linux/scripts/tests/test-media-finalize.sh",
  "why": "Failed environment setup must stop before collection."
 },
 {
  "id": "wheels.media-finalize-native-install",
  "target": "linux/scripts/03-media/runtime/finalize-media.sh",
  "find": "[ \"${TARGET_ARCH:-amd64}\" != \"amd64\" ]",
  "replace": "[ 1 = 1 ]",
  "test": "bash linux/scripts/tests/test-media-finalize.sh",
  "why": "Default/amd64 installation failures remain fatal."
 },
 {
  "id": "wheels.media-finalize-cross-install",
  "target": "linux/scripts/03-media/runtime/finalize-media.sh",
  "find": "[ \"${TARGET_ARCH:-amd64}\" != \"amd64\" ]",
  "replace": "[ \"${TARGET_ARCH:-amd64}\" = \"amd64\" ]",
  "test": "bash linux/scripts/tests/test-media-finalize.sh",
  "why": "Foreign wheel installation retains its advisory policy and reaches final validation."
 },
 {
  "id": "wheels.media-finalize-python-path",
  "target": "linux/scripts/03-media/runtime/finalize-media.sh",
  "find": "    PYTHONPATH=\"$(echo /opt/opencv5/lib/python*/site-packages 2>/dev/null):${PYTHONPATH:-}\" \\\n",
  "replace": "    PYTHONPATH=\"${PYTHONPATH:-}\" \\\n",
  "test": "bash linux/scripts/tests/test-media-finalize.sh",
  "why": "The final smoke prepends the image OpenCV path while retaining caller Python paths."
 },
 {
  "id": "probe.webgpu-abi",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if free_threaded != (phase == \"free-threaded\"):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "The actual interpreter ABI must own the selected delivery phase."
 },
 {
  "id": "probe.webgpu-gil",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if free_threaded and (not callable(getattr(sys, \"_is_gil_enabled\", None)) or sys._is_gil_enabled()):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "The FT process must keep its GIL disabled."
 },
 {
  "id": "probe.webgpu-native-loader",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if spec is None or not isinstance(spec.loader, importlib.machinery.ExtensionFileLoader):",
  "replace": "if spec is None:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "A Python source shim cannot stand in for the delivered native extension."
 },
 {
  "id": "probe.webgpu-pending",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if any(\"delivery_pending\" in record for record in receipt[\"phases\"].values()):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "Runtime cannot accept unfinished wheel repair."
 },
 {
  "id": "probe.webgpu-no-history",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "    if not history or any(a[\"after_manifest_sha256\"] != b[\"before_manifest_sha256\"]\n                          for a, b in pairwise(history)):\n        raise ValueError(\"WebGPU delivery has no completed manifest history\")",
  "replace": "    if not history:\n        return product\n    if any(a[\"after_manifest_sha256\"] != b[\"before_manifest_sha256\"] for a, b in pairwise(history)):\n        raise ValueError(\"WebGPU delivery has no completed manifest history\")",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "Original build hashes are not final wheel delivery."
 },
 {
  "id": "probe.webgpu-history-continuity",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "    if not history or any(a[\"after_manifest_sha256\"] != b[\"before_manifest_sha256\"]\n                          for a, b in pairwise(history)):\n        raise ValueError(\"WebGPU delivery has no completed manifest history\")",
  "replace": "    if not history:\n        raise ValueError(\"WebGPU delivery has no completed manifest history\")",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "Every repair hop retains manifest continuity."
 },
 {
  "id": "probe.webgpu-manifest-sha",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if hashlib.sha256(body).hexdigest() != history[-1][\"after_manifest_sha256\"]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "A changed final manifest cannot prove delivery."
 },
 {
  "id": "probe.webgpu-manifest-unique",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if matching != [[product[\"sha256\"], label]]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "A duplicate or wrong final row cannot prove one product."
 },
 {
  "id": "probe.webgpu-phase-mode",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if record[\"configured_flags\"] != receipt[\"phases\"][\"gil\"][\"configured_flags\"]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "The FT product must retain its native build mode."
 },
 {
  "id": "probe.webgpu-source-ref",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if receipt[\"source\"][\"ref\"] != source_ref:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "The proof must use the requested pinned source ref."
 },
 {
  "id": "probe.webgpu-python-sha",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "product is not None and product[\"sha256\"] == digest:",
  "replace": "product is not None:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "The loaded extension needs its own final-byte match."
 },
 {
  "id": "probe.webgpu-member-path",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if tuple(path.parts[-3:]) != tuple(Path(product[\"member\"]).parts):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "The matching extension must keep its delivered member identity."
 },
 {
  "id": "probe.webgpu-owner-count",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if len(matches) != 1:",
  "replace": "if not matches:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "Ambiguous owning prefixes are not a valid runtime proof."
 },
 {
  "id": "probe.webgpu-precise-error",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if str(error) != MISSING:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "Only the exact pinned ORT missing-registration error is a negative control."
 },
 {
  "id": "probe.webgpu-error-type",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "except error_type as error:",
  "replace": "except Exception as error:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "A non-ORT exception cannot masquerade as the known ORT failure."
 },
 {
  "id": "probe.webgpu-first-unregister",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "        binding.unregister_execution_provider_library(PROVIDER)\n    else:\n        require_missing(binding)",
  "replace": "        pass\n    else:\n        require_missing(binding)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "Enabled mode must first prove a registered factory."
 },
 {
  "id": "probe.webgpu-repeat-negative",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "    require_missing(binding)\n    interpreter_mode(phase)",
  "replace": "    interpreter_mode(phase)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "A repeat must independently prove the factory was removed."
 },
 {
  "id": "probe.webgpu-off-absence",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "    else:\n        require_missing(binding)\n    require_missing(binding)",
  "replace": "    else:\n        pass\n    require_missing(binding)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "Disabled mode must prove absence on both calls."
 },
 {
  "id": "probe.webgpu-post-gil",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "    require_missing(binding)\n    interpreter_mode(phase)",
  "replace": "    require_missing(binding)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "Factory calls must not turn the FT GIL back on."
 },
 {
  "id": "probe.webgpu-main-call",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    check_webgpu_factories \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-webgpu-runtime-transport.sh",
  "why": "The image smoke must execute the factory gate."
 },
 {
  "id": "probe.webgpu-gil-child",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "/opt/venv/bin/python -I /opt/scripts/03-media/final/ort_webgpu_runtime.py",
  "replace": "python3 /opt/scripts/03-media/final/ort_webgpu_runtime.py",
  "test": "bash linux/scripts/tests/test-webgpu-runtime-transport.sh",
  "why": "The GIL gate uses the isolated owning interpreter."
 },
 {
  "id": "probe.webgpu-gil-status",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "[ \"${status}\" = 0 ] && [ \"${sentinels}\" = 1 ]",
  "replace": "[ \"${sentinels}\" = 1 ]",
  "test": "bash linux/scripts/tests/test-runtime-probe-verdicts.sh",
  "why": "An OK sentinel cannot hide a failed process."
 },
 {
  "id": "probe.webgpu-gil-sentinel",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "[ \"${status}\" = 0 ] && [ \"${sentinels}\" = 1 ]",
  "replace": "[ \"${status}\" = 0 ]",
  "test": "bash linux/scripts/tests/test-runtime-probe-verdicts.sh",
  "why": "An empty or misleading successful child cannot pass."
 },
 {
  "id": "probe.webgpu-gil-unique",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "[ \"${sentinels}\" = 1 ]",
  "replace": "[ \"${sentinels}\" -ge 1 ]",
  "test": "bash linux/scripts/tests/test-runtime-probe-verdicts.sh",
  "why": "Two success sentinels are not one completed proof."
 },
 {
  "id": "wheels.ft-webgpu-phase",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "--phase free-threaded --source-ref",
  "replace": "--phase gil --source-ref",
  "test": "bash linux/scripts/tests/test-webgpu-runtime-transport.sh",
  "why": "The installed FT interpreter must prove its own phase."
 },
 {
  "id": "wheels.ft-webgpu-child",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "\"${work}/venv/bin/python\" -I /opt/scripts/03-media/final/ort_webgpu_runtime.py",
  "replace": "python3 /opt/scripts/03-media/final/ort_webgpu_runtime.py",
  "test": "bash linux/scripts/tests/test-webgpu-runtime-transport.sh",
  "why": "The FT factory probe must execute in the freshly installed FT venv."
 },
 {
  "id": "wheels.ft-webgpu-row",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "    _ft_store_webgpu_verdict \"${probe}\" \"${w%%-*}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "Generic module-import proof cannot replace the FT factory verdict."
 },
 {
  "id": "wheels.ft-webgpu-proof",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "if [[ \"${rows}\" == \"FTS WEBGPU ${distribution} WEBGPU-FACTORY OK: \"* ]] && [[ \"${rows}\" != *$'\\n'* ]]; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "Missing and failed factory children must remain visible."
 },
 {
  "id": "wheels.ft-webgpu-unique",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": " && [[ \"${rows}\" != *$'\\n'* ]]",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "Duplicated FT factory proofs cannot satisfy the gate."
 },
 {
  "id": "probe.native-webgpu-legacy",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (strcmp(providers[index], PROVIDER) == 0)",
  "replace": "if (0 && strcmp(providers[index], PROVIDER) == 0)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "A legacy compiled WebGPU provider cannot masquerade as a static plugin."
 },
 {
  "id": "probe.native-webgpu-cpu-baseline",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (cpu != 1)",
  "replace": "if (cpu < 0)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The compiled-provider baseline must contain exactly one CPU provider."
 },
 {
  "id": "probe.native-webgpu-negative-success",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (!status) return error(\"negative control unexpectedly unregistered a factory\");",
  "replace": "if (!status) return 0;",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "A repeat success cannot prove factory removal."
 },
 {
  "id": "probe.native-webgpu-negative-code",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "probe->api->GetErrorCode(status) != ORT_FAIL",
  "replace": "0",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The negative control requires ORT_FAIL, not another error with the same text."
 },
 {
  "id": "probe.native-webgpu-negative-message",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "strcmp(message, MISSING) != 0",
  "replace": "0",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "Only the exact pinned missing-key text proves absence."
 },
 {
  "id": "probe.native-webgpu-first-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (status_error(probe, status, \"first UnregisterExecutionProviderLibrary\")) return 1;",
  "replace": "(void)status_error(probe, status, \"first UnregisterExecutionProviderLibrary\");",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "Enabled mode requires a successful first unregistration."
 },
 {
  "id": "probe.native-webgpu-registration-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (!failed) failed = registration(&probe, enabled);",
  "replace": "if (!failed && enabled > 100) failed = registration(&probe, enabled);",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The real native executable must create an owning environment and check its factory."
 },
 {
  "id": "probe.native-webgpu-provider-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (!failed) failed = compiled_providers(&probe);",
  "replace": "if (!failed && enabled > 100) failed = compiled_providers(&probe);",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The compiled-provider legacy gate must run before environment creation."
 },
 {
  "id": "probe.native-webgpu-status-release",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "  probe->api->ReleaseStatus(status);\n  return failed;",
  "replace": "  (void)status;\n  return failed;",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "Negative-control statuses must be released."
 },
 {
  "id": "probe.native-webgpu-env-release",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (probe->env) probe->api->ReleaseEnv(probe->env);",
  "replace": "if (probe->env) (void)probe->env;",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "A successful or failed factory probe must release its environment."
 },
 {
  "id": "probe.native-webgpu-close-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (probe->library && dlclose(probe->library) != 0) { error(\"dlclose failed\"); failed = 1; }",
  "replace": "if (probe->library && dlclose(probe->library) != 0) { error(\"dlclose failed\"); }",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "Loader cleanup failure must prevent the success sentinel."
 },
 {
  "id": "probe.native-webgpu-provider-release-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (providers && status_error(probe, probe->api->ReleaseAvailableProviders(providers, count), \"ReleaseAvailableProviders\")) failed = 1;",
  "replace": "if (providers) (void)status_error(probe, probe->api->ReleaseAvailableProviders(providers, count), \"ReleaseAvailableProviders\");",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "Provider-list cleanup failure cannot be hidden by later registration success."
 },
 {
  "id": "probe.native-webgpu-core-status",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if result.returncode != 0 or len(sentinels) != 1 or failure:",
  "replace": "if len(sentinels) != 1 or failure:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The native wrapper retains the child's raw failure status."
 },
 {
  "id": "probe.native-webgpu-core-sentinel",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if result.returncode != 0 or len(sentinels) != 1 or failure:",
  "replace": "if result.returncode != 0 or failure:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "An empty, duplicate or wrong-mode native verdict is not a PASS."
 },
 {
  "id": "probe.native-webgpu-core-failure-marker",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if result.returncode != 0 or len(sentinels) != 1 or failure:",
  "replace": "if result.returncode != 0 or len(sentinels) != 1:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "A zero status and OK sentinel cannot hide an explicit native failure."
 },
 {
  "id": "probe.native-webgpu-core-stream-boundary",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "(result.stdout + \"\\n\" + result.stderr).splitlines()",
  "replace": "(result.stdout + result.stderr).splitlines()",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The two output streams remain distinct even without a trailing newline."
 },
 {
  "id": "probe.native-webgpu-core-after",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if delivery.build_api().native_product(prefix) != product or linker_digest(probe) != digest:",
  "replace": "if linker_digest(probe) != digest:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The loaded core's checked bytes must remain unchanged after execution."
 },
 {
  "id": "probe.native-webgpu-probe-after",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if delivery.build_api().native_product(prefix) != product or linker_digest(probe) != digest:",
  "replace": "if delivery.build_api().native_product(prefix) != product:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The native executable must retain its checked bytes through execution."
 },
 {
  "id": "probe.native-webgpu-all-prefixes",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "[native_core(prefix, source_ref) for prefix in prefixes]",
  "replace": "[native_core(prefix, source_ref) for prefix in prefixes[:1]]",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "Every selected native core needs its own proof."
 },
 {
  "id": "probe.native-webgpu-native-dispatch",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "prove_native(prefixes, args.source_ref) if args.phase == \"native\"",
  "replace": "prove_native(prefixes, args.source_ref) if False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "Native CLI execution must not import Python bindings instead."
 },
 {
  "id": "probe.native-webgpu-required-helper",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "printf 'ERROR: native WebGPU probe requires %s\\n' \"${required}\" >&2\n      return 1",
  "replace": "printf 'ERROR: native WebGPU probe requires %s\\n' \"${required}\" >&2\n      return 0",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "A missing required helper is fatal before selected tools run."
 },
 {
  "id": "probe.native-webgpu-cache-resolver",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "append_cmake_cache_linker_args probe_args || return $?",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "Native probe compilation must resolve its compiler cache through the canonical helper."
 },
 {
  "id": "probe.native-webgpu-configure-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "cmake \"${probe_args[@]}\" || return $?",
  "replace": "cmake \"${probe_args[@]}\" || true",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "A failed configure cannot advance to build or installation under conditional callers."
 },
 {
  "id": "probe.native-webgpu-cache-gate",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "cmake_assert_compiler_cache_pin \"${probe_build}\" \"${CMAKE_COMPILER_CACHE_PIN}\" || return $?",
  "replace": "cmake_assert_compiler_cache_pin \"${probe_build}\" \"${CMAKE_COMPILER_CACHE_PIN}\" || true",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "A replaced or missing configured compiler launcher stops the producer."
 },
 {
  "id": "probe.native-webgpu-build-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "run_cmake_build_with_fallback \"${probe_build}\" 1 || return $?",
  "replace": "run_cmake_build_with_fallback \"${probe_build}\" 1 || true",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "A failed native probe compilation must not publish a prefix."
 },
 {
  "id": "probe.native-webgpu-install-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "cmake --install \"${probe_build}\" --prefix \"${output_dir}\" || return $?",
  "replace": "cmake --install \"${probe_build}\" --prefix \"${output_dir}\" || true",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "A failed native executable installation cannot reach the build receipt."
 },
 {
  "id": "probe.native-webgpu-cpu-producer",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native.sh",
  "find": "build_onnx_webgpu_factory_probe \"${NATIVE_CPU_BUILD_DIR}/${NATIVE_CPU_CONFIG}\" \"${NATIVE_CPU_OUTPUT_DIR}\" \\\n  || err \"ONNX Runtime: the target-native WebGPU factory probe build failed\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "The CPU producer must build its native probe before receipt publication and FT reconfiguration."
 },
 {
  "id": "probe.native-webgpu-gpu-producer",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native-nvidia.sh",
  "find": "build_onnx_webgpu_factory_probe \"${NATIVE_GPU_BUILD_DIR}/${NATIVE_CPU_CONFIG}\" \"${NATIVE_GPU_OUTPUT_DIR}\" \\\n  || err \"ONNX Runtime: the target-native WebGPU factory probe build failed\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "The GPU producer must build its native probe before receipt publication and FT reconfiguration."
 },
 {
  "id": "probe.native-webgpu-configured-compiler",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/CMakeLists.txt",
  "find": "    set(${setting}\n        \"${CORE_${setting}}\"\n        CACHE STRING \"Owning ORT compiler configuration\" FORCE)",
  "replace": "    set(${setting}\n        \"${CORE_${setting}}\"\n        CACHE STRING \"Owning ORT compiler configuration\")",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The core compiler wins over a conflicting explicit host compiler."
 },
 {
  "id": "probe.native-webgpu-missing-compiler",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/CMakeLists.txt",
  "find": "if(NOT CORE_CMAKE_C_COMPILER)\n  message(FATAL_ERROR \"The owning ORT C compiler is required\")\nendif()",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "A readable cache without its owning C compiler cannot fall back to the host."
 },
 {
  "id": "probe.native-webgpu-missing-header",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/CMakeLists.txt",
  "find": "if(NOT EXISTS \"${ORT_INCLUDE_DIR}/onnxruntime_c_api.h\")\n  message(FATAL_ERROR \"The owning ORT C API header is required\")\nendif()",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "Missing owning headers fail configuration before build/install."
 },
 {
  "id": "probe.native-webgpu-native-smoke-phase",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "for phase in native gil; do",
  "replace": "for phase in gil gil; do",
  "test": "bash linux/scripts/tests/test-webgpu-runtime-transport.sh",
  "why": "Image smoke must execute the native and GIL phases separately."
 },
 {
  "id": "probe.native-webgpu-config-path",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "${1:?configured ORT build required}",
  "replace": "${1-}",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "An empty config-path must fail before creating a build or installation path."
 },
 {
  "id": "probe.native-webgpu-prefix-path",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "${2:?ORT output prefix required}",
  "replace": "${2-}",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "An empty prefix-path must fail before creating a build or installation path."
 },
 {
  "id": "probe.native-webgpu-provider-bound",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "count > 1024",
  "replace": "count > 2048",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "An invalid oversized provider list must be refused before walking or initializing an environment."
 },
 {
  "id": "probe.native-webgpu-cache-pin-scope",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "required CMAKE_COMPILER_CACHE_PIN=''",
  "replace": "required; CMAKE_COMPILER_CACHE_PIN=''",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native-build.sh",
  "why": "The canonical cache callback must write the producer helper's local output slot without changing the caller's absent, empty or existing binding."
 },
 {
  "id": "lib.compiler-tool-fixture-custom-temp-root",
  "target": "linux/scripts/tests/test-compiler-tool-toggles.sh",
  "find": "case \"$arg\" in */probe.c) arg=SOURCE ;; */probe) arg=OUTPUT ;; esac",
  "replace": "case \"$arg\" in /tmp/*/probe.c) arg=SOURCE ;; /tmp/*/probe) arg=OUTPUT ;; esac",
  "test": "bash linux/scripts/tests/test-compiler-tool-toggles.sh",
  "why": "The compiler spy must normalize generated source and output argv under arbitrary temporary roots, including paths containing spaces."
 },
 {
  "id": "lib.ort-plugin-registration-image-root-precedence",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "    if root_value:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "An advertised image root wins over a separately present bundled module; a missing advertised root cannot silently fall back."
 },
 {
  "id": "lib.ort-plugin-registration-absolute-image-root",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        if not root.is_absolute():",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "Relative image roots fail before native registration."
 },
 {
  "id": "lib.ort-plugin-registration-image-root-directory",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        if not root.is_dir():",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "A file advertised as an image root keeps the explicit configuration diagnostic."
 },
 {
  "id": "lib.ort-plugin-registration-windows-layout",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        path = root / filename if windows else root / \"lib\" / filename",
  "replace": "        path = root / \"lib\" / filename if windows else root / filename",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "The Windows root and Linux lib layout remain distinct, including paths with spaces."
 },
 {
  "id": "lib.ort-plugin-registration-absolute-binding-path",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "    if not module.is_absolute():",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "Relative binding paths cannot discover a plugin through the current working directory."
 },
 {
  "id": "lib.ort-plugin-registration-optional-bundle-absence",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "    if not path.exists() and not path.is_symlink():",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "A CPU binding without an advertised or bundled plugin does not attempt native registration."
 },
 {
  "id": "lib.ort-plugin-registration-registered-module-is-file",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        if not path.is_file():\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "A directory cannot be reported as a successfully registered native library."
 },
 {
  "id": "lib.ort-plugin-registration-native-call-required",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        register(plugin.name, str(path))",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "A success report requires the owning binding to receive the native registration call."
 },
 {
  "id": "lib.ort-plugin-registration-registration-name",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        register(plugin.name, str(path))",
  "replace": "        register(\"MIGraphXExecutionProvider\", str(path))",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "The plugin is registered with its actual chosen factory name, not the removed built-in name."
 },
 {
  "id": "lib.ort-plugin-registration-failed-call-retry",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        register(plugin.name, str(path))\n        _REGISTERED.setdefault(binding, {})[plugin.name] = path",
  "replace": "        _REGISTERED.setdefault(binding, {})[plugin.name] = path\n        register(plugin.name, str(path))",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "A failed native call cannot enter the successful-registration cache or prevent a retry."
 },
 {
  "id": "lib.ort-plugin-registration-owning-binding-cache",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        previous = _REGISTERED.get(binding, {}).get(plugin.name)",
  "replace": "        previous = next(iter(_REGISTERED.values()), {}).get(plugin.name)",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "Two owning bindings each require their own native registration even for the same module path."
 },
 {
  "id": "lib.ort-plugin-registration-register-once",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        if previous is not None:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "Repeated sessions and concurrent callers do not register the same factory twice."
 },
 {
  "id": "lib.ort-plugin-registration-path-conflict",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "            if previous != path:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "An existing name cannot silently change its native module after an environment change."
 },
 {
  "id": "lib.ort-plugin-registration-report-success-only",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        return tuple(sorted(_REGISTERED.get(binding, {})))",
  "replace": "        return ()",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "The self-test can report the actual successful registrations for its own binding."
 },
 {
  "id": "lib.ort-plugin-registration-negative-device-index",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "    if device_index < 0:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "Negative indices fail before native registration and cannot select the last enumerated device."
 },
 {
  "id": "lib.ort-plugin-registration-device-name-selection",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        device for device in binding.get_ep_devices() if device.ep_name == plugin.name",
  "replace": "        device for device in binding.get_ep_devices() if device.ep_name == \"MIGraphXExecutionProvider\"",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "Runtime device discovery matches the registered plugin name, not the legacy compile-time provider."
 },
 {
  "id": "lib.ort-plugin-registration-device-index-bounds",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "    if device_index >= len(devices):",
  "replace": "    if device_index > len(devices):",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "An index exactly past the matching devices retains the explicit unavailable-device failure."
 },
 {
  "id": "lib.ort-plugin-registration-requested-device-index",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "    return devices[device_index]",
  "replace": "    return devices[0]",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "An explicitly requested second GPU cannot silently select the first matching device."
 },
 {
  "id": "lib.ort-plugin-registration-exact-shared-asset",
  "target": "shared/config/shared-assets.manifest",
  "find": "ort-plugin-registration-python | shared/python/ort_plugin_eps.py | runtime_support/ort_plugin_eps.py | exact |",
  "replace": "ort-plugin-registration-python | shared/python/ort_plugin_eps.py | runtime_support/ort_plugin_eps.py | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "A packaged runtime helper remains byte-identical to its owning source, including header content."
 },
 {
  "id": "lib.ort-plugin-registration-shared-lock",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "    with _LOCK:\n        previous = _REGISTERED.get(binding, {}).get(plugin.name)",
  "replace": "    with threading.RLock():\n        previous = _REGISTERED.get(binding, {}).get(plugin.name)",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "Concurrent native calls release the GIL, so all callers must share one registration lock."
 },
 {
  "id": "lib.ort-plugin-native-image-root-precedence",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "    if (!advertised) {",
  "replace": "    if (true) {",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "An explicit image root wins and cannot silently fall back to a separately bundled module."
 },
 {
  "id": "lib.ort-plugin-native-absolute-root",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "    if (!root.is_absolute()) {",
  "replace": "    if (false) {",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A relative advertised root fails before any native registration."
 },
 {
  "id": "lib.ort-plugin-native-absolute-bundle",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "        if (!bundled_directory.is_absolute()) {",
  "replace": "        if (false) {",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Bundled lookup never depends on the current working directory."
 },
 {
  "id": "lib.ort-plugin-native-root-directory",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "    if (!std::filesystem::is_directory(root, status) || status) {",
  "replace": "    if (false) {",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A file advertised as the image root retains its explicit configuration failure."
 },
 {
  "id": "lib.ort-plugin-native-module-file",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "        if (!std::filesystem::is_regular_file(resolved, status) || status) {",
  "replace": "        if (false) {",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A directory cannot be accepted as a plugin module."
 },
 {
  "id": "lib.ort-plugin-native-broken-bundle-link",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "entry.type() != std::filesystem::file_type::symlink",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A broken advertised bundle link is an error rather than optional absence."
 },
 {
  "id": "lib.ort-plugin-native-native-registration-call",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "api_.RegisterExecutionProviderLibrary(environment_, name.c_str(), path->c_str())",
  "replace": "nullptr",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Successful registration requires the supplied owning native API call."
 },
 {
  "id": "lib.ort-plugin-native-retry-failed-registration",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "        if (!accept_status(api_.RegisterExecutionProviderLibrary(environment_, name.c_str(), path->c_str()), error)) {\n            return false;\n        }\n        registered_.emplace(name, *path);",
  "replace": "        registered_.emplace(name, *path);\n        if (!accept_status(api_.RegisterExecutionProviderLibrary(environment_, name.c_str(), path->c_str()), error)) {\n            return false;\n        }",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Only successful native calls enter the cache; a failed call remains retryable."
 },
 {
  "id": "lib.ort-plugin-native-per-environment-cache",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "    std::map<std::string, std::filesystem::path> registered_;",
  "replace": "    inline static std::map<std::string, std::filesystem::path> registered_;",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Separate owning environments cannot reuse each other's registration verdict."
 },
 {
  "id": "lib.ort-plugin-native-path-conflict",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "            if (previous->second == *path) { return true; }",
  "replace": "            return true;",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "An existing registration name cannot silently change its module path."
 },
 {
  "id": "lib.ort-plugin-native-shared-lock",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "        std::lock_guard<std::mutex> lock(mutex_);\n        return ensure_registered(plugin, bundled_directory, error);",
  "replace": "        std::mutex per_call;\n        std::lock_guard<std::mutex> lock(per_call);\n        return ensure_registered(plugin, bundled_directory, error);",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Parallel first callers must share one lock rather than each creating an independent lock."
 },
 {
  "id": "lib.ort-plugin-native-native-error-text",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "        error = message == nullptr ? \"ONNX Runtime returned an error without a message\" : message;",
  "replace": "        error = std::string(\"masked native failure\") + (message == nullptr ? \"\" : \"\");",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Raw native registration, enumeration and append diagnostics remain observable."
 },
 {
  "id": "lib.ort-plugin-native-status-release",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "        const std::unique_ptr<OrtStatus, decltype(release)> owned(status, release);",
  "replace": "        const std::unique_ptr<OrtStatus, decltype(release)> owned(nullptr, release);",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Every failed native status is released even though its copied error remains visible."
 },
 {
  "id": "lib.ort-plugin-native-negative-index",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "        if (device_index < 0) {",
  "replace": "        if (false) {",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A negative device index fails before registration or enumeration."
 },
 {
  "id": "lib.ort-plugin-native-fresh-device-query",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "api_.GetEpDevices(environment_, &devices, &count)",
  "replace": "nullptr",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Each attachment obtains a fresh matching device list from the owning environment."
 },
 {
  "id": "lib.ort-plugin-native-matching-device-name",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "name == ep_name && matching++ == index",
  "replace": "name == \"MIGraphXExecutionProvider\" && matching++ == index",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Device selection uses the plugin factory name, not the removed built-in name."
 },
 {
  "id": "lib.ort-plugin-native-requested-device-index",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "matching++ == index",
  "replace": "matching++ == 0",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "The explicitly requested second matching GPU is not replaced by the first one."
 },
 {
  "id": "lib.ort-plugin-native-v2-attachment",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "api_.SessionOptionsAppendExecutionProvider_V2(\n                               options, environment_, &device, 1, keys.data(), values.data(), keys.size())",
  "replace": "nullptr",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A successful return requires actually attaching the selected device through V2."
 },
 {
  "id": "lib.ort-plugin-native-provider-options",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "            values.push_back(option.second.c_str());",
  "replace": "            values.push_back(option.first.c_str());",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Device and memory options retain their caller-provided values."
 },
 {
  "id": "lib.ort-plugin-native-registered-report",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "        for (const auto &entry : registered_) { names.push_back(entry.first); }",
  "replace": "        for (const auto &entry : registered_) { (void)entry; }",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "The public report names successful registrations in this registry."
 },
 {
  "id": "lib.ort-plugin-native-owning-core-directory",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "    return resolved.parent_path();",
  "replace": "    return resolved;",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Automatic bundled fallback uses the directory of the actual supplied API's loaded core."
 },
 {
  "id": "lib.ort-plugin-native-exact-native-asset",
  "target": "shared/config/shared-assets.manifest",
  "find": "ort-plugin-registration-native | shared/native/ort_plugin_eps.hpp | runtime_support/ort_plugin_eps.hpp | exact |",
  "replace": "ort-plugin-registration-native | shared/native/ort_plugin_eps.hpp | runtime_support/ort_plugin_eps.hpp | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "A consumer native header remains byte-identical to its canonical source, including its directives."
 },
 {
  "id": "lib.migraphx-node-source-patch-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "  mgxep_apply_source_patch || return\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "The source phase must apply the cleanup fix before compilation."
 },
 {
  "id": "lib.migraphx-node-source-patch-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "  mgxep_apply_source_patch || return\n",
  "replace": "  mgxep_apply_source_patch\n",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "A patch failure under a conditional caller must retain its raw status and skip seeding."
 },
 {
  "id": "lib.migraphx-node-typed-delete",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+        delete static_cast<NodeComputeInfoBase*>(info);",
  "replace": "+        delete info;",
  "test": "bash linux/scripts/tests/test-ort-migraphx-nodes.sh",
  "why": "The C ABI pointer must reach the actual owning type at destruction."
 },
 {
  "id": "lib.migraphx-node-virtual-owner",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+    virtual ~NodeComputeInfoBase() = default;",
  "replace": "+    ~NodeComputeInfoBase() = default;",
  "test": "bash linux/scripts/tests/test-ort-migraphx-nodes.sh",
  "why": "Both derived node types need dynamic typed destruction."
 },
 {
  "id": "lib.migraphx-node-nodecomputeinfo-createstate-adjustment",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+            API_CALL_S(NodeComputeInfo, static_cast<NodeComputeInfo*>(this_), CreateState, compute_context, *compute_state);",
  "replace": "+            API_CALL_S(NodeComputeInfo, this_, CreateState, compute_context, *compute_state);",
  "test": "bash linux/scripts/tests/test-ort-migraphx-nodes.sh",
  "why": "NodeComputeInfo CreateState must adjust the C base before the reinterpret-cast dispatch."
 },
 {
  "id": "lib.migraphx-node-nodecomputeinfo-compute-adjustment",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+            API_CALL_S(NodeComputeInfo, static_cast<NodeComputeInfo*>(this_), Compute, *static_cast<ComputeState*>(compute_state),",
  "replace": "+            API_CALL_S(NodeComputeInfo, this_, Compute, *static_cast<ComputeState*>(compute_state),",
  "test": "bash linux/scripts/tests/test-ort-migraphx-nodes.sh",
  "why": "NodeComputeInfo Compute must adjust the C base before the reinterpret-cast dispatch."
 },
 {
  "id": "lib.migraphx-node-nodecomputeinfo-releasestate-adjustment",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+            API_CALL_V(NodeComputeInfo, static_cast<NodeComputeInfo*>(this_), ReleaseState, compute_state);",
  "replace": "+            API_CALL_V(NodeComputeInfo, this_, ReleaseState, compute_state);",
  "test": "bash linux/scripts/tests/test-ort-migraphx-nodes.sh",
  "why": "NodeComputeInfo ReleaseState must adjust the C base before the reinterpret-cast dispatch."
 },
 {
  "id": "lib.migraphx-node-epcontextnodecomputeinfo-createstate-adjustment",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+            API_CALL_S(EpContextNodeComputeInfo, static_cast<EpContextNodeComputeInfo*>(this_), CreateState, compute_context, *compute_state);",
  "replace": "+            API_CALL_S(EpContextNodeComputeInfo, this_, CreateState, compute_context, *compute_state);",
  "test": "bash linux/scripts/tests/test-ort-migraphx-nodes.sh",
  "why": "EpContextNodeComputeInfo CreateState must adjust the C base before the reinterpret-cast dispatch."
 },
 {
  "id": "lib.migraphx-node-epcontextnodecomputeinfo-compute-adjustment",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+            API_CALL_S(EpContextNodeComputeInfo, static_cast<EpContextNodeComputeInfo*>(this_), Compute, *static_cast<EpContextComputeState*>(compute_state),",
  "replace": "+            API_CALL_S(EpContextNodeComputeInfo, this_, Compute, *static_cast<EpContextComputeState*>(compute_state),",
  "test": "bash linux/scripts/tests/test-ort-migraphx-nodes.sh",
  "why": "EpContextNodeComputeInfo Compute must adjust the C base before the reinterpret-cast dispatch."
 },
 {
  "id": "lib.migraphx-node-epcontextnodecomputeinfo-releasestate-adjustment",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/001-node-compute-info-lifetime.patch",
  "find": "+            API_CALL_V(EpContextNodeComputeInfo, static_cast<EpContextNodeComputeInfo*>(this_), ReleaseState, compute_state);",
  "replace": "+            API_CALL_V(EpContextNodeComputeInfo, this_, ReleaseState, compute_state);",
  "test": "bash linux/scripts/tests/test-ort-migraphx-nodes.sh",
  "why": "EpContextNodeComputeInfo ReleaseState must adjust the C base before the reinterpret-cast dispatch."
 },
 {
  "id": "lib.migraphx-node-sanitizer-control",
  "target": "linux/scripts/tests/ort_migraphx_patch_fixture.py",
  "find": "\"-fsanitize=address\", ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-migraphx-nodes.sh",
  "why": "The mandatory unpatched control must prove the sanitizer is active."
 },
 {
  "id": "lib.migraphx-registry-source-patch",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "for source_patch in 001-node-compute-info-lifetime.patch 002-kernel-registry-lifetime.patch; do",
  "replace": "for source_patch in 001-node-compute-info-lifetime.patch; do",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "The source phase must patch registry ownership before seeding."
 },
 {
  "id": "lib.migraphx-registry-first-patch-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "\"MIGraphX ownership ${source_patch}\" || return",
  "replace": "\"MIGraphX ownership ${source_patch}\"",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "A failed earlier patch cannot be hidden by a successful later patch."
 },
 {
  "id": "lib.migraphx-registry-owned-cache",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/002-kernel-registry-lifetime.patch",
  "find": "+    mutable Ort::KernelRegistry kernel_registry_{nullptr};",
  "replace": "+    mutable OrtKernelRegistry* kernel_registry_{nullptr};",
  "test": "bash linux/scripts/tests/test-ort-migraphx-factory.sh",
  "why": "The registry must remain owned while its returned pointer is used and release at factory teardown."
 },
 {
  "id": "lib.migraphx-registry-creation-lock",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/002-kernel-registry-lifetime.patch",
  "find": "+        const std::lock_guard lock{kernel_registry_mutex_};",
  "replace": "+        (void)kernel_registry_mutex_;",
  "test": "bash linux/scripts/tests/test-ort-migraphx-factory.sh",
  "why": "Concurrent session creation must create exactly one cached registry."
 },
 {
  "id": "lib.migraphx-registry-creation-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/002-kernel-registry-lifetime.patch",
  "find": "+            RETURN_IF_ERROR(CreateKernelRegistry(ep_name, data_transfer_.get(), created));",
  "replace": "+            (void)CreateKernelRegistry(ep_name, data_transfer_.get(), created);",
  "test": "bash linux/scripts/tests/test-ort-migraphx-factory.sh",
  "why": "A failed creation retains its status and leaves the cache available for retry."
 },
 {
  "id": "lib.migraphx-registry-destruction-order",
  "target": "linux/scripts/03-media/build/onnxruntime/build/patches/002-kernel-registry-lifetime.patch",
  "find": "     std::unique_ptr<hip::DataTransfer> data_transfer_;\n+    mutable std::mutex kernel_registry_mutex_;\n+    mutable Ort::KernelRegistry kernel_registry_{nullptr};",
  "replace": "+    mutable Ort::KernelRegistry kernel_registry_{nullptr};\n     std::unique_ptr<hip::DataTransfer> data_transfer_;\n+    mutable std::mutex kernel_registry_mutex_;",
  "test": "bash linux/scripts/tests/test-ort-migraphx-factory.sh",
  "why": "Kernel state remains alive while its registry is released."
 },
 {
  "id": "lib.migraphx-registry-leak-control",
  "target": "linux/scripts/tests/ort_migraphx_patch_fixture.py",
  "find": "detect_leaks=1:alloc_dealloc_mismatch=1:new_delete_type_mismatch=1",
  "replace": "detect_leaks=0:alloc_dealloc_mismatch=1:new_delete_type_mismatch=1",
  "test": "bash linux/scripts/tests/test-ort-migraphx-factory.sh",
  "why": "The original raw registry must prove leak detection is active."
 },
 {
  "id": "lib.dev-doctor-unfetched-tip",
  "target": "linux/scripts/dev-doctor.sh",
  "find": "    _finding \"origin's develop is at ${tip:0:10}, a commit this clone does not have: fetch, then fast-forward\"",
  "replace": "    _ok \"origin's develop is at ${tip:0:10}\"",
  "test": "bash linux/scripts/tests/test-dev-doctor.sh",
  "why": "a tree 100 commits behind cost an hour of wrong debugging; a tip the clone lacks must be named"
 },
 {
  "id": "lib.dev-doctor-behind-counted",
  "target": "linux/scripts/dev-doctor.sh",
  "find": "  if [ \"${behind}\" -gt 0 ]; then _finding",
  "replace": "  if false; then _finding",
  "test": "bash linux/scripts/tests/test-dev-doctor.sh",
  "why": "a fetched but not merged origin is still behind, and the count says by how much"
 },
 {
  "id": "lib.dev-doctor-hooks-unset",
  "target": "linux/scripts/dev-doctor.sh",
  "find": "    '') _finding \"core.hooksPath is unset",
  "replace": "    '') _ok \"core.hooksPath is unset",
  "test": "bash linux/scripts/tests/test-dev-doctor.sh",
  "why": "a clone without hooks runs the gates only when someone remembers"
 },
 {
  "id": "lib.dev-doctor-old-image",
  "target": "linux/scripts/dev-doctor.sh",
  "find": "  if [ \"${age_days}\" -gt \"${DOCTOR_IMAGE_MAX_DAYS}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-dev-doctor.sh",
  "why": "a month-old local image reads as broken code; over a week is named"
 },
 {
  "id": "lib.dev-doctor-uv-pin",
  "target": "linux/scripts/dev-doctor.sh",
  "find": "  elif [ \"${have}\" != \"${uv_pin}\" ]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-dev-doctor.sh",
  "why": "a uv older than the lock format fails as a broken lock, so a pin mismatch is a finding"
 },
 {
  "id": "lib.dev-doctor-exit-on-finding",
  "target": "linux/scripts/dev-doctor.sh",
  "find": "    printf 'dev-doctor: %d stale item(s); nothing was changed\\n' \"${DOCTOR_FINDINGS}\"\n    exit 1\n",
  "replace": "    printf 'dev-doctor: %d stale item(s); nothing was changed\\n' \"${DOCTOR_FINDINGS}\"\n    exit 0\n",
  "test": "bash linux/scripts/tests/test-dev-doctor.sh",
  "why": "a doctor that lists findings and exits 0 reads as clean to any caller"
 },
 {
  "id": "lib.openai-tool-calls-dropped",
  "target": "shared/contracts/openai-tool-calls.json",
  "find": "\"usage\": null, \"tool_calls\": [{\"id\": \"call_1\", \"name\": \"read_file\", \"arguments\": \"{\\\"path\\\":\\\"README.md\\\"}\"}, {\"id\": \"call_2\"",
  "replace": "\"usage\": null, \"tool_calls\": [{\"id\": \"call_2\"",
  "test": "bash linux/scripts/tests/test-openai-stream-lines.sh",
  "why": "an expectation that dropped a parallel call is one only a reader dropping calls passes"
 },
 {
  "id": "lib.openai-stream-lines-shape",
  "target": "shared/contracts/openai-stream-lines.json",
  "find": "\"expect\": {\"text\": \"Paris\", \"thinking\": \"\", \"finish\": \"stop\", \"usage\": [7, 2]",
  "replace": "\"expect\": {\"text\": \"Paris\", \"thinking\": \"\", \"finish\": \"stop\", \"usage\": [7, -2]",
  "test": "bash linux/scripts/tests/test-openai-stream-lines.sh",
  "why": "a negative count is missing (owner D8): three bindings replay this file, and an expectation holding one is a case none can pass"
 },
 {
  "id": "amd64-v3.gcc-arch-default",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "_gcc_config_opt \"--with-arch=\" \"${X86_64_GCC_ARCH-x86-64-v3}\"",
  "replace": "_gcc_config_opt \"--with-arch=\" \"${X86_64_GCC_ARCH-x86-64}\"",
  "test": "bash linux/scripts/tests/test-native-gcc-multiarch.sh",
  "why": "the compiler default is the amd64 baseline: without it every source build falls back to SSE2"
 },
 {
  "id": "amd64-v3.gcc-native-path",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "case \"${TARGET_TRIPLET:-$(gcc -dumpmachine 2>/dev/null || cc -dumpmachine 2>/dev/null || true)}\" in",
  "replace": "case \"${TARGET_TRIPLET}\" in",
  "test": "bash linux/scripts/tests/test-native-gcc-multiarch.sh",
  "why": "the amd64 host GCC is built without --target, so keying on TARGET_TRIPLET alone skips the image's own compiler"
 },
 {
  "id": "amd64-v3.gcc-tune",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "    _gcc_config_opt \"--with-tune=\" \"${X86_64_GCC_TUNE-generic}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-gcc-multiarch.sh",
  "why": "generic tuning is explicit so the image is not biased to one CPU vendor"
 },
 {
  "id": "amd64-v3.gcc-empty-drops",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "  if [ -n \"$2\" ]; then CONFIG_CMD+=(\"$1$2\"); fi",
  "replace": "  CONFIG_CMD+=(\"$1$2\")",
  "test": "bash linux/scripts/tests/test-native-gcc-multiarch.sh",
  "why": "an override that empties a default must drop the option, not pass an empty one to configure"
 },
 {
  "id": "amd64-v3.gate-old-is-not-ok",
  "target": "linux/scripts/06-packaging/check-arch-isa.sh",
  "find": "  if [ \"${cc}\" != x86-64-v3 ]; then printf 'OLD cc %s\\n' \"${cc:-generic}\"; return 0; fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "a compiler that predates the switch must not be graded as x86-64-v3"
 },
 {
  "id": "amd64-v3.gate-defines",
  "target": "linux/scripts/06-packaging/check-arch-isa.sh",
  "find": "if [ \"${defs}\" = 3 ]; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "a default cc that predefines less than the gcc claims is not our compiler"
 },
 {
  "id": "amd64-v3.gate-opencv",
  "target": "linux/scripts/06-packaging/check-arch-isa.sh",
  "find": "    *AVX2*) printf 'OK opencv %s\\n' \"${ocv}\" ;;",
  "replace": "    *)      printf 'OK opencv %s\\n' \"${ocv}\" ;;",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "OpenCV at its upstream SSE3 baseline under a v3 compiler ships 128-bit intrinsics"
 },
 {
  "id": "amd64-v3.gate-loader",
  "target": "linux/scripts/06-packaging/check-arch-isa.sh",
  "find": "    *supported*) printf 'OK loader %s\\n' \"${ld}\" ;;",
  "replace": "    *)           printf 'OK loader %s\\n' \"${ld}\" ;;",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "a loader wording the entrypoint cannot read would leave its CPU check blind"
 },
 {
  "id": "amd64-v3.gate-wired",
  "target": "linux/scripts/06-packaging/check-arch-isa.sh",
  "find": "    check_amd64_isa \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "an unwired gate is not a gate"
 },
 {
  "id": "amd64-v3.gate-probe-wired",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  _probe_amd64_baseline\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "a gate without its probe lines reads NONE on every image"
 },
 {
  "id": "amd64-v3.renderer-bad-fails",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    BAD)  fail \"${bad//@2@/${value}}\" ;;",
  "replace": "    BAD)  echo \"${bad//@2@/${value}}\" ;;",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "a BAD verdict of either ISA gate must fail the smoke, not print"
 },
 {
  "id": "amd64-v3.renderer-none-fails",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    NONE) fail \"${none}\" ;;",
  "replace": "    NONE) : ;;",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "a probe that found nothing is a vacuous pass unless NONE fails"
 },
 {
  "id": "amd64-v3.opencv-request",
  "target": "linux/scripts/03-media/build/opencv/opencv-cpu-baseline.sh",
  "find": "_oaba_out+=(\"-DCPU_BASELINE=AVX2\")",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "OpenCV takes its intrinsics width from CPU_BASELINE, not from the compiler default"
 },
 {
  "id": "amd64-v3.opencv-request-wired",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "    opencv_amd64_baseline_args _occmo_out\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "a request nothing appends is not a request"
 },
 {
  "id": "amd64-v3.opencv-check-wired",
  "target": "linux/scripts/03-media/build/opencv/build-opencv.sh",
  "find": "    opencv_assert_amd64_baseline \"${build_dir}/opencv-configure.log\" \\\n        || die \"OpenCV amd64 configure did not take the AVX2 baseline\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "a configure that fell back must stop the build, not ship"
 },
 {
  "id": "amd64-v3.opencv-check-baseline-line",
  "target": "linux/scripts/03-media/build/opencv/opencv-cpu-baseline.sh",
  "find": "baseline=\"$(sed -n '/Baseline:/{s/^.*Baseline:[[:space:]]*//p;q}' \"${log}\")\"",
  "replace": "baseline=\"$(cat \"${log}\")\"",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "AVX2 in the dispatched list is not an AVX2 baseline"
 },
 {
  "id": "amd64-v3.entry-below",
  "target": "linux/scripts/04-runtime/entrypoint.sh",
  "find": "    *x86-64-v3*)              printf below ;;",
  "replace": "    *x86-64-v3*)              printf unknown ;;",
  "test": "bash linux/scripts/tests/test-cpu-baseline-check.sh",
  "why": "a CPU the loader lists without the supported marker is below the baseline"
 },
 {
  "id": "amd64-v3.entry-fatal",
  "target": "linux/scripts/04-runtime/entrypoint.sh",
  "find": "    echo \"ERROR: this image is built for x86-64-v3 (AVX2, FMA, BMI2) and this CPU does not provide it. See docs/amd64-x86-64-v3-baseline.md\" >&2\n    return 1\n",
  "replace": "    echo \"ERROR: this image is built for x86-64-v3 (AVX2, FMA, BMI2) and this CPU does not provide it. See docs/amd64-x86-64-v3-baseline.md\" >&2\n    return 0\n",
  "test": "bash linux/scripts/tests/test-cpu-baseline-check.sh",
  "why": "a CPU below the baseline must be refused with the cause, not die later with a bare SIGILL"
 },
 {
  "id": "amd64-v3.entry-wired",
  "target": "linux/scripts/04-runtime/entrypoint.sh",
  "find": "_ep_cpu_baseline_check /lib64/ld-linux-x86-64.so.2 || exit 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cpu-baseline-check.sh",
  "why": "a check nothing calls is not a check"
 },
 {
  "id": "critical-fixes.amd64-v3-pin",
  "target": "linux/scripts/verify-critical-fixes.sh",
  "find": "-q 'X86_64_GCC_ARCH-x86-64-v3}' \"${gcc}\" ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-critical-fixes.sh",
  "why": "the source pin must see a changed amd64 default"
 },
 {
  "id": "amd64-v3.arch-gate-own-arch-only",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  [ \"$2\" = \"$1\" ] || return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-amd64-isa-gate.sh",
  "why": "an arch-specific gate must not grade another architecture's image"
 },
 {
  "id": "intel-gpu.packages",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "        append_available_packages _sdp_out intel-media-va-driver libmfx-gen1.2 intel-opencl-icd\n",
  "replace": "        :\n",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "the amd64 package stage installs Intel's free GPU user space"
 },
 {
  "id": "intel-gpu.absent-is-bad",
  "target": "linux/scripts/06-packaging/check-intel-gpu-userspace.sh",
  "find": "if [ \"${state}\" = present ]; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "a package the index lacked is skipped silently at install time, so a missing file must fail the image"
 },
 {
  "id": "intel-gpu.none-is-not-green",
  "target": "linux/scripts/06-packaging/check-intel-gpu-userspace.sh",
  "find": "  [ \"${n}\" -gt 0 ] || printf 'NONE - -\\n'\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "a probe that printed no INTELGPU line is a vacuous pass unless it reads NONE"
 },
 {
  "id": "intel-gpu.probe-va-path",
  "target": "linux/scripts/06-packaging/check-intel-gpu-userspace.sh",
  "find": "va:/usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so",
  "replace": "va:/usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "the probe must look for the file intel-media-va-driver ships"
 },
 {
  "id": "intel-gpu.gate-wired",
  "target": "linux/scripts/06-packaging/check-arch-isa.sh",
  "find": "    check_intel_gpu_userspace \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "an unwired gate is not a gate"
 },
 {
  "id": "intel-gpu.probe-wired",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "  _probe_intel_gpu_userspace\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "a gate without its probe lines reads NONE on every image"
 },
 {
  "id": "intel-gpu.ffmpeg-libvpl-enabled",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "        _ffha_out+=(\"--enable-libvpl\")\n",
  "replace": "        :\n",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "FFmpeg's own Quick Sync codecs need --enable-libvpl"
 },
 {
  "id": "intel-gpu.ffmpeg-libvpl-amd64-only",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "if [ \"$(cross_target_arch)\" = \"amd64\" ] \\\n        && ffmpeg_probe_pkg_config_feature \"libvpl\"",
  "replace": "if ffmpeg_probe_pkg_config_feature \"libvpl\"",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "Quick Sync is an x86 GPU feature: no other arch asks for it"
 },
 {
  "id": "intel-gpu.ffmpeg-libvpl-check-args",
  "target": "linux/scripts/03-media/build/ffmpeg/build-ffmpeg.sh",
  "find": "\"vpl >= 2.6\" \"mfxvideo.h mfxdispatcher.h\" \"MFXLoad\"",
  "replace": "\"vpl\" \"mfxvideo.h\" \"MFXInit\"",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "the probe must ask what FFmpeg's configure asks, or a pass here fails there hours into the media stage"
 },
 {
  "id": "intel-gpu.ffmpeg-libvpl-runtime-map",
  "target": "linux/scripts/03-media/runtime/so-package-map.txt",
  "find": "libvpl.so.2\tlibvpl2\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "FFmpeg's new NEEDED entry must resolve to a package in the runtime image"
 },
 {
  "id": "intel-gpu.ffmpeg-qsv-probed",
  "target": "linux/scripts/06-packaging/check-intel-gpu-userspace.sh",
  "find": "grep -c -e h264_qsv",
  "replace": "grep -c -e h264_vaapi",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "the image gate must look for a Quick Sync encoder, not any hardware encoder"
 },
 {
  "id": "intel-gpu.ffmpeg-libvpl-dep",
  "target": "linux/scripts/03-media/build/ffmpeg/install-deps.sh",
  "find": "    install_optional_target_packages libvpl-dev\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "without the dispatcher's headers the probe skips Quick Sync silently"
 },
 {
  "id": "pre-commit.commit-a-reads-its-own-index",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "    GIT_INDEX_FILE=\"${_index}\" git diff --cached --name-only --diff-filter=ACM\n",
  "replace": "    git diff --cached --name-only --diff-filter=ACM\n",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "git commit -a and git commit <path> keep the commit's index in a lock file; read from the plain index, the staged shellcheck, the doc gates and the mutation sample see no file"
 },
 {
  "id": "pre-commit.unreadable-index-stops",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "_staged_any=\"$(_staged_paths)\" || {",
  "replace": "_staged_any=\"$(_staged_paths || true)\" || {",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a staged list that cannot be read is empty, and an empty list passes every staged check"
 },
 {
  "id": "pre-commit.image-reruns-only-pwsh-tests",
  "target": "linux/host-config/git-hooks/pre-commit",
  "find": "        for _id in ${_ps}; do _again+=(--only \"${_id}\"); done\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-precommit-hook.sh",
  "why": "a test written for the host fails in the container for the container's reasons; only the pwsh tests need the image"
 },
 {
  "id": "doc-links.numbered-mention-passes",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "            if num and num.group(1) in NUMBERED_HEADING.findall(other.body):\n                continue",
  "replace": "            if False:\n                continue",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "a section number with prose after it was read as one heading name, and three consumer backlogs failed on a plain mention in one day"
 },
 {
  "id": "doc-links.numbered-mention-number-checked",
  "target": "docs/scripts/verify_doc_links.py",
  "find": "num.group(1) in NUMBERED_HEADING.findall(other.body)",
  "replace": "num.group(1)",
  "test": "bash linux/scripts/tests/test-doc-links.sh",
  "why": "the number must name a numbered section of the page, or any digit after the sign makes a reference pass"
 },
 {
  "id": "bench-history.failed-download-retried",
  "target": "linux/scripts/bench-history.py",
  "find": "    for attempt in range(DOWNLOAD_TRIES):",
  "replace": "    for attempt in range(1):",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch_failures",
  "why": "one 502 from the artifact store must not cost the comparison an earlier record"
 },
 {
  "id": "bench-history.failed-download-left-out",
  "target": "linux/scripts/bench-history.py",
  "find": "            return None\n        found = sorted(",
  "replace": "            raise github.Broken(failure)\n        found = sorted(",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch_failures",
  "why": "one earlier record that cannot be downloaded ended the step, and the run's own result never reached the history"
 },
 {
  "id": "bench-history.left-out-is-named",
  "target": "linux/scripts/bench-history.py",
  "find": "            print(f\"::warning title=Benchmark history incomplete::left out after {DOWNLOAD_TRIES} tries: {failure}\",\n                  file=sys.stderr)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch_failures",
  "why": "a median over fewer records than asked for must say which one is missing"
 },
 {
  "id": "bench-history.retry-pauses",
  "target": "linux/scripts/bench-history.py",
  "find": "            time.sleep(pause)",
  "replace": "            time.sleep(0)",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch_failures",
  "why": "three tries in the same instant meet the same outage"
 },
 {
  "id": "bench-history.count-is-what-was-read",
  "target": "linux/scripts/bench-history.py",
  "find": "read {len(read)} earlier",
  "replace": "read {len(chosen)} earlier",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch_failures",
  "why": "the count line is how a reader sees that the median spans fewer records"
 },
 {
  "id": "bench-history.unreadable-list-fails",
  "target": "linux/scripts/bench-history.py",
  "find": "            print(f\"::error title=Benchmark history unreadable::{exc}\", file=sys.stderr)\n            return EXIT_INPUT",
  "replace": "            print(f\"::error title=Benchmark history unreadable::{exc}\", file=sys.stderr)\n            return 0",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch",
  "why": "an artifact list that cannot be read is no empty history: the step must fail, unlike one record's download"
 },
 {
  "id": "quality-report.download-tried-once",
  "target": "linux/scripts/quality_report_github.py",
  "find": "    for attempt in range(max(1, tries)):",
  "replace": "    for attempt in range(1):",
  "test": "bash linux/scripts/tests/test-quality-report.sh",
  "why": "A download the artifact store refuses once must not leave the verdict incomplete."
 },
 {
  "id": "quality-report.download-retry-no-pause",
  "target": "linux/scripts/quality_report_github.py",
  "find": "        if attempt:\n            time.sleep(pause)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-quality-report.sh",
  "why": "The second try comes after a pause, not at once into the same refusal."
 },
 {
  "id": "quality-report.download-failure-swallowed",
  "target": "linux/scripts/quality_report_github.py",
  "find": "    raise Broken(f\"gh run download {run_id} -n {name}: {stderr}\")",
  "replace": "    return",
  "test": "bash linux/scripts/tests/test-quality-report.sh",
  "why": "A download refused every time is still Broken: the verdict says incomplete, never a comparison with nothing."
 },
 {
  "id": "bench-history.download-tries-once-per-loop",
  "target": "linux/scripts/bench-history.py",
  "find": "            github.download(slug, run_id, name, tmp, tries=1)",
  "replace": "            github.download(slug, run_id, name, tmp)",
  "test": "bash linux/scripts/tests/test-bench-history.sh -k fetch_failures",
  "why": "bench-history keeps its own retry loop; the helper's three tries inside it would make nine."
 },
 {
  "id": "dispatch-lanes.x64-forgotten",
  "target": "linux/scripts/dispatch-consumer-lanes.sh",
  "find": "    if row.get(\"linux_x64\"):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-dispatch-consumer-lanes.sh",
  "why": "A Linux publish also runs each consumer's x64 lane, which on-request.yml does not hold."
 },
 {
  "id": "dispatch-lanes.refusal-hidden",
  "target": "linux/scripts/dispatch-consumer-lanes.sh",
  "find": "    failed=$((failed + 1))\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-dispatch-consumer-lanes.sh",
  "why": "A dispatch that was refused fails the step, or the image moves on with a consumer never checked."
 },
 {
  "id": "dispatch-lanes.lanes-dropped",
  "target": "linux/scripts/dispatch-consumer-lanes.sh",
  "find": "  [ -z \"${lanes}\" ] || cmd+=(-f \"lanes=${lanes}\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-dispatch-consumer-lanes.sh",
  "why": "Each image runs the lanes it changes; without them on-request.yml runs its default."
 },
 {
  "id": "dispatch-lanes.dry-run-sends",
  "target": "linux/scripts/dispatch-consumer-lanes.sh",
  "find": "  if [ \"${dry_run}\" -eq 1 ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-dispatch-consumer-lanes.sh",
  "why": "A dry run prints the commands and sends none."
 },
 {
  "id": "dispatch-lanes.not-after-promote",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  bash \"${REPO_ROOT}/linux/scripts/dispatch-consumer-lanes.sh\" --tag \"${IMAGE_NAME##*:}\" \\\n",
  "replace": "  false \\\n",
  "test": "bash linux/scripts/tests/test-manifest-acceptance.sh",
  "why": "After a promotion the consumers' lanes run on the new image (CON236), and a refused dispatch only warns."
 },
 {
  "id": "mutations.test-output-undecodable",
  "target": "docs/scripts/verify_mutations.py",
  "find": "encoding=\"utf-8\", errors=\"replace\", start_new_session=True)",
  "replace": "encoding=\"utf-8\", start_new_session=True)",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k basics",
  "why": "A test that prints bytes that are not UTF-8 keeps its verdict; strict decoding crashed the whole run."
 },
 {
  "id": "mutations.pwsh-test-named-on-a-host-without-it",
  "target": "docs/scripts/mutation_push.py",
  "find": "    _here, wanting = split_pwsh(entries, root, host_has_pwsh)\n    if wanting:\n        # The commit hook",
  "replace": "    wanting: list[E] = []\n    if wanting:\n        # The commit hook",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "a recipe whose test starts pwsh exits 127 on a host without it, a vacuous bite the commit hook cannot tell from a weak test"
 },
 {
  "id": "recipe-pytest.venv-synced-per-recipe",
  "target": "linux/scripts/02-toolchain/python/recipe-pytest.sh",
  "find": "  if [ ! -f \"${venv}/.synced\" ]; then\n",
  "replace": "  if true; then\n",
  "test": "bash linux/scripts/tests/test-recipe-pytest.sh",
  "why": "Recipes with the same Python, extras and lock share one synced venv instead of syncing it again for each copy."
 },
 {
  "id": "recipe-pytest.lock-ignored",
  "target": "linux/scripts/02-toolchain/python/recipe-pytest.sh",
  "find": "lock_key=\"$(cat pyproject.toml uv.lock 2>/dev/null | sha256sum | cut -c1-12)\"",
  "replace": "lock_key=\"fixed\"",
  "test": "bash linux/scripts/tests/test-recipe-pytest.sh",
  "why": "A changed lock is synced into a new venv, never into one built from the old lock."
 },
 {
  "id": "recipe-pytest.venv-not-active",
  "target": "linux/scripts/02-toolchain/python/recipe-pytest.sh",
  "find": "export VIRTUAL_ENV=\"${venv}\" PATH=\"${venv}/bin:${PATH}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-recipe-pytest.sh",
  "why": "pytest runs with the recipe venv active, so a test that starts python3 itself finds that venv, not the image's /opt/venv."
 },
 {
  "id": "buildkit.push-tag-takes-the-repository",
  "target": "windows/scripts/modules/WindowsBuildKit.Common.psm1",
  "find": "    if ($lastSegment -match ':') { return ($lastSegment -split ':')[-1] }\n",
  "replace": "    if ($lastSegment -match ':') { return ($lastSegment -split ':')[0] }\n",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.ConsumerDispatch.Tests.ps1 -ResultFile logs/code-quality/buildkit-consumer-dispatch.json",
  "why": "The consumer lanes are dispatched for the pushed tag, not the image's name."
 },
 {
  "id": "buildkit.dispatch-without-tag-runs",
  "target": "windows/scripts/modules/WindowsBuildKit.Common.psm1",
  "find": "    if (-not $tag) {\n        Write-Warning \"[bk] -PushRef '$PushRef' names no tag; no consumer lanes dispatched\"\n        return $false\n    }\n",
  "replace": "",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.ConsumerDispatch.Tests.ps1 -ResultFile logs/code-quality/buildkit-consumer-dispatch.json",
  "why": "A push ref without a tag dispatches nothing, rather than every consumer on an empty tag."
 },
 {
  "id": "packaging.pwsh-installs-pester",
  "target": "linux/scripts/06-packaging/package-image-wiring.sh",
  "find": "    install_pester \"${env_file}\" \"${prefix}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-package-image-wiring.sh",
  "why": "pwsh would ship without Pester, so Invoke-Tests.ps1 skips every suite in the image and no pwsh recipe proves there (CON273)"
 },
 {
  "id": "quality-report.perf-genai-threads-auto-unbounded",
  "target": "linux/scripts/lib/genai-model-threads.py",
  "find": "    return min(max(usable - 1, 1), MAX_THREADS)\n",
  "replace": "    return usable\n",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_auto",
  "why": "auto is the family's rule, the usable CPUs but one and at most eight, so a Pi perf copy does not oversubscribe its four cores (CON218)"
 },
 {
  "id": "quality-report.extra-language-size-graded",
  "target": "linux/scripts/quality_report_tree.py",
  "find": "                   \"functions\", CODE, True)),",
  "replace": "                   \"functions\", REPORT, True)),",
  "test": "bash linux/scripts/tests/test-quality-report.sh",
  "why": "a new oversized Rust, Dart or C++ function must read regressed in --compare, not moved"
 },
 {
  "id": "quality-report.dart-test-main-is-test-body",
  "target": "linux/scripts/lang_units.py",
  "find": "    return lang == \"dart\" and name == \"main\" and rel.endswith(\"_test.dart\")",
  "replace": "    return False",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "a Dart test file's main() grows with its tests; graded as product code it drowns the real count"
 },
 {
  "id": "quality-report.test-body-only-in-test-files",
  "target": "linux/scripts/lang_units.py",
  "find": "    return lang == \"dart\" and name == \"main\" and rel.endswith(\"_test.dart\")",
  "replace": "    return lang == \"dart\" and name == \"main\"",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "an app's own lib/main.dart is product code and stays graded"
 },
 {
  "id": "code-size.extra-language-test-bodies-left-out",
  "target": "linux/scripts/verify_code_size.py",
  "find": "        over += len(big) - len(test_bodies)",
  "replace": "        over += len(big)",
  "test": "bash linux/scripts/tests/test-quality-report.sh",
  "why": "the graded total leaves Dart test main() bodies out, or an added test reads as a regression"
 },
 {
  "id": "python.lane-coverage-extra-forwarded",
  "target": ".github/workflows/python-ci-linux.yml",
  "find": "-e PYTHON_COVERAGE_EXTRA=${{ inputs.coverage-extra }}",
  "replace": "-e PYTHON_COVERAGE_EXTRA=",
  "test": "bash linux/scripts/tests/test-reusable-linux-lane.sh",
  "why": "The declared extra trees must reach the test driver, or a consumer's benchmarks/ floor is a dead option."
 },
 {
  "id": "python.package-floor-reads-the-package",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "    package_coverage_report \"$V\" || test_status=$?\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "Read from the report that holds the extra trees, the package floor passes on their lines while the package falls."
 },
 {
  "id": "python.extra-tree-floor-checked",
  "target": "linux/scripts/02-toolchain/python/ci_tests.sh",
  "find": "    extra_coverage_checks \"$V\" || test_status=$?\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-python-ci-defaults.sh",
  "why": "An extra tree measured and never gated is the benchmarks/ floor that does not exist."
 },
 {
  "id": "rust.cargo-license-forbidden-package",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "        if not hits:\n            continue\n",
  "replace": "        if True:\n            continue\n",
  "test": "bash linux/scripts/tests/test-stage-cargo-licenses.sh",
  "why": "A forbidden package in the staged graph must fail before staging and name its dependency path."
 },
 {
  "id": "rust.cargo-license-runtime-budget",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "        if runtime > args.max_runtime_packages:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-stage-cargo-licenses.sh",
  "why": "A runtime graph over its package budget must fail with the count."
 },
 {
  "id": "rust.cargo-license-runtime-normal-edges",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "workspace, args.target, args.root_package, feature_args, \"normal\"\n",
  "replace": "workspace, args.target, args.root_package, feature_args\n",
  "test": "bash linux/scripts/tests/test-stage-cargo-licenses.sh",
  "why": "The budget counts the live normal-edge tree; build dependencies never ship in the binary."
 },
 {
  "id": "rust.cargo-license-forbidden-build-path",
  "target": "linux/scripts/06-packaging/stage-cargo-licenses.py",
  "find": "kinds = {None, \"build\"} if args.graph_scope",
  "replace": "kinds = {None} if args.graph_scope",
  "test": "bash linux/scripts/tests/test-stage-cargo-licenses.sh",
  "why": "A forbidden build dependency in the tree scope must print the build edge that reaches it."
 },
 {
  "id": "lib.ctest-run-fail-on-skipped-verdict",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "  if [[ \"${skipped}\" -gt 0 ]]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "A skipped test that --fail-on-skipped names must fail the run."
 },
 {
  "id": "lib.ctest-run-fail-on-skipped-disabled-exempt",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "      disabled) disabled=$((disabled + 1)) ;;\n",
  "replace": "      disabled) skipped=$((skipped + 1)) ;;\n",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "ctest's Disabled tests are deliberate and must never fail a --fail-on-skipped run."
 },
 {
  "id": "lib.ctest-run-fail-on-skipped-status",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "    _ctest_run_check_skipped \"${CTEST_RUN_JUNIT_REPORT}\" || [[ \"${rc}\" -ne 0 ]] || rc=1\n",
  "replace": "    _ctest_run_check_skipped \"${CTEST_RUN_JUNIT_REPORT}\"\n",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "The skip verdict must reach the status a passing ctest returned."
 },
 {
  "id": "lib.ctest-run-fail-on-skipped-missing-report",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "no readable JUnit report at ${report}\"\n    return 1\n",
  "replace": "no readable JUnit report at ${report}\"\n    return 0\n",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "Without a report the gate saw nothing, and that must not pass."
 },
 {
  "id": "lib.ctest-run-fail-on-skipped-stale-report",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "    rm -f \"${CTEST_RUN_JUNIT_REPORT}\" || err \"Cannot remove the old JUnit report: ${CTEST_RUN_JUNIT_REPORT}\"\n",
  "replace": "    :\n",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "An earlier run's report must not stand in for a run that wrote none."
 },
 {
  "id": "lib.proof-source-mutation-union",
  "target": "linux/scripts/source_ci/linux.py",
  "find": "collections.Counter(all_ids) == collections.Counter(expected)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "every executed mutation must match exactly one source manifest ID"
 },
 {
  "id": "lib.proof-source-mutation-delegation",
  "target": "linux/scripts/source_ci/linux.py",
  "find": "delegated == skipped == 0",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "delegated or skipped mutations cannot prove this run"
 },
 {
  "id": "lib.proof-source-tree-binding",
  "target": "linux/scripts/source_ci/linux.py",
  "find": "binding[\"tree\"] == git(args.root, \"rev-parse\", f\"{args.head}^{{tree}}\").decode().strip()",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "the tested checkout must match the exact local Git tree"
 },
 {
  "id": "lib.proof-source-windows-skips",
  "target": "linux/scripts/source_ci/windows.py",
  "find": "(\"Failed\", \"Skipped\", \"Broken\", \"CoverageFailures\")",
  "replace": "(\"Failed\", \"Broken\", \"CoverageFailures\")",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "a formally passed summary must not hide skipped native tests"
 },
 {
  "id": "lib.proof-source-windows-policy",
  "target": "linux/scripts/source_ci/windows.py",
  "find": "require(old == new, \"Previously audited",
  "replace": "require(True, \"Previously audited",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "a prior coverage baseline cannot certify a changed policy"
 },
 {
  "id": "lib.proof-source-windows-bytes",
  "target": "linux/scripts/source_ci/windows.py",
  "find": "digest == artifact[\"digest\"] and args.zip.stat().st_size == artifact[\"size_in_bytes\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "a valid modified ZIP must still fail its published digest and size"
 },
 {
  "id": "lib.proof-source-windows-xml",
  "target": "linux/scripts/source_ci/windows.py",
  "find": "xml.tag == \"coverage\" and valid > 0 and 0 < covered <= valid and abs(covered / valid - float(xml.attrib[\"line-rate\"])) < 1e-6",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "native XML coverage must contain a nonzero consistent result"
 },
 {
  "id": "lib.proof-source-security-gate",
  "target": "linux/scripts/source_ci/combined.py",
  "find": "re.search(r\"security-audit: .*mode gate\", path.read_text(encoding=\"utf-8\"))",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "a report-only security run is not the required gate"
 },
 {
  "id": "lib.proof-source-workflow-skips",
  "target": "linux/scripts/source_ci/combined.py",
  "find": "row[\"file\"] == \"docs.yml\" and job[\"name\"] == \"docs / Publish the site\"",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "only the explicit docs publication job may be skipped"
 },
 {
  "id": "lib.proof-source-log-binding",
  "target": "linux/scripts/source_ci/combined.py",
  "find": "fingerprint(args.directory / f\"source-ci-{job_id}.log\") == row[\"log_sha256\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "later log edits must invalidate the joined source proof"
 },
 {
  "id": "lib.proof-source-workflow-identity",
  "target": "linux/scripts/source_ci/common.py",
  "find": "run[\"path\"].split(\"@\", 1)[0] == \".github/workflows/\" + workflow",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "successful metadata from a different workflow cannot satisfy the selected run"
 },
 {
  "id": "lib.proof-source-dispatch-exclusive",
  "target": "linux/scripts/source_ci/dispatch.py",
  "find": "Path(args.output).open(\"x\", encoding=\"utf-8\")",
  "replace": "Path(args.output).open(\"w\", encoding=\"utf-8\")",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "an interrupted ambiguous dispatch must never be retried by overwriting its record"
 },
 {
  "id": "lib.proof-source-dispatch-checkpoint",
  "target": "linux/scripts/source_ci/dispatch.py",
  "find": "row[\"state\"] = \"dispatching-once-do-not-repeat-if-interrupted\"",
  "replace": "row[\"state\"] = \"pending\"",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "persist the ambiguous request state before sending the workflow write"
 },
 {
  "id": "lib.proof-source-download-status",
  "target": "linux/scripts/source_ci/fetch.py",
  "find": "capture_output=True, check=True, timeout=60",
  "replace": "capture_output=True, check=False, timeout=60",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "a failed raw HTTP response cannot become preserved log bytes"
 },
 {
  "id": "lib.proof-mutation-seal-loaded",
  "target": "linux/scripts/seal-mutation-unit.py",
  "find": "before.get(\"LoadState\") == \"loaded\" and before.get(\"Id\") == args.unit",
  "replace": "before.get(\"Id\") == args.unit",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "unloaded units have default success fields that do not prove execution"
 },
 {
  "id": "lib.proof-mutation-seal-exact-ids",
  "target": "linux/scripts/seal-mutation-unit.py",
  "find": "actual == expected and all(count == 1 for count in actual.values())",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "a completed banner cannot replace the executed exact mutation ID set"
 },
 {
  "id": "lib.proof-native-runtime-distinct-profiles",
  "target": "linux/scripts/audit-native-plugin-runtime.py",
  "find": "profile.parent == directory.resolve() and profile not in profiles",
  "replace": "profile.parent == directory.resolve()",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "two reported GPU sessions need distinct original profiles"
 },
 {
  "id": "lib.proof-native-runtime-plugin-provider",
  "target": "shared/python/verify_ort_profile.py",
  "find": "    \"migraphx-plugin\": \"MIGraphX\",\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-source-ci.sh",
  "why": "the plugin profile uses its real provider name independently of the legacy built-in name"
 },
 {
  "id": "lib.proof-cache-command-raw-failure",
  "target": "linux/scripts/capture-sccache-command.sh",
  "find": "  exit \"${result}\"",
  "replace": "  exit \"${cache_result}\"",
  "test": "bash linux/scripts/tests/test-capture-sccache-command.sh",
  "why": "successful cache statistics cannot hide a failed wrapped command"
 },
 {
  "id": "lib.proof-cli-argument-minimum",
  "target": "linux/scripts/lib/cli-value-options.sh",
  "find": "\"$#\" -lt \"${_crp_min}\"",
  "replace": "\"$#\" -lt 0",
  "test": "bash linux/scripts/tests/test-capture-sccache-command.sh",
  "why": "missing positional arguments must fail before creating evidence or expanding unset arguments"
 },
 {
  "id": "lib.proof-cli-help",
  "target": "linux/scripts/lib/cli-value-options.sh",
  "find": "if [[ \"${1:-}\" == --help ]]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-capture-sccache-command.sh",
  "why": "help must exit before creating an output directory or running a command"
 },
 {
  "id": "lib.amd-plugin-appimage-module-preservation",
  "target": "linux/scripts/06-packaging/patchelf-keep-glibc.sh",
  "find": "libonnxruntime*.so*|libmigraphx-ep.so)",
  "replace": "libonnxruntime*.so*)",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "The opted-in AppImage wrapper must leave the AMD plugin bytes untouched."
 },
 {
  "id": "lib.amd-plugin-appimage-opt-in-boundary",
  "target": "linux/scripts/06-packaging/patchelf-keep-glibc.sh",
  "find": "if [[ \"${keep_ort}\" == 1 ]]; then exit 0; fi",
  "replace": "exit 0",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "Ordinary module patching must retain the original non-opt-in behavior."
 },
 {
  "id": "lib.ort-plugin-rust-advertised-precedence",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "advertised.filter(|root| !root.is_empty())",
  "replace": "advertised.filter(|root| !root.is_empty() && false)",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A valid advertised image module wins over the bundle and malformed advertisements cannot fall back."
 },
 {
  "id": "lib.ort-plugin-rust-absolute-root",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "if !root.is_absolute() {",
  "replace": "if false {",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "Advertised roots must be absolute, even when a valid bundled module exists."
 },
 {
  "id": "lib.ort-plugin-rust-absolute-bundle",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "if !bundled.is_absolute() {",
  "replace": "if false {",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "The owning core bundle directory cannot be a relative search path."
 },
 {
  "id": "lib.ort-plugin-rust-dangling-module",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "error.kind() == ErrorKind::NotFound && absent",
  "replace": "error.kind() == ErrorKind::NotFound && (absent || true)",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A dangling bundled module must not count as an absent optional module."
 },
 {
  "id": "lib.ort-plugin-rust-regular-module",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "if !path.is_file() {",
  "replace": "if false {",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A directory at the module path cannot be registered as a plugin library."
 },
 {
  "id": "lib.ort-plugin-rust-path-freeze",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "if previous != &path {",
  "replace": "if false {",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A successful registration freezes the canonical path behind its name."
 },
 {
  "id": "lib.ort-plugin-rust-registration-status",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "self.binding.register_library(plugin.name, &path)?;",
  "replace": "let _ = self.binding.register_library(plugin.name, &path);",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "Failed native registration remains visible and retryable, without poisoning the success cache."
 },
 {
  "id": "lib.ort-plugin-rust-provider-match",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": ".filter(|device| device.provider == plugin.name)",
  "replace": ".filter(|device| !device.provider.is_empty())",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "Matching-provider ordinal selection must ignore devices from unrelated providers."
 },
 {
  "id": "lib.ort-plugin-rust-device-index",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "devices.get(index)",
  "replace": "devices.first()",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "The selected matching device index must not silently become device zero."
 },
 {
  "id": "lib.ort-plugin-rust-enumeration-status",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "            .devices()?\n            .into_iter()",
  "replace": "            .devices()\n            .unwrap_or_default()\n            .into_iter()",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "An enumeration error must retain its cause rather than become a missing-device verdict."
 },
 {
  "id": "lib.ort-plugin-rust-attachment-status",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": ".append_provider(options, &selected.device, values)",
  "replace": ".append_provider(options, &selected.device, values).or_else(|_| Ok(()))",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A failed V2 attachment must fail without hiding its original reason."
 },
 {
  "id": "lib.ort-plugin-rust-poisoned-cache",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "        let mut registered = self\n            .registered\n            .lock()\n            .map_err(|_| \"Plugin registry lock is poisoned\".to_string())?;",
  "replace": "        let mut registered = self.registered.lock().unwrap_or_else(|poison| poison.into_inner());",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A panic while changing registration state cannot silently reuse the poisoned cache."
 },
 {
  "id": "lib.ort-plugin-rust-exact-copy",
  "target": "shared/config/shared-assets.manifest",
  "find": "ort-plugin-registration-rust | shared/rust/ort_plugin_eps.rs | runtime_support/ort_plugin_eps.rs | exact |",
  "replace": "ort-plugin-registration-rust | shared/rust/ort_plugin_eps.rs | runtime_support/ort_plugin_eps.rs | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "The installed Rust policy remains an exact shared asset, including its header."
 },
 {
  "id": "host.owned-id-check",
  "target": "linux/scripts/owned_containers.py",
  "find": "if not re.fullmatch(r\"[0-9a-f]{64}\", value):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Reject short or path-like IDs before any container mutation."
 },
 {
  "id": "host.owned-run-token",
  "target": "linux/scripts/owned_containers.py",
  "find": "if not re.fullmatch(r\"[0-9a-f]{32}\", self.run_id):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A nonempty fresh-run token is required before engine queries."
 },
 {
  "id": "host.owned-label-check",
  "target": "linux/scripts/owned_containers.py",
  "find": "if not re.fullmatch(r\"org\\.kataglyphis\\.[a-z0-9.-]+\", self.label):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Reject empty or selector-like ownership labels before engine calls."
 },
 {
  "id": "host.owned-inspect-owner",
  "target": "linux/scripts/owned_containers.py",
  "find": "if record.get(\"Id\") != cid or not isinstance(labels, dict) or labels.get(self.label) != self.run_id:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "An engine selector alone cannot authorize removing a mismatched inspected container."
 },
 {
  "id": "host.owned-cid-binding",
  "target": "linux/scripts/owned_containers.py",
  "find": "if expected not in owned and expected in self.ids(owned=False):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A saved foreign CID must refuse cleanup before touching any container."
 },
 {
  "id": "host.owned-settled-check",
  "target": "linux/scripts/owned_containers.py",
  "find": "if not self.settled(cid, retain=retain):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A successful stop command cannot prove the retained payload actually stopped."
 },
 {
  "id": "host.owned-final-inventory",
  "target": "linux/scripts/owned_containers.py",
  "find": "if remaining - owned or (remaining and not retain):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A late owned container must fail the final cleanup inventory."
 },
 {
  "id": "host.owned-stopped-facts",
  "target": "linux/scripts/owned_containers.py",
  "find": "return state.get(\"Running\") is False and type(state.get(\"Pid\")) is int and state[\"Pid\"] == 0 and state.get(\"Status\") in (\"created\", \"exited\")",
  "replace": "return state.get(\"Running\") is False",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Running=false alone is insufficient without PID0 and a stopped status."
 },
 {
  "id": "host.owned-retain-filesystem",
  "target": "linux/scripts/owned_containers.py",
  "find": "command = [\"stop\", \"--time\", \"10\"] if retain else [\"rm\", \"--force\"]",
  "replace": "command = [\"rm\", \"--force\"]",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Retained failed proof containers must keep their stopped filesystem."
 },
 {
  "id": "host.owned-raw-status",
  "target": "linux/scripts/owned_containers.py",
  "find": "status = status or result.returncode",
  "replace": "status = status or 0",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Preserve the first raw engine failure even when final inventory also fails."
 },
 {
  "id": "host.owned-receipt-verdict",
  "target": "linux/scripts/cleanup-owned-containers.py",
  "find": "\"stopped-or-absent\" if status == 0 else \"failed\"",
  "replace": "\"stopped-or-absent\"",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A failed cleanup must leave a failed receipt."
 },
 {
  "id": "host.owned-receipt-no-replace",
  "target": "linux/scripts/cleanup-owned-containers.py",
  "find": "args.output.open(\"x\", encoding=\"utf-8\")",
  "replace": "args.output.open(\"w\", encoding=\"utf-8\")",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Existing cleanup evidence must refuse before another container command."
 },
 {
  "id": "host.owned-state-object",
  "target": "linux/scripts/owned_containers.py",
  "find": "if not isinstance(state, dict):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A missing inspected state must fail before mutating the container, and cannot escape as successful cleanup."
 },
 {
  "id": "lib.ort-plugin-rust-hip-teardown-report",
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "find": "[[ \"$(grep -Fxc -e 'SUMMARY: AddressSanitizer: 17 byte(s) leaked in 1 allocation(s).' \"${_ih_report}\")\" == 1 ]]",
  "replace": "[[ -r \"${_ih_report}\" ]]",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A fake worker exiting86 before cleanup must fail even when raw Dart/Rust status checks accept that code; require the real17-byte LSan report.",
  "timeout": 90
 },
 {
  "id": "lib.native-worker-tools-retain",
  "target": "linux/scripts/05-frameworks/flutter/setup-flutter.sh",
  "find": "KEEP_CACHE=1; shift",
  "replace": "KEEP_CACHE=0; shift",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "Native tests must retain the verified archive Dart SDK when requested.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-default-bare",
  "target": "linux/scripts/05-frameworks/flutter/setup-flutter.sh",
  "find": "KEEP_CACHE=0",
  "replace": "KEEP_CACHE=1",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "Fresh image installs keep the existing bare SDK default.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-caller-pins",
  "target": "linux/scripts/ensure-native-worker-test-tools.sh",
  "find": "unset FLUTTER_VERSION FLUTTER_SDK_SHA256",
  "replace": ": inherited pins retained",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "Native source test setup uses the canonical pin instead of an inherited stale override.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-required-compilers",
  "target": "linux/scripts/ensure-native-worker-test-tools.sh",
  "find": "for tool in cc c++ rustc sccache; do \"${tool}\" --version; done",
  "replace": ": compiler probes omitted",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "Every compiler and cache prerequisite failure must retain its raw status before an SDK fetch.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-complete-pin",
  "target": "linux/scripts/ensure-native-worker-test-tools.sh",
  "find": ": \"${FLUTTER_VERSION:?}\" \"${FLUTTER_SDK_SHA256:?}\"",
  "replace": ": incomplete pin accepted",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "A successful resolver with half a pin cannot authorize an installer invocation.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-required-dart",
  "target": "linux/scripts/ensure-native-worker-test-tools.sh",
  "find": "\"${dart_binary}\" --version",
  "replace": ": Dart probe omitted",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "A retained SDK must execute its Dart and retain a failed runtime status.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-ci-preflight",
  "target": ".github/workflows/linux-x64.yml",
  "find": "      - name: Prepare mandatory native worker tests\n        uses: ./.github/actions/native-worker-test-tools\n      # The runner image ships no pytest, and without it every mutation baseline fails unmutated.\n",
  "replace": "      - name: Prepare mandatory native worker tests\n        run: echo tools-omitted\n      # The runner image ships no pytest, and without it every mutation baseline fails unmutated.\n",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "Both source-CI lanes must provision the real VM/cache before their mandatory tests.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-ci-mutations",
  "target": ".github/workflows/linux-x64.yml",
  "find": "      - name: Prepare mandatory native worker tests\n        uses: ./.github/actions/native-worker-test-tools\n      - name: Install pytest (mutation-gate baselines)\n",
  "replace": "      - name: Prepare mandatory native worker tests\n        run: echo tools-omitted\n      - name: Install pytest (mutation-gate baselines)\n",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "Both source-CI lanes must provision the real VM/cache before their mandatory tests.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-isolated-setup",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "bash \"${task_source}/linux/scripts/ensure-native-worker-test-tools.sh\" /opt/preflight-native-tools",
  "replace": ": native worker tools omitted",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "The isolated bootstrap must execute the shared required tool provisioner.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-isolated-path",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "PATH=/opt/preflight-native-tools/flutter/bin/cache/dart-sdk/bin:",
  "replace": "PATH=",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "The nonroot isolated worker must receive the retained Dart executable on PATH.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-sdk-cache-key",
  "target": ".github/actions/native-worker-test-tools/action.yml",
  "find": "native-worker-sdk-${{ runner.os }}-${{ runner.arch }}-${{ steps.pin.outputs.sha256 }}",
  "replace": "native-worker-sdk-${{ runner.os }}-${{ runner.arch }}",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "The reusable CI SDK cache key retains the exact archive checksum.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-cache-package",
  "target": ".github/actions/native-worker-test-tools/action.yml",
  "find": "sccache build-essential xz-utils",
  "replace": "build-essential xz-utils",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "Bare source-CI setup explicitly installs the compiler cache prerequisite.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-ci-installer",
  "target": ".github/actions/native-worker-test-tools/action.yml",
  "find": "        bash linux/scripts/ensure-native-worker-test-tools.sh \"${RUNNER_TEMP}/native-worker-sdk\"",
  "replace": "        : native installer omitted",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "The composite action executes the required shared tool setup instead of merely naming its path.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-ci-path",
  "target": ".github/actions/native-worker-test-tools/action.yml",
  "find": "        echo \"${RUNNER_TEMP}/native-worker-sdk/flutter/bin/cache/dart-sdk/bin\" >> \"${GITHUB_PATH}\"",
  "replace": "        : Dart path omitted",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "Subsequent CI test steps require the retained Dart directory on PATH.",
  "timeout": 30
 },
 {
  "id": "lib.native-worker-tools-ci-pin",
  "target": ".github/actions/native-worker-test-tools/action.yml",
  "find": "        flutter_resolve_pin",
  "replace": "        : pin resolution omitted",
  "test": "bash linux/scripts/tests/test-native-worker-tools.sh",
  "why": "SDK cache identity and installer selection require canonical pin resolution.",
  "timeout": 30
 },
 {
  "id": "lib.parity-shared-cli-bound-dispatch",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "parse_cli_value_options _parity_values _parity_rest +_parity_flag \"$@\"",
  "replace": "parse_cli_value_options _parity_values _parity_rest _parity_flag \"$@\"",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "Parity uses output-count callbacks so required help preserves caller errexit and exact argument context.",
  "timeout": 30
 },
 {
  "id": "lib.parity-shared-cli-unconditional-callback",
  "target": "linux/scripts/lib/cli-value-options.sh",
  "find": "      \"${_cpo_handler:1}\" _cpo_consumed \"$@\"",
  "replace": "      \"${_cpo_handler:1}\" _cpo_consumed \"$@\" || _cpo_consumed=$?",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "An active strict caller must retain the raw failing usage status through the selected bound callback.",
  "timeout": 30
 },
 {
  "id": "lib.parity-shared-cli-cross-value",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "[--cross]=CROSS_IMAGE",
  "replace": "[--cross]=NATIVE_IMAGE",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "Every mapped value reaches its distinct caller variable, including spaced arguments and empty optional values.",
  "timeout": 30
 },
 {
  "id": "lib.parity-shared-cli-consumed-flag",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "_parity_consumed=1",
  "replace": "_parity_consumed=0",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "A handled verbose flag consumes one argument before help, preserving the frozen receipt matrix.",
  "timeout": 30
 },
 {
  "id": "lib.parity-shared-cli-remaining-argv",
  "target": "linux/scripts/06-packaging/verify-parity.sh",
  "find": "  local -n _parity_consumed=\"$1\"\n  shift",
  "replace": "  local -n _parity_consumed=\"$1\"\n  : output parameter retained",
  "test": "bash linux/scripts/tests/test-cli-help-exit.sh",
  "why": "Bound callbacks remove only their output slot before forwarding all original remaining arguments to usage.",
  "timeout": 30
 },
 {
  "id": "lib.loaded-module.symbol-owner",
  "target": "shared/rust/loaded_module.rs",
  "find": "    Ok(path)\n}\n\n#[cfg(target_os = \"linux\")]\nstruct Mapping",
  "replace": "    std::env::current_exe().map_err(|error| error.to_string())\n}\n\n#[cfg(target_os = \"linux\")]\nstruct Mapping",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A foreign function must resolve to its loaded library rather than the host executable."
 },
 {
  "id": "lib.loaded-module.exclusive-range",
  "target": "shared/rust/loaded_module.rs",
  "find": "address >= high",
  "replace": "address > high",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "The byte just past a mapping cannot select that mapping."
 },
 {
  "id": "lib.loaded-module.path-spaces",
  "target": "shared/rust/loaded_module.rs",
  "find": "OsStr::from_bytes(line.trim_ascii_start())",
  "replace": "OsStr::from_bytes(line.trim_ascii_start().split(|byte| *byte == b' ').next().unwrap_or_default())",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A space in the actual module filename is not a field separator."
 },
 {
  "id": "lib.loaded-module.path-bytes",
  "target": "shared/rust/loaded_module.rs",
  "find": "PathBuf::from(OsStr::from_bytes(line.trim_ascii_start()))",
  "replace": "PathBuf::from(OsStr::from_bytes(line.trim_ascii_start()).to_string_lossy().into_owned())",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "Non-UTF8 Linux filenames retain exact bytes instead of lossy substitutions."
 },
 {
  "id": "lib.loaded-module.file-backed",
  "target": "shared/rust/loaded_module.rs",
  "find": "if inode.parse::<u64>().map_err(|error| error.to_string())? == 0 {",
  "replace": "if inode.parse::<u64>().map_err(|error| error.to_string())? == u64::MAX {",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "An anonymous mapping is refused even when its synthetic pathname is absolute."
 },
 {
  "id": "lib.loaded-module.absolute-path",
  "target": "shared/rust/loaded_module.rs",
  "find": "if !path.is_absolute() {",
  "replace": "if path.as_os_str().is_empty() {",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "The textual mapping fallback cannot reinterpret a relative pathname under a changed cwd."
 },
 {
  "id": "lib.loaded-module.ambiguous-newline",
  "target": "shared/rust/loaded_module.rs",
  "find": "bytes == b\"\\\\012\"",
  "replace": "bytes == b\"\\\\013\"",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "Ambiguous proc mapping newline escapes cannot identify an exact file."
 },
 {
  "id": "lib.loaded-module.null-address",
  "target": "shared/rust/loaded_module.rs",
  "find": "if address.is_null() {",
  "replace": "if address as usize == usize::MAX {",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A null symbol is rejected explicitly before mapping lookup."
 },
 {
  "id": "lib.native-worker.exact-loaded-module-rust",
  "target": "shared/config/shared-assets.manifest",
  "find": "loaded-module-rust | shared/rust/loaded_module.rs | runtime_support/loaded_module.rs | exact |",
  "replace": "loaded-module-rust | shared/rust/loaded_module.rs | runtime_support/loaded_module.rs | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "Every declared native-worker companion remains exact, including its header."
 },
 {
  "id": "lib.native-worker.exact-isolated-helper-rust",
  "target": "shared/config/shared-assets.manifest",
  "find": "isolated-helper-rust | shared/rust/isolated_helper.rs | runtime_support/isolated_helper.rs | exact |",
  "replace": "isolated-helper-rust | shared/rust/isolated_helper.rs | runtime_support/isolated_helper.rs | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "Every declared native-worker companion remains exact, including its header."
 },
 {
  "id": "lib.native-worker.exact-isolated-helper-tests-rust",
  "target": "shared/config/shared-assets.manifest",
  "find": "isolated-helper-tests-rust | shared/rust/tests/isolated_helper_tests.rs | runtime_support/tests/isolated_helper_tests.rs | exact |",
  "replace": "isolated-helper-tests-rust | shared/rust/tests/isolated_helper_tests.rs | runtime_support/tests/isolated_helper_tests.rs | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "Every declared native-worker companion remains exact, including its header."
 },
 {
  "id": "lib.native-worker.exact-isolated-helper-native-source",
  "target": "shared/config/shared-assets.manifest",
  "find": "isolated-helper-native-source | shared/native/isolated_helper.c | runtime_support/isolated_helper.c | exact |",
  "replace": "isolated-helper-native-source | shared/native/isolated_helper.c | runtime_support/isolated_helper.c | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "Every declared native-worker companion remains exact, including its header."
 },
 {
  "id": "lib.native-worker.exact-isolated-helper-native-header",
  "target": "shared/config/shared-assets.manifest",
  "find": "isolated-helper-native-header | shared/native/isolated_helper.h | runtime_support/isolated_helper.h | exact |",
  "replace": "isolated-helper-native-header | shared/native/isolated_helper.h | runtime_support/isolated_helper.h | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "Every declared native-worker companion remains exact, including its header."
 },
 {
  "id": "lib.native-worker.exact-hip-probe-native-header",
  "target": "shared/config/shared-assets.manifest",
  "find": "hip-probe-native-header | shared/native/hip_copy.hpp | runtime_support/hip_copy.hpp | exact |",
  "replace": "hip-probe-native-header | shared/native/hip_copy.hpp | runtime_support/hip_copy.hpp | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "Every declared native-worker companion remains exact, including its header."
 },
 {
  "id": "lib.native-worker.exact-hip-probe-native-main",
  "target": "shared/config/shared-assets.manifest",
  "find": "hip-probe-native-main | shared/native/hip_probe_main.cpp | runtime_support/hip_probe_main.cpp | exact |",
  "replace": "hip-probe-native-main | shared/native/hip_probe_main.cpp | runtime_support/hip_probe_main.cpp | body |",
  "test": "bash linux/scripts/tests/test-shared-config-sync.sh",
  "why": "Every declared native-worker companion remains exact, including its header."
 },
 {
  "id": "lib.native-worker.dart-module-refusal",
  "target": "shared/rust/tests/dart_child_owner_probe.dart",
  "find": "controls['module'] == 0 &&",
  "replace": "controls['module'] != null &&",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "The live VM acceptance fails when the expected existing module differs from the loaded owner."
 },
 {
  "id": "lib.native-worker.rust-module-refusal",
  "target": "shared/rust/tests/dart_child_owner_probe.rs",
  "find": "        Ok(_) => 22,",
  "replace": "        Ok(_) => 0,",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "A compiled mismatched module result remains a refusal rather than success."
 },
 {
  "id": "lib.native-worker.wrong-module-control",
  "target": "linux/scripts/probe-rust-child-under-dart.sh",
  "find": "module_path=\"${output}/hip-worker\"",
  "replace": "module_path=\"${output}/libchild-owner-probe.so\"",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "The wrong-module control deliberately selects another existing file and must fail."
 },
 {
  "id": "package.cargo-native-helper.success",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "finished[0].get(\"success\") is not True",
  "replace": "finished[0].get(\"success\") is None",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "A failed Cargo build cannot identify delivered artifacts."
 },
 {
  "id": "package.cargo-native-helper.single-build",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "len(finished) != 1",
  "replace": "not finished",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Repeated build completion records are refused."
 },
 {
  "id": "package.cargo-native-helper.final-build",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "result[-1] != finished[0]",
  "replace": "finished[0] != finished[0]",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "The successful build completion is the final record."
 },
 {
  "id": "package.cargo-native-helper.single-record",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "if len(rows) != 1:",
  "replace": "if not rows:",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Duplicate module or build-script records never silently choose the first."
 },
 {
  "id": "package.cargo-native-helper.exact-package",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "r.get(\"package_id\") == package",
  "replace": "r.get(\"package_id\") is not None",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Only the explicitly selected helper package may supply the worker."
 },
 {
  "id": "package.cargo-native-helper.module-not-test",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "row.get(\"profile\", {}).get(\"test\") is not False",
  "replace": "row.get(\"profile\", {}).get(\"test\") is None",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Test executables cannot identify packaged native artifacts."
 },
 {
  "id": "package.cargo-native-helper.duplicate-env",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "len(values) != len(pairs)",
  "replace": "len(values) > len(pairs)",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Repeated helper environment keys are ambiguous and refused."
 },
 {
  "id": "package.cargo-native-helper.env-schema",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "all(isinstance(v, str) for v in p)",
  "replace": "bool(p)",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Cargo helper environment values are strings before use."
 },
 {
  "id": "package.cargo-native-helper.basename",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "if not re.fullmatch(r\"[A-Za-z0-9][A-Za-z0-9_.+-]*\", name) or name in (\".\", \"..\"):",
  "replace": "if name is None:",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "The helper name remains a single safe basename."
 },
 {
  "id": "package.cargo-native-helper.canonical-out",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "if not out.is_absolute() or out.resolve(strict=True) != out:",
  "replace": "if out.is_absolute() and out.resolve(strict=True) != out:",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "OUT_DIR remains absolute and canonical."
 },
 {
  "id": "package.cargo-native-helper.exact-path",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "values.get(path_env) != str(helper)",
  "replace": "values.get(path_env) is None",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "The full helper path equals the selected OUT_DIR and basename."
 },
 {
  "id": "package.cargo-native-helper.no-source-links",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "metadata = path.lstat()",
  "replace": "metadata = path.stat()",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "A linked native module or helper cannot redirect staging."
 },
 {
  "id": "package.cargo-native-helper.nonempty",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "metadata.st_size < 64",
  "replace": "metadata.st_size < 0",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Empty native sources fail before header processing or destination writes."
 },
 {
  "id": "package.cargo-native-helper.executable",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "if executable and not metadata.st_mode & 0o111:",
  "replace": "if executable and not metadata.st_mode & 0o111 and False:",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "The staged native worker must be executable."
 },
 {
  "id": "package.cargo-native-helper.target",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "elf_target(header) != (2, 1, machine)",
  "replace": "elf_target(header) not in ((2, 1, machine), (2, 1, 183))",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Selected module and helper both match the requested target."
 },
 {
  "id": "package.cargo-native-helper.elf-type",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "not in (2, 3):",
  "replace": "not in (1, 2, 3):",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "A relocatable object header is not a native executable or shared module."
 },
 {
  "id": "package.cargo-native-helper.destination",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "if not stat.S_ISDIR(destination.lstat().st_mode) or destination.resolve(strict=True) != destination:",
  "replace": "if not destination.is_dir():",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "A linked output directory cannot redirect the published companion."
 },
 {
  "id": "package.cargo-native-helper.copy-hash",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "file_sha(str(temporary)) != expected",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Copied bytes must retain the selected worker digest."
 },
 {
  "id": "package.cargo-native-helper.source-hash",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "file_sha(str(helper)) != expected",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "A changed worker source cannot produce a passed copy."
 },
 {
  "id": "package.cargo-native-helper.no-replace",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "os.link(temporary, destination / helper.name)",
  "replace": "os.replace(temporary, destination / helper.name)",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Publishing never replaces an existing output file."
 },
 {
  "id": "package.cargo-native-helper.temp-cleanup",
  "target": "linux/scripts/06-packaging/stage-cargo-native-helper.py",
  "find": "temporary.unlink(missing_ok=True)",
  "replace": "temporary.exists()",
  "test": "bash linux/scripts/tests/test-cargo-native-helper.sh",
  "why": "Failed copies and publications leave no staging temporary file."
 },
 {
  "id": "host.proof-orphan-reaper",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "\"--pull\", \"never\", \"--init\",",
  "replace": "\"--pull\", \"never\",",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The complete source runner must request an orphan reaper; adopted zombie groups otherwise cannot disappear after KILL."
 },
 {
  "id": "host.proof-image-override",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "    image = args.image or base_image(source)",
  "replace": "    image = base_image(source)",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "An explicitly selected cached image must reach the preserved-source runner and its receipt."
 },
 {
  "id": "host.proof-native-cache-readonly",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "f\"{args.native_tools_cache}:/opt/preflight-native-tools:ro\"",
  "replace": "f\"{args.native_tools_cache}:/opt/preflight-native-tools:rw\"",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Reusing the verified SDK cache must not expose its bytes to the disposable source check."
 },
 {
  "id": "host.proof-writable-reports",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "    reports.chmod(0o777)",
  "replace": "    reports.chmod(0o755)",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The nonroot worker needs a writable report bind before launch; stdout alone cannot replace missing evidence."
 },
 {
  "id": "host.proof-native-cache-directory",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "        if not args.native_tools_cache.is_dir():",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A missing retained SDK directory must fail before source/output allocation rather than becoming an engine-created empty cache."
 },
 {
  "id": "host.proof-supplied-run-id",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "    run_id = args.run_id",
  "replace": "    run_id = uuid.uuid4().hex",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A long unit and its independent cleanup hook must use the same supplied fresh ownership token."
 },
 {
  "id": "host.proof-run-id-validation",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "    if not re.fullmatch(r\"[0-9a-f]{32}\", args.run_id):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Malformed ownership tokens must refuse before allocating a source run or invoking a container engine."
 },
 {
  "id": "packaging.amdgpu-module-bytes",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  ort_assert_plugin_module \"$lib/${ORT_AMDGPU_EP_MODULE}\" || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "A separate plugin must match the original image module."
 },
 {
  "id": "packaging.amdgpu-legacy-provider",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  if [ -e \"$lib/libonnxruntime_providers_migraphx.so\" ] || [ -L \"$lib/libonnxruntime_providers_migraphx.so\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "An AMD package cannot retain the removed in-tree provider."
 },
 {
  "id": "packaging.amdgpu-complete-license-tree",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  diff --no-dereference -qr \"$image_licenses\" \"$licenses\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Every original transitive license and the exact tree inventory remain required."
 },
 {
  "id": "packaging.amdgpu-license-source",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  [ -s \"$image_licenses/onnxruntime-ep-amdgpu/LICENSE\" ] || {",
  "replace": "  true || {",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "A missing image plugin license must fail before staging, even under conditional calls."
 },
 {
  "id": "packaging.amdgpu-license-destination",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "    mkdir \"$licenses\" || return",
  "replace": "    mkdir -p \"$licenses\" || return",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Staging must not reuse an existing or linked license destination."
 },
 {
  "id": "packaging.amdgpu-license-parent",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "    _ort_package_inside \"$root\" \"$(dirname \"$licenses\")\" 'Plugin license destination escapes package' || return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Staging must refuse a destination whose existing parent is outside the package."
 },
 {
  "id": "packaging.amdgpu-license-root",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  _ort_package_inside \"$root\" \"$licenses\" 'Plugin licenses escape package' || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "An extracted package license tree cannot resolve outside its root."
 },
 {
  "id": "packaging.amdgpu-license-mkdir-status",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "    mkdir \"$licenses\" || return",
  "replace": "    mkdir \"$licenses\" || :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Failed allocation must retain its raw status and prevent later staging."
 },
 {
  "id": "packaging.amdgpu-license-copy-status",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "    cp -a \"$image_licenses/.\" \"$licenses/\" || return",
  "replace": "    cp -a \"$image_licenses/.\" \"$licenses/\" || :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Failed copying must retain its raw status rather than become a later proof error."
 },
 {
  "id": "packaging.amdgpu-program-mode",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  if [ ! -f \"$2\" ] || [ -L \"$2\" ] || [ ! -x \"$2\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Finished launchers and native helpers must remain executable regular files, never links."
 },
 {
  "id": "packaging.amdgpu-program-root",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  _ort_package_inside \"$1\" \"$2\" 'Packaged program escapes package'",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "A regular helper reached through an escaping parent directory is not inside the package."
 },
 {
  "id": "mutations.external-changed-root",
  "target": "docs/scripts/verify_mutations.py",
  "find": "touched = changed_files(args.root, args.base)",
  "replace": "touched = changed_files(ROOT, args.base)",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "A Hub-installed runner must select staged/edited consumer work from its explicit root rather than silently proving nothing."
 },
 {
  "id": "mutations.external-push-root",
  "target": "docs/scripts/verify_mutations.py",
  "find": "entries = select_push(entries, args.push_range, args.root, os.path.abspath(args.manifest))",
  "replace": "entries = select_push(entries, args.push_range, ROOT, os.path.abspath(args.manifest))",
  "test": "bash linux/scripts/tests/test-mutation-push.sh",
  "why": "Push-range history must come from the requested consumer root rather than the Hub history."
 },
 {
  "id": "ort-census.explicit-loader-cli",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "loader_args=$'--ld-library-path\\n'\"${2?--ld-library-path needs a bundle-relative loader path}\"",
  "replace": "loader_args=\"\"",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "An explicit launcher path must reach the tree probe; a no-RUNPATH plugin still fails without it."
 },
 {
  "id": "ort-census.explicit-loader-probe",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  mapfile -t args <<< \"$3${4:+$'\\n'}$4\"",
  "replace": "  mapfile -t args <<< \"$3\"",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "Dropping the forwarded loader path must break the actual synthetic plugin lookup, rather than pass a source-only assertion."
 },
 {
  "id": "python-types.cargo-helper-strict-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/06-packaging/stage-cargo-native-helper.py' \\\n  'linux/scripts/06-packaging/python-app-selftest.py' \\\n",
  "replace": "  'linux/scripts/06-packaging/python-app-selftest.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The native helper stager must remain in the real checker scope; a complete isolated fixture must reject its type and annotation defects."
 },
 {
  "id": "python-types.cargo-helper-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/06-packaging/stage-cargo-native-helper.py' \\\n  'linux/scripts/06-packaging/venv-version-probe.py' \\\n",
  "replace": "  'linux/scripts/06-packaging/venv-version-probe.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The native helper stager must remain in the real checker scope; a complete isolated fixture must reject its type and annotation defects."
 },
 {
  "id": "lib.isolated-helper-log-bootstrap",
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "find": "source \"${BASH_SOURCE[0]%/*}/log-bootstrap.sh\" || return\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "The newly shared compiler library must source standalone logging from its canonical companion, with no private fallback."
 },
 {
  "id": "packaging.ort-restore-wrapper-mode",
  "target": "linux/scripts/06-packaging/ort-wheel-licenses.sh",
  "find": "stage_ort_wheel_originals() { stage_ort_wheel_licenses \"$1\" --restore-unstripped; }",
  "replace": "stage_ort_wheel_originals() { stage_ort_wheel_licenses \"$1\"; }",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "The shared original-byte API must actually restore the native core rather than only stage its matching notices."
 },
 {
  "id": "packaging.ort-restore-linked-input",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "    if library.is_symlink():",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "An internal symlink is not an explicit regular native file eligible for replacement."
 },
 {
  "id": "packaging.ort-restore-linked-root",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "        if path.is_symlink():",
  "replace": "        if path.is_symlink() and path != destination:",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "The existing notice writer owns linked-root refusal before any native originals publish; the new mode must retain that canonical guard."
 },
 {
  "id": "packaging.ort-restore-root-boundary",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "if not root.is_dir() or not target.is_relative_to(root):",
  "replace": "if not root.is_dir():",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "Native originals cannot overwrite files outside the declared bundle, including through a parent link."
 },
 {
  "id": "packaging.ort-restore-duplicate-target",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "if target in seen:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "Repeated destination arguments must refuse before notices or any native bytes change."
 },
 {
  "id": "packaging.ort-restore-input-unchanged",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "if library.is_symlink() or not library.is_file() or file_sha(str(library)) != expected:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "A file replaced during copy must survive; an earlier wheel match is not authority to overwrite later bytes."
 },
 {
  "id": "packaging.ort-restore-copy-complete",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "if file_sha(str(pending)) != original_sha:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "A silent short copy must fail before replacing the proved native input."
 },
 {
  "id": "packaging.ort-restore-temporary-cleanup",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "            pending.unlink(missing_ok=True)",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "Failed copying or atomic replacement must remove its unpublished temporary file."
 },
 {
  "id": "packaging.ort-restore-validate-before-write",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "            originals = original_library_plan(wheel, args.library, args.destination, args.strip, Path(temp), inputs) if args.restore_unstripped else []\n            output = write_texts(args.destination, texts)",
  "replace": "            output = write_texts(args.destination, texts)\n            originals = original_library_plan(wheel, args.library, args.destination, args.strip, Path(temp), inputs) if args.restore_unstripped else []",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "All destination checks must complete before writing even the original notices."
 },
 {
  "id": "packaging.ort-restore-publish-after-copy",
  "target": "linux/scripts/06-packaging/stage-ort-wheel-licenses.py",
  "find": "        try:\n            with original.open(\"rb\") as source:",
  "replace": "        try:\n            os.replace(pending, library)\n            with original.open(\"rb\") as source:",
  "test": "bash linux/scripts/tests/test-ort-wheel-licenses.sh",
  "why": "A failed copy cannot touch the prior native library; publish only a complete validated temporary."
 },
 {
  "id": "sccache.fixture-helper-path",
  "target": "linux/scripts/tests/test-compiler-cache.sh",
  "find": "    absent)\n      command() {\n        if [ \"$#\" -eq 2 ] && [ \"$1\" = -v ] && [ \"$2\" = sccache ]; then return 1; fi\n        builtin command \"$@\"\n      }\n      sccache() { printf invoked >> \"${CACHE_FIXTURE_WORK}/unavailable-invoked\"; return 127; }\n      ;;",
  "replace": "    absent)\n      PATH=\"$(\n        filtered=\"\"\n        while IFS= read -r candidate; do\n          [ -x \"${candidate}/sccache\" ] || filtered=\"${filtered:+${filtered}:}${candidate}\"\n        done < <(printf '%s\\n' \"${PATH//:/$'\\n'}\")\n        printf '%s' \"${filtered}\"\n      )\"\n      ;;",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "A missing-cache fixture must preserve colocated shell utilities; removing their whole PATH directory made the actual clean Ubuntu baseline fail."
 },
 {
  "id": "ort-census.webgpu-unbuilt-required",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "    if not rows and not lines and unbuilt_prefix(prefix):\n        return\n",
  "replace": "    if False:\n        return\n",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "A skipped GPU build must retain successful GIL/FT check/follow transport without fabricated receipts."
 },
 {
  "id": "ort-census.webgpu-unbuilt-payload-refusal",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "    if not rows and not lines and unbuilt_prefix(prefix):\n",
  "replace": "    if not rows and not lines:\n",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Empty rows cannot hide native products, wheels or damaged receipts."
 },
 {
  "id": "ort-census.webgpu-unbuilt-links",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "        if path.is_symlink():\n            return False\n",
  "replace": "        if False:\n            return False\n",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "A linked empty directory or census placeholder is not an absent build."
 },
 {
  "id": "ort-census.webgpu-unbuilt-root-link",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "    if prefix.is_symlink() or not prefix.is_dir():\n",
  "replace": "    if not prefix.is_dir():\n",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "A linked prefix must not satisfy the absent-build exception."
 },
 {
  "id": "ort-census.webgpu-unbuilt-empty-manifest",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": " or path.stat().st_size:\n",
  "replace": " :\n",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Only exactly empty manifest placeholders may belong to an unbuilt prefix."
 },
 {
  "id": "ort-census.webgpu-unbuilt-known-placeholders",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_delivery.py",
  "find": "        if path.parent != prefix or path.name not in PHASES or not path.is_file() or path.stat().st_size:\n",
  "replace": "        if not path.is_file() or path.stat().st_size:\n",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-delivery.sh",
  "why": "Unknown and nested empty files must not become valid census placeholders."
 },
 {
  "id": "lib.webgpu-media-completed-delivery",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "product = runtime.completed_product(prefix, receipt, phase)",
  "replace": "product = runtime.delivery.current_product(receipt, phase)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "Pending wheel repairs must stop the media replay."
 },
 {
  "id": "lib.webgpu-media-selected-wheel",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "wheel = selected_wheel(prefix, pool, phase, args.source_ref)",
  "replace": "wheel = next(pool.glob(\"*.whl\"))",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "Preparation must use the completed receipt rather than select an arbitrary collected wheel."
 },
 {
  "id": "lib.webgpu-media-native-phase",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "for phase in (\"native\", \"gil\", \"free-threaded\"):",
  "replace": "for phase in (\"gil\", \"free-threaded\"):",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "Native registration must execute beside both Python products."
 },
 {
  "id": "lib.webgpu-media-ft-phase",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "for phase in (\"native\", \"gil\", \"free-threaded\"):",
  "replace": "for phase in (\"native\", \"gil\"):",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "A successful GIL product cannot substitute for free-threaded execution."
 },
 {
  "id": "lib.webgpu-media-ft-interpreter",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "else (args.ft_python, args.ft_wheels))",
  "replace": "else (args.gil_python, args.ft_wheels))",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "The FT phase must use its selected FT interpreter."
 },
 {
  "id": "lib.webgpu-media-offline-default",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "if not args.allow_network:",
  "replace": "if args.allow_network:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "Only explicit network opt-in may permit fetching the pinned dependency."
 },
 {
  "id": "lib.webgpu-media-numpy-pin",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "f\"numpy=={args.numpy_version}\", str(wheel)",
  "replace": "\"numpy\", str(wheel)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "Dependency preparation must retain the caller-supplied exact NumPy pin."
 },
 {
  "id": "lib.webgpu-media-raw-child",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "    result.check_returncode()",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "A failed child must retain its raw failure instead of accepting stdout."
 },
 {
  "id": "lib.webgpu-media-phase-verdict",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "if result.get(\"phase\") != phase:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "A zero-status child with another phase cannot publish a passed proof."
 },
 {
  "id": "lib.webgpu-media-raw-status",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "return error.returncode if error.returncode > 0 else 128 - error.returncode",
  "replace": "return 1",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "The CLI must retain the failing child status."
 },
 {
  "id": "lib.webgpu-media-timeout-output",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "        save_streams(log, error)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "Timed-out children must preserve their partial stdout and stderr after reaping."
 },
 {
  "id": "lib.webgpu-media-fresh-evidence",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "args.work_dir.mkdir(mode=0o700)",
  "replace": "args.work_dir.mkdir(mode=0o700, exist_ok=True)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "Existing evidence must never be reused or overwritten."
 },
 {
  "id": "lib.webgpu-media-pool-boundary",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "    wheel.relative_to(pool.resolve(strict=True))",
  "replace": "    pool.resolve(strict=True)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "A wheel symlink cannot redirect installation outside its selected collection."
 },
 {
  "id": "lib.webgpu-media-timeout-bound",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "if args.timeout <= 0:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "The driver refuses an unbounded child timeout before starting work."
 },
 {
  "id": "lib.webgpu-media-no-dependencies",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "\"--no-deps\", \"--only-binary=:all:\"",
  "replace": "\"--only-binary=:all:\"",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "Installation must not resolve and fetch a substitute ORT or unpinned dependency graph."
 },
 {
  "id": "lib.webgpu-media-isolated-child",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_media.py",
  "find": "str(python), \"-I\", str(Path(runtime.__file__).resolve())",
  "replace": "str(python), str(Path(runtime.__file__).resolve())",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-media.sh",
  "why": "Factory execution must isolate Python environment and user-site overrides."
 },
 {
  "id": "probe.webgpu-default-unbuilt",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "and not delivery.unbuilt_prefix(p)",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "An empty optional GPU tree must not demand a fabricated runtime receipt."
 },
 {
  "id": "probe.webgpu-default-explicit",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "if requested is not None:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "An explicitly requested invalid prefix must not silently disappear from the proof."
 },
 {
  "id": "probe.webgpu-default-broken-link",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "(p.exists() or p.is_symlink())",
  "replace": "p.exists()",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "A broken optional-prefix link must remain a failed input, not an absent prefix."
 },
 {
  "id": "probe.webgpu-default-payload",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "not delivery.unbuilt_prefix(p)",
  "replace": "(p / \"lib/libonnxruntime.so\").is_file()",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "Unknown payloads and damaged receipts cannot be dropped merely because a native core is absent."
 },
 {
  "id": "probe.webgpu-default-cli",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_runtime.py",
  "find": "prefixes = selected_prefixes(args.prefix)",
  "replace": "prefixes = args.prefix if args.prefix is not None else [p for p in DEFAULT_PREFIXES if p.is_dir()]",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-runtime.sh",
  "why": "The actual CLI must reuse strict unbuilt-prefix discovery rather than the old directory-only filter."
 },
 {
  "id": "probe.ft-deps-pins",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "if (version, python_tag) != (lock[\"numpy_version\"], lock[\"python_tag\"]):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Version and Python pin drift must fail before installation."
 },
 {
  "id": "probe.ft-deps-artifact-path",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "not re.fullmatch(r\"numpy-[A-Za-z0-9_.-]+\", name)",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Locked artifact basenames cannot escape the pool."
 },
 {
  "id": "probe.ft-deps-artifact-hash-format",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "not re.fullmatch(r\"[0-9a-f]{64}\", row[\"sha256\"])",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Artifact checksums must be complete SHA256 values."
 },
 {
  "id": "probe.ft-deps-artifact-host",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "not row[\"url\"].startswith(\"https://files.pythonhosted.org/packages/\")",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Locked artifacts retain their official HTTPS origin."
 },
 {
  "id": "probe.ft-deps-artifact-url-basename",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "row[\"url\"].rsplit(\"/\", 1)[-1] != name",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The source URL must identify the recorded file."
 },
 {
  "id": "probe.ft-deps-wheel-abi",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "if (name, have_version, py, abi) != (\"numpy\", version, python_tag, python_tag + \"t\"):",
  "replace": "if (name, have_version, py) != (\"numpy\", version, python_tag):",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The wheel must use the target FT ABI."
 },
 {
  "id": "probe.ft-deps-wheel-arch",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "if any(not tag.endswith(\"_\" + machine) for tag in plat.split(\".\")):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "A foreign wheel filename cannot pass target selection."
 },
 {
  "id": "probe.ft-deps-license",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "or not wheel.read(license_name).strip():",
  "replace": "or False:",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The wheel must retain the original nonempty license."
 },
 {
  "id": "probe.ft-deps-metadata",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "if (meta[\"Name\"], meta[\"Version\"]) != (\"numpy\", version):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Wheel metadata must agree with the requested dependency."
 },
 {
  "id": "probe.ft-deps-elf-machine",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "struct.unpack_from(\"<H\", header, 18)[0] != machine",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "A target-tagged wheel cannot contain a foreign ELF."
 },
 {
  "id": "probe.ft-deps-native-code",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "if not binaries:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "A NumPy wheel must actually carry native code."
 },
 {
  "id": "probe.ft-deps-pool-root",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "if pool.is_symlink() or not pool.is_dir():",
  "replace": "if not pool.is_dir():",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The probe pool itself cannot be a symlink."
 },
 {
  "id": "probe.ft-deps-receipt-target",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "if (record[\"numpy_version\"], record[\"arch\"], record[\"python_tag\"], record[\"artifact\"]) != (version, arch, python_tag, row):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Receipt identity must bind the exact pin and target."
 },
 {
  "id": "probe.ft-deps-wheel-path",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "    if Path(wheel_name).name != wheel_name or not wheel_name.endswith(\".whl\"):\n        raise ValueError(\"invalid probe dependency wheel basename\")\n    expected = {\"receipt.json\", row[\"filename\"], wheel_name}\n    if {p.name for p in pool.iterdir()} != expected or any(p.is_symlink() or not p.is_file() for p in pool.iterdir()):\n        raise ValueError(\"probe dependency pool has unexpected entries\")",
  "replace": "    if any(p.is_symlink() or not p.is_file() for p in pool.iterdir()):\n        raise ValueError(\"probe dependency pool has unexpected entries\")",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Removing both path and roster defenses must expose the matching external-wheel escape control."
 },
 {
  "id": "probe.ft-deps-pool-roster",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "{p.name for p in pool.iterdir()} != expected",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Unrecorded payloads cannot enter the private probe environment."
 },
 {
  "id": "probe.ft-deps-pool-symlink",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "any(p.is_symlink() or not p.is_file() for p in pool.iterdir())",
  "replace": "any(not p.is_file() for p in pool.iterdir())",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "A linked wheel cannot replace the checked regular input."
 },
 {
  "id": "probe.ft-deps-original-bytes",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "digest(pool / row[\"filename\"]) != row[\"sha256\"]",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The upstream artifact hash is independent of the produced-wheel receipt."
 },
 {
  "id": "probe.ft-deps-wheel-bytes",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "digest(wheel) != record[\"wheel_sha256\"]",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The wheel payload must match its receipt before install."
 },
 {
  "id": "probe.ft-deps-offline",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "\"install\", \"--offline\", \"--no-index\", \"--no-deps\"",
  "replace": "\"install\", \"--no-index\", \"--no-deps\"",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Acceptance cannot fetch from the network."
 },
 {
  "id": "probe.ft-deps-no-index",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "\"install\", \"--offline\", \"--no-index\", \"--no-deps\"",
  "replace": "\"install\", \"--offline\", \"--no-deps\"",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Installation selects only the checked local wheel."
 },
 {
  "id": "probe.ft-deps-no-deps",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "\"install\", \"--offline\", \"--no-index\", \"--no-deps\"",
  "replace": "\"install\", \"--offline\", \"--no-index\"",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Unpinned transitive resolution is forbidden in acceptance."
 },
 {
  "id": "probe.ft-deps-normal-import",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "\"import numpy; assert numpy.__version__ == sys.argv[1]; assert not sys._is_gil_enabled()\"",
  "replace": "\"pass; assert not sys._is_gil_enabled()\"",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The probe executes a normal NumPy initializer and verifies its version."
 },
 {
  "id": "probe.ft-deps-gil-after",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "numpy.__version__ == sys.argv[1]; assert not sys._is_gil_enabled()",
  "replace": "numpy.__version__ == sys.argv[1]",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Import cannot silently re-enable the GIL."
 },
 {
  "id": "probe.ft-deps-source-before-build",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "if digest(archive) != row[\"sha256\"]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Source bytes are checked before invoking the build backend."
 },
 {
  "id": "probe.ft-deps-cached-import",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "        prove_import(wheel, args.numpy_version, work)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Even a verified cache hit must execute a fresh target import."
 },
 {
  "id": "probe.ft-deps-existing-output",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "if args.pool.exists() or args.pool.is_symlink():",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "A replay must not overwrite existing proof output."
 },
 {
  "id": "probe.ft-deps-raw-status",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "return error.returncode if error.returncode > 0 else 128 - error.returncode",
  "replace": "return 1",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "A failed child retains its raw failure status."
 },
 {
  "id": "probe.ft-deps-smoke-install",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "\"${work}/venv/bin/python\" -I /opt/scripts/packaging/free-threaded-probe-deps.py install",
  "replace": "\"${work}/venv/bin/python\" -I /opt/scripts/packaging/free-threaded-probe-deps.py verify",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "The FT smoke installs the checked dependency, rather than merely inspecting it."
 },
 {
  "id": "probe.ft-deps-smoke-failure",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "FTS NOINSTALL the pinned offline probe dependencies do not install",
  "replace": "FTS NOTE the pinned offline probe dependencies do not install",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "A failed dependency install is a failed FT-store verdict."
 },
 {
  "id": "probe.ft-deps-smoke-version",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "FT_PROBE_NUMPY_VERSION=$(_rt_versions_env_pin PY_NUMPY_VERSION)",
  "replace": "FT_PROBE_NUMPY_VERSION=unverified",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "The smoke forwards the repository NumPy pin."
 },
 {
  "id": "probe.ft-deps-smoke-architecture",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "FT_PROBE_ARCH=${target_arch}",
  "replace": "FT_PROBE_ARCH=amd64",
  "test": "bash linux/scripts/tests/test-free-threaded-store.sh",
  "why": "The smoke forwards the actual target architecture."
 },
 {
  "id": "probe.ft-deps-runtime-lock",
  "target": "linux/Dockerfile.torch",
  "find": "COPY linux/scripts/06-packaging/free-threaded-probe-deps.json /opt/scripts/packaging/free-threaded-probe-deps.json",
  "replace": "COPY linux/scripts/06-packaging/free-threaded-probe-deps.json /opt/scripts/packaging/unused.json",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The installed helper needs its exact lock companion."
 },
 {
  "id": "probe.ft-deps-runtime-builder",
  "target": "linux/Dockerfile.torch",
  "find": "TARGETARCH=\"${TARGETARCH}\" bash /opt/scripts/packaging/build-free-threaded-probe-deps.sh",
  "replace": "TARGETARCH=\"${TARGETARCH}\" true",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The runtime layer must actually build the offline pool."
 },
 {
  "id": "probe.ft-deps-builder-pin",
  "target": "linux/scripts/06-packaging/build-free-threaded-probe-deps.sh",
  "find": "--numpy-version \"${PY_NUMPY_VERSION:?missing NumPy pin}\"",
  "replace": "--numpy-version unverified",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "The builder forwards the authoritative NumPy pin."
 },
 {
  "id": "probe.ft-deps-builder-cache",
  "target": "linux/scripts/06-packaging/build-free-threaded-probe-deps.sh",
  "find": "export CC=\"${launcher} ${CC:-gcc}\" CXX=\"${launcher} ${CXX:-g++}\"",
  "replace": "export CC=\"${CC:-gcc}\" CXX=\"${CXX:-g++}\"",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "RISC-V source compilation uses the shared compiler cache."
 },
 {
  "id": "probe.ft-deps-builder-cache-stats",
  "target": "linux/scripts/06-packaging/build-free-threaded-probe-deps.sh",
  "find": "compiler_cache_stats_for_launcher \"${launcher}\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "Compiler-cache statistics remain observable on stderr."
 },
 {
  "id": "lib.onnx-wasm-proof-plugin-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "\"onnxruntime_WEBGPU_STATIC_PLUGIN\": \"ON\"",
  "replace": "\"onnxruntime_WEBGPU_STATIC_PLUGIN\": \"OFF\"",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Independent fixture flags must reject a legacy plugin mode."
 },
 {
  "id": "lib.onnx-wasm-proof-dawn-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "\"onnxruntime_USE_EXTERNAL_DAWN\": \"OFF\"",
  "replace": "\"onnxruntime_USE_EXTERNAL_DAWN\": \"ON\"",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "WASM uses integrated Dawn, independently of native defaults."
 },
 {
  "id": "lib.onnx-wasm-proof-threads",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "\"onnxruntime_ENABLE_WEBASSEMBLY_THREADS\": \"ON\"",
  "replace": "\"onnxruntime_ENABLE_WEBASSEMBLY_THREADS\": \"OFF\"",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Threaded module receipts require actual threaded configuration."
 },
 {
  "id": "lib.onnx-wasm-proof-jspi-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "\"ON\" if flavor == \"jspi\" else \"OFF\"",
  "replace": "\"OFF\"",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "The second pass must actually configure JSPI."
 },
 {
  "id": "lib.onnx-wasm-proof-prefix-link",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if prefix.is_symlink() or not prefix.is_dir():",
  "replace": "if not prefix.is_dir():",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A linked artifact prefix cannot substitute for its owner."
 },
 {
  "id": "lib.onnx-wasm-proof-file-link",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "path.is_symlink() or not path.is_file()",
  "replace": "False or not path.is_file()",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A linked receipt cannot import provenance from another tree."
 },
 {
  "id": "lib.onnx-wasm-proof-nonempty",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "not 0 < path.stat().st_size <= 1024 * 1024 * 1024",
  "replace": "path.stat().st_size > 1024 * 1024 * 1024",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A loader must be a real nonempty delivered file."
 },
 {
  "id": "lib.onnx-wasm-proof-wasm-header",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if stream.read(8) != b\"\\0asm\\x01\\0\\0\\0\":",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A compiler-product receipt cannot bless non-WASM bytes."
 },
 {
  "id": "lib.onnx-wasm-proof-source-format",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if not args.source_ref or not re.fullmatch(r\"[0-9a-f]{40}\", args.source_revision or \"\"):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Source identity needs a full Git revision before a CLI action."
 },
 {
  "id": "lib.onnx-wasm-proof-receipt-identity",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if (receipt.get(\"schema_version\") != 2 or receipt.get(\"source\") != source_identity(args)\n            or receipt.get(\"config\") != args.config):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Both flavor records must belong to the requested source and configuration."
 },
 {
  "id": "lib.onnx-wasm-proof-both-flavors",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "(complete and set(phases) != set(FLAVORS))",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "One successful flavor cannot complete the requested pair."
 },
 {
  "id": "lib.onnx-wasm-proof-recorded-flags",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if phase[\"configured_flags\"] != expected_flags(flavor):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Recorded flags cannot silently become legacy after compilation."
 },
 {
  "id": "lib.onnx-wasm-proof-cache-id-format",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if not re.fullmatch(r\"[0-9a-f]{64}\", phase[\"cmake_cache_sha256\"]):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Each flavor retains a complete configured-cache identity."
 },
 {
  "id": "lib.onnx-wasm-proof-product-bytes",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if phase[\"product\"] != product:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "An earlier product must stay unchanged before the next pass is recorded."
 },
 {
  "id": "lib.onnx-wasm-proof-no-overwrite",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if args.flavor in receipt[\"flavors\"]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "An already recorded flavor cannot be silently replaced."
 },
 {
  "id": "lib.onnx-wasm-proof-actual-config",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "    BUILD[\"configured_mode\"](cache, {\"CMAKE_BUILD_TYPE\": args.config}, \"STRING\")",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "The caller label must match the actual configured build type."
 },
 {
  "id": "lib.onnx-wasm-proof-product-digest",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "return {\"path\": wasm.name, \"sha256\": digest,",
  "replace": "return {\"path\": wasm.name, \"sha256\": \"0\" * 64,",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Receipts retain the real compiled module digest."
 },
 {
  "id": "lib.onnx-wasm-proof-disabled-payload",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if (args.prefix / RECEIPT).exists() or any(args.prefix.glob(\"ort-wasm-simd-threaded.asyncify.*\")) or any(args.prefix.glob(\"ort-wasm-simd-threaded.jspi.*\")):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Disabled flavors cannot retain an earlier plugin payload."
 },
 {
  "id": "lib.onnx-wasm-proof-any-wasm",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if not any(args.prefix.glob(\"*.wasm\")):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A skipped empty output cannot seal a shared cache."
 },
 {
  "id": "lib.onnx-wasm-proof-roster",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if p.name not in (CACHE, \".complete\")",
  "replace": "if p.suffix in (\".wasm\", \".mjs\")",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "The manifest binds every regular payload, including provenance and extra files."
 },
 {
  "id": "lib.onnx-wasm-proof-seal-verdict",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "def seal_cache(args: argparse.Namespace) -> None:\n    verify(args)",
  "replace": "def seal_cache(args: argparse.Namespace) -> None:\n    pass",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A partial pool cannot acquire a complete marker through the standalone sealer."
 },
 {
  "id": "lib.onnx-wasm-proof-marker-binding",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if marker != {\"cache_sha256\": file_digest(args.prefix / CACHE)}:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A nonempty marker still must name this exact manifest."
 },
 {
  "id": "lib.onnx-wasm-proof-cache-identity",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if data != cache_identity(args):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Even disabled-flavor caches retain source, configuration and payload identity."
 },
 {
  "id": "lib.onnx-wasm-proof-cache-semantics",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "    verify(args)\n\n\ndef reset",
  "replace": "    pass\n\n\ndef reset",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Self-consistent hashes cannot excuse invalid flavor semantics."
 },
 {
  "id": "lib.onnx-wasm-proof-reset-policy",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if any(p.is_symlink() or not p.is_file() for p in entries):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Nonregular output trees refuse before deleting any retained file."
 },
 {
  "id": "lib.onnx-wasm-proof-overlap",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if source == target or source.is_relative_to(target) or target.is_relative_to(source):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Cache publication cannot reset its own source or an ancestor."
 },
 {
  "id": "lib.onnx-wasm-proof-copied-bytes",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if cache_files(args.destination) != files:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Loader copies must match their checked source even when WASM code is unchanged."
 },
 {
  "id": "lib.onnx-wasm-proof-outer-required",
  "target": "linux/scripts/03-media/build/onnxruntime/build/web-wasm-cache.sh",
  "find": "if [ \"${ORT_WEB_REQUIRED:-0}\" = 1 ]; then exit \"${status}\"; fi",
  "replace": "if false; then exit \"${status}\"; fi",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "Required inner failures remain failed at the outer cache boundary."
 },
 {
  "id": "lib.onnx-wasm-proof-complete-output",
  "target": "linux/scripts/03-media/build/onnxruntime/build/web-wasm-cache.sh",
  "find": "elif [ \"${ORT_WEB_REQUIRED:-0}\" = 1 ]; then",
  "replace": "elif false; then",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "A zero-exit build with a missing flavor cannot pass strict policy."
 },
 {
  "id": "lib.onnx-wasm-proof-post-js",
  "target": "linux/scripts/03-media/build/onnxruntime/build/web-wasm-cache.sh",
  "find": "if [ -n \"${check_mode}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "Inspection and post-JS delivery modes cannot rebuild or allocate a shared cache."
 },
 {
  "id": "lib.onnx-wasm-proof-strict-value",
  "target": "linux/scripts/03-media/build/onnxruntime/build/web-wasm-cache.sh",
  "find": "case \"${ORT_WEB_REQUIRED:-0}\" in 0|1) ;;",
  "replace": "case \"${ORT_WEB_REQUIRED:-0}\" in 0|1|2) ;;",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "Invalid policy values cannot silently select optional behavior."
 },
 {
  "id": "lib.onnx-wasm-proof-docker-policy",
  "target": "linux/Dockerfile.media",
  "find": "ORT_WEB_REQUIRED=\"${ORT_WEB_REQUIRED}\" ORT_WASM_WEBGPU_FLAVORS=\"${ORT_WASM_WEBGPU_FLAVORS}\"",
  "replace": "ORT_WEB_REQUIRED=0 ORT_WASM_WEBGPU_FLAVORS=\"${ORT_WASM_WEBGPU_FLAVORS}\"",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "The Docker boundary retains the requested strict policy."
 },
 {
  "id": "lib.onnx-wasm-proof-docker-verification",
  "target": "linux/Dockerfile.media",
  "find": "web-wasm-cache.sh --verify-delivery;",
  "replace": "web-wasm-cache.sh --verify-only;",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "Post-JS delivery runs both enabled factory probes instead of inspecting saved receipts only."
 },
 {
  "id": "lib.onnx-wasm-proof-docker-js-policy",
  "target": "linux/Dockerfile.media",
  "find": "ORT_WEB_REQUIRED=\"${ORT_WEB_REQUIRED}\" bash /opt/scripts/03-media/build/onnxruntime/build/build-onnxruntime.sh --step js;",
  "replace": "ORT_WEB_REQUIRED=0 bash /opt/scripts/03-media/build/onnxruntime/build/build-onnxruntime.sh --step js;",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "Required JS failures retain their strict verdict."
 },
 {
  "id": "lib.onnx-wasm-proof-fixture-status",
  "target": "linux/scripts/tests/python-proof-fixture.sh",
  "find": "  printf '%s\\n' \"${_tpf_output}\"",
  "replace": "  _tpf_status=0\n  printf '%s\\n' \"${_tpf_output}\"",
  "test": "bash linux/scripts/tests/test-python-proof-fixture.sh",
  "why": "A passing unittest summary cannot hide a nonzero child status."
 },
 {
  "id": "lib.onnx-wasm-proof-fixture-count",
  "target": "linux/scripts/tests/python-proof-fixture.sh",
  "find": "'^Ran [1-9][0-9]* tests? in '",
  "replace": "'^Ran [0-9]+ tests? in '",
  "test": "bash linux/scripts/tests/test-python-proof-fixture.sh",
  "why": "Zero executed tests cannot pass a proof fixture."
 },
 {
  "id": "lib.onnx-wasm-proof-fixture-summary",
  "target": "linux/scripts/tests/python-proof-fixture.sh",
  "find": "grep -F -x -q OK",
  "replace": "grep -E -q '^OK$|^FAILED '",
  "test": "bash linux/scripts/tests/test-python-proof-fixture.sh",
  "why": "A zero-exit failing suite cannot masquerade as success."
 },
 {
  "id": "lib.onnx-wasm-proof-fixture-return",
  "target": "linux/scripts/tests/python-proof-fixture.sh",
  "find": "if [ \"${_tpf_status}\" -ne 0 ] || [ \"${_tpf_count_status}\" -ne 0 ] || [ \"${_tpf_summary_status}\" -ne 0 ]; then return 1; fi",
  "replace": "if [ \"${_tpf_status}\" -ne 0 ] || [ \"${_tpf_count_status}\" -ne 0 ] || [ \"${_tpf_summary_status}\" -ne 0 ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-python-proof-fixture.sh",
  "why": "The shared fixture function itself returns failure before the final suite summary."
 },
 {
  "id": "lib.onnx-wasm-proof-required-reset",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "  rm -rf \"${BUILD_DIR}\" || return $?\n  if \"$@\" && assert_onnx_webgpu_static_plugin",
  "replace": "  rm -rf \"${BUILD_DIR}\"\n  if \"$@\" && assert_onnx_webgpu_static_plugin",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "A failed fresh-tree reset cannot reach a conditionally invoked compiler with stale outputs."
 },
 {
  "id": "lib.onnx-wasm-collector-no-bak",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "-type f ! -name '*.bak' '('",
  "replace": "-type f '('",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "a loader's pre-rewrite *.mjs.bak never reaches the web output"
 },
 {
  "id": "lib.onnx-wasm-ort-license-texts",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "  cp \"${ORT_SRC_DIR}/LICENSE\" \"${ORT_SRC_DIR}/ThirdPartyNotices.txt\" \"${WASM_OUTPUT_DIR}/\"\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "ORT's LICENSE and ThirdPartyNotices ship beside its web output"
 },
 {
  "id": "lib.onnx-wasm-proof-gpu-fixture-isolation",
  "target": "linux/scripts/tests/test-gpu-variant.sh",
  "find": "unset ENABLE_NVIDIA ENABLE_AMD ONNX_PACKAGE PYTORCH_EXTRA",
  "replace": ":",
  "test": "env ENABLE_NVIDIA=true ENABLE_AMD=true ONNX_PACKAGE=onnxruntime PYTORCH_EXTRA=pytorch-rocm10 bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "GPU image defaults cannot contaminate CPU baselines or explicit variant-conflict cases."
 },
 {
  "id": "stage-graph.webgpu-wasm-required",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "      append_optional_build_arg _csba_out ORT_WEB_REQUIRED \"${ORT_WEB_REQUIRED:-}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-stage-defs.sh",
  "why": "The canonical media lane forwards explicit strict policy."
 },
 {
  "id": "stage-graph.webgpu-wasm-flavors",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "      append_optional_build_arg _csba_out ORT_WASM_WEBGPU_FLAVORS \"${ORT_WASM_WEBGPU_FLAVORS:-}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-stage-defs.sh",
  "why": "An explicit disabled-flavor selection must reach the media build."
 },
 {
  "id": "lib.detector-tensor-file-kind",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "path.is_symlink()",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "A symlink cannot stand in for recorded bytes."
 },
 {
  "id": "lib.detector-tensor-shape-type",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "type(size) is int and size > 0",
  "replace": "size > 0",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "Boolean dimensions cannot satisfy the integer shape contract."
 },
 {
  "id": "lib.detector-tensor-byte-count",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "len(raw) != math.prod(shape) * 4",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "The payload count must match its declared shape."
 },
 {
  "id": "lib.detector-tensor-finite",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "not all(math.isfinite(value) for value in values)",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "Nonfinite values cannot produce ordinary numeric comparison statistics."
 },
 {
  "id": "lib.detector-tensor-fixed-name",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "entry[\"path\"] != name",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "Each metadata item names its own fixed run payload."
 },
 {
  "id": "lib.detector-tensor-schema-type",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "type(data[\"schema_version\"]) is not int",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "Boolean schema values are not integer schema versions."
 },
 {
  "id": "lib.detector-tensor-roster",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "{path.name for path in directory.iterdir()} != expected",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "Unlisted evidence cannot silently disappear from the comparison."
 },
 {
  "id": "lib.detector-tensor-identical-inputs",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "len({(tensor[\"shape\"], tensor[\"sha256\"]) for tensor in inputs}) != 1",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "Every repeated CPU and GPU input must match before attributing output differences."
 },
 {
  "id": "lib.detector-tensor-diagnostic-only",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "\"acceptance\": False",
  "replace": "\"acceptance\": True",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "A valid tensor summary never grants numerical or GPU acceptance."
 },
 {
  "id": "lib.detector-tensor-absolute-difference",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "abs(a - b)",
  "replace": "a - b",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "Both signs contribute to absolute-error statistics."
 },
 {
  "id": "lib.detector-tensor-no-overwrite",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "args.output.open(\"x\", encoding=\"utf-8\")",
  "replace": "args.output.open(\"w\", encoding=\"utf-8\")",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "An existing summary is preserved without rewriting evidence."
 },
 {
  "id": "lib.detector-tensor-canonical-reader",
  "target": "shared/python/summarize_detector_tensors.py",
  "find": "if not callable(unique):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-detector-tensor-summary.sh",
  "why": "A copied tool with a missing canonical reader must fail before treating default JSON parsing as equivalent."
 },
 {
  "id": "lib.native-tensor-empty-shape",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "shape.empty()",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Empty shapes do not describe a scalar payload implicitly."
 },
 {
  "id": "lib.native-tensor-rank-bound",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "shape.size() > 8",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "The bounded recording format refuses excessive ranks."
 },
 {
  "id": "lib.native-tensor-positive-dimension",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "dimension <= 0",
  "replace": "dimension < 0",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A zero dimension cannot become a completed diagnostic input."
 },
 {
  "id": "lib.native-tensor-count-limit",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "static_cast<uint64_t>(dimension) > (1024ULL * 1024 * 1024 / 4) / count",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Excessive or overflowing element counts refuse before allocation."
 },
 {
  "id": "lib.native-tensor-symlink",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "std::filesystem::is_symlink(path)",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A link cannot masquerade as the original recorded payload."
 },
 {
  "id": "lib.native-tensor-input-bytes",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "std::filesystem::file_size(path) != count * 4",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "The complete input byte count is bound to its requested shape."
 },
 {
  "id": "lib.native-tensor-finite",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "!std::isfinite(values[i])",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A nonfinite input cannot pass ordinary tensor replay controls."
 },
 {
  "id": "lib.native-tensor-exclusive-file",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "exclusive_mode[] = \"wbx\"",
  "replace": "exclusive_mode[] = \"wb\"",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Existing output evidence must remain untouched."
 },
 {
  "id": "lib.native-tensor-output-count",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "elements(shape) != count",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Written payloads cannot disagree with their metadata shape."
 },
 {
  "id": "lib.native-tensor-little-endian-read",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "uint32_t(bytes[i * 4 + 1]) << 8U",
  "replace": "uint32_t(bytes[i * 4 + 1])",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Input decoding preserves independent known float bits."
 },
 {
  "id": "lib.native-tensor-little-endian-write",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "static_cast<unsigned char>(bits >> 16U)",
  "replace": "static_cast<unsigned char>(bits >> 8U)",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Output encoding preserves the declared little-endian float bits."
 },
 {
  "id": "lib.native-tensor-schema-version",
  "target": "shared/native/ort_tensor_io.hpp",
  "find": "\\\"schema_version\\\":1",
  "replace": "\\\"schema_version\\\":2",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Native records retain the shared schema expected by independent readers."
 },
 {
  "id": "lib.onnx-tensor-model-file",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "path.is_symlink()\n        or not path.is_file()",
  "replace": "False\n        or not path.is_file()",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Symbolic model links cannot masquerade as the preserved regular original."
 },
 {
  "id": "lib.onnx-tensor-model-size",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "not 0 < path.stat().st_size <= 1024**3",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Preparation refuses excessive or empty model files before loading."
 },
 {
  "id": "lib.onnx-tensor-model-hash",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "if hashlib.sha256(raw).hexdigest() != expected:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "The original model must match the caller-supplied exact hash."
 },
 {
  "id": "lib.onnx-tensor-local-function-sparse",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "if model.functions or model.graph.sparse_initializer:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Unsupported functions and sparse initializers stay outside the diagnostic."
 },
 {
  "id": "lib.onnx-tensor-nested-graphs",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "if attribute.type in (",
  "replace": "if False and attribute.type in (",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Nested graphs and sparse attributes cannot silently escape tensor checks."
 },
 {
  "id": "lib.onnx-tensor-external-data",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "    if any(\n        t.external_data",
  "replace": "    if False and any(\n        t.external_data",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "No external tensor payload is accepted without binding its source."
 },
 {
  "id": "lib.onnx-tensor-source-checker",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "    require_supported(model, api)\n    api.checker.check_model(model)",
  "replace": "    require_supported(model, api)",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "The original ONNX checker remains required before inference."
 },
 {
  "id": "lib.onnx-tensor-strict-inference",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "check_type=True, strict_mode=True, data_prop=True",
  "replace": "check_type=True, strict_mode=False, data_prop=True",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Shape inference retains strict failure rather than an unchecked partial model."
 },
 {
  "id": "lib.onnx-tensor-inference-bytes",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "if graph_bytes(inferred) != original:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Shape inference cannot silently replace nodes or initializer bytes."
 },
 {
  "id": "lib.onnx-tensor-float-type",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "element == api.TensorProto.FLOAT",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "The native recorder only supports float32 outputs."
 },
 {
  "id": "lib.onnx-tensor-rank",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "and 1 <= len(shape) <= 8",
  "replace": "and True",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Unsupported scalar and excessive tensor ranks cannot be selected."
 },
 {
  "id": "lib.onnx-tensor-dimensions",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "and all(d is None or d > 0 for d in shape)",
  "replace": "and True",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Known zero or negative output dimensions cannot be declared replayable."
 },
 {
  "id": "lib.onnx-tensor-unique-tensor",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "if len(matches) != 1 or not matches[0][\"replayable_float\"]:",
  "replace": "if not matches or not matches[0][\"replayable_float\"]:",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Tensor selection must be unique at the top level."
 },
 {
  "id": "lib.onnx-tensor-eligible-selection",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "if len(matches) != 1 or not matches[0][\"replayable_float\"]:",
  "replace": "if len(matches) != 1:",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Exposure cannot bypass inventory type/rank eligibility."
 },
 {
  "id": "lib.onnx-tensor-retain-outputs",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "retained = [v for v in model.graph.output if v.name != name]",
  "replace": "retained = []",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Instrumented copies retain all original outputs while selecting an intermediate."
 },
 {
  "id": "lib.onnx-tensor-selected-first",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "model.graph.output.extend([selected, *retained])",
  "replace": "model.graph.output.extend([*retained, selected])",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "The canonical native replay must fetch the requested intermediate first."
 },
 {
  "id": "lib.onnx-tensor-expose-checker",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "    model.graph.output.extend([selected, *retained])\n    api.checker.check_model(model)",
  "replace": "    model.graph.output.extend([selected, *retained])",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "The changed output declarations must pass the actual ONNX checker."
 },
 {
  "id": "lib.onnx-tensor-expose-bytes",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "if graph_bytes(model) != before:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Exposing an output cannot silently rewrite nodes or weights."
 },
 {
  "id": "lib.onnx-tensor-diagnostic-hash",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "receipt[\"diagnostic_model_sha256\"] = hashlib.sha256(raw).hexdigest()",
  "replace": "receipt[\"diagnostic_model_sha256\"] = \"0\" * 64",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "The manifest binds the actual serialized diagnostic model bytes."
 },
 {
  "id": "lib.onnx-tensor-source-stability",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "!= receipt[\"original_model_sha256\"]",
  "replace": "!= hashlib.sha256(args.model.read_bytes()).hexdigest()",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "A source model changed during preparation cannot produce a valid diagnostic."
 },
 {
  "id": "lib.onnx-tensor-new-directory",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "    args.output.mkdir()",
  "replace": "    args.output.mkdir(exist_ok=True)",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "A prepared output requires a genuinely new directory."
 },
 {
  "id": "lib.onnx-tensor-new-payload",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "(args.output / \"model.onnx\").open(\"xb\")",
  "replace": "(args.output / \"model.onnx\").open(\"wb\")",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Unexpected existing payload bytes cannot be replaced."
 },
 {
  "id": "lib.onnx-tensor-no-acceptance",
  "target": "shared/python/prepare_onnx_tensor_replay.py",
  "find": "\"acceptance\": False,",
  "replace": "\"acceptance\": True,",
  "test": "bash linux/scripts/tests/test-onnx-tensor-preparation.sh",
  "why": "Successful graph preparation never grants model or hardware acceptance."
 },
 {
  "id": "lib.native-tensor-pair-new-output",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "mkdir \"${output}\"",
  "replace": "mkdir -p \"${output}\"",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "Every pair requires a fresh evidence root."
 },
 {
  "id": "lib.native-tensor-pair-both-devices",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "for selected in cpu migraphx; do",
  "replace": "for selected in cpu; do",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "Both CPU and MIGraphX are required before comparing tensors."
 },
 {
  "id": "lib.native-tensor-pair-clean-environment",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "gpu_without_migraphx_overrides \"${runner[@]}\"",
  "replace": "\"${runner[@]}\"",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "Inherited tuning overrides cannot alter the baseline silently."
 },
 {
  "id": "lib.native-tensor-pair-native-required",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "gpu_without_migraphx_overrides \"${runner[@]}\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "Profile and summary phases cannot replace the actual native command."
 },
 {
  "id": "lib.native-tensor-pair-one-profile",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "[[ \"${#profiles[@]}\" == 1 ]]",
  "replace": "[[ 1 == 1 ]]",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "An extra completed profile makes the device result ambiguous."
 },
 {
  "id": "lib.native-tensor-pair-gpu-profile-device",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "then device=migraphx-plugin;",
  "replace": "then device=cpu;",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "The GPU profile is checked against the actual plugin policy."
 },
 {
  "id": "lib.native-tensor-pair-profile-required",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "\"${python}\" -I \"${hub}/shared/python/verify_ort_profile.py\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "A failed profile probe must fail the pair before summary."
 },
 {
  "id": "lib.native-tensor-pair-every-run",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "--min-runs 2",
  "replace": "--min-runs 1",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "Both sequential runs require provider operators."
 },
 {
  "id": "lib.native-tensor-pair-summary-required",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "\"${python}\" -I \"${hub}/shared/python/summarize_detector_tensors.py\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "The final raw tensor validator cannot be omitted."
 },
 {
  "id": "lib.native-tensor-pair-summary-runs",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "--runs 2",
  "replace": "--runs 1",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "The tensor comparison includes both captured repetitions."
 },
 {
  "id": "lib.native-tensor-pair-separator",
  "target": "linux/scripts/replay-native-tensor-pair.sh",
  "find": "[[ \"$6\" == -- ]]",
  "replace": "[[ \"$6\" == wrong ]]",
  "test": "bash linux/scripts/tests/test-native-tensor-pair.sh",
  "why": "The explicit command-prefix separator protects argument boundaries."
 },
 {
  "id": "lib.migraphx-padding-max-guard",
  "target": "linux/scripts/patches/migraphx/001-preserve-zero-pad-maxpool.patch",
  "find": "+    if(op.mode == op::pooling_mode::average or op.mode == op::pooling_mode::max)",
  "replace": "+    if(op.mode == op::pooling_mode::average)",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "MaxPool must retain explicit zero padding rather than fold it into ignored outside values."
 },
 {
  "id": "lib.migraphx-padding-average-guard",
  "target": "linux/scripts/patches/migraphx/001-preserve-zero-pad-maxpool.patch",
  "find": "+    if(op.mode == op::pooling_mode::average or op.mode == op::pooling_mode::max)",
  "replace": "+    if(op.mode == op::pooling_mode::max)",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "Average pooling retains its existing explicit-padding policy."
 },
 {
  "id": "lib.migraphx-padding-lp-fold",
  "target": "linux/scripts/patches/migraphx/001-preserve-zero-pad-maxpool.patch",
  "find": "+    if(op.mode == op::pooling_mode::average or op.mode == op::pooling_mode::max)",
  "replace": "+    if(true)",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "The unrelated LP pooling optimization must remain available."
 },
 {
  "id": "lib.migraphx-padding-input-values",
  "target": "linux/scripts/prepare-migraphx-padding-reproducer.py",
  "find": "struct.pack(\"<4f\", -1, -2, -3, -4)",
  "replace": "struct.pack(\"<4f\", -5, -2, -3, -4)",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "The saved negative input is the independently chosen four-value contract."
 },
 {
  "id": "lib.migraphx-padding-expected-values",
  "target": "linux/scripts/prepare-migraphx-padding-reproducer.py",
  "find": "struct.pack(\"<4f\", -1, 0, 0, 0)",
  "replace": "struct.pack(\"<4f\", -1, -2, -3, -4)",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "The expected output includes zero contributions at all three padded boundaries."
 },
 {
  "id": "lib.migraphx-padding-pad-output",
  "target": "linux/scripts/prepare-migraphx-padding-reproducer.py",
  "find": "\"padded\", api.TensorProto.FLOAT, [1, 1, 3, 3]",
  "replace": "\"other\", api.TensorProto.FLOAT, [1, 1, 3, 3]",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "The padded tensor remains a second graph output so CPU is a valid isolation baseline."
 },
 {
  "id": "lib.migraphx-padding-pad-shape",
  "target": "linux/scripts/prepare-migraphx-padding-reproducer.py",
  "find": "\"padded\", api.TensorProto.FLOAT, [1, 1, 3, 3]",
  "replace": "\"padded\", api.TensorProto.FLOAT, [1, 1, 2, 3]",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "The retained padded tensor reports its full 3x3 shape."
 },
 {
  "id": "lib.migraphx-padding-pad-values",
  "target": "linux/scripts/prepare-migraphx-padding-reproducer.py",
  "find": "[8], [0, 0, 0, 0, 0, 0, 1, 1]",
  "replace": "[8], [0, 0, 1, 1, 0, 0, 0, 0]",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "Only the bottom and right sides receive explicit zero padding."
 },
 {
  "id": "lib.migraphx-padding-kernel",
  "target": "linux/scripts/prepare-migraphx-padding-reproducer.py",
  "find": "kernel_shape=[2, 2]",
  "replace": "kernel_shape=[1, 2]",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "The pooling window remains exactly 2x2."
 },
 {
  "id": "lib.migraphx-padding-cpu-output-check",
  "target": "linux/scripts/prepare-migraphx-padding-reproducer.py",
  "find": "api.checker.check_model(model)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "An unchecked graph must not be presented as a prepared fixture."
 },
 {
  "id": "lib.migraphx-padding-serialization",
  "target": "linux/scripts/prepare-migraphx-padding-reproducer.py",
  "find": "SerializeToString(deterministic=True)",
  "replace": "SerializeToString(deterministic=False)",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "Model bytes are serialized deterministically."
 },
 {
  "id": "lib.migraphx-padding-new-evidence",
  "target": "linux/scripts/prepare-migraphx-padding-reproducer.py",
  "find": "output.mkdir()",
  "replace": "output.mkdir(exist_ok=True)",
  "test": "bash linux/scripts/tests/test-migraphx-padding.sh",
  "why": "Existing evidence directories refuse before writing any artifact."
 },
 {
  "id": "lib.native-cxx-probe-cache-api",
  "target": "linux/scripts/lib/native-cxx-probe.sh",
  "find": "declare -F compiler_cache_guarded_launcher",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-native-cxx-probe.sh",
  "why": "A missing selected compiler-cache API must refuse with the required diagnostic policy."
 },
 {
  "id": "lib.native-cxx-probe-gcc-api",
  "target": "linux/scripts/lib/native-cxx-probe.sh",
  "find": "declare -F gcc_toolchain_resolve_prefix",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-native-cxx-probe.sh",
  "why": "The selected GCC resolver must exist before compiler arguments can be published."
 },
 {
  "id": "lib.native-cxx-probe-launcher",
  "target": "linux/scripts/lib/native-cxx-probe.sh",
  "find": "cache_launcher=\"$(compiler_cache_guarded_launcher \"$1\")\"",
  "replace": "cache_launcher=\"/wrong launcher\"",
  "test": "bash linux/scripts/tests/test-native-cxx-probe.sh",
  "why": "Use the canonical cache resolver with its original core argument and raw failure."
 },
 {
  "id": "lib.native-cxx-probe-gcc",
  "target": "linux/scripts/lib/native-cxx-probe.sh",
  "find": "probe_gcc_root=\"$(gcc_toolchain_resolve_prefix)\"",
  "replace": "probe_gcc_root=\"/wrong gcc\"",
  "test": "bash linux/scripts/tests/test-native-cxx-probe.sh",
  "why": "The chosen GCC prefix and its raw failure must reach the caller."
 },
 {
  "id": "lib.native-cxx-probe-flag-boundary",
  "target": "linux/scripts/lib/native-cxx-probe.sh",
  "find": "probe_toolchain+=(\"--gcc-toolchain=${probe_gcc_root}\")",
  "replace": "probe_toolchain+=(--gcc-toolchain=${probe_gcc_root})",
  "test": "bash linux/scripts/tests/test-native-cxx-probe.sh",
  "why": "A GCC path containing spaces stays exactly one compiler argument."
 },
 {
  "id": "lib.native-cxx-probe-reset-array",
  "target": "linux/scripts/lib/native-cxx-probe.sh",
  "find": "  probe_toolchain=()",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-native-cxx-probe.sh",
  "why": "An existing caller flag array must be replaced with exactly the chosen one-argument GCC toolchain flag."
 },
 {
  "id": "lib.mgx-source-feature-verdict",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "cmake_assert_configured_entries \"${work}/build\" bool \"${required_features[@]}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "Every selected GPU feature must remain enabled in the configured cache."
 },
 {
  "id": "lib.mgx-source-compiler-verdict",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "cmake_assert_configured_entries \"${work}/build\" first \\",
  "replace": "true \\",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "The configured C/C++ compilers must remain the explicitly selected source-built tools."
 },
 {
  "id": "lib.mgx-source-hip-verdict",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "grep -E '^HAS_HIP:INTERNAL=(1|TRUE)$' \"${work}/build/CMakeCache.txt\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "The real HIP compiler test must succeed before configuration is reported ready."
 },
 {
  "id": "lib.mgx-source-explicit-mlir",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "features=(MIGRAPHX_ENABLE_GPU MIGRAPHX_ENABLE_MLIR MIGRAPHX_USE_COMPOSABLEKERNEL",
  "replace": "features=(MIGRAPHX_ENABLE_GPU MIGRAPHX_USE_COMPOSABLEKERNEL",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "rocMLIR remains an explicit part of the full GPU selection."
 },
 {
  "id": "lib.mgx-source-gcc-argv",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "\"-DCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=${gcc_prefix}\"",
  "replace": "-DCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=${gcc_prefix}",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "A GCC prefix containing spaces must stay one CMake argument."
 },
 {
  "id": "lib.mgx-source-llvm-version",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "[[ \"${compiler_version%%$'\\n'*}\" == \"clang version ${LLVM_RELEASE} \"* ]]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "A distro or wrong-version LLVM cannot satisfy the source compiler gate."
 },
 {
  "id": "lib.mgx-source-archive-copy",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "cp \"$1\" \"$3.tar.gz\" || return",
  "replace": "cp \"$1\" \"$3.tar.gz\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "A failed selected copy cannot reuse a stale matching archive."
 },
 {
  "id": "lib.mgx-source-archive-sha",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "download_verify_sha256 \"$2\" \"$3.tar.gz\" || return",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "Archives are verified before extraction and their original inputs stay intact."
 },
 {
  "id": "lib.mgx-source-archive-extract",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "tar -xzf \"$3.tar.gz\" --strip-components=1 -C \"$3\"",
  "replace": "tar -xzf \"$3.tar.gz\" --strip-components=1 -C \"$3\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "A corrupt archive must retain its actual extraction failure."
 },
 {
  "id": "lib.mgx-source-archive-directory",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "mkdir \"$3\" || return",
  "replace": "mkdir \"$3\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "A selected existing source directory refuses before extraction."
 },
 {
  "id": "lib.mgx-source-cache-pin",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "\"${CMAKE_COMPILER_CACHE_PIN:-}\"",
  "replace": "\"\"",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "An explicit selected compiler-cache launcher cannot be silently unverified."
 },
 {
  "id": "lib.mgx-source-source-commit-shape",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "^[0-9a-f]{40}$",
  "replace": ".*",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "The declared source ref must be a full lowercase commit ID."
 },
 {
  "id": "lib.mgx-source-source-sha-shape",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "^[0-9a-f]{64}$",
  "replace": ".*",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "The source checksum cannot be empty, shortened or nonhex."
 },
 {
  "id": "lib.mgx-launcher-pull",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"--pull\", \"never\"",
  "replace": "\"--pull\", \"always\"",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "A source proof reuses the exact local image without pulling a moving replacement."
 },
 {
  "id": "lib.mgx-launcher-network",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"--network\", \"none\"",
  "replace": "\"--network\", \"host\"",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "Configuration dependencies remain offline in the isolated proof."
 },
 {
  "id": "lib.mgx-launcher-init",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"--init\", ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "The normal container uses an init to reap payload children."
 },
 {
  "id": "lib.mgx-launcher-apparmor",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"apparmor=unconfined\"",
  "replace": "\"apparmor=default\"",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "The existing approved snap-host AppArmor setting remains explicit."
 },
 {
  "id": "lib.mgx-launcher-start-bound",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "f\"TimeoutStartSec={timeout}\"",
  "replace": "\"TimeoutStartSec=0\"",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "Every preparation or selected vendor-build profile keeps its own finite start bound."
 },
 {
  "id": "lib.mgx-launcher-stop-bound",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"TimeoutStopSec=180\"",
  "replace": "\"TimeoutStopSec=0\"",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "Container cleanup has a finite stop bound."
 },
 {
  "id": "lib.mgx-launcher-cleanup-owner",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"--owner-label\", LABEL",
  "replace": "\"--owner-label\", \"org.kataglyphis.other\"",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "ExecStopPost cleanup names exactly this invocation's owner."
 },
 {
  "id": "lib.mgx-launcher-raw-launch",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "return run_logged(command, args.output / \"launch.log\")",
  "replace": "run_logged(command, args.output / \"launch.log\")\n    return 0",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "The unit submission's raw failure cannot become success."
 },
 {
  "id": "lib.mgx-launcher-busy-unit",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "if state != \"not-found\":",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "An existing unit is preserved before source freezing or submission."
 },
 {
  "id": "lib.mgx-launcher-unit-shape",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "if not re.fullmatch(",
  "replace": "if not re.search(",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "The whole explicit service name must validate, not just a matching substring."
 },
 {
  "id": "lib.mgx-source-compiler-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "compiler_version=\"$(\"${mgx_selected_clang}/bin/clang++\" --version)\" || return",
  "replace": "compiler_version=\"$(\"${mgx_selected_clang}/bin/clang++\" --version)\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "The source compiler command retains its actual failure before a version verdict."
 },
 {
  "id": "lib.mgx-source-gcc-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "mgx_selected_gcc=\"$(gcc_toolchain_resolve_prefix)\" || return",
  "replace": "mgx_selected_gcc=\"$(gcc_toolchain_resolve_prefix)\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "A failed GCC resolver cannot publish an empty successful toolchain."
 },
 {
  "id": "lib.mgx-source-compiler-binding",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "printf -v \"$1\" '%s' \"${mgx_selected_clang}\"",
  "replace": ": \"$1\" '%s' \"${mgx_selected_clang}\"",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "Compiler output slots are published into the caller scope."
 },
 {
  "id": "lib.mgx-source-common-import",
  "target": "linux/scripts/03-media/build/migraphx/entry-common.sh",
  "find": "source \"${SCRIPT_DIR}/source-common.sh\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "The source entry point carries its shared verified archive and compiler owner."
 },
 {
  "id": "lib.mgx-deps-required-cache",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "[[ -n \"${CMAKE_COMPILER_CACHE_PIN:-}\" ]]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "Parser dependencies require a selected compiler-cache pin."
 },
 {
  "id": "lib.mgx-deps-cache-verdict",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "cmake_assert_compiler_cache_pin \"${dep_work}/${dep}-build\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "A replaced compiler-cache launcher must fail before compilation."
 },
 {
  "id": "lib.mgx-deps-static-verdict",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "cmake_assert_configured_entries \"${dep_work}/${dep}-build\" bool \\",
  "replace": "true \\",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "Static PIC and offline configuration facts are verified before compilation."
 },
 {
  "id": "lib.mgx-deps-compiler-verdict",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "cmake_assert_configured_entries \"${dep_work}/${dep}-build\" first \\",
  "replace": "true \\",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "Configured compiler and C++ standard must match the selected tools."
 },
 {
  "id": "lib.mgx-deps-offline-flag",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "-DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON",
  "replace": "-DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=OFF",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "A dependency configure cannot acquire unpinned sources."
 },
 {
  "id": "lib.mgx-deps-local-protobuf",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "-Dprotobuf_LOCAL_DEPENDENCIES_ONLY:BOOL=ON",
  "replace": "-Dprotobuf_LOCAL_DEPENDENCIES_ONLY:BOOL=OFF",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "Protobuf refuses absent local Abseil instead of fetching."
 },
 {
  "id": "lib.mgx-deps-protoc",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "-Dprotobuf_BUILD_PROTOC_BINARIES:BOOL=ON",
  "replace": "-Dprotobuf_BUILD_PROTOC_BINARIES:BOOL=OFF",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "The same source build supplies protoc for parser generation."
 },
 {
  "id": "lib.mgx-deps-abseil-export",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "-DABSL_ENABLE_INSTALL:BOOL=ON",
  "replace": "-DABSL_ENABLE_INSTALL:BOOL=OFF",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "Protobuf consumes the installed Abseil CMake package."
 },
 {
  "id": "lib.mgx-deps-configure-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "cmake \"${selected_args[@]}\" || return",
  "replace": "cmake \"${selected_args[@]}\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "Failed configuration retains raw status and stops before build."
 },
 {
  "id": "lib.mgx-deps-build-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "cmake --build \"${dep_work}/${dep}-build\" --parallel \"${JOBS:-2}\" || return",
  "replace": "cmake --build \"${dep_work}/${dep}-build\" --parallel \"${JOBS:-2}\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "Failed compilation cannot become successful installation."
 },
 {
  "id": "lib.mgx-deps-install-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "cmake --install \"${dep_work}/${dep}-build\" || return",
  "replace": "cmake --install \"${dep_work}/${dep}-build\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "Failed installation cannot become successful dependency result."
 },
 {
  "id": "lib.mgx-deps-notice-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "cp \"${dep_work}/${dep}-source/LICENSE\" \"${notice_root}/${dep}/LICENSE\" || return",
  "replace": "cp \"${dep_work}/${dep}-source/LICENSE\" \"${notice_root}/${dep}/LICENSE\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "Missing original Abseil or Protobuf license text stays fatal."
 },
 {
  "id": "lib.mgx-deps-utf8-notice",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "cp \"${dep_work}/protobuf-source/third_party/utf8_range/LICENSE\" \"${notice_root}/utf8_range/LICENSE\" || return",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-migraphx-source-deps.sh",
  "why": "The bundled utf8_range original notice is retained separately."
 },
 {
  "id": "lib.mgx-sdk-rocmlir",
  "target": "linux/scripts/03-media/build/migraphx/sdk-closure/SdkPackages.cmake",
  "find": "\"rocMLIR@1.0.0\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "The independently required rocMLIR package is never replaced by ordinary MLIR metadata."
 },
 {
  "id": "lib.mgx-sdk-ck-host",
  "target": "linux/scripts/03-media/build/migraphx/sdk-closure/SdkPackages.cmake",
  "find": "\"composable_kernel_host@1.0.0\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Composable-kernel host codegen stays mandatory for the selected GPU configuration."
 },
 {
  "id": "lib.mgx-sdk-version",
  "target": "linux/scripts/03-media/build/migraphx/sdk-closure/SdkPackages.cmake",
  "find": "find_package(\n      ${mgx_package}\n      \"${mgx_version}\"\n      QUIET\n      CONFIG)",
  "replace": "find_package(\n      ${mgx_package}\n      \n      QUIET\n      CONFIG)",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Both versioned development packages satisfy their requested minimum."
 },
 {
  "id": "lib.mgx-sdk-found-fact",
  "target": "linux/scripts/03-media/build/migraphx/sdk-closure/SdkPackages.cmake",
  "find": "if(mgx_found)",
  "replace": "if(TRUE)",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "A missing or rejected package cannot be reported found."
 },
 {
  "id": "lib.mgx-sdk-missing-list",
  "target": "linux/scripts/03-media/build/migraphx/sdk-closure/SdkPackages.cmake",
  "find": "list(APPEND missing \"${dependency}\")",
  "replace": "message(STATUS \"missing aggregate mutation\")",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Missing identities reach the failing aggregate."
 },
 {
  "id": "lib.mgx-sdk-fatal",
  "target": "linux/scripts/03-media/build/migraphx/sdk-closure/SdkPackages.cmake",
  "find": "message(FATAL_ERROR \"MIGraphX SDK development packages missing: ${diagnostic}\")",
  "replace": "message(STATUS \"MIGraphX SDK development packages missing: ${diagnostic}\")",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Incomplete SDK resolution retains a failing CMake result."
 },
 {
  "id": "lib.mgx-sdk-project-import",
  "target": "linux/scripts/03-media/build/migraphx/sdk-closure/CMakeLists.txt",
  "find": "include(\"${CMAKE_CURRENT_LIST_DIR}/SdkPackages.cmake\")",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "The real CMake project imports the same package gate the tests execute."
 },
 {
  "id": "lib.mgx-sdk-mode",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "  sdk)",
  "replace": "  sdk-disabled)",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "The preserved bounded transport exposes the selected SDK mode."
 },
 {
  "id": "lib.mgx-sdk-raw-status",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "bash /hub/linux/scripts/03-media/build/migraphx/check-source-sdk.sh /proof/work /opt/rocm > /proof/configure.log 2>&1",
  "replace": "bash /hub/linux/scripts/03-media/build/migraphx/check-source-sdk.sh /proof/work /opt/rocm > /proof/configure.log 2>&1 || true",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "SDK child retains its raw failure through transport."
 },
 {
  "id": "lib.mgx-sdk-source-import",
  "target": "linux/scripts/03-media/build/migraphx/entry-common.sh",
  "find": "source \"${SCRIPT_DIR}/source-common.sh\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "SDK probing uses the shared source-built compiler owner."
 },
 {
  "id": "lib.mgx-sdk-launcher-mode",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "*([args.mode] if args.mode != \"configure\" else []),",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "The typed SDK selection reaches the preserved bounded container transport."
 },
 {
  "id": "lib.mgx-sdk-namespace",
  "target": "linux/scripts/03-media/build/migraphx/sdk-closure/SdkPackages.cmake",
  "find": "function(migraphx_sdk_find mgx_package mgx_version)\n  if(NOT\n     \"${mgx_version}\"\n     STREQUAL\n     \"\")\n    find_package(\n      ${mgx_package}\n      \"${mgx_version}\"\n      QUIET\n      CONFIG)\n  else()\n    find_package(${mgx_package} QUIET CONFIG)\n  endif()\n  set(mgx_found\n      \"${${mgx_package}_FOUND}\"\n      PARENT_SCOPE)\nendfunction()",
  "replace": "macro(migraphx_sdk_find mgx_package mgx_version)\n  if(NOT\n     \"${mgx_version}\"\n     STREQUAL\n     \"\")\n    find_package(\n      ${mgx_package}\n      \"${mgx_version}\"\n      QUIET\n      CONFIG)\n  else()\n    find_package(${mgx_package} QUIET CONFIG)\n  endif()\n  set(mgx_found\n      \"${${mgx_package}_FOUND}\"\n     )\nendmacro()",
  "test": "python3 linux/scripts/tests/migraphx_sdk_closure_tests.py MigraphxSDKClosureTests.test_provider_variables_cannot_erase_an_earlier_missing_fact",
  "why": "A provider config cannot erase a previous missing-package fact from the caller."
 },
 {
  "id": "lib.mgx-work-reuse",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "mkdir \"$1\" || return",
  "replace": "mkdir -p \"$1\" || return",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "Selected work roots refuse existing directories."
 },
 {
  "id": "lib.mgx-work-cd-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "mgx_work=\"$(cd \"$1\" && pwd)\" || return",
  "replace": "mgx_work=\"$(cd \"$1\" && pwd)\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "Failed work-path resolution retains its raw status and cannot publish a path."
 },
 {
  "id": "lib.mgx-work-binding",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "printf -v \"$2\" '%s' \"${mgx_work}\"",
  "replace": ": \"$2\" '%s' \"${mgx_work}\"",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "Normalized work paths reach the explicit caller output slot."
 },
 {
  "id": "lib.mgx-native-work-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "migraphx_new_work \"$1\" \"$2\" || return",
  "replace": "migraphx_new_work \"$1\" \"$2\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "A native setup refuses work reuse before compiler selection."
 },
 {
  "id": "lib.mgx-native-work-binding",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "migraphx_compiler_setup \"$3\" \"$4\" \"${selected_work}/compiler.txt\"",
  "replace": "migraphx_compiler_setup ignored_clang ignored_gcc \"${selected_work}/compiler.txt\"",
  "test": "bash linux/scripts/tests/test-migraphx-source-plan.sh",
  "why": "Native compiler output slots survive the shared lifecycle helper."
 },
 {
  "id": "lib.mgx-entry-init-raw",
  "target": "linux/scripts/03-media/build/migraphx/entry-common.sh",
  "find": "media_common_init \"${SCRIPT_DIR}\" || return",
  "replace": "media_common_init \"${SCRIPT_DIR}\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Media initialization failure stops the entry with its selected raw status."
 },
 {
  "id": "lib.mgx-entry-module-raw",
  "target": "linux/scripts/03-media/build/migraphx/entry-common.sh",
  "find": "source_module cross-gcc.sh || return",
  "replace": "source_module cross-gcc.sh || true",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Selected GCC module import failures remain fatal and raw."
 },
 {
  "id": "lib.mgx-entry-gcc-api",
  "target": "linux/scripts/03-media/build/migraphx/entry-common.sh",
  "find": "declare -F gcc_toolchain_resolve_prefix >/dev/null",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "A missing required toolchain export fails before work allocation."
 },
 {
  "id": "lib.mgx-entry-core-raw",
  "target": "linux/scripts/03-media/build/migraphx/entry-common.sh",
  "find": "source \"${SCRIPT_DIR}/../../core/common.sh\" || return",
  "replace": "source \"${SCRIPT_DIR}/../../core/common.sh\" || true",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "A missing selected core file cannot turn into an unrelated later status."
 },
 {
  "id": "lib.mgx-entry-source-scope",
  "target": "linux/scripts/03-media/build/migraphx/entry-common.sh",
  "find": "#!/usr/bin/env bash\n# Imports stay in the entry shell so module declarations and compiler setup keep their caller scope.\nsource \"${SCRIPT_DIR}/../../core/common.sh\" || return\nmedia_common_init \"${SCRIPT_DIR}\" || return\nsource_module cross-gcc.sh || return\ndeclare -F gcc_toolchain_resolve_prefix >/dev/null || { printf 'Missing GCC toolchain resolver\\n' >&2; return 1; }\nsource \"${SCRIPT_DIR}/source-common.sh\"\n",
  "replace": "_migraphx_entry_mutant() {\n#!/usr/bin/env bash\n# Imports stay in the entry shell so module declarations and compiler setup keep their caller scope.\nsource \"${SCRIPT_DIR}/../../core/common.sh\" || return\nmedia_common_init \"${SCRIPT_DIR}\" || return\nsource_module cross-gcc.sh || return\ndeclare -F gcc_toolchain_resolve_prefix >/dev/null || { printf 'Missing GCC toolchain resolver\\n' >&2; return 1; }\nsource \"${SCRIPT_DIR}/source-common.sh\"\n}\n_migraphx_entry_mutant\n",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Framework declarations stay in the entry shell rather than a helper local scope."
 },
 {
  "id": "lib.mgx-cli-arity",
  "target": "linux/scripts/03-media/build/migraphx/cli-common.sh",
  "find": "cli_require_positionals \"$1\" \"$2\" \"$2\" \"${@:3}\" || return",
  "replace": ": \"$1\" \"$2\" \"$2\" \"${@:3}\"",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Exact CLI validation happens before workspace publication and framework import."
 },
 {
  "id": "lib.mgx-cli-work",
  "target": "linux/scripts/03-media/build/migraphx/cli-common.sh",
  "find": "work=\"$3\"",
  "replace": "work=mutated",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "The selected first CLI value reaches the caller without splitting or positional drift."
 },
 {
  "id": "lib.mgx-cli-root",
  "target": "linux/scripts/03-media/build/migraphx/cli-common.sh",
  "find": "SCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\" || return",
  "replace": "SCRIPT_DIR=/invalid-migraphx-cli",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Sibling CLI imports resolve from their actual source owner."
 },
 {
  "id": "lib.mgx-cli-nonempty",
  "target": "linux/scripts/03-media/build/migraphx/cli-common.sh",
  "find": "[[ -n \"${work}\" ]]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "An empty selected work root refuses before any framework import or directory allocation."
 },
 {
  "id": "lib.mgx-ck-cxx20",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "printf '20\\n'",
  "replace": "printf '17\\n'",
  "test": "python3 linux/scripts/tests/migraphx_source_deps_tests.py MigraphxSourceDepsTests.test_independent_static_pic_offline_and_compiler_arguments",
  "why": "CK host retains its upstream C++20 selection independently of the shared cache check."
 },
 {
  "id": "lib.mgx-ck-codegen",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "dep_source+=\"/codegen\"",
  "replace": "dep_source+=\"/unused\"",
  "test": "python3 linux/scripts/tests/migraphx_source_deps_tests.py MigraphxSourceDepsTests.test_independent_static_pic_offline_and_compiler_arguments",
  "why": "CK configures the pinned host code generator rather than its GPU kernel project."
 },
 {
  "id": "lib.mgx-ck-embed-ld",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "-DEMBED_USE:STRING=CArrays",
  "replace": "-DEMBED_USE:STRING=LD",
  "test": "python3 linux/scripts/tests/migraphx_source_deps_tests.py MigraphxSourceDepsTests.test_independent_static_pic_offline_and_compiler_arguments",
  "why": "CK retains the upstream static-library embedding mode; LD lacks a complete install export."
 },
 {
  "id": "lib.mgx-ck-tests-off",
  "target": "linux/scripts/03-media/build/migraphx/source-deps.sh",
  "find": "dep_args+=(-DEMBED_USE:STRING=CArrays -DBUILD_TESTING:BOOL=OFF)",
  "replace": "dep_args+=(-DEMBED_USE:STRING=CArrays -DBUILD_TESTING:BOOL=ON)",
  "test": "python3 linux/scripts/tests/migraphx_source_deps_tests.py MigraphxSourceDepsTests.test_independent_static_pic_offline_and_compiler_arguments",
  "why": "The bounded host dependency does not silently add the separate upstream test build."
 },
 {
  "id": "lib.mgx-ck-tools-version",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "grep -Fx \"rocm_setup_version(VERSION ${MIGRAPHX_ROCM_CMAKE_VERSION})\"",
  "replace": "true",
  "test": "python3 linux/scripts/tests/migraphx_source_deps_tests.py MigraphxSourceDepsTests.test_rocm_tools_keep_version_original_license_and_raw_failures",
  "why": "Selected ROCm-CMake source version must match its recorded pin before configure."
 },
 {
  "id": "lib.mgx-ck-tools-configure-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "\"-DCMAKE_INSTALL_PREFIX=${tools_work}/host-tools\" || return",
  "replace": "\"-DCMAKE_INSTALL_PREFIX=${tools_work}/host-tools\" || :",
  "test": "python3 linux/scripts/tests/migraphx_source_deps_tests.py MigraphxSourceDepsTests.test_rocm_tools_keep_version_original_license_and_raw_failures",
  "why": "Required ROCm-CMake configure failures retain their raw status and stop installation."
 },
 {
  "id": "lib.mgx-ck-tools-install-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "cmake --install \"${tools_work}/rocm-cmake-build\" || return",
  "replace": "cmake --install \"${tools_work}/rocm-cmake-build\" || :",
  "test": "python3 linux/scripts/tests/migraphx_source_deps_tests.py MigraphxSourceDepsTests.test_rocm_tools_keep_version_original_license_and_raw_failures",
  "why": "Required ROCm-CMake installation failures remain fatal and raw."
 },
 {
  "id": "lib.mgx-ck-tools-license",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "cp \"${tools_work}/rocm-cmake-source/LICENSE\" \"${tools_work}/host-tools/share/licenses/rocm-cmake/LICENSE\"",
  "replace": ": \"${tools_work}/rocm-cmake-source/LICENSE\" \"${tools_work}/host-tools/share/licenses/rocm-cmake/LICENSE\"",
  "test": "python3 linux/scripts/tests/migraphx_source_deps_tests.py MigraphxSourceDepsTests.test_rocm_tools_keep_version_original_license_and_raw_failures",
  "why": "Shared host-tool setup retains the original root license bytes."
 },
 {
  "id": "lib.mgx-ck-required-cmake",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"ck\": ((\"archive\", \"source.tar.gz\"), (\"rocm_cmake_archive\", \"rocm-cmake.tar.gz\")),",
  "replace": "\"ck\": ((\"archive\", \"source.tar.gz\"),),",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_ck_mode_requires_its_two_archives_and_omits_msgpack",
  "why": "CK mode requires and mounts both selected archives, with no unused msgpack input."
 },
 {
  "id": "lib.mgx-ck-dispatch",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "  ck)",
  "replace": "  ck-never)",
  "test": "python3 linux/scripts/tests/migraphx_sdk_closure_tests.py MigraphxSDKClosureTests.test_bounded_transport_modes_and_raw_status",
  "why": "The bounded CK mode invokes the real selected component entry."
 },
 {
  "id": "lib.mgx-ck-dispatch-raw",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "bash /hub/linux/scripts/03-media/build/migraphx/build-source-ck.sh /proof/work /source.tar.gz /rocm-cmake.tar.gz > /proof/configure.log 2>&1",
  "replace": "bash /hub/linux/scripts/03-media/build/migraphx/build-source-ck.sh /proof/work /source.tar.gz /rocm-cmake.tar.gz > /proof/configure.log 2>&1 || true",
  "test": "python3 linux/scripts/tests/migraphx_sdk_closure_tests.py MigraphxSDKClosureTests.test_bounded_transport_modes_and_raw_status",
  "why": "The outer bounded CK component cannot swallow its selected child failure."
 },
 {
  "id": "lib.mgx-ck-consumer-exact-version",
  "target": "linux/scripts/03-media/build/migraphx/ck-host-consumer/CMakeLists.txt",
  "find": "  EXACT\n",
  "replace": "  \n",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_real_cmake_refuses_inexact_version_or_missing_target",
  "why": "A compatible but different CK package version cannot satisfy the recorded component pin."
 },
 {
  "id": "lib.mgx-ck-consumer-no-fallback",
  "target": "linux/scripts/03-media/build/migraphx/ck-host-consumer/CMakeLists.txt",
  "find": "  NO_DEFAULT_PATH)",
  "replace": "  )",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_real_cmake_refuses_inexact_version_or_missing_target",
  "why": "A missing supplied package cannot silently fall back to a different available prefix."
 },
 {
  "id": "lib.mgx-ck-consumer-full-bytes",
  "target": "linux/scripts/03-media/build/migraphx/ck-host-consumer/main.cpp",
  "find": "output.write(bytes.data(), static_cast<std::streamsize>(bytes.size()));",
  "replace": "output << bytes.data();",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_program_writes_exact_bytes_and_reports_argument_or_output_errors",
  "why": "The host API probe writes every selected header byte, including embedded NULs."
 },
 {
  "id": "lib.mgx-ck-consumer-empty-header",
  "target": "linux/scripts/03-media/build/migraphx/ck-host-consumer/main.cpp",
  "find": "!headers.contains(name) || headers.at(name).empty()",
  "replace": "!headers.contains(name) || false",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_missing_or_empty_actual_api_header_fails",
  "why": "An empty selected real API header remains a failed probe."
 },
 {
  "id": "lib.mgx-ck-consumer-output-status",
  "target": "linux/scripts/03-media/build/migraphx/ck-host-consumer/main.cpp",
  "find": "if (!output) {",
  "replace": "if (false) {",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_program_writes_exact_bytes_and_reports_argument_or_output_errors",
  "why": "Output open, write and close failures cannot become a passed header probe."
 },
 {
  "id": "lib.mgx-ck-consumer-library-selection",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "[[ \"${mgx_selected_consumer_library}\" == \"$2\" ]]",
  "replace": "true",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_transport_retains_selected_raw_failures",
  "why": "A real existing foreign archive cannot bypass the supplied-prefix selection verdict."
 },
 {
  "id": "lib.mgx-ck-consumer-header-compare",
  "target": "linux/scripts/03-media/build/migraphx/verify-source-ck.sh",
  "find": "cmp -- \"${original_header}\" \"${work}/embedded-header.hpp\"",
  "replace": ": -- \"${original_header}\" \"${work}/embedded-header.hpp\"",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_transport_retains_selected_raw_failures",
  "why": "The selected embedded header must exactly match the original source bytes."
 },
 {
  "id": "lib.mgx-ck-consumer-cache-pin",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "  cmake_assert_compiler_cache_pin \"$2/build\" \"${CMAKE_COMPILER_CACHE_PIN:-}\" || return",
  "replace": "  :",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_transport_retains_selected_raw_failures",
  "why": "The external consumer retains the canonical configured compiler-cache pin."
 },
 {
  "id": "lib.mgx-ck-consumer-compiler-facts",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "  cmake_assert_configured_entries \"$2/build\" first \"CMAKE_CXX_COMPILER=$4/bin/clang++\" \"CMAKE_CXX_STANDARD=$6\" \"${@:7}\"",
  "replace": "  :",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_transport_retains_selected_raw_failures",
  "why": "Configured compiler, language standard and supplied package directory retain their selected identities."
 },
 {
  "id": "lib.mgx-ck-consumer-configure-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "  cmake \"${mgx_native_consumer_argv[@]}\" || return",
  "replace": "  cmake \"${mgx_native_consumer_argv[@]}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_transport_retains_selected_raw_failures",
  "why": "External consumer configure failures keep their original raw status."
 },
 {
  "id": "lib.mgx-ck-consumer-build-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "  cmake --build \"$1/build\" --parallel \"$3\"",
  "replace": "  cmake --build \"$1/build\" --parallel \"$3\" || true",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_transport_retains_selected_raw_failures",
  "why": "External consumer build failures keep their original raw status."
 },
 {
  "id": "lib.mgx-ck-consumer-runtime-raw",
  "target": "linux/scripts/03-media/build/migraphx/verify-source-ck.sh",
  "find": "\"${work}/build/ck-host-consumer\" \"${work}/embedded-header.hpp\"",
  "replace": "\"${work}/build/ck-host-consumer\" \"${work}/embedded-header.hpp\" || true",
  "test": "python3 linux/scripts/tests/migraphx_ck_consumer_tests.py CKConsumerTests.test_transport_retains_selected_raw_failures",
  "why": "A selected host API failure cannot be replaced with a later comparison status."
 },
 {
  "id": "lib.mgx-ck-consumer-sdk-precedence",
  "target": "linux/scripts/03-media/build/migraphx/check-source-sdk.sh",
  "find": "prefix_path=\"${MIGRAPHX_DEPS_PREFIX};${prefix_path}\"",
  "replace": "prefix_path=\"${prefix_path}\"",
  "test": "python3 linux/scripts/tests/migraphx_sdk_closure_tests.py MigraphxSDKClosureTests.test_supplied_development_prefix_precedes_image_sdk_paths",
  "why": "A genuine supplied development prefix precedes existing image SDK paths without losing the default list."
 },
 {
  "id": "lib.mgx-ck-consumer-required-inputs",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "if args.mode in required:",
  "replace": "if False:",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_consumer_prefix_and_original_header_are_required_and_readonly",
  "why": "CK consumer mode requires both a real supplied prefix and original header input."
 },
 {
  "id": "lib.mgx-ck-consumer-readonly-inputs",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "f\"{value}:{target}:ro\"",
  "replace": "f\"{value}:{target}:rw\"",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_consumer_prefix_and_original_header_are_required_and_readonly",
  "why": "External component and original-header inputs remain readonly mounts."
 },
 {
  "id": "lib.mgx-ck-consumer-prefix-env",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"MIGRAPHX_DEPS_PREFIX=/deps-prefix\"",
  "replace": "\"MIGRAPHX_DEPS_PREFIX=/wrong-prefix\"",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_consumer_prefix_and_original_header_are_required_and_readonly",
  "why": "The supplied SDK prefix binding reaches the bounded child at its actual mounted path."
 },
 {
  "id": "lib.mgx-ck-consumer-dispatch",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "  ck-consumer)",
  "replace": "  ck-consumer-never)",
  "test": "python3 linux/scripts/tests/migraphx_sdk_closure_tests.py MigraphxSDKClosureTests.test_bounded_transport_modes_and_raw_status",
  "why": "The bounded consumer mode invokes the external CK verification entry."
 },
 {
  "id": "lib.mgx-ck-consumer-dispatch-raw",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "bash /hub/linux/scripts/03-media/build/migraphx/verify-source-ck.sh /proof/work /deps-prefix /ck-original-header.hpp > /proof/configure.log 2>&1",
  "replace": "bash /hub/linux/scripts/03-media/build/migraphx/verify-source-ck.sh /proof/work /deps-prefix /ck-original-header.hpp > /proof/configure.log 2>&1 || true",
  "test": "python3 linux/scripts/tests/migraphx_sdk_closure_tests.py MigraphxSDKClosureTests.test_bounded_transport_modes_and_raw_status",
  "why": "The outer bounded payload retains the external verification child status."
 },
 {
  "id": "lib.mgx-cmake-plan-native-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "migraphx_native_cmake_args \"$1\" \"$2\" \"$3\" || return",
  "replace": "migraphx_native_cmake_args \"$1\" \"$2\" \"$3\" || :",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_cmake_plan_retains_raw_selection_failures",
  "why": "The common plan retains selected native-argument failure before cache setup or writing."
 },
 {
  "id": "lib.mgx-cmake-plan-cache-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "append_cmake_cache_linker_args \"$1\" || return",
  "replace": "append_cmake_cache_linker_args \"$1\" || :",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_cmake_plan_retains_raw_selection_failures",
  "why": "The common plan retains cache resolver failure without writing an incomplete command plan."
 },
 {
  "id": "lib.mgx-cmake-plan-argv-bytes",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "printf '%s\\0' \"${planned_args[@]}\"",
  "replace": "printf '%s ' \"${planned_args[@]}\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_cmake_plan_preserves_argument_bytes_and_cache_publication",
  "why": "Recorded CMake plans retain every argument and empty boundary plus parent-visible cache selection."
 },
 {
  "id": "lib.mgx-cmake-directories-source",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "cmake_directory_args=(-S \"$2\" -B \"$3\" -G Ninja \"${cmake_directory_args[@]}\")",
  "replace": "cmake_directory_args=(-S \"$3\" -B \"$3\" -G Ninja \"${cmake_directory_args[@]}\")",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_cmake_directories_preserve_option_arguments",
  "why": "Shared CMake directory composition retains source/build/Ninja selection and every caller option boundary."
 },
 {
  "id": "lib.mgx-cmake-directories-build",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "cmake_directory_args=(-S \"$2\" -B \"$3\" -G Ninja \"${cmake_directory_args[@]}\")",
  "replace": "cmake_directory_args=(-S \"$2\" -B \"$2\" -G Ninja \"${cmake_directory_args[@]}\")",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_cmake_directories_preserve_option_arguments",
  "why": "Shared CMake directory composition retains source/build/Ninja selection and every caller option boundary."
 },
 {
  "id": "lib.mgx-cmake-directories-generator",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "cmake_directory_args=(-S \"$2\" -B \"$3\" -G Ninja \"${cmake_directory_args[@]}\")",
  "replace": "cmake_directory_args=(-S \"$2\" -B \"$3\" -G \"Unix Makefiles\" \"${cmake_directory_args[@]}\")",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_cmake_directories_preserve_option_arguments",
  "why": "Shared CMake directory composition retains source/build/Ninja selection and every caller option boundary."
 },
 {
  "id": "lib.mgx-cmake-directories-reset",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "cmake_directory_args=(-S \"$2\" -B \"$3\" -G Ninja \"${cmake_directory_args[@]}\")",
  "replace": "cmake_directory_args=(-S \"$2\" -B \"$3\" -G Ninja)",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_cmake_directories_preserve_option_arguments",
  "why": "Shared CMake directory composition retains source/build/Ninja selection and every caller option boundary."
 },
 {
  "id": "lib.mgx-rocmlir-source-version",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "grep -Fx \"project(rocMLIR VERSION ${MIGRAPHX_ROCMLIR_VERSION} LANGUAGES CXX C)\" \"${tree}/CMakeLists.txt\" || return",
  "replace": ":",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_exact_version_and_each_vendored_source_are_required",
  "why": "A different rocMLIR version or missing root must fail before preparation continues."
 },
 {
  "id": "lib.mgx-rocmlir-vendored-llvm",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "external/llvm-project/llvm/CMakeLists.txt",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_exact_version_and_each_vendored_source_are_required",
  "why": "Each required vendored source tree must be present; an installed generic MLIR package is insufficient."
 },
 {
  "id": "lib.mgx-rocmlir-vendored-mlir",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "external/llvm-project/mlir/CMakeLists.txt",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_exact_version_and_each_vendored_source_are_required",
  "why": "Each required vendored source tree must be present; an installed generic MLIR package is insufficient."
 },
 {
  "id": "lib.mgx-rocmlir-vendored-lld",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "external/llvm-project/lld/CMakeLists.txt",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_exact_version_and_each_vendored_source_are_required",
  "why": "Each required vendored source tree must be present; an installed generic MLIR package is insufficient."
 },
 {
  "id": "lib.mgx-rocmlir-vendored-triton",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "external/triton/CMakeLists.txt",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_exact_version_and_each_vendored_source_are_required",
  "why": "Each required vendored source tree must be present; an installed generic MLIR package is insufficient."
 },
 {
  "id": "lib.mgx-rocmlir-vendored-triton-wiring",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "cmake/triton.cmake",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_exact_version_and_each_vendored_source_are_required",
  "why": "Each required vendored source tree must be present; an installed generic MLIR package is insufficient."
 },
 {
  "id": "lib.mgx-rocmlir-fresh-notice-destination",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "mkdir \"${dest}\" || return",
  "replace": "mkdir -p \"${dest}\" || return",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_original_notice_bytes_and_policy_are_preserved",
  "why": "A reused destination can mix stale notices with this source."
 },
 {
  "id": "lib.mgx-rocmlir-hash-required",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "download_verify_sha256 \"${digest}\" \"${dest}/${relative}\" || return",
  "replace": ":",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_hash_mismatch_never_deletes_or_changes_original_source",
  "why": "A full valid policy with one bad digest must fail instead of producing a receipt."
 },
 {
  "id": "lib.mgx-rocmlir-hash-original-protected",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "download_verify_sha256 \"${digest}\" \"${dest}/${relative}\" || return",
  "replace": "download_verify_sha256 \"${digest}\" \"${tree}/${relative}\" || return",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_hash_mismatch_never_deletes_or_changes_original_source",
  "why": "Checksum cleanup may delete a staged copy, never the preserved original input."
 },
 {
  "id": "lib.mgx-rocmlir-cp-raw-failure",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "cp -- \"${tree}/${relative}\" \"${dest}/${relative}\" || return",
  "replace": "cp -- \"${tree}/${relative}\" \"${dest}/${relative}\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_copy_and_hash_failures_keep_raw_status",
  "why": "Conditional shell callers must retain raw transport failure and stop later notice publication."
 },
 {
  "id": "lib.mgx-rocmlir-hash-raw-failure",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "download_verify_sha256 \"${digest}\" \"${dest}/${relative}\" || return",
  "replace": "download_verify_sha256 \"${digest}\" \"${dest}/${relative}\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_copy_and_hash_failures_keep_raw_status",
  "why": "Conditional shell callers must retain raw transport failure and stop later notice publication."
 },
 {
  "id": "lib.mgx-rocmlir-policy-validation",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "[[ \"${digest}\" =~ ^[0-9a-f]{64}$ && -n \"${relative}\" ]]",
  "replace": "true",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_empty_incomplete_missing_and_invalid_policy_refuse",
  "why": "Malformed policy rows fail before copying unverified originals."
 },
 {
  "id": "lib.mgx-rocmlir-policy-path",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "/*|../*|*/../*|*/..)",
  "replace": "__invalid_pattern__)",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_empty_incomplete_missing_and_invalid_policy_refuse",
  "why": "Absolute and parent traversal paths are refused before source or destination access."
 },
 {
  "id": "lib.mgx-rocmlir-primary-root",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "for required in LICENSE external/llvm-project/LICENSE.TXT external/triton/LICENSE; do",
  "replace": "for required in external/llvm-project/LICENSE.TXT external/triton/LICENSE; do",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_empty_incomplete_missing_and_invalid_policy_refuse",
  "why": "Each primary original text remains independently mandatory even when other valid policy rows copy successfully."
 },
 {
  "id": "lib.mgx-rocmlir-primary-llvm",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "for required in LICENSE external/llvm-project/LICENSE.TXT external/triton/LICENSE; do",
  "replace": "for required in LICENSE external/triton/LICENSE; do",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_empty_incomplete_missing_and_invalid_policy_refuse",
  "why": "Each primary original text remains independently mandatory even when other valid policy rows copy successfully."
 },
 {
  "id": "lib.mgx-rocmlir-primary-triton",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "for required in LICENSE external/llvm-project/LICENSE.TXT external/triton/LICENSE; do",
  "replace": "for required in LICENSE external/llvm-project/LICENSE.TXT; do",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_empty_incomplete_missing_and_invalid_policy_refuse",
  "why": "Each primary original text remains independently mandatory even when other valid policy rows copy successfully."
 },
 {
  "id": "lib.mgx-rocmlir-plan-fat",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "-DBUILD_FAT_LIBROCKCOMPILER:BOOL=ON",
  "replace": "-DBUILD_FAT_LIBROCKCOMPILER:BOOL=OFF",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_independent_fat_static_pic_offline_source_compiler_plan",
  "why": "Recorded source/build, fat static/PIC, compiler, offline, host-Python and own ROCm-CMake arguments retain independent expectations."
 },
 {
  "id": "lib.mgx-rocmlir-plan-static",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "-DBUILD_SHARED_LIBS:BOOL=OFF",
  "replace": "-DBUILD_SHARED_LIBS:BOOL=ON",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_independent_fat_static_pic_offline_source_compiler_plan",
  "why": "Recorded source/build, fat static/PIC, compiler, offline, host-Python and own ROCm-CMake arguments retain independent expectations."
 },
 {
  "id": "lib.mgx-rocmlir-plan-pic",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON",
  "replace": "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_independent_fat_static_pic_offline_source_compiler_plan",
  "why": "Recorded source/build, fat static/PIC, compiler, offline, host-Python and own ROCm-CMake arguments retain independent expectations."
 },
 {
  "id": "lib.mgx-rocmlir-plan-offline",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "-DTRITON_OFFLINE_BUILD:BOOL=ON",
  "replace": "-DTRITON_OFFLINE_BUILD:BOOL=OFF",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_independent_fat_static_pic_offline_source_compiler_plan",
  "why": "Recorded source/build, fat static/PIC, compiler, offline, host-Python and own ROCm-CMake arguments retain independent expectations."
 },
 {
  "id": "lib.mgx-rocmlir-plan-targets",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "-DLLVM_TARGETS_TO_BUILD=X86;AMDGPU",
  "replace": "-DLLVM_TARGETS_TO_BUILD=AMDGPU",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_independent_fat_static_pic_offline_source_compiler_plan",
  "why": "Recorded source/build, fat static/PIC, compiler, offline, host-Python and own ROCm-CMake arguments retain independent expectations."
 },
 {
  "id": "lib.mgx-rocmlir-plan-python",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "\"-DPython3_EXECUTABLE=$6\"",
  "replace": "\"-DPython3_EXECUTABLE=/foreign/python\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_independent_fat_static_pic_offline_source_compiler_plan",
  "why": "Recorded source/build, fat static/PIC, compiler, offline, host-Python and own ROCm-CMake arguments retain independent expectations."
 },
 {
  "id": "lib.mgx-rocmlir-plan-rocm-cmake",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "\"-DROCmCMakeBuildTools_DIR=${selected_work}/host-tools/share/rocmcmakebuildtools/cmake\"",
  "replace": "\"-DROCmCMakeBuildTools_DIR=/foreign/cmake\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_independent_fat_static_pic_offline_source_compiler_plan",
  "why": "Recorded source/build, fat static/PIC, compiler, offline, host-Python and own ROCm-CMake arguments retain independent expectations."
 },
 {
  "id": "lib.mgx-rocmlir-plan-plan-record",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "\"${selected_work}/cmake-argv.nul\"",
  "replace": "\"${selected_work}/wrong-argv.nul\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_independent_fat_static_pic_offline_source_compiler_plan",
  "why": "Recorded source/build, fat static/PIC, compiler, offline, host-Python and own ROCm-CMake arguments retain independent expectations."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-build-fat-librockcompiler",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "BUILD_FAT_LIBROCKCOMPILER=ON",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "The actual post-configure verdict must reject a missing or changed cache fact, independently of the intended command line."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-build-shared-libs",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "BUILD_SHARED_LIBS=OFF",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "The actual post-configure verdict must reject a missing or changed cache fact, independently of the intended command line."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-cmake-position-independent-code",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "CMAKE_POSITION_INDEPENDENT_CODE=ON",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "The actual post-configure verdict must reject a missing or changed cache fact, independently of the intended command line."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-llvm-include-tests",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "LLVM_INCLUDE_TESTS=OFF",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "The actual post-configure verdict must reject a missing or changed cache fact, independently of the intended command line."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-mlir-include-tests",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "MLIR_INCLUDE_TESTS=OFF",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "The actual post-configure verdict must reject a missing or changed cache fact, independently of the intended command line."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-mlir-enable-rocm-runner",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "MLIR_ENABLE_ROCM_RUNNER=OFF",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "The actual post-configure verdict must reject a missing or changed cache fact, independently of the intended command line."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-triton-offline-build",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "TRITON_OFFLINE_BUILD=ON",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "The actual post-configure verdict must reject a missing or changed cache fact, independently of the intended command line."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-fetchcontent-fully-disconnected",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "FETCHCONTENT_FULLY_DISCONNECTED=ON",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "The actual post-configure verdict must reject a missing or changed cache fact, independently of the intended command line."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-fetchcontent-updates-disconnected",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "FETCHCONTENT_UPDATES_DISCONNECTED=ON",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "The actual post-configure verdict must reject a missing or changed cache fact, independently of the intended command line."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-cache",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "cmake_assert_compiler_cache_pin \"${work}/build\" \"${CMAKE_COMPILER_CACHE_PIN:-}\"",
  "replace": ":",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "Configured C and CXX launchers must remain bound to the selected cache."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-cmake-c-compiler",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "\"CMAKE_C_COMPILER=${clang_root}/bin/clang\"",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "Configured compiler, install prefix and both LLVM targets must survive the post-configure verdict."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-cmake-cxx-compiler",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "\"CMAKE_CXX_COMPILER=${clang_root}/bin/clang++\"",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "Configured compiler, install prefix and both LLVM targets must survive the post-configure verdict."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-cmake-install-prefix",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "\"CMAKE_INSTALL_PREFIX=${work}/host-deps\"",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "Configured compiler, install prefix and both LLVM targets must survive the post-configure verdict."
 },
 {
  "id": "lib.mgx-rocmlir-verdict-llvm-targets-to-build",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh",
  "find": "\"LLVM_TARGETS_TO_BUILD=X86;AMDGPU\"",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_source_tests.py MigraphxRocmlirSourceTests.test_actual_cache_verdict_rejects_each_missing_or_wrong_fact",
  "why": "Configured compiler, install prefix and both LLVM targets must survive the post-configure verdict."
 },
 {
  "id": "lib.mgx-rocmlir-cleanup-status",
  "target": "linux/scripts/03-media/build/migraphx/proof-cleanup.sh",
  "find": "local status=\"$1\"",
  "replace": "local status=0",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_worker_cleanup_retains_status_and_ownership_failures",
  "why": "Shared proof cleanup preserves raw command/import failures and refuses failed ownership or status-receipt writes, including conditional shell calls."
 },
 {
  "id": "lib.mgx-rocmlir-cleanup-import",
  "target": "linux/scripts/03-media/build/migraphx/proof-cleanup.sh",
  "find": "source \"${core}/bind-mount-ownership.sh\" || exit \"$?\"",
  "replace": "source \"${core}/bind-mount-ownership.sh\"",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_worker_cleanup_retains_status_and_ownership_failures",
  "why": "Shared proof cleanup preserves raw command/import failures and refuses failed ownership or status-receipt writes, including conditional shell calls."
 },
 {
  "id": "lib.mgx-rocmlir-cleanup-owner",
  "target": "linux/scripts/03-media/build/migraphx/proof-cleanup.sh",
  "find": "fix_bind_mount_ownership \"${path}\" \"${evidence}\" || exit 1",
  "replace": "fix_bind_mount_ownership \"${path}\" \"${evidence}\"",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_worker_cleanup_retains_status_and_ownership_failures",
  "why": "Shared proof cleanup preserves raw command/import failures and refuses failed ownership or status-receipt writes, including conditional shell calls."
 },
 {
  "id": "lib.mgx-rocmlir-cleanup-receipt",
  "target": "linux/scripts/03-media/build/migraphx/proof-cleanup.sh",
  "find": "> \"${evidence}/command-status.txt\" || exit \"$?\"",
  "replace": "> \"${evidence}/command-status.txt\"",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_cleanup_cannot_pass_when_status_receipt_cannot_be_written",
  "why": "Shared proof cleanup preserves raw command/import failures and refuses failed ownership or status-receipt writes, including conditional shell calls."
 },
 {
  "id": "lib.mgx-rocmlir-launch-archives",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"rocmlir\": ((\"archive\", \"source.tar.gz\"), (\"rocm_cmake_archive\", \"rocm-cmake.tar.gz\")),",
  "replace": "\"rocmlir\": (),",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_ck_mode_requires_its_two_archives_and_omits_msgpack",
  "why": "rocMLIR requires its exact source and ROCm-CMake archives through read-only mounts; mode selection cannot discard them."
 },
 {
  "id": "lib.mgx-rocmlir-build-compile-mode",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "require(\"-c\" in args, \"Object rule has no compile command\")",
  "replace": "require(True, \"Object rule has no compile command\")",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_empty_incomplete_unknown_or_uncompiled_object_records_refuse",
  "why": "An object record without a real compile action cannot pass the cache census."
 },
 {
  "id": "lib.mgx-rocmlir-build-unknown-output",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "require(not (\"-c\" in args and (source in CXX | {\".c\", \".s\", \".S\"} or compiler)),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_empty_incomplete_unknown_or_uncompiled_object_records_refuse",
  "why": "A compiler action with another output kind cannot disappear while a healthy C++ action keeps the census green."
 },
 {
  "id": "lib.mgx-rocmlir-build-unknown-language",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "require(suffix == \".c\" or suffix in CXX,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_empty_incomplete_unknown_or_uncompiled_object_records_refuse",
  "why": "Unknown source language cannot be counted as checked C++."
 },
 {
  "id": "lib.mgx-rocmlir-build-assembly-compiler",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "require(args[0] == clang + \"/bin/clang\",",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_empty_incomplete_unknown_or_uncompiled_object_records_refuse",
  "why": "Separately recorded assembly still uses the selected source compiler."
 },
 {
  "id": "lib.mgx-rocmlir-build-cache-compiler",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "require(args[:2] == [launcher, compiler],",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_each_c_or_cxx_cache_compiler_and_toolchain_drift_refuses",
  "why": "Every planned C and C++ action retains its selected cache launcher, native compiler and GCC toolchain."
 },
 {
  "id": "lib.mgx-rocmlir-build-gcc-toolchain",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "require(\"--gcc-toolchain=\" + gcc in args,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_each_c_or_cxx_cache_compiler_and_toolchain_drift_refuses",
  "why": "Every planned C and C++ action retains its selected cache launcher, native compiler and GCC toolchain."
 },
 {
  "id": "lib.mgx-rocmlir-build-checked-cxx",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "require(counts[\"cxx\"] > 0,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_empty_incomplete_unknown_or_uncompiled_object_records_refuse",
  "why": "A plan without checked C++ actions cannot be a successful cache proof."
 },
 {
  "id": "lib.mgx-rocmlir-build-record-source",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "for key in (\"file\", \"command\", \"output\")",
  "replace": "for key in (\"command\", \"output\")",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_empty_incomplete_unknown_or_uncompiled_object_records_refuse",
  "why": "Every Ninja record retains its source identity, including the fat-library plan record."
 },
 {
  "id": "lib.mgx-rocmlir-build-mri-unique",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "len(selected) == 1",
  "replace": "len(selected) >= 1",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_missing_duplicate_empty_or_malformed_fat_archive_loop_refuses",
  "why": "The selected package retains one recognizable fat-library generator with nonempty unique static archive members."
 },
 {
  "id": "lib.mgx-rocmlir-build-mri-loop-unique",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "len(positions) == 1",
  "replace": "len(positions) >= 1",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_missing_duplicate_empty_or_malformed_fat_archive_loop_refuses",
  "why": "The selected package retains one recognizable fat-library generator with nonempty unique static archive members."
 },
 {
  "id": "lib.mgx-rocmlir-build-members-nonempty",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "bool(members) and len(set(members))",
  "replace": "True and len(set(members))",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_missing_duplicate_empty_or_malformed_fat_archive_loop_refuses",
  "why": "The selected package retains one recognizable fat-library generator with nonempty unique static archive members."
 },
 {
  "id": "lib.mgx-rocmlir-build-members-unique",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "len(set(members)) == len(members)",
  "replace": "True",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_missing_duplicate_empty_or_malformed_fat_archive_loop_refuses",
  "why": "The selected package retains one recognizable fat-library generator with nonempty unique static archive members."
 },
 {
  "id": "lib.mgx-rocmlir-build-members-static",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "all(name.endswith(\".a\") for name in members)",
  "replace": "True",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_missing_duplicate_empty_or_malformed_fat_archive_loop_refuses",
  "why": "The selected package retains one recognizable fat-library generator with nonempty unique static archive members."
 },
 {
  "id": "lib.mgx-rocmlir-build-input-preservation",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "require(before == {name: fingerprint(args.build / name) for name in inputs},",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_metadata_transport_raw_status_fresh_output_and_input_preservation",
  "why": "Metadata observation cannot change configured source inputs and still write a passed receipt."
 },
 {
  "id": "lib.mgx-rocmlir-build-tool-raw",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "return result.returncode",
  "replace": "return 0",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_metadata_transport_raw_status_fresh_output_and_input_preservation",
  "why": "A failed Ninja subtool stops before builds or a passed plan receipt and preserves its raw failure."
 },
 {
  "id": "lib.mgx-rocmlir-build-fresh-output",
  "target": "linux/scripts/03-media/build/migraphx/inspect-rocmlir-build.py",
  "find": "args.output.mkdir()",
  "replace": "args.output.mkdir(exist_ok=True)",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildPlanTests.test_metadata_transport_raw_status_fresh_output_and_input_preservation",
  "why": "A prior receipt-only output directory must not be overwritten by a later observation."
 },
 {
  "id": "lib.mgx-rocmlir-build-prepare-scope",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/prepare-source-rocmlir.sh\" \"$@\"",
  "replace": "bash \"$(dirname \"${BASH_SOURCE[0]}\")/prepare-source-rocmlir.sh\" \"$@\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_exact_build_target_leaf_install_and_memory_capped_jobs",
  "why": "Preparation publishes the selected compiler, Python and cache into the actual build shell."
 },
 {
  "id": "lib.mgx-rocmlir-build-prepare-argv",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "/prepare-source-rocmlir.sh\" \"$@\"",
  "replace": "/prepare-source-rocmlir.sh\" \"$1\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_exact_build_target_leaf_install_and_memory_capped_jobs",
  "why": "The builder forwards all four original argument boundaries into canonical preparation."
 },
 {
  "id": "lib.mgx-rocmlir-build-required-cache",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "[[ -n \"${CMAKE_COMPILER_CACHE_PIN:-}\" ]]",
  "replace": "true",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_prepare_jobs_plan_build_install_and_archive_failures_remain_raw",
  "why": "A full vendor build refuses an unresolved compiler-cache pin."
 },
 {
  "id": "lib.mgx-rocmlir-build-build-jobs",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "--parallel \"${jobs}\"",
  "replace": "--parallel \"${JOBS}\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_exact_build_target_leaf_install_and_memory_capped_jobs",
  "why": "The build uses the memory-capped result rather than the uncapped caller request."
 },
 {
  "id": "lib.mgx-rocmlir-build-build-target",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "--target librockCompiler",
  "replace": "--target rockCompiler",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_exact_build_target_leaf_install_and_memory_capped_jobs",
  "why": "The actual upstream Linux fat-library target is librockCompiler."
 },
 {
  "id": "lib.mgx-rocmlir-build-package-install",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "cmake --install \"${work}/build/mlir/tools/rocmlir-lib\"",
  "replace": "cmake --install \"${work}/build\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_exact_build_target_leaf_install_and_memory_capped_jobs",
  "why": "Install the complete generated rocMLIR package rather than assuming unbuilt LLVM toolchain install targets exist."
 },
 {
  "id": "lib.mgx-rocmlir-build-raw-build",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "cmake --build \"${work}/build\" --target librockCompiler --parallel \"${jobs}\"",
  "replace": "cmake --build \"${work}/build\" --target librockCompiler --parallel \"${jobs}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_prepare_jobs_plan_build_install_and_archive_failures_remain_raw",
  "why": "Required plan, build and installation failures must remain fatal with their raw child status."
 },
 {
  "id": "lib.mgx-rocmlir-build-raw-install",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "cmake --install \"${work}/build/mlir/tools/rocmlir-lib\"",
  "replace": "cmake --install \"${work}/build/mlir/tools/rocmlir-lib\" || true",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_prepare_jobs_plan_build_install_and_archive_failures_remain_raw",
  "why": "Required plan, build and installation failures must remain fatal with their raw child status."
 },
 {
  "id": "lib.mgx-rocmlir-build-raw-plan",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "--cache-launcher \"${CMAKE_COMPILER_CACHE_PIN}\"",
  "replace": "--cache-launcher \"${CMAKE_COMPILER_CACHE_PIN}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_prepare_jobs_plan_build_install_and_archive_failures_remain_raw",
  "why": "Required plan, build and installation failures must remain fatal with their raw child status."
 },
 {
  "id": "lib.mgx-rocmlir-build-prefix-verdict",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "migraphx_rocmlir_prefix_contract \"${work}/host-deps\" \"${clang_root}/bin/llvm-ar\" \"${work}/installed-archive-members.txt\"",
  "replace": ":",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_each_required_installed_payload_is_mandatory",
  "why": "A successful installer cannot replace checks of the actual required archive, exports and headers."
 },
 {
  "id": "lib.mgx-rocmlir-build-original-notices",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "migraphx_stage_rocmlir_notices \"${work}/source\" \"${work}/host-deps/share/licenses/rocmlir\" \"${SCRIPT_DIR}/rocmlir-source-notices.sha256\"",
  "replace": ":",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_missing_original_notice_fails_after_install_without_success",
  "why": "The installed vendor output retains verified original source texts before a successful result."
 },
 {
  "id": "lib.mgx-rocmlir-build-prefix-nonempty",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "[[ -s \"${required}\" ]]",
  "replace": "[[ -e \"${required}\" ]]",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_each_required_installed_payload_must_be_nonempty",
  "why": "Each required installed archive, CMake export and header must contain real bytes."
 },
 {
  "id": "lib.mgx-rocmlir-build-archive-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "\"${ar}\" t \"${prefix}/lib/librockCompiler.a\" > \"${record}\" || return",
  "replace": "\"${ar}\" t \"${prefix}/lib/librockCompiler.a\" > \"${record}\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_prefix_raw_archive_failure_and_reused_receipt_under_conditional_calls",
  "why": "A conditional caller retains the actual selected archive inspector failure."
 },
 {
  "id": "lib.mgx-rocmlir-build-archive-fresh",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "[[ ! -e \"${record}\" ]]",
  "replace": "true",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_prefix_raw_archive_failure_and_reused_receipt_under_conditional_calls",
  "why": "An earlier archive receipt must be preserved rather than reused."
 },
 {
  "id": "lib.mgx-rocmlir-build-archive-members",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "[[ -s \"${record}\" ]]",
  "replace": "true",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_prepare_jobs_plan_build_install_and_archive_failures_remain_raw",
  "why": "A successful archive inspector with no members cannot prove the required static library."
 },
 {
  "id": "lib.mgx-rocmlir-build-required-payload-0",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "replace": "  selected_files=(\n     lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_each_required_installed_payload_is_mandatory",
  "why": "Every independently expected installed static archive, CMake package file and public/external header remains mandatory."
 },
 {
  "id": "lib.mgx-rocmlir-build-required-payload-1",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "replace": "  selected_files=(\n    lib/librockCompiler.a  lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_each_required_installed_payload_is_mandatory",
  "why": "Every independently expected installed static archive, CMake package file and public/external header remains mandatory."
 },
 {
  "id": "lib.mgx-rocmlir-build-required-payload-2",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "replace": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake \n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_each_required_installed_payload_is_mandatory",
  "why": "Every independently expected installed static archive, CMake package file and public/external header remains mandatory."
 },
 {
  "id": "lib.mgx-rocmlir-build-required-payload-3",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "replace": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n     include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_each_required_installed_payload_is_mandatory",
  "why": "Every independently expected installed static archive, CMake package file and public/external header remains mandatory."
 },
 {
  "id": "lib.mgx-rocmlir-build-required-payload-4",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "replace": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake \n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_each_required_installed_payload_is_mandatory",
  "why": "Every independently expected installed static archive, CMake package file and public/external header remains mandatory."
 },
 {
  "id": "lib.mgx-rocmlir-build-required-payload-5",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "replace": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n     include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_each_required_installed_payload_is_mandatory",
  "why": "Every independently expected installed static archive, CMake package file and public/external header remains mandatory."
 },
 {
  "id": "lib.mgx-rocmlir-build-required-payload-6",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h include/rocmlir/external/include/mlir-c/IR.h\n  )",
  "replace": "  selected_files=(\n    lib/librockCompiler.a lib/cmake/rocmlir/rocmlir-config.cmake lib/cmake/rocmlir/rocmlir-config-version.cmake\n    lib/cmake/rocmlir/rocmlir-targets.cmake include/rocmlir/mlir-c/RegisterRocMLIR.h\n    include/rocmlir/mlir-c/Dialect/MIGraphX.h \n  )",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_each_required_installed_payload_is_mandatory",
  "why": "Every independently expected installed static archive, CMake package file and public/external header remains mandatory."
 },
 {
  "id": "lib.mgx-rocmlir-api-exact-version",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/CMakeLists.txt",
  "find": "  EXACT\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_inexact_package_missing_target_or_foreign_inputs_refuse",
  "why": "Require the exact supplied package and inspect both imported archive and include roots before compilation."
 },
 {
  "id": "lib.mgx-rocmlir-api-no-fallback",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/CMakeLists.txt",
  "find": "  NO_DEFAULT_PATH)",
  "replace": "  )",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_inexact_package_missing_target_or_foreign_inputs_refuse",
  "why": "Require the exact supplied package and inspect both imported archive and include roots before compilation."
 },
 {
  "id": "lib.mgx-rocmlir-api-archive-origin",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/CMakeLists.txt",
  "find": "if(NOT\n   rocmlir_links\n   STREQUAL\n   \"${ROCMLIR_PREFIX}/lib/librockCompiler.a\")",
  "replace": "if(FALSE)",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_inexact_package_missing_target_or_foreign_inputs_refuse",
  "why": "Require the exact supplied package and inspect both imported archive and include roots before compilation."
 },
 {
  "id": "lib.mgx-rocmlir-api-header-origin",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/CMakeLists.txt",
  "find": "if(NOT\n   rocmlir_includes\n   STREQUAL\n   \"${ROCMLIR_PREFIX}/include/rocmlir;${ROCMLIR_PREFIX}/include/rocmlir/external/include\")",
  "replace": "if(FALSE)",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_inexact_package_missing_target_or_foreign_inputs_refuse",
  "why": "Require the exact supplied package and inspect both imported archive and include roots before compilation."
 },
 {
  "id": "lib.mgx-rocmlir-api-header-version",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "static_assert(MLIR_MIGRAPHX_DIALECT_API_VERSION == ROCMLIR_REQUIRED_API_VERSION);",
  "replace": "static_assert(true);",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_incompatible_header_api_fails_actual_compilation",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-register-dialects",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "  mlirRegisterRocMLIRDialects(registry);\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_real_compiled_program_observes_registration_namespace_and_pipeline",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-register-passes",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "  mlirRegisterRocMLIRPasses();\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_real_compiled_program_observes_registration_namespace_and_pipeline",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-registry-guard",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "if (registry.ptr == nullptr)",
  "replace": "if (false)",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_runtime_invalid_context_dialect_namespace_and_pipeline_refuse",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-context-guard",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "if (mlirContextIsNull(context))",
  "replace": "if (false)",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_runtime_invalid_context_dialect_namespace_and_pipeline_refuse",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-context-threading",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "mlirContextCreateWithRegistry(registry, false)",
  "replace": "mlirContextCreateWithRegistry(registry, true)",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_real_compiled_program_observes_registration_namespace_and_pipeline",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-dialect-guard",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "bool valid = !mlirDialectIsNull(dialect);",
  "replace": "bool valid = true;",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_runtime_invalid_context_dialect_namespace_and_pipeline_refuse",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-namespace",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "std::string_view(name.data, 8) == \"migraphx\"",
  "replace": "std::string_view(name.data, 8) != \"migraphx\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_real_compiled_program_observes_registration_namespace_and_pipeline",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-namespace-length",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "name.length == 8",
  "replace": "true",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_runtime_invalid_context_dialect_namespace_and_pipeline_refuse",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-pipeline-registration",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "      mlirMIGraphXAddHighLevelPipeline(manager);\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_real_compiled_program_observes_registration_namespace_and_pipeline",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-pipeline-chunks",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "->append(text.data, static_cast<std::size_t>(text.length))",
  "replace": "->assign(text.data, static_cast<std::size_t>(text.length))",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_real_compiled_program_observes_registration_namespace_and_pipeline",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-pipeline-state",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "if (!valid || pipeline.find(\"migraphx-to-tosa\") == std::string::npos)",
  "replace": "if (!valid)",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_runtime_invalid_context_dialect_namespace_and_pipeline_refuse",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-output-flush",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": " << std::flush",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_program_output_failure_remains_fatal",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-output-status",
  "target": "linux/scripts/03-media/build/migraphx/rocmlir-host-consumer/main.cpp",
  "find": "return std::cout ? 0 : 4;",
  "replace": "return 0;",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_program_output_failure_remains_fatal",
  "why": "The compiled production probe must observe C API state and chunked pipeline output; fixture linkage is not genuine vendor or GPU proof."
 },
 {
  "id": "lib.mgx-rocmlir-api-original-header-cmp",
  "target": "linux/scripts/03-media/build/migraphx/verify-source-rocmlir.sh",
  "find": "  cmp -- \"${original}\" \"${installed}\"",
  "replace": "  : \"${original}\" \"${installed}\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_every_selected_original_header_is_compared_before_configuration",
  "why": "A successful host probe cannot excuse changed input/header bytes, wrong output or original notice failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-original-header-census",
  "target": "linux/scripts/03-media/build/migraphx/verify-source-rocmlir.sh",
  "find": "input_files+=(\"${original_files[@]}\")",
  "replace": ": \"${original_files[@]}\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_every_selected_installed_or_original_input_is_stable_after_api",
  "why": "A successful host probe cannot excuse changed input/header bytes, wrong output or original notice failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-input-stability",
  "target": "linux/scripts/03-media/build/migraphx/verify-source-rocmlir.sh",
  "find": "cmp -- \"${work}/inputs-before.sha256\" \"${work}/inputs-after.sha256\"",
  "replace": ": \"${work}/inputs-before.sha256\" \"${work}/inputs-after.sha256\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_every_selected_installed_or_original_input_is_stable_after_api",
  "why": "A successful host probe cannot excuse changed input/header bytes, wrong output or original notice failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-output-identity",
  "target": "linux/scripts/03-media/build/migraphx/verify-source-rocmlir.sh",
  "find": "cmp -- \"${work}/expected-output.txt\" \"${work}/api-output.txt\"",
  "replace": ": \"${work}/expected-output.txt\" \"${work}/api-output.txt\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_shell_worker_refuses_raw_failures_input_drift_and_invalid_api",
  "why": "A successful host probe cannot excuse changed input/header bytes, wrong output or original notice failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-notice-before",
  "target": "linux/scripts/03-media/build/migraphx/verify-source-rocmlir.sh",
  "find": "migraphx_verify_rocmlir_notices \"${rocmlir_prefix}/share/licenses/rocmlir\" \"${SCRIPT_DIR}/rocmlir-source-notices.sha256\"\nsha256sum",
  "replace": ":\nsha256sum",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_shell_worker_refuses_raw_failures_input_drift_and_invalid_api",
  "why": "A successful host probe cannot excuse changed input/header bytes, wrong output or original notice failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-notice-after",
  "target": "linux/scripts/03-media/build/migraphx/verify-source-rocmlir.sh",
  "find": "migraphx_verify_rocmlir_notices \"${rocmlir_prefix}/share/licenses/rocmlir\" \"${SCRIPT_DIR}/rocmlir-source-notices.sha256\"\nprintf",
  "replace": ":\nprintf",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_shell_worker_refuses_raw_failures_input_drift_and_invalid_api",
  "why": "A successful host probe cannot excuse changed input/header bytes, wrong output or original notice failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-notice-policy",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  cmp -- \"$1/SOURCE-NOTICE-SHA256SUMS\" \"$2\" || return",
  "replace": "  : \"$1/SOURCE-NOTICE-SHA256SUMS\" \"$2\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_shell_worker_refuses_raw_failures_input_drift_and_invalid_api",
  "why": "Original-notice and selected-payload failures remain observable even under conditional shell callers."
 },
 {
  "id": "lib.mgx-rocmlir-api-notice-hashes",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  (cd \"$1\" && sha256sum --check \"$2\")",
  "replace": "  : \"$1\" \"$2\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_api_tests.py RocmlirAPIConsumerTests.test_shell_worker_refuses_raw_failures_input_drift_and_invalid_api",
  "why": "Original-notice and selected-payload failures remain observable even under conditional shell callers."
 },
 {
  "id": "lib.mgx-rocmlir-api-payload-selector-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  migraphx_rocmlir_payload_files required_files \"${prefix}\" || return",
  "replace": "  migraphx_rocmlir_payload_files required_files \"${prefix}\"",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_prefix_raw_archive_failure_and_reused_receipt_under_conditional_calls",
  "why": "Original-notice and selected-payload failures remain observable even under conditional shell callers."
 },
 {
  "id": "lib.mgx-rocmlir-api-payload-empty",
  "target": "linux/scripts/03-media/build/migraphx/source-rocmlir.sh",
  "find": "  (( ${#required_files[@]} > 0 )) || { printf 'Empty rocMLIR payload selection\\n' >&2; return 1; }",
  "replace": "  :",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_prefix_raw_archive_failure_and_reused_receipt_under_conditional_calls",
  "why": "Original-notice and selected-payload failures remain observable even under conditional shell callers."
 },
 {
  "id": "lib.mgx-rocmlir-api-configure-plan-raw",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "  migraphx_prepare_cmake_plan \"$1\" \"$4\" \"$5\" \"$2/cmake-argv.nul\" \"$3\" \"$2/build\" || return",
  "replace": "  migraphx_prepare_cmake_plan \"$1\" \"$4\" \"$5\" \"$2/cmake-argv.nul\" \"$3\" \"$2/build\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_consumer_configuration_keeps_raw_phase_failures",
  "why": "Shared native transport must preserve caller arguments, expected facts, parent publication and raw failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-configure-entries",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": " \"CMAKE_CXX_STANDARD=$6\" \"${@:7}\"",
  "replace": " \"CMAKE_CXX_STANDARD=$6\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_consumer_configuration_keeps_options_scope_and_expected_entries",
  "why": "Shared native transport must preserve caller arguments, expected facts, parent publication and raw failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-build-publication",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "    printf -v \"$4\" '%s' \"${mgx_selected_consumer_library}\" || return",
  "replace": "    : \"$4\" \"${mgx_selected_consumer_library}\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_native_consumer_build_preserves_selection_publication_and_raw_status",
  "why": "Shared native transport must preserve caller arguments, expected facts, parent publication and raw failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-build-read-status",
  "target": "linux/scripts/03-media/build/migraphx/source-common.sh",
  "find": "  mgx_selected_consumer_library=\"$(cat \"$1/build/imported-library.txt\")\" || return",
  "replace": "  mgx_selected_consumer_library=\"$(cat \"$1/build/imported-library.txt\")\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_shared_native_consumer_build_preserves_selection_publication_and_raw_status",
  "why": "Shared native transport must preserve caller arguments, expected facts, parent publication and raw failures."
 },
 {
  "id": "lib.mgx-rocmlir-api-required-builder-child",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "bash \"${SCRIPT_DIR}/verify-source-rocmlir.sh\" \"${work}/api-check\" \"${work}/host-deps\" \"${work}/source\"",
  "replace": "bash \"${SCRIPT_DIR}/verify-source-rocmlir.sh\" \"${work}/api-check\" \"${work}/host-deps\" \"${work}/source\" || true",
  "test": "python3 linux/scripts/tests/migraphx_rocmlir_build_tests.py RocmlirBuildLifecycleTests.test_required_external_api_check_preserves_failure_after_notices",
  "why": "A failed external API child after notice staging cannot produce builder success."
 },
 {
  "id": "lib.mgx-rocmlir-api-original-source-required",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"original_source\": ((\"rocmlir-consumer\", \"python-consumer\"), (\"rocmlir-consumer\", \"python-consumer\")),",
  "replace": "\"original_source\": ((\"rocmlir-consumer\", \"python-consumer\"), ()),",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_rocmlir_consumer_requires_both_readonly_inputs_without_archives",
  "why": "The external consumer requires its selected original source tree before freezing or launching."
 },
 {
  "id": "lib.mgx-rocmlir-api-replay-registry-unique",
  "target": "linux/scripts/launch-migraphx-source-check.py",
  "find": "require(len(current) == len(registry),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_source_launcher_tests.py MigraphxSourceLauncherTests.test_empty_unknown_or_internally_duplicated_selection_refuses",
  "why": "Trusted-profile replay retains current recipe definitions, immutable tools, resource bounds, unit ownership and raw status; it launches no vendor build."
 },
 {
  "id": "lib.mgx-rocmlir-api-replay-input-unique",
  "target": "linux/scripts/launch-migraphx-source-check.py",
  "find": "require(bool(names) and len(names) == len(set(names)),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_source_launcher_tests.py MigraphxSourceLauncherTests.test_empty_unknown_or_internally_duplicated_selection_refuses",
  "why": "Trusted-profile replay retains current recipe definitions, immutable tools, resource bounds, unit ownership and raw status; it launches no vendor build."
 },
 {
  "id": "lib.mgx-rocmlir-api-replay-current-recipes",
  "target": "linux/scripts/launch-migraphx-source-check.py",
  "find": "return [entry for entry in registry if entry[\"id\"] in wanted]",
  "replace": "return [entry for entry in entries if entry[\"id\"] in wanted]",
  "test": "python3 linux/scripts/tests/migraphx_source_launcher_tests.py MigraphxSourceLauncherTests.test_selection_uses_current_registry_and_deduplicates_across_inputs",
  "why": "Trusted-profile replay retains current recipe definitions, immutable tools, resource bounds, unit ownership and raw status; it launches no vendor build."
 },
 {
  "id": "lib.mgx-rocmlir-api-replay-empty-selection",
  "target": "linux/scripts/launch-migraphx-source-check.py",
  "find": "require(bool(wanted) and not (wanted - current.keys()),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_source_launcher_tests.py MigraphxSourceLauncherTests.test_empty_unknown_or_internally_duplicated_selection_refuses",
  "why": "Trusted-profile replay retains current recipe definitions, immutable tools, resource bounds, unit ownership and raw status; it launches no vendor build."
 },
 {
  "id": "lib.mgx-rocmlir-api-replay-busy-unit",
  "target": "linux/scripts/launch-migraphx-source-check.py",
  "find": "require(state == \"not-found\",",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_source_launcher_tests.py MigraphxSourceLauncherTests.test_busy_unit_and_changed_tool_locks_cannot_launch",
  "why": "Trusted-profile replay retains current recipe definitions, immutable tools, resource bounds, unit ownership and raw status; it launches no vendor build."
 },
 {
  "id": "lib.mgx-rocmlir-api-replay-tool-locks",
  "target": "linux/scripts/launch-migraphx-source-check.py",
  "find": "require((source / relative).read_bytes() == (previous_source / relative).read_bytes(),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_source_launcher_tests.py MigraphxSourceLauncherTests.test_busy_unit_and_changed_tool_locks_cannot_launch",
  "why": "Trusted-profile replay retains current recipe definitions, immutable tools, resource bounds, unit ownership and raw status; it launches no vendor build."
 },
 {
  "id": "lib.mgx-rocmlir-api-replay-resource-policy",
  "target": "linux/scripts/launch-migraphx-source-check.py",
  "find": "require(payload.count(flag) == 1 and payload[payload.index(flag) + 1] == expected,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_source_launcher_tests.py MigraphxSourceLauncherTests.test_changed_profile_owner_worker_or_bounds_refuse",
  "why": "Trusted-profile replay retains current recipe definitions, immutable tools, resource bounds, unit ownership and raw status; it launches no vendor build."
 },
 {
  "id": "lib.mgx-rocmlir-api-replay-unit-policy",
  "target": "linux/scripts/launch-migraphx-source-check.py",
  "find": "require(value in command,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_source_launcher_tests.py MigraphxSourceLauncherTests.test_changed_profile_owner_worker_or_bounds_refuse",
  "why": "Trusted-profile replay retains current recipe definitions, immutable tools, resource bounds, unit ownership and raw status; it launches no vendor build."
 },
 {
  "id": "lib.mgx-rocmlir-api-replay-raw-launch",
  "target": "linux/scripts/launch-migraphx-source-check.py",
  "find": "return run_logged(command, args.output / \"launch.log\")",
  "replace": "run_logged(command, args.output / \"launch.log\")\n    return 0",
  "test": "python3 linux/scripts/tests/migraphx_source_launcher_tests.py MigraphxSourceLauncherTests.test_raw_launch_status_and_current_selected_receipt_are_preserved",
  "why": "Trusted-profile replay retains current recipe definitions, immutable tools, resource bounds, unit ownership and raw status; it launches no vendor build."
 },
 {
  "id": "lib.mgx-backend-build-prefix-absolute",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(prefix.is_absolute(),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_fresh_absolute_prefix_only_and_alias_refusals",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-prefix-fresh",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(not prefix.is_symlink() and not prefix.exists(),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_fresh_absolute_prefix_only_and_alias_refusals",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-prefix-resolved",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(not prefix.resolve().exists(),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_fresh_absolute_prefix_only_and_alias_refusals",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-manifest-nonempty-files",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(path.is_absolute() and path.is_file() and path.stat().st_size > 0,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_selected_header_and_config_cannot_be_empty",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-manifest-contained",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(path.resolve().is_relative_to(root),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_unlisted_files_and_directory_links_and_foreign_library_links_refuse",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-manifest-unique",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(relative not in records,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_manifest_empty_repeated_relative_foreign_or_incomplete_refuses",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-manifest-complete",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(actual == set(records),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_unlisted_files_and_directory_links_and_foreign_library_links_refuse",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-payloads-required",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(name in records,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_every_selected_payload_and_python_extension_is_required",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-python-required",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(len(modules) == 1 and Path(modules[0]).name == expected_module,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_every_selected_payload_and_python_extension_is_required",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-native-identity",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(ELF_TARGET(stream.read(20)) == native,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_bad_empty_or_foreign_ELF_and_wrong_missing_or_duplicate_version_refuse",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-version-pin",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(\".\".join(parts) == version,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_bad_empty_or_foreign_ELF_and_wrong_missing_or_duplicate_version_refuse",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-prefixes-unique",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(all(values) and len(set(values)) == len(values),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_missing_ambiguous_or_empty_dependency_prefixes_refuse",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-prefixes-absolute",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(all(root.is_absolute() and root.is_dir() for root in roots),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_missing_ambiguous_or_empty_dependency_prefixes_refuse",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-notice-owner",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(len(matches) == 1,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_missing_ambiguous_or_empty_dependency_prefixes_refuse",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-notice-policy-unique",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(name not in expected and component in sources,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_policy_duplicates_traversal_bad_hash_or_missing_named_notice_refuses",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-notice-hashes",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(not file.is_symlink() and file.is_file() and digest(file) == sha256, \"Original notice bytes differ: \" + name)",
  "replace": "require(True, \"Original notice bytes differ: \" + name)",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_every_known_original_notice_rejects_corruption_or_symlinks",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-notice-policy-complete",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(set(expected) == NOTICE_NAMES,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_policy_duplicates_traversal_bad_hash_or_missing_named_notice_refuses",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-archive-pin",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(digest(archive) == expected_archive,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_archive_pin_primary_notice_and_source_identity_must_match",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-archive-primary",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(len(members) == 1 and members[0].isfile(),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_ambiguous_archive_primary_and_symlinked_original_notice_refuse",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-archive-original",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(not license_file.is_symlink() and license_file.is_file() and license_file.stat().st_size > 0\n            and digest(license_file) == expected,",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_archive_pin_primary_notice_and_source_identity_must_match",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-source-id",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(re.fullmatch(r\"[0-9a-f]{40}\", args.source_commit) and re.fullmatch(r\"[0-9a-f]{64}\", args.source_sha256),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_archive_pin_primary_notice_and_source_identity_must_match",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-rocmlir-policy",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require((rocmlir / \"SOURCE-NOTICE-SHA256SUMS\").read_bytes() == rocmlir_policy.read_bytes(),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_rocmlir_policy_and_original_per_file_notices_remain_required",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-rocmlir-originals",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(not file.is_symlink() and file.is_file() and digest(file) == sha256, \"rocMLIR original notice differs\")",
  "replace": "require(True, \"rocMLIR original notice differs\")",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_rocmlir_policy_and_original_per_file_notices_remain_required",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-staging-notice-hashes",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(digest(target) == notice_hashes[name] == digest(source),",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_notice_or_symlink_drift_during_copy_never_publishes_receipt",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-staging-library-stability",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(digest(file) == expected[\"sha256\"],",
  "replace": "require(True,",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_copy_failures_and_changed_installed_bytes_never_publish_receipt",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-licence-review-false",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "\"complete_binary_licence_review\": False",
  "replace": "\"complete_binary_licence_review\": True",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_complete_install_stages_exact_originals_patch_and_false_review_verdict",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-preserve-source-patch",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "notices[\"migraphx/applied.patch\"] = args.patch",
  "replace": "pass",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_complete_install_stages_exact_originals_patch_and_false_review_verdict",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-prefix-raw",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "python3 \"${SCRIPT_DIR}/stage-backend-install.py\" check-prefix --prefix \"${MIGRAPHX_SOURCE_PREFIX}\"",
  "replace": "python3 \"${SCRIPT_DIR}/stage-backend-install.py\" check-prefix --prefix \"${MIGRAPHX_SOURCE_PREFIX}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendLifecycleTests.test_prefix_prepare_jobs_build_install_and_stage_failures_remain_raw",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-build-raw",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "cmake --build \"${work}/build\" --parallel \"${jobs}\"",
  "replace": "cmake --build \"${work}/build\" --parallel \"${jobs}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendLifecycleTests.test_prefix_prepare_jobs_build_install_and_stage_failures_remain_raw",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-install-raw",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "cmake --install \"${work}/build\"",
  "replace": "cmake --install \"${work}/build\" || true",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendLifecycleTests.test_prefix_prepare_jobs_build_install_and_stage_failures_remain_raw",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-source-stability",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "sha256sum --check \"${work}/source-inputs.sha256\"",
  "replace": ": \"${work}/source-inputs.sha256\"",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendLifecycleTests.test_missing_cache_original_notice_or_changed_inputs_cannot_pass",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-stage-raw",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "--source-sha256 \"${MIGRAPHX_WINDOWS_SOURCE_SHA256}\" --patch \"${patch_file}\" --python-patch \"${python_patch_file}\"",
  "replace": "--source-sha256 \"${MIGRAPHX_WINDOWS_SOURCE_SHA256}\" --patch \"${patch_file}\" --python-patch \"${python_patch_file}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendLifecycleTests.test_prefix_prepare_jobs_build_install_and_stage_failures_remain_raw",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-cache-required",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "[[ -n \"${CMAKE_COMPILER_CACHE_PIN:-}\" ]]",
  "replace": "true",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendLifecycleTests.test_missing_cache_original_notice_or_changed_inputs_cannot_pass",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-source-notice-census",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "sha256sum \"${work}/source/LICENSE\" >> \"${work}/source-inputs.sha256\"",
  "replace": ": \"${work}/source/LICENSE\"",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendLifecycleTests.test_missing_cache_original_notice_or_changed_inputs_cannot_pass",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-backend-build-memory-job-cap",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "jobs=\"$(compute_cpp_heavy_jobs \"${JOBS:-}\")\"",
  "replace": "jobs=\"${JOBS:-}\"",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendLifecycleTests.test_same_shell_preparation_jobs_install_and_notice_stage_arguments",
  "why": "Installed output, original bytes and explicit provenance must fail independently; fixture libraries do not establish a real backend or complete licence review."
 },
 {
  "id": "lib.mgx-selected-python-pybind-exact",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": " EXACT CONFIG REQUIRED)",
  "replace": " CONFIG REQUIRED)",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_inexact_pybind_or_missing_required_pins_refuse",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-runtime-version",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "if(NOT _selected_python_version STREQUAL MIGRAPHX_REQUIRED_PYTHON_VERSION)",
  "replace": "if(FALSE)",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_failed_interpreter_invalid_JSON_or_wrong_pin_refuses",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-runtime-raw",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "if(NOT _selected_python_result STREQUAL \"0\")",
  "replace": "if(FALSE)",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_failed_interpreter_invalid_JSON_or_wrong_pin_refuses",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-config-raw",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "if(NOT _config_prefix_result STREQUAL \"0\" OR NOT _config_suffix_result STREQUAL \"0\"\n+       OR NOT _config_includes_result STREQUAL \"0\")",
  "replace": "if(FALSE\n+       )",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_paired_config_raw_failures_and_wrong_prefix_or_suffix_refuse",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-config-prefix",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "NOT _config_prefix STREQUAL _selected_python_prefix OR",
  "replace": "FALSE OR",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_paired_config_raw_failures_and_wrong_prefix_or_suffix_refuse",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-config-suffix",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "NOT _config_suffix STREQUAL _selected_python_suffix",
  "replace": "FALSE",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_paired_config_raw_failures_and_wrong_prefix_or_suffix_refuse",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-config-empty-headers",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "OR _config_includes STREQUAL \"\"",
  "replace": "OR FALSE",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_paired_config_raw_failures_and_wrong_prefix_or_suffix_refuse",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-config-header-root",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "if(NOT _selected_include_dir STREQUAL _selected_python_include\n+           AND NOT _selected_include_dir STREQUAL _selected_python_platinclude)",
  "replace": "if(FALSE\n+           )",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_paired_config_raw_failures_and_wrong_prefix_or_suffix_refuse",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-paired-config-force",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "\"${_selected_python_config}\" CACHE FILEPATH \"\" FORCE)",
  "replace": "\"${_selected_python_config}\" CACHE FILEPATH \"\")",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_original_fails_named_ABI_assertion_corrected_uses_paired_config",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-one-selected-ABI",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "set(PYTHON_SEARCH_VERSIONS \"${_selected_python_abi}\")",
  "replace": "set(PYTHON_SEARCH_VERSIONS 3.14)",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_original_fails_named_ABI_assertion_corrected_uses_paired_config",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-headers-required",
  "target": "linux/scripts/patches/migraphx/002-select-pinned-python.patch",
  "find": "if(NOT TARGET \"python${_selected_python_abi}::headers\")",
  "replace": "if(FALSE)",
  "test": "python3 linux/scripts/tests/migraphx_python_selection_tests.py MigraphxPythonSelectionTests.test_missing_paired_config_or_selected_headers_cannot_fall_back",
  "why": "The controlled selection fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-prepare-runtime-pin",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "\"-DMIGRAPHX_REQUIRED_PYTHON_VERSION=${PYTHON_VERSION}\"",
  "replace": "\"-DMIGRAPHX_REQUIRED_PYTHON_VERSION=0.0.0\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_full_feature_and_argument_contract",
  "why": "The controlled plan fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-prepare-pybind-pin",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "\"-DMIGRAPHX_REQUIRED_PYBIND11_VERSION=${PY_PYBIND11_VERSION}\"",
  "replace": "\"-DMIGRAPHX_REQUIRED_PYBIND11_VERSION=0.0.0\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_full_feature_and_argument_contract",
  "why": "The controlled plan fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-prepare-pybind-root",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "\"-Dpybind11_DIR=${pybind_dir}\"",
  "replace": "\"-Dpybind11_DIR=/foreign/pybind\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_full_feature_and_argument_contract",
  "why": "The controlled plan fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-configured-interpreter",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": "\"MIGRAPHX_SELECTED_PYTHON_EXECUTABLE=${HOST_PYTHON_BIN}\"",
  "replace": "\"CMAKE_CXX_COMPILER=${clang_root}/bin/clang++\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_missing_duplicate_compiler_cache_and_hip_facts_refuse",
  "why": "The controlled plan fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-patch-input-hash",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": " \"${python_patch_file}\" \"${work}/source/cmake/PythonModules.cmake\"",
  "replace": " \"${work}/source/cmake/PythonModules.cmake\"",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_source_input_hashes_bind_both_patches_and_selected_Python_module",
  "why": "The controlled plan fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-module-input-hash",
  "target": "linux/scripts/03-media/build/migraphx/prepare-source-build.sh",
  "find": " \"${work}/source/cmake/PythonModules.cmake\"",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_source_plan_tests.py MigraphxSourcePlanTests.test_source_input_hashes_bind_both_patches_and_selected_Python_module",
  "why": "The controlled plan fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-stage-patch-copy",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "notices[\"migraphx/python-selection.patch\"] = args.python_patch",
  "replace": "notices[\"migraphx/python-selection.patch\"] = args.patch",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_complete_install_stages_exact_originals_patch_and_false_review_verdict",
  "why": "The controlled stage fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-stage-patch-hash",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "\"python_selection_patch_sha256\": digest(args.python_patch)",
  "replace": "\"python_selection_patch_sha256\": digest(args.patch)",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_complete_install_stages_exact_originals_patch_and_false_review_verdict",
  "why": "The controlled stage fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-stage-exact-ABI",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "len(modules) == 1 and Path(modules[0]).name == expected_module",
  "replace": "bool(modules)",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_python_extension_rejects_foreign_or_additional_ABIs",
  "why": "The controlled stage fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-probe-runtime-version",
  "target": "linux/scripts/03-media/build/migraphx/run-python-probe.py",
  "find": "if platform.python_version() != version:",
  "replace": "if False:",
  "test": "python3 linux/scripts/tests/migraphx_python_probe_tests.py MigraphxPythonProbeTests.test_wrong_interpreter_ABI_or_outside_module_refuses_before_load",
  "why": "The controlled probe fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-probe-contained-module",
  "target": "linux/scripts/03-media/build/migraphx/run-python-probe.py",
  "find": "not module_path.is_relative_to(build.resolve())",
  "replace": "False",
  "test": "python3 linux/scripts/tests/migraphx_python_probe_tests.py MigraphxPythonProbeTests.test_wrong_interpreter_ABI_or_outside_module_refuses_before_load",
  "why": "The controlled probe fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-probe-extension-ABI",
  "target": "linux/scripts/03-media/build/migraphx/run-python-probe.py",
  "find": "module_path.name != \"migraphx_python_probe\" + sysconfig.get_config_var(\"EXT_SUFFIX\")",
  "replace": "False",
  "test": "python3 linux/scripts/tests/migraphx_python_probe_tests.py MigraphxPythonProbeTests.test_wrong_interpreter_ABI_or_outside_module_refuses_before_load",
  "why": "The controlled probe fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-probe-value",
  "target": "linux/scripts/03-media/build/migraphx/run-python-probe.py",
  "find": "module.constant_value() != 42",
  "replace": "False",
  "test": "python3 linux/scripts/tests/migraphx_python_probe_tests.py MigraphxPythonProbeTests.test_wrong_return_or_module_origin_cannot_pass",
  "why": "The controlled probe fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-probe-origin",
  "target": "linux/scripts/03-media/build/migraphx/run-python-probe.py",
  "find": "not isinstance(origin, str) or Path(origin).resolve() != module_path",
  "replace": "False",
  "test": "python3 linux/scripts/tests/migraphx_python_probe_tests.py MigraphxPythonProbeTests.test_wrong_return_or_module_origin_cannot_pass",
  "why": "The controlled probe fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-probe-module-bytes",
  "target": "linux/scripts/03-media/build/migraphx/run-python-probe.py",
  "find": "before != hashlib.sha256(module_path.read_bytes()).hexdigest()",
  "replace": "False",
  "test": "python3 linux/scripts/tests/migraphx_python_probe_tests.py MigraphxPythonProbeTests.test_changed_native_bytes_cannot_pass",
  "why": "The controlled probe fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-probe-GIL-preservation",
  "target": "linux/scripts/03-media/build/migraphx/run-python-probe.py",
  "find": "(not gil_before and gil_after)",
  "replace": "False",
  "test": "python3 linux/scripts/tests/migraphx_python_probe_tests.py MigraphxPythonProbeTests.test_disabled_GIL_remains_disabled_and_reenable_is_fatal",
  "why": "The controlled probe fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-launcher-source-required",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "(\"rocmlir-consumer\", \"python-consumer\")),",
  "replace": "(\"rocmlir-consumer\",)),",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_python_consumer_requires_one_readonly_source_without_archives",
  "why": "The controlled launcher fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-launcher-source-readonly",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "target = \"/migraphx-original-source\"",
  "replace": "target = \"/migraphx-foreign-source\"",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_python_consumer_requires_one_readonly_source_without_archives",
  "why": "The controlled launcher fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-plugin-HIP-root",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "rocm=\"${ROCM_HOME:-/opt/rocm}\"",
  "replace": "rocm=\"${MIGRAPHX_HOME}\"",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "The controlled plugin fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-plugin-HIP-core",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "if [ -f \"${rocm}/core/lib/cmake/hip/hip-config.cmake\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "The controlled plugin fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-plugin-HIP-early-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "|| { err \"no hip-config.cmake under ${ROCM_HOME:-/opt/rocm}\"; return; }",
  "replace": "|| err \"no hip-config.cmake under ${ROCM_HOME:-/opt/rocm}\"",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "The controlled plugin fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-selected-python-plugin-HIP-cmake-prefix",
  "target": "linux/scripts/03-media/build/onnxruntime/build/35-build-migraphx-plugin-ep.sh",
  "find": "\"-DCMAKE_PREFIX_PATH=${mgx};${rocm}\"",
  "replace": "\"-DCMAKE_PREFIX_PATH=${mgx}\"",
  "test": "bash linux/scripts/tests/test-migraphx-plugin-ep.sh",
  "why": "The controlled plugin fixture must reject this semantic defect; separate compiled-backend, free-threaded and GPU acceptance evidence is still required."
 },
 {
  "id": "lib.mgx-stack-pins-before-network",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "[[ \"${revision}\" =~ ^[A-Za-z0-9._+-]+$ && \"${digest}\" =~ ^[0-9a-f]{64}$ ]]",
  "replace": "[[ 1 == 1 ]]",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_every_pin_and_key_is_required_before_fetch",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-exact-seven-inputs",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "[[ \"${#seen[@]}\" -eq 7 ]]",
  "replace": "[[ 1 == 1 ]]",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_empty_duplicate_unknown_or_missing_required_table_entry_refuses",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-all-required-names",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "[[ \"${seen[${required}]:-}\" == 1 ]]",
  "replace": "[[ 1 == 1 ]]",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_empty_duplicate_unknown_or_missing_required_table_entry_refuses",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-distinct-table-names",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "-z \"${seen[${name}]:-}\"",
  "replace": "1 == 1",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_empty_duplicate_unknown_or_missing_required_table_entry_refuses",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-https-and-version-template",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": " && \"${url}\" == https://*'{0}'*",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_empty_duplicate_unknown_or_missing_required_table_entry_refuses",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-all-version-placeholders",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "url=\"${url//\\{0\\}/${revision}}\"",
  "replace": "url=\"${url/\\{0\\}/${revision}}\"",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_seven_exact_URLs_hash_names_and_order_are_planned_before_network",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-content-addressed-cache",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "${cache}/${digest}.tar.gz",
  "replace": "${cache}/${name}.tar.gz",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_seven_exact_URLs_hash_names_and_order_are_planned_before_network",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-matching-cache-required",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "if [[ -f \"${archive}\" ]] && download_verify_sha256 \"${digest}\" \"${archive}\"; then",
  "replace": "if [[ -f \"${archive}\" ]]; then",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_bad_cache_refetches_and_failed_or_wrong_fetch_never_passes",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-cache-symlink-refusal",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "[[ ! -L \"${archive}\" ]]",
  "replace": "[[ 1 == 1 ]]",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_symlinked_cache_cannot_supply_an_archive_even_with_matching_bytes",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-download-raw-status",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "download_verified_file \"${url}\" \"${digest}\" \"${archive}\" || return",
  "replace": "download_verified_file \"${url}\" \"${digest}\" \"${archive}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_bad_cache_refetches_and_failed_or_wrong_fetch_never_passes",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-fetched-bytes-reverified",
  "target": "linux/scripts/03-media/build/migraphx/source-stack.sh",
  "find": "      download_verify_sha256 \"${digest}\" \"${archive}\" || return",
  "replace": "      :",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_bad_cache_refetches_and_failed_or_wrong_fetch_never_passes",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-dedicated-default-prefix",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": ": \"${MIGRAPHX_SOURCE_PREFIX:=/opt/rocm/migraphx}\"",
  "replace": ": \"${MIGRAPHX_SOURCE_PREFIX:=/opt/rocm}\"",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_default_source_prefix_is_fresh_dedicated_and_explicit_value_survives",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-prefix-refusal-raw",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "python3 \"${SCRIPT_DIR}/stage-backend-install.py\" check-prefix --prefix \"${MIGRAPHX_SOURCE_PREFIX}\"",
  "replace": "python3 \"${SCRIPT_DIR}/stage-backend-install.py\" check-prefix --prefix \"${MIGRAPHX_SOURCE_PREFIX}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_prefix_refusal_happens_before_cache_work_download_or_build",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-fresh-work-required",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "migraphx_new_work \"${work}\" work",
  "replace": "migraphx_new_work \"${work}\" work || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_reused_work_invalid_cache_and_invalid_arity_refuse_before_children",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-plan-refusal-raw",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "migraphx_stack_plan sources \"${cache}\" \"${SCRIPT_DIR}/source-archives.txt\"",
  "replace": "migraphx_stack_plan sources \"${cache}\" \"${SCRIPT_DIR}/source-archives.txt\" || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_pin_failure_stops_all_children_and_fetch_failure_stops_dependency_builds",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-fetch-refusal-raw",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "migraphx_stack_fetch sources archives",
  "replace": "migraphx_stack_fetch sources archives || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_pin_failure_stops_all_children_and_fetch_failure_stops_dependency_builds",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-recorded-archive-plan",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "printf '%s\\n' \"${sources[@]}\" > \"${work}/source-archive-plan.txt\"",
  "replace": ":",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_complete_stack_keeps_required_order_exact_arguments_and_owned_prefixes",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-owned-development-prefixes",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "${work}/parsers/host-deps;${work}/ck/host-deps;${work}/rocmlir/host-deps",
  "replace": "${work}/parsers/host-deps;${work}/rocmlir/host-deps",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_complete_stack_keeps_required_order_exact_arguments_and_owned_prefixes",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-exact-original-CK-header",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "${work}/ck/ck-source/include/ck/utility/type.hpp",
  "replace": "${work}/ck/host-deps/include/ck/utility/type.hpp",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_complete_stack_keeps_required_order_exact_arguments_and_owned_prefixes",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-required-build-source-deps",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "bash \"${SCRIPT_DIR}/build-source-deps.sh\" \"${work}/parsers\" \"${archives[abseil]}\" \"${archives[protobuf]}\"",
  "replace": "bash \"${SCRIPT_DIR}/build-source-deps.sh\" \"${work}/parsers\" \"${archives[abseil]}\" \"${archives[protobuf]}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_every_child_failure_is_raw_and_stops_all_later_children",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-required-build-source-ck",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "bash \"${SCRIPT_DIR}/build-source-ck.sh\" \"${work}/ck\" \"${archives[ck]}\" \"${archives[rocm-cmake]}\"",
  "replace": "bash \"${SCRIPT_DIR}/build-source-ck.sh\" \"${work}/ck\" \"${archives[ck]}\" \"${archives[rocm-cmake]}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_every_child_failure_is_raw_and_stops_all_later_children",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-required-verify-source-ck",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "bash \"${SCRIPT_DIR}/verify-source-ck.sh\" \"${work}/ck-api\" \"${work}/ck/host-deps\" \"${work}/ck/ck-source/include/ck/utility/type.hpp\"",
  "replace": "bash \"${SCRIPT_DIR}/verify-source-ck.sh\" \"${work}/ck-api\" \"${work}/ck/host-deps\" \"${work}/ck/ck-source/include/ck/utility/type.hpp\" || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_every_child_failure_is_raw_and_stops_all_later_children",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-required-build-source-rocmlir",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "bash \"${SCRIPT_DIR}/build-source-rocmlir.sh\" \"${work}/rocmlir\" \"${archives[rocmlir]}\" \"${archives[rocm-cmake]}\" \"${rocm}\"",
  "replace": "bash \"${SCRIPT_DIR}/build-source-rocmlir.sh\" \"${work}/rocmlir\" \"${archives[rocmlir]}\" \"${archives[rocm-cmake]}\" \"${rocm}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_every_child_failure_is_raw_and_stops_all_later_children",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-required-check-source-sdk",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "bash \"${SCRIPT_DIR}/check-source-sdk.sh\" \"${work}/sdk-check\" \"${rocm}\"",
  "replace": "bash \"${SCRIPT_DIR}/check-source-sdk.sh\" \"${work}/sdk-check\" \"${rocm}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_every_child_failure_is_raw_and_stops_all_later_children",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-required-build-source-backend",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "bash \"${SCRIPT_DIR}/build-source-backend.sh\" \"${work}/backend\" \"${archives[migraphx]}\" \"${archives[rocm-cmake]}\" \"${archives[msgpack]}\" \"${rocm}\"",
  "replace": "bash \"${SCRIPT_DIR}/build-source-backend.sh\" \"${work}/backend\" \"${archives[migraphx]}\" \"${archives[rocm-cmake]}\" \"${archives[msgpack]}\" \"${rocm}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_every_child_failure_is_raw_and_stops_all_later_children",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-SDK-before-backend",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "bash \"${SCRIPT_DIR}/check-source-sdk.sh\" \"${work}/sdk-check\" \"${rocm}\"\nbash \"${SCRIPT_DIR}/build-source-backend.sh\" \"${work}/backend\" \"${archives[migraphx]}\" \"${archives[rocm-cmake]}\" \"${archives[msgpack]}\" \"${rocm}\"",
  "replace": "bash \"${SCRIPT_DIR}/build-source-backend.sh\" \"${work}/backend\" \"${archives[migraphx]}\" \"${archives[rocm-cmake]}\" \"${archives[msgpack]}\" \"${rocm}\"\nbash \"${SCRIPT_DIR}/check-source-sdk.sh\" \"${work}/sdk-check\" \"${rocm}\"",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_complete_stack_keeps_required_order_exact_arguments_and_owned_prefixes",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-protobuf-release-archive",
  "target": "linux/scripts/03-media/build/migraphx/source-archives.txt",
  "find": "https://github.com/protocolbuffers/protobuf/releases/download/v{0}/protobuf-{0}.tar.gz",
  "replace": "https://github.com/protocolbuffers/protobuf/archive/v{0}.tar.gz",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_seven_exact_URLs_hash_names_and_order_are_planned_before_network",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-stack-msgpack-release-archive",
  "target": "linux/scripts/03-media/build/migraphx/source-archives.txt",
  "find": "https://github.com/msgpack/msgpack-c/releases/download/cpp-{0}/msgpack-{0}.tar.gz",
  "replace": "https://github.com/msgpack/msgpack-c/archive/cpp-{0}.tar.gz",
  "test": "python3 linux/scripts/tests/migraphx_stack_tests.py MigraphxStackTests.test_seven_exact_URLs_hash_names_and_order_are_planned_before_network",
  "why": "Real hashing with explicit download/build doubles must reject this source-stack defect; no vendor binary,compiler-cache,licence closure or GPU/image acceptance is implied."
 },
 {
  "id": "lib.mgx-parser-build-exact-byte-floor",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "free < 193273528320",
  "replace": "False",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_vendor_disk_uses_both_exact_bytes_and_canonical_free_probe",
  "why": "Selected parser build transport retains normal resource admission,immutable inputs and bounded failure policy; protocol doubles are not real vendor or final image acceptance."
 },
 {
  "id": "lib.mgx-parser-build-canonical-floor",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "int(canonical) < 180",
  "replace": "False",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_vendor_disk_uses_both_exact_bytes_and_canonical_free_probe",
  "why": "Selected parser build transport retains normal resource admission,immutable inputs and bounded failure policy; protocol doubles are not real vendor or final image acceptance."
 },
 {
  "id": "lib.mgx-parser-build-disk-before-freeze",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "admission = require_build_disk(args.output.parent) if args.mode in BUILD_PROFILES else None",
  "replace": "admission = None",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_vendor_disk_refusal_prevents_freezing_and_launch",
  "why": "Selected parser build transport retains normal resource admission,immutable inputs and bounded failure policy; protocol doubles are not real vendor or final image acceptance."
 },
 {
  "id": "lib.mgx-parser-build-admission-receipt",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"resource_admission\": admission",
  "replace": "\"resource_admission\": None",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_parser_admission_is_recorded_with_the_actual_launch",
  "why": "Selected parser build transport retains normal resource admission,immutable inputs and bounded failure policy; protocol doubles are not real vendor or final image acceptance."
 },
 {
  "id": "lib.mgx-parser-build-bounded-build-profile",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"parsers\": (3600, \"2\", \"6g\")",
  "replace": "\"parsers\": (0, \"2\", \"6g\")",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_parser_build_requires_exact_two_archives_and_long_bounded_transport",
  "why": "Selected parser build transport retains normal resource admission,immutable inputs and bounded failure policy; protocol doubles are not real vendor or final image acceptance."
 },
 {
  "id": "lib.mgx-parser-build-both-original-archives",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"parsers\": ((\"archive\", \"abseil.tar.gz\"), (\"protobuf_archive\", \"protobuf.tar.gz\")),",
  "replace": "\"parsers\": ((\"archive\", \"abseil.tar.gz\"),),",
  "test": "python3 linux/scripts/tests/migraphx_configure_launcher_tests.py MigraphxConfigureLauncherTests.test_parser_build_requires_exact_two_archives_and_long_bounded_transport",
  "why": "Selected parser build transport retains normal resource admission,immutable inputs and bounded failure policy; protocol doubles are not real vendor or final image acceptance."
 },
 {
  "id": "lib.mgx-parser-build-raw-child",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "bash /hub/linux/scripts/03-media/build/migraphx/build-source-deps.sh /proof/work /abseil.tar.gz /protobuf.tar.gz > /proof/configure.log 2>&1",
  "replace": "bash /hub/linux/scripts/03-media/build/migraphx/build-source-deps.sh /proof/work /abseil.tar.gz /protobuf.tar.gz > /proof/configure.log 2>&1 || true",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "An actual parser child failure must survive the worker and cleanup; dispatch doubles prove status only,not a vendor build."
 },
 {
  "id": "lib.main-reconcile-platform-main-wiring",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    check_runtime_platform_baselines \"${image_tag}\" \"${target_arch}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "The grouped platform contract must remain executable from main and preserve all three ordered calls,argv and caller failure accounting; fixture checks do not prove an actual image or GPU."
 },
 {
  "id": "lib.main-reconcile-platform-riscv-retained",
  "target": "linux/scripts/06-packaging/check-arch-isa.sh",
  "find": "    check_riscv64_isa \"${image_tag}\" \"${target_arch}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "The grouped platform contract must remain executable from main and preserve all three ordered calls,argv and caller failure accounting; fixture checks do not prove an actual image or GPU."
 },
 {
  "id": "lib.main-reconcile-platform-shared-failure-counter",
  "target": "linux/scripts/06-packaging/check-arch-isa.sh",
  "find": "check_runtime_platform_baselines() {\n  local image_tag=\"$1\" target_arch=\"$2\"",
  "replace": "check_runtime_platform_baselines() {\n  local image_tag=\"$1\" target_arch=\"$2\"\n  local FAILS=0",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "The grouped platform contract must remain executable from main and preserve all three ordered calls,argv and caller failure accounting; fixture checks do not prove an actual image or GPU."
 },
 {
  "id": "lib.main-reconcile-platform-argument-boundaries",
  "target": "linux/scripts/06-packaging/check-arch-isa.sh",
  "find": "check_runtime_platform_baselines() {\n  local image_tag=\"$1\" target_arch=\"$2\"",
  "replace": "check_runtime_platform_baselines() {\n  local image_tag=\"$2\" target_arch=\"$1\"",
  "test": "bash linux/scripts/tests/test-intel-gpu-userspace.sh",
  "why": "The grouped platform contract must remain executable from main and preserve all three ordered calls,argv and caller failure accounting; fixture checks do not prove an actual image or GPU."
 },
 {
  "id": "probe.webgpu-ft-dependency-numpy-version",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "--numpy-version \"${FT_PROBE_NUMPY_VERSION:?missing NumPy source pin}\"",
  "replace": "--numpy-version 0.0.0",
  "test": "bash linux/scripts/tests/test-webgpu-runtime-transport.sh",
  "why": "The FT factory transport must install probe dependencies for the selected NumPy pin and target architecture; interpreter doubles do not prove real wheel or image acceptance."
 },
 {
  "id": "probe.webgpu-ft-dependency-target-arch",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "--arch \"${FT_PROBE_ARCH:?missing probe architecture}\"",
  "replace": "--arch amd64",
  "test": "bash linux/scripts/tests/test-webgpu-runtime-transport.sh",
  "why": "The FT factory transport must install probe dependencies for the selected NumPy pin and target architecture; interpreter doubles do not prove real wheel or image acceptance."
 },
 {
  "id": "lib.mgx-rocmlir-build-finite-bound",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"rocmlir-build\": (7200, \"4\", \"12g\")",
  "replace": "\"rocmlir-build\": (0, \"4\", \"12g\")",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "Selected rocMLIR build transport retains its real builder,raw failures,exact finite resource profile and normal disk admission; doubles do not prove a vendor build or image acceptance."
 },
 {
  "id": "lib.mgx-rocmlir-build-cpu-profile",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"rocmlir-build\": (7200, \"4\", \"12g\")",
  "replace": "\"rocmlir-build\": (7200, \"2\", \"12g\")",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "Selected rocMLIR build transport retains its real builder,raw failures,exact finite resource profile and normal disk admission; doubles do not prove a vendor build or image acceptance."
 },
 {
  "id": "lib.mgx-rocmlir-build-memory-profile",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"rocmlir-build\": (7200, \"4\", \"12g\")",
  "replace": "\"rocmlir-build\": (7200, \"4\", \"6g\")",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "Selected rocMLIR build transport retains its real builder,raw failures,exact finite resource profile and normal disk admission; doubles do not prove a vendor build or image acceptance."
 },
 {
  "id": "lib.mgx-rocmlir-build-disk-required",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "if args.mode in BUILD_PROFILES else None",
  "replace": "if args.mode == \"parsers\" else None",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "Selected rocMLIR build transport retains its real builder,raw failures,exact finite resource profile and normal disk admission; doubles do not prove a vendor build or image acceptance."
 },
 {
  "id": "lib.mgx-rocmlir-build-cli-mode",
  "target": "linux/scripts/launch-migraphx-configure-proof.py",
  "find": "\"python-consumer\", \"parsers\", \"rocmlir-build\"), default=\"configure\"",
  "replace": "\"python-consumer\", \"parsers\"), default=\"configure\"",
  "test": "bash linux/scripts/tests/test-migraphx-configure-launcher.sh",
  "why": "Selected rocMLIR build transport retains its real builder,raw failures,exact finite resource profile and normal disk admission; doubles do not prove a vendor build or image acceptance."
 },
 {
  "id": "lib.mgx-rocmlir-build-actual-builder",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "bash /hub/linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh /proof/work /source.tar.gz /rocm-cmake.tar.gz /opt/rocm > /proof/configure.log 2>&1",
  "replace": "bash /hub/linux/scripts/03-media/build/migraphx/prepare-source-rocmlir.sh /proof/work /source.tar.gz /rocm-cmake.tar.gz /opt/rocm > /proof/configure.log 2>&1",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Selected rocMLIR build transport retains its real builder,raw failures,exact finite resource profile and normal disk admission; doubles do not prove a vendor build or image acceptance."
 },
 {
  "id": "lib.mgx-rocmlir-build-raw-failure",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "bash /hub/linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh /proof/work /source.tar.gz /rocm-cmake.tar.gz /opt/rocm > /proof/configure.log 2>&1",
  "replace": "bash /hub/linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh /proof/work /source.tar.gz /rocm-cmake.tar.gz /opt/rocm > /proof/configure.log 2>&1 || true",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Selected rocMLIR build transport retains its real builder,raw failures,exact finite resource profile and normal disk admission; doubles do not prove a vendor build or image acceptance."
 },
 {
  "id": "lib.mgx-rocmlir-build-worker-jobs",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "export JOBS=4 BUILD_JOBS=4 MAX_JOBS=4",
  "replace": "export JOBS=2 BUILD_JOBS=2 MAX_JOBS=2",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Selected rocMLIR build transport retains its real builder,raw failures,exact finite resource profile and normal disk admission; doubles do not prove a vendor build or image acceptance."
 },
 {
  "id": "lib.full-preflight-rocm-ck-owner",
  "target": "docs/scripts/bump_versions.py",
  "find": "    \"MIGRAPHX_ROCM_CMAKE_VERSION\", \"MIGRAPHX_CK_HOST_VERSION\",\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "New source package versions are deliberately slaved to MIGraphX requirements and must keep an explicit manual owner without exempting their hashes. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-rocmlir-api-owner",
  "target": "docs/scripts/bump_versions.py",
  "find": "    \"MIGRAPHX_ROCMLIR_VERSION\", \"MIGRAPHX_ROCMLIR_DIALECT_API_VERSION\",\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "New source package versions are deliberately slaved to MIGraphX requirements and must keep an explicit manual owner without exempting their hashes. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-rocm_cmake-hash-owner",
  "target": "linux/scripts/01-core/versions.env",
  "find": "# bump:hold slaved to MIGraphX requirements; re-derive the complete source commit/version/hash tuple together.\nMIGRAPHX_ROCM_CMAKE_SOURCE_SHA256=",
  "replace": "MIGRAPHX_ROCM_CMAKE_SOURCE_SHA256=",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "A source hash moves only with its reviewed requirement tuple; removing its hold must make the existing real-pin audit red. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-ck-hash-owner",
  "target": "linux/scripts/01-core/versions.env",
  "find": "# bump:hold slaved to MIGraphX requirements; re-derive the complete source commit/version/hash tuple together.\nMIGRAPHX_CK_SOURCE_SHA256=",
  "replace": "MIGRAPHX_CK_SOURCE_SHA256=",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "A source hash moves only with its reviewed requirement tuple; removing its hold must make the existing real-pin audit red. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-rocmlir-hash-owner",
  "target": "linux/scripts/01-core/versions.env",
  "find": "# bump:hold slaved to MIGraphX requirements; re-derive the complete source commit/version/hash tuple together.\nMIGRAPHX_ROCMLIR_SOURCE_SHA256=",
  "replace": "MIGRAPHX_ROCMLIR_SOURCE_SHA256=",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "A source hash moves only with its reviewed requirement tuple; removing its hold must make the existing real-pin audit red. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-ft-cache-env",
  "target": "linux/scripts/06-packaging/build-free-threaded-probe-deps.sh",
  "find": "  compiler_cache_launcher_env 2>/dev/null || true\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "Every launcher resolution keeps its guarded parent-shell environment call. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-native-bootstrap",
  "target": "linux/scripts/lib/native-cxx-probe.sh",
  "find": "source \"${BASH_SOURCE[0]%/*}/log-bootstrap.sh\" || return\n",
  "replace": "true\n",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "Standalone native C++ helpers retain their own required canonical logging bootstrap. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-ft-run-drain",
  "target": "linux/Dockerfile.torch",
  "find": "    TARGETARCH=\"${TARGETARCH}\" bash /opt/scripts/packaging/build-free-threaded-probe-deps.sh; \\\n    bash /opt/scripts/core/sccache-s3-level.sh drain\n",
  "replace": "    TARGETARCH=\"${TARGETARCH}\" bash /opt/scripts/packaging/build-free-threaded-probe-deps.sh; \\\n    true\n",
  "test": "bash linux/scripts/tests/test-sccache-s3-level.sh",
  "why": "A RUN mounting sccache ends in the canonical drain and carries its library. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-ft-drain-library",
  "target": "linux/Dockerfile.torch",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/sccache-s3-level.sh,target=/opt/scripts/core/sccache-s3-level.sh,ro \\\n    set -euo pipefail; \\\n    TARGETARCH=\"${TARGETARCH}\" bash /opt/scripts/packaging/build-free-threaded-probe-deps.sh;",
  "replace": "    set -euo pipefail; \\\n    TARGETARCH=\"${TARGETARCH}\" bash /opt/scripts/packaging/build-free-threaded-probe-deps.sh;",
  "test": "bash linux/scripts/tests/test-sccache-s3-level.sh",
  "why": "The FT compiler RUN retains the narrow canonical drain mount. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-sdk-fixture-redirect",
  "target": "linux/scripts/tests/migraphx_sdk_closure_tests.py",
  "find": "shlex.quote(str(self.root / \"dispatch.log\"))",
  "replace": "str(self.root / \"dispatch.log\")",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "A path with spaces remains one redirection target and must not become extra child argv or an unowned temporary file. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-sdk-child-argv",
  "target": "linux/scripts/03-media/build/migraphx/configure-proof.sh",
  "find": "build-source-rocmlir.sh /proof/work /source.tar.gz /rocm-cmake.tar.gz /opt/rocm",
  "replace": "build-source-rocmlir.sh /proof/work /source.tar.gz /rocm-cmake.tar.gz /wrong-rocm",
  "test": "bash linux/scripts/tests/test-migraphx-sdk-closure.sh",
  "why": "Every dispatch branch must retain the complete selected archive and SDK arguments, independently expected by the fixture. Source/fixture contracts do not prove actual GPU/image acceptance."
 },
 {
  "id": "lib.full-preflight-bootstrap-comment-not-import",
  "target": "linux/scripts/tests/test-lib-modules.sh",
  "find": "grep -Eq '^[[:space:]]*source[[:space:]]+[^#]*log-bootstrap[.]sh'",
  "replace": "grep -qF 'log-bootstrap.sh'",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "A ShellCheck source comment cannot satisfy the library import contract; the source-line check does not prove unconditional branch execution."
 },
 {
  "id": "lib.full-preflight-cache-fixture-image-isolation",
  "target": "linux/scripts/tests/test-compiler-cache-launcher.sh",
  "find": "source <(sed \"s#/opt/scripts/core#${_COMMON_SH_DIR}#g\" \"${TESTS_DIR}/../01-core/compiler-cache-utils.sh\")",
  "replace": "source \"${TESTS_DIR}/../01-core/compiler-cache-utils.sh\"",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "The fixture redirects the actual shared helper image fallback before exercising resolver stdout; no real server or compiler-cache hit is implied."
 },
 {
  "id": "lib.rocm-source-paths-source-first",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "  local -a rocm_paths=(/opt/rocm/migraphx/lib /opt/rocm/migraphx/lib/migraphx/lib /opt/rocm/migraphx/lib64)\n",
  "replace": "  local -a rocm_paths=()\n",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.rocm-source-paths-source-lib64",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "  local -a rocm_paths=(/opt/rocm/migraphx/lib /opt/rocm/migraphx/lib/migraphx/lib /opt/rocm/migraphx/lib64)\n",
  "replace": "  local -a rocm_paths=(/opt/rocm/migraphx/lib /opt/rocm/migraphx/lib/migraphx/lib)\n",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.rocm-source-paths-deduplicate",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "      rocm_seen[\"${rocm_library}\"]=1",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.rocm-source-paths-root-symlink",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "find -H \"${rocm_image_root}/opt/rocm\"",
  "replace": "find \"${rocm_image_root}/opt/rocm\"",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.rocm-source-paths-discovery-failure",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "-printf '%h\\n')\" || return",
  "replace": "-printf '%h\\n')\" || true",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.rocm-source-paths-sort-failure",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "| LC_ALL=C sort -u)\" || return",
  "replace": "| LC_ALL=C sort -u)\" || true",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.rocm-source-paths-image-relative",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "rocm_paths+=(\"${rocm_library#\"${rocm_image_root}\"}\")",
  "replace": "rocm_paths+=(\"${rocm_library}\")",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.rocm-source-paths-publish-failure",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "  rocm_directories=\"$(media_rocm_library_paths \"${rocm_image_root}\")\" || return",
  "replace": "  rocm_directories=\"$(media_rocm_library_paths \"${rocm_image_root}\")\"",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.rocm-source-paths-write-failure",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "> \"${rocm_image_root}/etc/ld.so.conf.d/000-rocm.conf\" || return",
  "replace": "> \"${rocm_image_root}/etc/ld.so.conf.d/000-rocm.conf\" || true",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.rocm-source-paths-main-call",
  "target": "linux/scripts/06-packaging/copy-media-payloads.sh",
  "find": "  publish_rocm_ld_path\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Source-prefix runtime paths retain priority,legacy HIP paths,ASAN exclusion,deduplication and raw failures; filesystem fixtures do not prove ELF ABI,real loader choice or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-version",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "package.version == expected_version",
  "replace": "True",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-missing-package",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "raise ValueError(\"Selected Python has no pybind11 distribution\") from error",
  "replace": "return work",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-unique-original",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(len(candidates) == 1, \"Missing or ambiguous original pybind11 notice\")",
  "replace": "require(bool(candidates), \"Missing or ambiguous original pybind11 notice\")",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-relative-path",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "not relative.is_absolute() and \"..\" not in relative.parts",
  "replace": "True",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-regular-original",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "not notice.is_symlink() and notice.is_file()",
  "replace": "True",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-cmake-origin",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "Path(selected[0]).resolve() == cmake_dir.resolve()",
  "replace": "True",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-cmake-exists",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "(cmake_dir / \"pybind11Config.cmake\").is_file()",
  "replace": "True",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-stage-required",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "    sources[\"pybind11\"] = pybind_notice_root(args.work, args.pybind_version)\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-receipt-version",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "\"pybind11_version\": args.pybind_version",
  "replace": "\"pybind11_version\": \"wrong\"",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-cli-pin-required",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "\"version\", \"pybind_version\", \"source_commit\"",
  "replace": "\"version\", \"source_commit\"",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-original-policy",
  "target": "linux/scripts/03-media/build/migraphx/backend-source-notices.sha256",
  "find": "83965b843b98f670d3a85bd041ed4b372c8ec50d7b4a5995a83ac697ba675dcb  pybind11/LICENSE",
  "replace": "03965b843b98f670d3a85bd041ed4b372c8ec50d7b4a5995a83ac697ba675dcb  pybind11/LICENSE",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-pybind-notice-caller-pin",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "--pybind-version \"${PY_PYBIND11_VERSION:?missing selected pybind11 pin}\"",
  "replace": "--pybind-version 3.0.0",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendLifecycleTests",
  "why": "Original pybind11 notice staging binds selected Python version,unique regular original bytes and configured CMake origin before provenance;fixture and source proofs do not complete binary licence review or image/GPU acceptance."
 },
 {
  "id": "lib.mgx-image-prefix-refusal",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "[[ \"${MIGRAPHX_SOURCE_PREFIX}\" == /opt/rocm/migraphx ]]",
  "replace": "[[ -n \"${MIGRAPHX_SOURCE_PREFIX}\" ]]",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-prefix-export",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "export MIGRAPHX_SOURCE_PREFIX\n",
  "replace": ":\n",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-selected-python",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "--python \"${HOST_PYTHON_BIN}\"",
  "replace": "--python /different/python",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-no-extra-deps",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "--no-deps ",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-exact-pin",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "pybind11==${PY_PYBIND11_VERSION:?missing selected pybind11 pin}",
  "replace": "pybind11==3.1.0",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-missing-pin",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "${PY_PYBIND11_VERSION:?missing selected pybind11 pin}",
  "replace": "${PY_PYBIND11_VERSION:-3.1.0}",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-complete-stack",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "bash \"${SCRIPT_DIR}/build-source-stack.sh\" \"$@\"\n",
  "replace": ":\n",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-publisher",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "publish_rocm_ld_path\n",
  "replace": ":\n",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-ldconfig",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "ldconfig\n",
  "replace": ":\n",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-install-fatal",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "uv pip install --python \"${HOST_PYTHON_BIN}\" --no-deps \"pybind11==${PY_PYBIND11_VERSION:?missing selected pybind11 pin}\"",
  "replace": "uv pip install --python \"${HOST_PYTHON_BIN}\" --no-deps \"pybind11==${PY_PYBIND11_VERSION:?missing selected pybind11 pin}\" || true",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-core-companion",
  "target": "linux/scripts/script-closures/core-common.txt",
  "find": "01-core/compiler-cache-utils.sh|core/compiler-cache-utils.sh\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-source-patch",
  "target": "linux/scripts/script-closures/migraphx-image.txt",
  "find": "patches/migraphx/001-preserve-zero-pad-maxpool.patch|patches/migraphx/001-preserve-zero-pad-maxpool.patch\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-cache-mount",
  "target": "linux/Dockerfile.amd",
  "find": "    --mount=type=cache,target=/var/cache/sccache,id=sccache-${TARGETARCH},sharing=locked \\\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-s3-secret",
  "target": "linux/Dockerfile.amd",
  "find": "--mount=type=secret,id=sccache_s3,required=false",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-failed-build-status",
  "target": "linux/Dockerfile.amd",
  "find": "exit \"${status}\"",
  "replace": "exit 0",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-closing-drain",
  "target": "linux/Dockerfile.amd",
  "find": "    bash /opt/scripts/core/sccache-s3-level.sh drain\n",
  "replace": ":\n",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-gpu-home",
  "target": "linux/Dockerfile.amd",
  "find": "MIGRAPHX_HOME=\"/opt/rocm/migraphx\"",
  "replace": "MIGRAPHX_HOME=\"/opt/rocm\"",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-gpu-path",
  "target": "linux/Dockerfile.amd",
  "find": "PATH=\"/opt/rocm/migraphx/bin:",
  "replace": "PATH=\"",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-gpu-pkg-config",
  "target": "linux/Dockerfile.amd",
  "find": "PKG_CONFIG_PATH=\"/opt/rocm/migraphx/lib/pkgconfig:/opt/rocm/migraphx/lib64/pkgconfig:",
  "replace": "PKG_CONFIG_PATH=\"",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-gpu-python",
  "target": "linux/Dockerfile.amd",
  "find": "PYTHONPATH=\"/opt/rocm/migraphx/lib:",
  "replace": "PYTHONPATH=\"",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-gpu-cmake",
  "target": "linux/Dockerfile.amd",
  "find": "CMAKE_PREFIX_PATH=\"/opt/rocm/migraphx:",
  "replace": "CMAKE_PREFIX_PATH=\"",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-gpu-loader",
  "target": "linux/Dockerfile.amd",
  "find": "LD_LIBRARY_PATH=\"/opt/rocm/migraphx/lib:/opt/rocm/migraphx/lib/migraphx/lib:/opt/rocm/migraphx/lib64:",
  "replace": "LD_LIBRARY_PATH=\"",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-runtime-home",
  "target": "linux/Dockerfile.package",
  "find": "MIGRAPHX_HOME=${ROCM_ON:+/opt/rocm/migraphx}",
  "replace": "MIGRAPHX_HOME=${ROCM_ON:+/opt/rocm}",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-runtime-path",
  "target": "linux/Dockerfile.package",
  "find": "${ROCM_ON:+/opt/rocm/migraphx/bin:}",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-runtime-pkg-config",
  "target": "linux/Dockerfile.package",
  "find": "${ROCM_ON:+/opt/rocm/migraphx/lib/pkgconfig:/opt/rocm/migraphx/lib64/pkgconfig:}",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-runtime-python",
  "target": "linux/Dockerfile.package",
  "find": "${ROCM_ON:+/opt/rocm/migraphx/lib:}",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-runtime-cmake",
  "target": "linux/Dockerfile.package",
  "find": "${ROCM_ON:+/opt/rocm/migraphx:}",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-runtime-loader",
  "target": "linux/Dockerfile.package",
  "find": "${ROCM_ON:+/opt/rocm/migraphx/lib:/opt/rocm/migraphx/lib/migraphx/lib:/opt/rocm/migraphx/lib64:}",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Normal AMD source-image integration retains complete stack,selected Python pin,fresh per-file closure,caches,source-first environments and raw RUN failures; controls do not prove installed vendor binaries,complete licences,real loader ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.leaf-name-boundary",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "\\.sh(?![A-Za-z0-9._/-])",
  "replace": "\\.sh",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-mounted-inputs",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "    if any(mounted.get(\"/script-sources/\" + path.relative_to(SCRIPTS_SRC).as_posix()) != path for path in required):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-required-plans",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "*manifests, ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-required-selected",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "*selected.values(), ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-required-entry",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "SCRIPTS_SRC / \"stage-script-closure.py\", ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-required-module",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": ", SCRIPTS_SRC / \"script_closure.py\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-data-inputs",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "arguments[\"target\"], \"/script-sources\", \"*\")",
  "replace": "arguments[\"target\"], \"/script-sources\", \"*.sh\")",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-transport-required",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "    bundles = script_bundles(dockerfile)\n",
  "replace": "    bundles = script_bundles(dockerfile)\n    for files in bundles.values():\n        add_bundle(provided, files, \"/script-bundle\", \"/opt/scripts\")\n",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-bind-provision",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "                    add_bundle(provided, bundles[kv[\"from\"]], kv[\"source\"], kv[\"target\"])",
  "replace": "                    pass",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-copy-provision",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "                add_bundle(provided, bundles[from_stage[1]], src, dest)",
  "replace": "                pass",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.bundle-stage-reset",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "        elif line.upper().startswith(\"FROM \"):\n            stage = \"\"",
  "replace": "        elif line.upper().startswith(\"FROM \"):\n            pass",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.report-map-arity",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "len(arguments) != 2",
  "replace": "len(arguments) < 2",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.report-map-name",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "re.fullmatch(r\"Dockerfile\\.[A-Za-z0-9_-]+\", arguments[1]) is None",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.report-map-existing-file",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "    if not dockerfile.is_file():",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "copy-coverage.report-map-dispatch",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "        return report_provided(sys.argv[1:])",
  "replace": "        return 0",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-profile-shape",
  "target": "linux/scripts/script_closure.py",
  "find": "re.fullmatch(r\"[a-z][a-z0-9-]*\", profile) is None",
  "replace": "False",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-profile-cycle",
  "target": "linux/scripts/script_closure.py",
  "find": " or profile in trail",
  "replace": "",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-empty",
  "target": "linux/scripts/script_closure.py",
  "find": "    if not selected:",
  "replace": "    if False:",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-relative-path",
  "target": "linux/scripts/script_closure.py",
  "find": "    if not path.parts or path.is_absolute() or \"\\\\\" in value or \"..\" in path.parts:",
  "replace": "    if False:",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-symlink",
  "target": "linux/scripts/script_closure.py",
  "find": "path.is_symlink() or ",
  "replace": "",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-source-root",
  "target": "linux/scripts/script_closure.py",
  "find": "not actual.is_relative_to(root.resolve()) or ",
  "replace": "",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-regular-file",
  "target": "linux/scripts/script_closure.py",
  "find": " or not actual.is_file()",
  "replace": "",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-duplicate-target",
  "target": "linux/scripts/script_closure.py",
  "find": "        if selected.keys() & entries.keys():",
  "replace": "        if False:",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-reserved-receipt",
  "target": "linux/scripts/script_closure.py",
  "find": "            if target_path.split(\"/\")[0] == \"SCRIPT-CLOSURE.json\":",
  "replace": "            if False:",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-payload-hash",
  "target": "linux/scripts/script_closure.py",
  "find": "hashlib.sha256(payload).hexdigest()",
  "replace": "\"0\" * 64",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-script-mode",
  "target": "linux/scripts/script_closure.py",
  "find": "mode = 0o755 if target.endswith(\".sh\") else 0o644",
  "replace": "mode = 0o644",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-stable-time",
  "target": "linux/scripts/script_closure.py",
  "find": "        os.utime(path, (0, 0))",
  "replace": "        pass",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-refuse-existing",
  "target": "linux/scripts/script_closure.py",
  "find": "    output.mkdir()",
  "replace": "    output.mkdir(exist_ok=True)",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-cli-failure",
  "target": "linux/scripts/script_closure.py",
  "find": "        return 2",
  "replace": "        return 0",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-required-stage",
  "target": "linux/scripts/script_closure.py",
  "find": "        stage(args.root, args.profile, args.output)",
  "replace": "        pass",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-complete-marker",
  "target": "linux/scripts/script_closure.py",
  "find": "    print(\"SCRIPT_CLOSURE_STAGED \" + args.profile)",
  "replace": "    pass",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-input-plans",
  "target": "linux/scripts/script_closure.py",
  "find": "        manifests.add(manifest)",
  "replace": "        pass",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-bundle-readonly",
  "target": "linux/Dockerfile.amd",
  "find": "from=hub-scripts,source=/${HUB_SCRIPTS_KEY}/files,target=/opt/scripts,ro",
  "replace": "from=hub-scripts,source=/${HUB_SCRIPTS_KEY}/files,target=/opt/scripts",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.mgx-image-bundle-stage",
  "target": "linux/Dockerfile.amd",
  "find": "from=hub-scripts,source=/",
  "replace": "from=unknown-scripts,source=/",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-closure-sdk-producer",
  "target": "linux/Dockerfile.sdk",
  "find": "COPY --from=sdk-core-scripts /${HUB_SCRIPTS_KEY}/files/ /opt/scripts/",
  "replace": "COPY --from=unknown-scripts /${HUB_SCRIPTS_KEY}/files/ /opt/scripts/",
  "test": "bash linux/scripts/tests/test-sudo-policy-closures.sh",
  "why": "Declared script bundles retain real source bytes,deterministic output,actual stage transport and complete mounted inputs; fixtures and metadata do not prove BuildKit hits,compiler builds,ELF ABI or GPU/final-image acceptance."
 },
 {
  "id": "lib.script-context-query-status",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "  _sc_profile=\"$(python3 -B \"${_sc_helper}\" --profile-for \"${_sc_dockerfile}\")\" || return",
  "replace": "  _sc_profile=\"$(python3 -B \"${_sc_helper}\" --profile-for \"${_sc_dockerfile}\")\" || return 0",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-mkdir-status",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "  mkdir -p \"${_sc_root}\" || return",
  "replace": "  mkdir -p \"${_sc_root}\" || return 0",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-allocation-status",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "  _sc_work=\"$(mktemp -d \"${_sc_root}/${_sc_profile}.XXXXXX\")\" || return",
  "replace": "  _sc_work=\"$(mktemp -d \"${_sc_root}/${_sc_profile}.XXXXXX\")\" || return 0",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-stage-status",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "  _sc_key=\"$(python3 -B \"${_sc_helper}\" \"${_sc_profile}\" --context --output \"${_sc_work}/scripts\")\" || return",
  "replace": "  _sc_key=\"$(python3 -B \"${_sc_helper}\" \"${_sc_profile}\" --context --output \"${_sc_work}/scripts\")\" || return 0",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-argv-boundaries",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "  _sc_args+=(--build-context \"hub-scripts=${_sc_work}/scripts\" --build-arg \"HUB_SCRIPTS_KEY=${_sc_key}\")",
  "replace": "  _sc_args=(--build-context \"hub-scripts=${_sc_work}/scripts\" --build-arg \"HUB_SCRIPTS_KEY=${_sc_key}\")",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-dry-no-staging",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "  if declare -F is_dry_run >/dev/null 2>&1 && is_dry_run; then",
  "replace": "  if false; then",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-dry-forwarding",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "    _sc_args+=(--build-context \"hub-scripts=<staged-${_sc_profile}>\" --build-arg \"HUB_SCRIPTS_KEY=<receipt-sha256>\")",
  "replace": "    :",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-legacy-loader",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "    *) return 0 ;;",
  "replace": "    *) : ;;",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-owner-import",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "source \"${_CROSS_STAGE_BUILD_SH_DIR}/context-management.sh\"",
  "replace": ":",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-dispatch-wiring",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "  append_script_closure_context build_args \"${dockerfile}\" || return",
  "replace": "  :",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-dispatch-status",
  "target": "linux/scripts/01-core/cross-stage-build.sh",
  "find": "  append_script_closure_context build_args \"${dockerfile}\" || return",
  "replace": "  append_script_closure_context build_args \"${dockerfile}\" || return 0",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-literal-profile",
  "target": "linux/scripts/script_closure.py",
  "find": "    return profiles[0]",
  "replace": "    return \"missing\"",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-ambiguous-profile",
  "target": "linux/scripts/script_closure.py",
  "find": "    if len(profiles) != 1:",
  "replace": "    if not profiles:",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-query-inputs",
  "target": "linux/scripts/script_closure.py",
  "find": "                read_profile(args.root, profile)",
  "replace": "                pass",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-query-output",
  "target": "linux/scripts/script_closure.py",
  "find": "                print(profile)",
  "replace": "                pass",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "copy-coverage.named-context-external",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "            bundles[\"hub-scripts\"] = {prefix + target: source for target, source in module.read_profile(SCRIPTS_SRC, profile).items()}",
  "replace": "            bundles[\"hub-scripts\"] = {}",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "copy-coverage.named-context-profile",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "        profile = module.profile_for(dockerfile)",
  "replace": "        profile = None",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "lib.script-context-required-cache-scan",
  "target": "linux/scripts/tests/test-sccache-s3-level.sh",
  "find": ")\" || { printf 'Dockerfile cache scan failed\\n' >&2; exit 1; }",
  "replace": ")\"",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Host-selected script contexts preserve actual selected bytes,fail before dispatch on required errors and retain caller arguments. These controls do not prove BuildKit cache reuse,compiled libraries,ELF ABI or finished GPU/image acceptance."
 },
 {
  "id": "copy-coverage.named-context-alias",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "                bundles[stage] = bundles[source]",
  "replace": "                pass",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "A real declared context FROM alias preserves its selected sources through actual copy/bind transports; this does not prove BuildKit cache reuse or compiled/image acceptance."
 },
 {
  "id": "lib.context-cache-base-format",
  "target": "linux/scripts/script_context_cache.py",
  "find": "re.fullmatch(r\"sha256:[0-9a-f]{64}\", digest)",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-base-index",
  "target": "linux/scripts/script_context_cache.py",
  "find": "any(row[\"digest\"] == digest for row in index[\"manifests\"])",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-base-bytes",
  "target": "linux/scripts/script_context_cache.py",
  "find": "fingerprint(blob) == digest.split(\":\")[1]",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-production-profile",
  "target": "linux/scripts/script_context_cache.py",
  "find": "profile_for(path) == profile",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-production-transport",
  "target": "linux/scripts/script_context_cache.py",
  "find": "all(text.count(fragment) == 1 for fragment in fragments)",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-one-consumer",
  "target": "linux/scripts/script_context_cache.py",
  "find": "len(headers) == 1",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-warm-step",
  "target": "linux/scripts/script_context_cache.py",
  "find": "len(cache_lines) == 1 and not markers",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-executed-step",
  "target": "linux/scripts/script_context_cache.py",
  "find": "not cache_lines and markers == [(nonce, digest)]",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-finished-step",
  "target": "linux/scripts/script_context_cache.py",
  "find": "re.search(r\"^#\" + step + r\" DONE \\d+(?:\\.\\d+)?s$\", log, re.MULTILINE)",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-artifact-files",
  "target": "linux/scripts/script_context_cache.py",
  "find": "sorted(item.name for item in directory.iterdir()) == [\"cache-proof.txt\"]",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-artifact-regular",
  "target": "linux/scripts/script_context_cache.py",
  "find": "not path.is_symlink() and path.is_file()",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-artifact-bytes",
  "target": "linux/scripts/script_context_cache.py",
  "find": "path.read_bytes() == f\"{nonce} {digest}\\n\".encode()",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-control-namespace",
  "target": "linux/scripts/script_context_cache.py",
  "find": "scripts / SELECTED in selected.values() and scripts / UNSELECTED not in selected.values()",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-raw-build-status",
  "target": "linux/scripts/script_context_cache.py",
  "find": "result.returncode == 0",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-warm-receipt",
  "target": "linux/scripts/script_context_cache.py",
  "find": "first[\"receipt_sha256\"] == warm[\"receipt_sha256\"]",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-warm-artifact",
  "target": "linux/scripts/script_context_cache.py",
  "find": "first[\"artifact_sha256\"] == warm[\"artifact_sha256\"]",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-selected-receipt",
  "target": "linux/scripts/script_context_cache.py",
  "find": "changed[\"receipt_sha256\"] != first[\"receipt_sha256\"]",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-selected-artifact",
  "target": "linux/scripts/script_context_cache.py",
  "find": "changed[\"artifact_sha256\"] != first[\"artifact_sha256\"]",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-original-inputs",
  "target": "linux/scripts/script_context_cache.py",
  "find": "all(fingerprint(path) == digest for path, digest in original.items())",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-clean-source",
  "target": "linux/scripts/script_context_cache.py",
  "find": "not git(args.source, \"status\", \"--porcelain\").strip(), \"Preserve a clean source input\"",
  "replace": "True, \"Preserve a clean source input\"",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-stable-base",
  "target": "linux/scripts/script_context_cache.py",
  "find": "base_identity(args.base_context, args.base_digest) == index",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-stable-source",
  "target": "linux/scripts/script_context_cache.py",
  "find": "git(args.source, \"rev-parse\", \"HEAD\").decode().strip() == head\n            and not git(args.source, \"status\", \"--porcelain\").strip()",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-fresh-output",
  "target": "linux/scripts/script_context_cache.py",
  "find": "    args.output.mkdir()",
  "replace": "    args.output.mkdir(exist_ok=True)",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-complete-profiles",
  "target": "linux/scripts/script_context_cache.py",
  "find": "for profile in PROFILES]",
  "replace": "for profile in PROFILES[:1]]",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-cold-nonce",
  "target": "linux/scripts/script_context_cache.py",
  "find": "\"CACHE_NONCE=\" + nonce",
  "replace": "\"OTHER_NONCE=\" + nonce",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-readonly-mount",
  "target": "linux/scripts/script_context_cache.py",
  "find": "source=/${HUB_SCRIPTS_KEY}/files,target=/opt/scripts,ro ",
  "replace": "source=/${HUB_SCRIPTS_KEY}/files,target=/opt/scripts ",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-copy-alias",
  "target": "linux/scripts/script_context_cache.py",
  "find": "        lines.append(\"FROM hub-scripts AS sdk-core-scripts\")",
  "replace": "        pass",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-failure-status",
  "target": "linux/scripts/script_context_cache.py",
  "find": "        return 2",
  "replace": "        return 0",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Selected-context cache evidence requires exact actual consumer step/byte/input verdicts for both production transports; fixture logs and fake solves do not prove real cache reuse,compiler statistics,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-size",
  "target": "linux/scripts/script_context_cache.py",
  "find": "type(descriptor[\"size\"]) is int and descriptor[\"size\"] > 0 and path.stat().st_size == descriptor[\"size\"]",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-hash",
  "target": "linux/scripts/script_context_cache.py",
  "find": "fingerprint(path) == digest.removeprefix(\"sha256:\")",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-native-root",
  "target": "linux/scripts/script_context_cache.py",
  "find": "len(matches) == 1, \"Expected one pinned OCI root descriptor\"",
  "replace": "True, \"Expected one pinned OCI root descriptor\"",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-native-child",
  "target": "linux/scripts/script_context_cache.py",
  "find": "len(matches) == 1, \"Expected one exact linux/amd64 child\"",
  "replace": "True, \"Expected one exact linux/amd64 child\"",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-manifest",
  "target": "linux/scripts/script_context_cache.py",
  "find": "descriptor[\"mediaType\"] == \"application/vnd.oci.image.manifest.v1+json\" and document.get(\"schemaVersion\") == 2",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-config-platform",
  "target": "linux/scripts/script_context_cache.py",
  "find": "config.get(\"architecture\") == \"amd64\" and config.get(\"os\") == \"linux\"",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-layers",
  "target": "linux/scripts/script_context_cache.py",
  "find": "isinstance(document[\"layers\"], list) and bool(document[\"layers\"])",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-original-stable",
  "target": "linux/scripts/script_context_cache.py",
  "find": "all(fingerprint(Path(path)) == digest for path, digest in native[\"source_blobs\"].items())",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-derived-stable",
  "target": "linux/scripts/script_context_cache.py",
  "find": "base_identity(solve_args.base_context, solve_args.base_digest) == native[\"index_sha256\"]",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-copied-bytes",
  "target": "linux/scripts/script_context_cache.py",
  "find": "        oci_blob(output, row)",
  "replace": "        pass",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs require unique amd64 selection,exact original and copied blobs and stable identities; synthetic layouts do not prove image execution,compiler reuse or GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-config-arch",
  "target": "linux/scripts/script_context_cache.py",
  "find": "config.get(\"architecture\") == \"amd64\"",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs retain exact platform and manifest selection; synthetic fixture metadata does not prove actual image execution or compiler/GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-config-os",
  "target": "linux/scripts/script_context_cache.py",
  "find": "config.get(\"os\") == \"linux\"",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs retain exact platform and manifest selection; synthetic fixture metadata does not prove actual image execution or compiler/GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-manifest-version",
  "target": "linux/scripts/script_context_cache.py",
  "find": "document.get(\"schemaVersion\") == 2",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs retain exact platform and manifest selection; synthetic fixture metadata does not prove actual image execution or compiler/GPU acceptance."
 },
 {
  "id": "lib.context-cache-oci-child-selection",
  "target": "linux/scripts/script_context_cache.py",
  "find": "row.get(\"platform\") == {\"os\": \"linux\", \"architecture\": \"amd64\"}",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Native cache-probe OCI inputs retain exact platform and manifest selection; synthetic fixture metadata does not prove actual image execution or compiler/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-full-digest",
  "target": "linux/scripts/script_closure.py",
  "find": "    key = hashlib.sha256(receipt_bytes).hexdigest()",
  "replace": "    key = hashlib.sha256(receipt_bytes).hexdigest()[:16]",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-addressed-tree",
  "target": "linux/scripts/script_closure.py",
  "find": "    tree = output / key / \"files\" if addressed else output",
  "replace": "    tree = output / \"wrong\" / \"files\" if addressed else output",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-context-mode",
  "target": "linux/scripts/script_closure.py",
  "find": "    return _stage(root, profile, output, True)",
  "replace": "    return _stage(root, profile, output, False)",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-cli-mode",
  "target": "linux/scripts/script_closure.py",
  "find": "        if args.context:",
  "replace": "        if False:",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-query-exclusive",
  "target": "linux/scripts/script_closure.py",
  "find": "            if args.profile is not None or args.context:",
  "replace": "            if args.profile is not None:",
  "test": "python3 linux/scripts/tests/script_closure_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-host-context",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": " --context --output \"${_sc_work}/scripts\"",
  "replace": " --output \"${_sc_work}/scripts\"",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-host-key",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "  [[ \"${_sc_key}\" =~ ^[0-9a-f]{64}$ ]] || {",
  "replace": "  [[ 1 = 1 ]] || {",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-key-forwarding",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": " --build-arg \"HUB_SCRIPTS_KEY=${_sc_key}\"",
  "replace": "",
  "test": "python3 linux/scripts/tests/script_context_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "copy-coverage.context-key-arg",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "            if len(re.findall(r\"^ARG HUB_SCRIPTS_KEY$\", text, re.MULTILINE)) != 1:",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "copy-coverage.context-key-selector",
  "target": "linux/scripts/verify_script_copy_coverage.py",
  "find": "            prefix = \"/${HUB_SCRIPTS_KEY}/files/\"",
  "replace": "            prefix = \"/\"",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-sdk-key",
  "target": "linux/Dockerfile.sdk",
  "find": "ARG HUB_SCRIPTS_KEY\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.script-namespace-amd-key",
  "target": "linux/Dockerfile.amd",
  "find": "ARG HUB_SCRIPTS_KEY\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-script-copy-coverage.sh",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-key-binding",
  "target": "linux/scripts/script_context_cache.py",
  "find": "digest == key, \"Staged context key differs",
  "replace": "True, \"Staged context key differs",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-key-argument",
  "target": "linux/scripts/script_context_cache.py",
  "find": "\"HUB_SCRIPTS_KEY=\" + key",
  "replace": "\"OTHER_SCRIPTS_KEY=\" + key",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-same-size-control",
  "target": "linux/scripts/script_context_cache.py",
  "find": "after != before and len(after) == len(before)",
  "replace": "True",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.context-cache-raw-status-record",
  "target": "linux/scripts/script_context_cache.py",
  "find": "    save(output / \"command-status.json\", {\"exit_status\": result.returncode})",
  "replace": "    pass",
  "test": "python3 linux/scripts/tests/script_context_cache_tests.py",
  "why": "Full-SHA selected-file namespaces prevent equal-stat stale transfer; host arguments,production selectors and exact byte/step verdicts remain mandatory. Synthetic fixtures do not prove real BuildKit reuse,vendor builds or final image/GPU acceptance."
 },
 {
  "id": "lib.cache-readiness-integer-activity",
  "target": "linux/scripts/02-toolchain/probe-sccache.sh",
  "find": "/^([Cc]ache writes?|Cache hits|Compile requests executed)[[:space:]][[:space:]]+[0-9]+[[:space:]]*$/",
  "replace": "/[Cc]ache write|Cache hits|Compile requests executed/",
  "test": "bash linux/scripts/tests/test-sccache-probe-stats.sh",
  "why": "Cache activity uses only aggregate integer counters and retains raw collection failures. Synthetic rows and parser fixtures do not prove real compiler reuse,S3,compiler-stage or final image/GPU acceptance."
 },
 {
  "id": "lib.cache-readiness-language-subtotals",
  "target": "linux/scripts/02-toolchain/probe-sccache.sh",
  "find": "[Cc]ache writes?|Cache hits|Compile requests executed",
  "replace": "[Cc]ache writes?|Cache hits.*|Compile requests executed",
  "test": "bash linux/scripts/tests/test-sccache-probe-stats.sh",
  "why": "Cache activity uses only aggregate integer counters and retains raw collection failures. Synthetic rows and parser fixtures do not prove real compiler reuse,S3,compiler-stage or final image/GPU acceptance."
 },
 {
  "id": "lib.cache-readiness-integer-values",
  "target": "linux/scripts/02-toolchain/probe-sccache.sh",
  "find": "[[:space:]][[:space:]]+[0-9]+[[:space:]]*$/",
  "replace": "[[:space:]][[:space:]]+.+$/",
  "test": "bash linux/scripts/tests/test-sccache-probe-stats.sh",
  "why": "Cache activity uses only aggregate integer counters and retains raw collection failures. Synthetic rows and parser fixtures do not prove real compiler reuse,S3,compiler-stage or final image/GPU acceptance."
 },
 {
  "id": "probe.wasm-webgpu-runtime-binding",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "if (proof.get(\"schema_version\") != 1 or proof.get(\"flavor\") != flavor\n            or proof.get(\"product\") != product or proof.get(\"source\") != source\n            or proof.get(\"recipe\") != recipe(digest)):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "A factory receipt binds its source, flavor, exact products and current recipe."
 },
 {
  "id": "probe.wasm-webgpu-child-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "if (type(proof.get(\"returncode\")) is not int or proof[\"returncode\"] != 0\n            or proof.get(\"timed_out\") is not False or proof.get(\"unchanged_inputs\") is not True\n            or not re.fullmatch(r\"[0-9a-f]{64}\", proof.get(\"node_sha256\", \"\"))):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "A false/failed status, timeout or changed inputs cannot be a runtime pass."
 },
 {
  "id": "probe.wasm-webgpu-output-bound",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "if not isinstance(stdout, str) or not isinstance(stderr, str) or len(stdout) + len(stderr) > 2 * 1024 * 1024:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "Unbounded or malformed child output is not a valid receipt."
 },
 {
  "id": "probe.wasm-webgpu-one-c-sentinel",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "len(success) != 1",
  "replace": "not success",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "Two C success markers cannot be accepted as one invocation."
 },
 {
  "id": "probe.wasm-webgpu-inner-failure",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "any(marker in stdout + stderr for marker in failed)",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "An inner failure remains fatal even beside a successful C marker."
 },
 {
  "id": "probe.wasm-webgpu-c-mode-version",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "if not match or (re.fullmatch(r\"v?[0-9]+\\.[0-9]+\\.[0-9]+\", source_ref)\n                     and match[2] != source_ref.removeprefix(\"v\")):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "C output must identify the requested enabled mode and pinned version."
 },
 {
  "id": "probe.wasm-webgpu-one-node-identity",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "if len(metadata) != 1:",
  "replace": "if not metadata:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "Duplicate runtime identities cannot be normalized to the first line."
 },
 {
  "id": "probe.wasm-webgpu-node-capability",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "if (not re.fullmatch(r\"v[0-9]+\\.[0-9]+\\.[0-9]+\", node[\"version\"])\n            or type(node[\"jspiSupported\"]) is not bool or (flavor == \"jspi\" and not node[\"jspiSupported\"])):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "JSPI requires a real supported Node capability and typed runtime identity."
 },
 {
  "id": "probe.wasm-webgpu-bounded-child",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "timeout=120",
  "replace": "timeout=1200",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "The child has its own bounded deadline rather than relying on the outer source unit."
 },
 {
  "id": "probe.wasm-webgpu-unchanged-inputs",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "return before == [digest(path) for path in paths] and before_recipe == recipe(digest)",
  "replace": "return True",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "Changes during execution invalidate the raw proof."
 },
 {
  "id": "probe.wasm-webgpu-recipe-before-child",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-runtime.py",
  "find": "\"recipe\": before_recipe",
  "replace": "\"recipe\": {}",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "An executed proof must retain its complete source-owned runtime recipe."
 },
 {
  "id": "probe.wasm-webgpu-linked-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (enabled != 0 && enabled != 1) return error(\"mode must be zero or one\");",
  "replace": "if (enabled < 0) return error(\"mode must be zero or one\");",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The linked entry refuses invalid enabled values instead of treating any nonzero input as ON."
 },
 {
  "id": "probe.wasm-webgpu-flush-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/probe.c",
  "find": "if (!failed && fflush(stdout) != 0) return error(\"stdout flush failed\");",
  "replace": "if (!failed) (void)fflush(stdout);",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "A failed real flush cannot be hidden behind a buffered success marker."
 },
 {
  "id": "probe.wasm-webgpu-deferred-target",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/wasm.cmake",
  "find": "cmake_language(DEFER CALL ant_ort_webgpu_factory_probe)",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "The owning target must actually receive the shared C probe after it is declared."
 },
 {
  "id": "probe.wasm-webgpu-hook-idempotent",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/wasm.cmake",
  "find": "include_guard(GLOBAL)",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "An operator who already includes the hook cannot attach duplicate probe sources."
 },
 {
  "id": "probe.wasm-webgpu-required-target",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/wasm.cmake",
  "find": "if(NOT TARGET onnxruntime_webassembly)",
  "replace": "if(FALSE)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "A missing owning target fails with its explicit configuration diagnostic."
 },
 {
  "id": "probe.wasm-webgpu-required-header",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/wasm.cmake",
  "find": "if(NOT EXISTS \"${header}\")",
  "replace": "if(FALSE)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "A missing owning header fails before generating a misleading build tree."
 },
 {
  "id": "probe.wasm-webgpu-target-system",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/wasm.cmake",
  "find": "NOT\n     CMAKE_SYSTEM_NAME\n     STREQUAL\n     \"Emscripten\"",
  "replace": "FALSE",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "The hook refuses a foreign target or legacy WebGPU configuration."
 },
 {
  "id": "probe.wasm-webgpu-webgpu-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/wasm.cmake",
  "find": "OR NOT onnxruntime_USE_WEBGPU",
  "replace": "OR FALSE",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "The hook refuses a foreign target or legacy WebGPU configuration."
 },
 {
  "id": "probe.wasm-webgpu-adapter-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/wasm.cmake",
  "find": "OR NOT onnxruntime_USE_EP_API_ADAPTERS",
  "replace": "OR FALSE",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "The hook refuses a foreign target or legacy WebGPU configuration."
 },
 {
  "id": "probe.wasm-webgpu-static-mode",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/wasm.cmake",
  "find": "OR NOT onnxruntime_WEBGPU_STATIC_PLUGIN",
  "replace": "OR FALSE",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "The hook refuses a foreign target or legacy WebGPU configuration."
 },
 {
  "id": "probe.wasm-webgpu-integrated-dawn",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/wasm.cmake",
  "find": "OR onnxruntime_USE_EXTERNAL_DAWN",
  "replace": "OR FALSE",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "The hook refuses a foreign target or legacy WebGPU configuration."
 },
 {
  "id": "probe.wasm-webgpu-driver-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/run-wasm.mjs",
  "find": "if (status !== 0)",
  "replace": "if (false)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "Numeric zero is required; a nonzero or string status cannot pass the driver."
 },
 {
  "id": "probe.wasm-webgpu-driver-enabled-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/run-wasm.mjs",
  "find": "module._OrtWebGpuFactoryProbe(1)",
  "replace": "module._OrtWebGpuFactoryProbe(0)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "The real driver invokes the enabled-factory control."
 },
 {
  "id": "probe.wasm-webgpu-driver-jspi-capability",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/run-wasm.mjs",
  "find": "if (flavor === 'jspi' && !jspiSupported)",
  "replace": "if (false)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-runtime.sh",
  "why": "A Node runtime without JSPI must refuse before importing the loader."
 },
 {
  "id": "probe.wasm-webgpu-record-validates-child",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "RUNTIME[\"validate\"](runtime, args.flavor, product, source, file_digest)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A failed recorded Node child cannot publish a successful flavor."
 },
 {
  "id": "probe.wasm-webgpu-preserve-raw-child",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "BUILD[\"write_receipt\"](args.prefix, runtime, filename=runtime_name)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Raw child status/output must survive before a semantic failure is returned."
 },
 {
  "id": "probe.wasm-webgpu-verify-runtime-bytes",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if phase[\"runtime\"] != {\"path\": runtime_path.name, \"sha256\": file_digest(runtime_path)}:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Runtime receipt bytes remain bound even when the JSON semantics are unchanged."
 },
 {
  "id": "probe.wasm-webgpu-verify-runtime-verdict",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "RUNTIME[\"validate\"](json.loads(runtime_path.read_text()), flavor, product, source_identity(args), file_digest)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A self-consistent hash cannot turn a failed factory result into acceptance."
 },
 {
  "id": "probe.wasm-webgpu-loader-digest",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "\"loader\": {\"path\": loader.name, \"sha256\": loader_digest}",
  "replace": "\"loader\": {\"path\": loader.name, \"sha256\": \"0\" * 64}",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "The compiled receipt binds the exact MJS loader as well as the WASM bytes."
 },
 {
  "id": "probe.wasm-webgpu-replay-both",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "for flavor in FLAVORS:",
  "replace": "for flavor in FLAVORS[:1]:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A fresh runtime replay must actually execute both enabled flavors."
 },
 {
  "id": "probe.wasm-webgpu-complete-recipe",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "*(\"lib/\" + name for name in RUNTIME[\"COMPANIONS\"])",
  "replace": "*()",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "The shared cache fingerprint includes all five compilation/runtime companions."
 },
 {
  "id": "probe.wasm-webgpu-build-hook-forwarding",
  "target": "linux/scripts/03-media/build/onnxruntime/build/40-build-wasm.sh",
  "find": "\"CMAKE_PROJECT_TOP_LEVEL_INCLUDES=${CMAKE_PROJECT_TOP_LEVEL_INCLUDES:+${CMAKE_PROJECT_TOP_LEVEL_INCLUDES};}${SCRIPT_DIR}/lib/webgpu-factory-probe/wasm.cmake\"",
  "replace": "\"CMAKE_PROJECT_TOP_LEVEL_INCLUDES=${SCRIPT_DIR}/lib/webgpu-factory-probe/wasm.cmake\"",
  "test": "bash linux/scripts/tests/test-onnx-wasm-passes.sh",
  "why": "The required factory hook retains the operator list and path boundaries."
 },
 {
  "id": "probe.wasm-webgpu-original-mit-text",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/LICENSE",
  "find": "MIT License",
  "replace": "Foreign License",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "The copied probe notice must retain the original Hub text rather than a replacement notice."
 },
 {
  "id": "probe.wasm-webgpu-mit-identity",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if digest != file_digest(Path(__file__).parent / \"webgpu-factory-probe/LICENSE\"):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "An altered existing notice must fail instead of being normalized or accepted."
 },
 {
  "id": "probe.wasm-webgpu-mit-stage-call",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if install_notice:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A compiled product cannot omit the original notice during recording."
 },
 {
  "id": "probe.wasm-webgpu-mit-dangling-link",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "if target.exists() or target.is_symlink():",
  "replace": "if target.exists():",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "A dangling destination link must fail before writing outside the product directory."
 },
 {
  "id": "probe.wasm-webgpu-mit-product-binding",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "\"probe_license\": probe_license(prefix)",
  "replace": "\"probe_license\": {}",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-wasm-proof.sh",
  "why": "Both compiled flavor receipts bind the actual original notice bytes."
 },
 {
  "id": "probe.wasm-webgpu-native-mit-install",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/webgpu-factory-probe/CMakeLists.txt",
  "find": "install(FILES LICENSE DESTINATION share/licenses/ort-webgpu-factory-probe)",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-native.sh",
  "why": "The shared native probe installs the same original notice beside its binary."
 },
 {
  "id": "probe.compiler-defaults.native-tree",
  "target": "linux/Dockerfile.toolchain",
  "find": "bash /tmp/register-llvm-alternatives.sh \"/opt/llvm-target-${TARGETARCH}\"",
  "replace": "bash /tmp/register-llvm-alternatives.sh \"/usr/lib/llvm-23\"",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "The native stage must select the unified source install instead of apt's same-channel compiler."
 },
 {
  "id": "probe.compiler-defaults.complete-install",
  "target": "linux/scripts/02-toolchain/register-llvm-alternatives.sh",
  "find": "[ -x \"${prefix}/bin/${name}\" ] ||",
  "replace": ": ||",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "All required source tools must exist before any alternatives update."
 },
 {
  "id": "probe.compiler-defaults.manual-selection",
  "target": "linux/scripts/02-toolchain/register-llvm-alternatives.sh",
  "find": "  update-alternatives --set \"${name}\" \"${prefix}/bin/${name}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "An installed high-priority distro alternative must not remain selected."
 },
 {
  "id": "probe.compiler-defaults.raw-update-status",
  "target": "linux/scripts/02-toolchain/register-llvm-alternatives.sh",
  "find": "  update-alternatives --set \"${name}\" \"${prefix}/bin/${name}\"",
  "replace": "  update-alternatives --set \"${name}\" \"${prefix}/bin/${name}\" || true",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "A failed alternative update cannot report a successful compiler stage."
 },
 {
  "id": "probe.compiler-defaults.all-llvm-tools",
  "target": "linux/scripts/02-toolchain/register-llvm-alternatives.sh",
  "find": "tools=(clang clang++ llvm-ar llvm-ranlib)",
  "replace": "tools=(clang clang++ llvm-ar)",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "The archive indexer must come from the same source tree as the compiler."
 },
 {
  "id": "probe.compiler-defaults.smoke-exact-patch",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "[ \"${BASH_REMATCH[2]}\" = \"${expected}\" ]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "A newer distro patch does not satisfy the selected source pin."
 },
 {
  "id": "probe.compiler-defaults.smoke-child-status",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "if banner=\"$(\"${binary}\" --version 2>&1)\"; then",
  "replace": "if banner=\"$(\"${binary}\" --version 2>&1)\" || true; then",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "A failing executable cannot pass by printing the expected version."
 },
 {
  "id": "probe.compiler-defaults.smoke-first-line",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "first=\"${banner%%$'\\n'*}\"",
  "replace": "first=\"${banner}\"",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "A later valid token cannot replace a missing compiler banner."
 },
 {
  "id": "probe.compiler-defaults.smoke-cxx",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "  check_clang_version clang++ \"${LLVM_RELEASE}\" \"clang++\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "Both default Clang languages require exact patch checks."
 },
 {
  "id": "probe.compiler-defaults.gnu-pin",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    if version != expected:\n        raise ValueError(f\"GCC full version {version!r} differs from {expected}\")",
  "replace": "    if False:\n        raise ValueError(f\"GCC full version {version!r} differs from {expected}\")",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Every GNU alias must match the complete selected pin."
 },
 {
  "id": "probe.compiler-defaults.gnu-target",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    if not machine.startswith(\"x86_64-\") or not machine.endswith(\"-linux-gnu\"):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "An amd64 response check must reject a foreign compiler."
 },
 {
  "id": "probe.compiler-defaults.gnu-defaults",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "        if values != [wanted]:",
  "replace": "        if not values:",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Nonempty defaults are insufficient when ISA or tuning differs."
 },
 {
  "id": "probe.compiler-defaults.gnu-macros",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "        if re.findall(rf\"^#define __{name}__ (\\S+)$\", macros, re.MULTILINE) != [\"1\"]:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "All three v3 macros must be exactly one literal one."
 },
 {
  "id": "probe.compiler-defaults.llvm-pin",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    if not match or match[1] != expected:",
  "replace": "    if not match:",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "The external installed-image probe independently rejects wrong LLVM patch versions."
 },
 {
  "id": "probe.compiler-defaults.child-status",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "or result.get(\"timed_out\") is not False):",
  "replace": "or result.get(\"timed_out\") is not False) and False:",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Nonzero and timed-out compiler children remain failed evidence."
 },
 {
  "id": "probe.compiler-defaults.bounded-output",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "or len(stdout) + len(stderr) > 2 * 1024 * 1024:",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Oversized child evidence is refused rather than accepted as a response."
 },
 {
  "id": "probe.compiler-defaults.complete-aliases",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    if set(payload[\"tools\"]) != {*GNU, *LLVM}:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Missing and unexpected ordinary aliases cannot produce a complete receipt."
 },
 {
  "id": "probe.compiler-defaults.timeout",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "check=False, timeout=20)",
  "replace": "check=False, timeout=None)",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Each compiler child has its own finite execution bound."
 },
 {
  "id": "probe.compiler-defaults.failed-cli-status",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "        status = 1",
  "replace": "        status = 0",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "A failed semantic receipt must also return a failed process status."
 },
 {
  "id": "probe.compiler-defaults.installer-fixture-mode",
  "target": "linux/scripts/tests/verified_installer_tests.py",
  "find": "            env=dict(os.environ, BUILD_MODE=\"native\"),",
  "replace": "            env=dict(os.environ),",
  "test": "bash linux/scripts/tests/test-verified-installers.sh",
  "why": "Cold installer imports own their build mode instead of failing early on an inherited cross image without CROSS_TARGETS."
 },
 {
  "id": "probe.native-llvm-path",
  "target": "linux/Dockerfile.toolchain",
  "find": "PATH=/opt/python/.venv/bin:/opt/gcc-${GCC_VERSION}/bin:/opt/llvm-target-${TARGETARCH}/bin:${PATH}",
  "replace": "PATH=/opt/python/.venv/bin:/opt/gcc-${GCC_VERSION}/bin:${PATH}",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "Every source LLVM utility must outrank distro aliases while GNU keeps its priority."
 },
 {
  "id": "probe.native-llvm-copied-probe",
  "target": "linux/Dockerfile.toolchain",
  "find": "COPY --chmod=755 linux/scripts/06-packaging/probe-compiler-defaults.py \\\n",
  "replace": "COPY --chmod=755 ",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "The baked smoke must carry the exact native-selection probe it invokes."
 },
 {
  "id": "probe.native-llvm-smoke-call",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "  check_native_llvm_tools\n  check_rust",
  "replace": "  :\n  check_rust",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "The final compiler image must actually execute the broad native tool gate."
 },
 {
  "id": "probe.native-llvm-smoke-status",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "--native-llvm-prefix \"/opt/llvm-target-$(smoke_host_arch)\"; then",
  "replace": "--native-llvm-prefix \"/opt/llvm-target-$(smoke_host_arch)\" || true; then",
  "test": "bash linux/scripts/tests/test-llvm-alternatives.sh",
  "why": "A failed native inventory must increment the outer smoke failure count."
 },
 {
  "id": "probe.native-llvm-executables",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "path.is_file() and os.access(path, os.X_OK) and path.name not in GNU",
  "replace": "path.is_file() and path.name not in GNU",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Nonexecutable source data is not a PATH-selected command."
 },
 {
  "id": "probe.native-llvm-gnu-aliases",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": " and path.name not in GNU:",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "GNU aliases retain their independent default-compiler policy."
 },
 {
  "id": "probe.native-llvm-scope",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "or payload[\"prefix\"] != str(prefix.resolve()) or payload[\"expected\"] != expected):",
  "replace": "or payload[\"prefix\"] != str(prefix.resolve()) or payload[\"expected\"] != expected) and False:",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "A receipt from another prefix or pin cannot qualify this source tree."
 },
 {
  "id": "probe.native-llvm-required-tools",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "if not required.issubset(names) or len(names) != len(set(names)):",
  "replace": "if len(names) != len(set(names)):",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "A missing required compiler, linker or tablegen must fail the inventory."
 },
 {
  "id": "probe.native-llvm-unique-tools",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "if not required.issubset(names) or len(names) != len(set(names)):",
  "replace": "if not required.issubset(names):",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Duplicated tool rows cannot manufacture a complete inventory."
 },
 {
  "id": "probe.native-llvm-owned-source",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "not Path(row[\"source\"]).is_relative_to(prefix.resolve())\n                or row[\"selected\"] != row[\"source\"]",
  "replace": "False\n                or row[\"selected\"] != row[\"source\"]",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "An escaped source symlink cannot make a matching distro path valid."
 },
 {
  "id": "probe.native-llvm-selected-source",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "or row[\"selected\"] != row[\"source\"]):",
  "replace": "or False):",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Missing or distro-selected utilities must fail even when all source files exist."
 },
 {
  "id": "probe.native-llvm-config-pin",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    if version != expected:\n        raise ValueError(f\"native llvm-config",
  "replace": "    if False:\n        raise ValueError(f\"native llvm-config",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "The default llvm-config must report the full selected source patch."
 },
 {
  "id": "probe.native-llvm-config-status",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    version = output(payload[\"version\"])",
  "replace": "    version = str(payload[\"version\"][\"stdout\"]).strip()",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "A failed llvm-config cannot pass by printing the expected version."
 },
 {
  "id": "probe.native-llvm-mode-scope",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "if args.gcc_version or not args.native_llvm_prefix.is_absolute():",
  "replace": "if not args.native_llvm_prefix.is_absolute():",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "A native LLVM-only receipt cannot silently accept the GNU-mode pin."
 },
 {
  "id": "probe.llvm-loader-write-status",
  "target": "linux/scripts/06-packaging/llvm-loader-path.sh",
  "find": " > \"${config}\" || return $?",
  "replace": " > \"${config}\"",
  "test": "bash linux/scripts/tests/test-llvm-loader-path.sh",
  "why": "A failed conf write cannot proceed to a successful ldconfig under conditional callers."
 },
 {
  "id": "probe.llvm-loader-cache-status",
  "target": "linux/scripts/06-packaging/llvm-loader-path.sh",
  "find": "  ldconfig",
  "replace": "  ldconfig || true",
  "test": "bash linux/scripts/tests/test-llvm-loader-path.sh",
  "why": "A failed loader-cache update must retain its raw failure."
 },
 {
  "id": "probe.llvm-loader-native-publish",
  "target": "linux/Dockerfile.toolchain",
  "find": "    publish_llvm_target_ld_path \"/opt/llvm-target-${TARGETARCH}\" /etc/ld.so.conf.d/000-llvm-native.conf;",
  "replace": "    :;",
  "test": "bash linux/scripts/tests/test-llvm-loader-path.sh",
  "why": "The native compiler must publish its library directory before the baked smoke."
 },
 {
  "id": "probe.llvm-loader-native-companion",
  "target": "linux/Dockerfile.toolchain",
  "find": "                 linux/scripts/06-packaging/llvm-loader-path.sh \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-llvm-loader-path.sh",
  "why": "The late native loader publisher must be carried beside its caller."
 },
 {
  "id": "probe.llvm-loader-package-companion",
  "target": "linux/Dockerfile.package",
  "find": "linux/scripts/06-packaging/copy-media-payloads.sh linux/scripts/06-packaging/llvm-loader-path.sh",
  "replace": "linux/scripts/06-packaging/copy-media-payloads.sh",
  "test": "bash linux/scripts/tests/test-llvm-loader-path.sh",
  "why": "The isolated package payload entry imports the same shared publisher."
 },
 {
  "id": "probe.llvm-loader-required-export",
  "target": "linux/scripts/06-packaging/copy-media-payloads.sh",
  "find": "declare -F publish_llvm_target_ld_path >/dev/null || {",
  "replace": ": || {",
  "test": "bash linux/scripts/tests/test-log-fallbacks.sh",
  "why": "An empty required companion must fail before payload or logger use."
 },
 {
  "id": "probe.llvm-loader-first-winner",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    match = re.search(rf\"^\\s*{re.escape(name)}\\s+\\([^)]+\\)\\s+=>\\s+(.+)$\", text, re.MULTILINE)",
  "replace": "    match = re.search(rf\"^\\s*{re.escape(name)}\\s+\\([^)]+\\)\\s+=>\\s+(.+)$\", chr(10).join(reversed(text.splitlines())), re.MULTILINE)",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "The first cache entry wins; a later source path cannot hide a distro-first lookup."
 },
 {
  "id": "probe.llvm-loader-selection-verdict",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "or row[\"cache_winner\"] != row[\"source\"]):",
  "replace": "or False):",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "A distro or missing loader-cache winner must fail native admission."
 },
 {
  "id": "probe.llvm-loader-file-present",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "row[\"source_exists\"] is not True or",
  "replace": "False or",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "A missing source library cannot qualify through a stale cache row."
 },
 {
  "id": "probe.llvm-loader-owned-library",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "not Path(row[\"source\"]).is_relative_to(prefix.resolve())\n                or row[\"cache_winner\"]",
  "replace": "False\n                or row[\"cache_winner\"]",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Matching distro source/cache paths cannot stand in for the source prefix."
 },
 {
  "id": "probe.llvm-loader-shared-names",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    if (not names or len(names) != len(set(names))",
  "replace": "    if (False or len(names) != len(set(names))",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "An empty shared-library list is a vacuous cache pass."
 },
 {
  "id": "probe.llvm-loader-library-inventory",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    if [row[\"name\"] for row in payload[\"libraries\"]] != names:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "The source-library inventory must match the reported shared names."
 },
 {
  "id": "probe.llvm-loader-cache-raw-status",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    cache = output(payload[\"loader_cache\"])",
  "replace": "    cache = payload[\"loader_cache\"][\"stdout\"]",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "A failed ldconfig child cannot qualify a previously recorded winner."
 },
 {
  "id": "probe.llvm-loader-shared-raw-status",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "    names = output(payload[\"shared_names\"]).split()",
  "replace": "    names = payload[\"shared_names\"][\"stdout\"].split()",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "A failed shared-name child cannot qualify previously printed names."
 },
 {
  "id": "probe.llvm-loader-gate-called",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "**native_library_facts(payload, prefix)",
  "replace": "**{}",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Native executable/version success must also invoke the shared-library gate."
 },
 {
  "id": "probe.llvm-loader-dynamic-status",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "parse_llvm_soname(output(row[\"dynamic\"]))",
  "replace": "parse_llvm_soname(row[\"dynamic\"][\"stdout\"])",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Failed readelf output cannot qualify a stale ELF SONAME."
 },
 {
  "id": "probe.llvm-loader-soname-used",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "llvm_cache_winner(cache[\"stdout\"], soname) if soname else None",
  "replace": "llvm_cache_winner(cache[\"stdout\"], name) if soname else None",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "The ELF SONAME, rather than llvm-config linker alias, selects the cache entry."
 },
 {
  "id": "probe.llvm-loader-unique-soname",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "return values[0] if len(values) == 1 else None",
  "replace": "return values[0] if values else None",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Ambiguous ELF SONAME output must fail instead of selecting its first entry."
 },
 {
  "id": "probe.llvm-loader-soname-bound",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "or row[\"soname\"] != soname",
  "replace": "or False",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "The recorded SONAME must match its raw ELF dynamic report."
 },
 {
  "id": "probe.llvm-loader-cache-record",
  "target": "linux/scripts/06-packaging/probe-compiler-defaults.py",
  "find": "row[\"cache_winner\"] != llvm_cache_winner(cache, soname)",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-compiler-defaults.sh",
  "why": "Raw loader-cache output must substantiate the recorded winning source path."
 },
 {
  "id": "llvm-target.selected-prefix-alias",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "    ln -s \"${prefix}\" \"${prefix}-${arch}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-llvm-target-aliases.sh",
  "why": "Native SDK PATH, alternatives, loader entries and external CMake references still name the selected architecture prefix."
 },
 {
  "id": "llvm-target.foreign-build-host-retained",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "[ \"${entry}\" = \"${prefix}-${host_arch}\" ]",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-llvm-target-aliases.sh",
  "why": "Moving a foreign target must retain the native compiler and library tree used by the SDK builder."
 },
 {
  "id": "llvm-target.unselected-prefix-cleanup",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "        rm -rf \"${entry}\" || return $?",
  "replace": "        :",
  "test": "bash linux/scripts/tests/test-llvm-target-aliases.sh",
  "why": "The native copied tree must become an alias and unused architecture prefixes must not survive materialization."
 },
 {
  "id": "llvm-target.dangling-prefix-cleanup",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "[ -e \"${entry}\" ] || [ -L \"${entry}\" ] || continue",
  "replace": "[ -e \"${entry}\" ] || continue",
  "test": "bash linux/scripts/tests/test-llvm-target-aliases.sh",
  "why": "A dangling selected prefix must be removed before its valid replacement alias is created."
 },
 {
  "id": "llvm-target.prefix-cleanup-raw-failure",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "        rm -rf \"${entry}\" || return $?",
  "replace": "        rm -rf \"${entry}\"",
  "test": "bash linux/scripts/tests/test-llvm-target-aliases.sh",
  "why": "Conditional callers must receive the original cleanup failure before any alias creation is attempted."
 },
 {
  "id": "llvm-target.prefix-alias-raw-failure",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "    ln -s \"${prefix}\" \"${prefix}-${arch}\"",
  "replace": "    ln -s \"${prefix}\" \"${prefix}-${arch}\" || true",
  "test": "bash linux/scripts/tests/test-llvm-target-aliases.sh",
  "why": "A failed alias cannot pass the SDK materializer under an outer conditional call."
 },
 {
  "id": "llvm-target.prefix-preservation-wired",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "_llvm_target_preserve_prefixes /opt/llvm-target \"${_arch}\" \"${_host_arch}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-llvm-target-aliases.sh",
  "why": "The SDK entry point must actually preserve prefixes after target materialization."
 },
 {
  "id": "llvm-target.prefix-host-is-detected",
  "target": "linux/scripts/02-toolchain/materialize-llvm-target.sh",
  "find": "local prefix=\"$1\" arch=\"$2\" host_arch=\"$3\" entry",
  "replace": "local prefix=\"$1\" arch=\"$2\" host_arch=amd64 entry",
  "test": "bash linux/scripts/tests/test-llvm-target-aliases.sh",
  "why": "ARM64 and RISC-V builders require their own native trees rather than a literal amd64 retention rule."
 },
 {
  "id": "compiler-llvm-tools.source-prefix-first",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "if [ -e \"${source_prefix}\" ] || [ -L \"${source_prefix}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "An installed pinned source compiler must precede the versioned apt bootstrap."
 },
 {
  "id": "compiler-llvm-tools.incomplete-source-refuses",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "    [ -x \"${candidate}\" ] || return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A partial native source tree cannot select apt or silently succeed without a compiler."
 },
 {
  "id": "compiler-llvm-tools.source-prefix-is-native",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "source_prefix=\"/opt/llvm-target-$(build_arch_oci)\" || return $?",
  "replace": "source_prefix=\"/opt/llvm-target-amd64\"",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "ARM64 and RISC-V build hosts must select their own source compiler prefix."
 },
 {
  "id": "compiler-llvm-tools.host-lookup-raw-status",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "source_prefix=\"/opt/llvm-target-$(build_arch_oci)\" || return $?",
  "replace": "source_prefix=\"/opt/llvm-target-$(build_arch_oci)\"",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "Failed host discovery must not fall through to a bootstrap selection."
 },
 {
  "id": "compiler-llvm-tools.dangling-source-refuses",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "[ -e \"${source_prefix}\" ] || [ -L \"${source_prefix}\" ]",
  "replace": "[ -e \"${source_prefix}\" ]",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A dangling source prefix is incomplete rather than permission to borrow apt."
 },
 {
  "id": "compiler-llvm-tools.native-backend-union",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "if [ \"${target}\" != \"${host}\" ]; then",
  "replace": "if true; then",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "The native host Clang must emit every configured cross target, not only its own machine."
 },
 {
  "id": "compiler-llvm-tools.foreign-backend-stays-narrow",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "if [ \"${target}\" != \"${host}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "Foreign target-native trees keep their own backend instead of rebuilding all host targets."
 },
 {
  "id": "compiler-llvm-tools.native-backends-include-host",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "for target in \"${host}\" \"${backend_targets[@]}\"; do",
  "replace": "for target in \"${backend_targets[@]}\"; do",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A cross-only target list must still retain the build host backend."
 },
 {
  "id": "compiler-llvm-tools.native-backends-deduplicate",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "*\";${backend};\"*) ;;",
  "replace": "__never__) ;;",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "Host inclusion and repeated architecture selections must not duplicate CMake backend names."
 },
 {
  "id": "compiler-llvm-tools.backend-host-raw-status",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "host=\"$(build_arch_oci)\" || return $?",
  "replace": "host=\"$(build_arch_oci)\"",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A failed build-host query cannot quietly change native backend selection to the foreign path."
 },
 {
  "id": "compiler-llvm-tools.backend-normalizer-raw-status",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "targets=\"$(arch_list_csv_normalize \"${CROSS_TARGETS:-amd64,arm64,riscv64}\")\" || return $?",
  "replace": "targets=\"$(arch_list_csv_normalize \"${CROSS_TARGETS:-amd64,arm64,riscv64}\")\"",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "Malformed or failed target normalization must stop before a backend list is emitted."
 },
 {
  "id": "compiler-llvm-tools.backend-mapping-raw-status",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "backend=\"$(llvm_cross_backend \"${target}\")\" || return $?",
  "replace": "backend=\"$(llvm_cross_backend \"${target}\")\"",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A failed backend mapping must not become an empty or partial successful list."
 },
 {
  "id": "compiler-llvm-tools.configure-uses-backend-union",
  "target": "linux/scripts/02-toolchain/llvm-cross.sh",
  "find": "[\"backend\"]=\"$(llvm_cross_build_backends \"${target_label}\")\"",
  "replace": "[\"backend\"]=\"$(llvm_cross_backend \"${target_label}\")\"",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "The actual LLVM configure state must consume the host-aware backend union."
 },
 {
  "id": "smoke.clang-cross-both-drivers",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "for driver in clang clang++; do",
  "replace": "for driver in clang; do",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "Both the C and C++ wrapper drivers require their own pin and target compiler probes."
 },
 {
  "id": "smoke.clang-cross-full-pin",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "    check_clang_version \"${compiler}\" \"${LLVM_RELEASE}\" \"${driver} (${target_arch} wrapper)\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A same-major or bootstrap wrapper must not escape the exact successful Clang version gate."
 },
 {
  "id": "smoke.clang-cross-codegen",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "    validate_compiler_for_target \"${compiler}\" \"${target_arch}\" \"${driver} (${target_arch} wrapper)\" cross",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "Version output alone cannot prove target object emission, linking and the existing QEMU execution checks."
 },
 {
  "id": "smoke.clang-cross-mode",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "    validate_compiler_for_target \"${compiler}\" \"${target_arch}\" \"${driver} (${target_arch} wrapper)\" cross",
  "replace": "    validate_compiler_for_target \"${compiler}\" \"${target_arch}\" \"${driver} (${target_arch} wrapper)\" native",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A cross wrapper is a host program; retain cross-mode object and executable checks."
 },
 {
  "id": "smoke.clang-cross-wired",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "  check_cross_clang \"${target_arch}\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "The ordinary toolchain target loop must execute the Clang wrapper gates."
 },
 {
  "id": "smoke.clang-cross-version-raw-failure",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "    check_clang_version \"${compiler}\" \"${LLVM_RELEASE}\" \"${driver} (${target_arch} wrapper)\"",
  "replace": "    check_clang_version \"${compiler}\" \"${LLVM_RELEASE}\" \"${driver} (${target_arch} wrapper)\" || true",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "An unexpected version callback failure must still stop the unconditional compiler smoke."
 },
 {
  "id": "smoke.clang-cross-codegen-raw-failure",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "    validate_compiler_for_target \"${compiler}\" \"${target_arch}\" \"${driver} (${target_arch} wrapper)\" cross",
  "replace": "    validate_compiler_for_target \"${compiler}\" \"${target_arch}\" \"${driver} (${target_arch} wrapper)\" cross || true",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "An unexpected target-compiler callback failure must stop before a later successful driver can hide it."
 },
 {
  "id": "compiler-llvm-tools.foreign-backend-raw-failure",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "    llvm_cross_backend \"${target}\"\n    return $?",
  "replace": "    llvm_cross_backend \"${target}\"\n    return 0",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "Foreign backend selection must propagate the actual mapping failure under conditional callers."
 },
 {
  "id": "compiler-llvm-tools.wrappers-after-source-build",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "  install_cross_llvm_runner_tools\n  build_cross_llvm_targets\n  install_cross_clang_wrappers",
  "replace": "  install_cross_clang_wrappers\n  install_cross_llvm_runner_tools\n  build_cross_llvm_targets",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A fresh compiler has no native source prefix before the unified build; early wrappers permanently bake the apt bootstrap path."
 },
 {
  "id": "compiler-llvm-tools.source-wrapper-publication",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "  build_cross_llvm_targets\n  install_cross_clang_wrappers",
  "replace": "  build_cross_llvm_targets",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "The completed source build must publish its selected driver paths into the ordinary architecture wrappers."
 },
 {
  "id": "compiler-llvm-tools.failed-build-stops-wrapper-publication",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "  build_cross_llvm_targets\n  install_cross_clang_wrappers",
  "replace": "  build_cross_llvm_targets || true\n  install_cross_clang_wrappers",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A failed source build must retain its raw status and cannot publish a successful-looking cross wrapper."
 },
 {
  "id": "smoke.clang-cross-host-wired",
  "target": "linux/scripts/06-packaging/smoke-toolchain.sh",
  "find": "  check_llvm_clang\n  check_cross_clang \"${host_arch}\"\n",
  "replace": "  check_llvm_clang\n",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "The foreign-target loop skips the build host, so its architecture wrappers need their own unconditional exact-pin and real compiler probes."
 },
 {
  "id": "lib.mgx-image-native-path-before-distro",
  "target": "linux/Dockerfile.amd",
  "find": "ENV PATH=\"/opt/rocm/migraphx/bin:${PATH}:/opt/rocm/bin\"",
  "replace": "ENV PATH=\"/opt/rocm/migraphx/bin:/usr/lib/llvm-${LLVM_RELEASE%%.*}/bin:/opt/rocm/bin:${PATH}\"",
  "test": "bash linux/scripts/tests/test-migraphx-image.sh",
  "why": "The AMD environment must not restore a major-only distro LLVM path ahead of the qualified source toolchain."
 },
 {
  "id": "lib.mgx-image-native-path-before-rocm",
  "target": "linux/Dockerfile.amd",
  "find": "ENV PATH=\"/opt/rocm/migraphx/bin:${PATH}:/opt/rocm/bin\"",
  "replace": "ENV PATH=\"/opt/rocm/migraphx/bin:/opt/rocm/bin:${PATH}\"",
  "test": "bash linux/scripts/tests/test-migraphx-image.sh",
  "why": "ROCm tools remain available after the inherited native compilers, so a vendor clang cannot shadow the source build."
 },
 {
  "id": "lib.mgx-image-retains-inherited-compiler-path",
  "target": "linux/Dockerfile.amd",
  "find": "ENV PATH=\"/opt/rocm/migraphx/bin:${PATH}:/opt/rocm/bin\"",
  "replace": "ENV PATH=\"/opt/rocm/migraphx/bin:/opt/rocm/bin\"",
  "test": "bash linux/scripts/tests/test-migraphx-image.sh",
  "why": "The complete inherited GNU and source LLVM path must survive the GPU environment boundary."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-01",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert len(backends) == 4 and set(backends) == BACKENDS, 'Native LLVM must carry exactly the three CPU backends and AMDGPU'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-02",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert set(payload['wrappers']) == expected, 'Every actual architecture wrapper is required'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-03",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "        assert row['selected'] == '/usr/local/bin/' + name, 'PATH selected another architecture wrapper'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-04",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "        assert shlex.split(lines[1]) == ['exec', f'{PREFIX}/bin/{driver}', '--target=' + triplet,\n                                        '--sysroot=' + sysroot, f'--gcc-toolchain=/opt/gcc-{gcc_pin}', '$@'], 'Wrapper does not bind the source driver and target contract'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-05",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert '=== Results: 0 failure(s) ===' in smoke and not re.search(r'^\\s*FAIL ', smoke, re.MULTILINE), 'The actual baked toolchain smoke must pass'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-06",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "                assert smoke.count(f'  PASS {label}: {suffix}\\n') == 1, 'Missing actual wrapper compiler assertion: ' + label\n",
  "replace": "                pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-07",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "            assert re.search(r'^  PASS ' + re.escape(label) + r': object ELF machine=.+$', smoke, re.MULTILINE), 'Missing target object ELF assertion'\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-08",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "                assert re.search(r'^  PASS ' + re.escape(label) + r': static binary RUNS under \\S+ \\(exit 42\\)$', smoke, re.MULTILINE), 'Actual foreign static execution is required'\n",
  "replace": "                pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-09",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert set(payload['native_programs']) == {'c', 'cxx'}, 'Both real native languages are required'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-10",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "        assert output(row['execution']) == '42', 'Native executable returned the wrong result: ' + name\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-11",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "        assert re.search(r'^\\s*Machine:\\s+Advanced Micro Devices X86-64\\s*$', output(row['elf']), re.MULTILINE), 'Native executable has the wrong ELF machine'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-12",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert not payload['environment'].get('LD_PRELOAD'), 'Preload cannot qualify the ordinary image'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-probe-guard-13",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "        helpers['llvm_facts']({'version':row['version']}, llvm_pin)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-parent-guard-01",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "    elif subject['cross_required']:\n        assert proof['cross_wrapper_checks_required'] and proof['cross_wrapper_CPU_checks_passed']\n        assert set(proof['cross_wrapper_modes']) == {'default','login'}\n        for mode,result in proof['cross_wrapper_modes'].items():\n            assert result['status'] == 'passed-baked-cross-Clang-wrappers-and-CPU-smokes-only' and result['mode'] == mode\n            assert result['native_backends'] == ['AArch64','AMDGPU','RISCV','X86'] and result['wrapper_count'] == 6\n            assert result['foreign_static_executions_required'] == 4 and result['native_languages'] == ['c','cxx']\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-parent-guard-02",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "        assert proof['cross_wrapper_checks_required'] and proof['cross_wrapper_CPU_checks_passed']\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-parent-guard-03",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "        assert set(proof['cross_wrapper_modes']) == {'default','login'}\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-parent-guard-04",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "            assert result['status'] == 'passed-baked-cross-Clang-wrappers-and-CPU-smokes-only' and result['mode'] == mode\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-parent-guard-05",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "            assert result['native_backends'] == ['AArch64','AMDGPU','RISCV','X86'] and result['wrapper_count'] == 6\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "compiler-llvm-tools.preserved-parent-guard-06",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "            assert result['foreign_static_executions_required'] == 4 and result['native_languages'] == ['c','cxx']\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The versioned qualification boundary must refuse the independently constructed incomplete receipt."
 },
 {
  "id": "host.preserved-authorization",
  "target": "linux/host-config/autonomous-safe-prune.py",
  "find": "assert 'agents may run the existing `linux/host-config/prune-safe.sh` autonomously' in authorization.read_text()",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Removing the operational guard must fail the real assertion-bearing refusal fixture."
 },
 {
  "id": "host.preserved-mid-build-budget",
  "target": "linux/host-config/autonomous-safe-prune.py",
  "find": "assert args.keep_gb > 0 and (args.keep_gb >= 100 or args.idle_store)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Removing the operational guard must fail the real assertion-bearing refusal fixture."
 },
 {
  "id": "host.preserved-cache-identities",
  "target": "linux/host-config/verify-safe-prune.py",
  "find": "assert before['cachemount_ids'] == after['cachemount_ids']",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Removing the operational guard must fail the real assertion-bearing refusal fixture."
 },
 {
  "id": "host.preserved-image-identities",
  "target": "linux/host-config/verify-safe-prune.py",
  "find": "assert image_identities(before) == image_identities(after)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Removing the operational guard must fail the real assertion-bearing refusal fixture."
 },
 {
  "id": "host.preserved-idle-store",
  "target": "linux/host-config/verify-safe-prune.py",
  "find": "    assert all(value['in_use'] == 0 for snapshot in [before, after] for value in snapshot['buildkit_record_types'].values())",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Removing the operational guard must fail the real assertion-bearing refusal fixture."
 },
 {
  "id": "host.preserved-checkpoint-owner",
  "target": "linux/scripts/local-proof/checkpoint-proof-runs.py",
  "find": "    assert invocation['run_id'] == record['owner_run_id']",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Removing the operational guard must fail the real assertion-bearing refusal fixture."
 },
 {
  "id": "host.preserved-oneshot-observer",
  "target": "linux/scripts/watch-build-units.py",
  "find": "    return retained or (unit.get(\"ActiveState\") in (\"inactive\", \"failed\") and (ended or failed))",
  "replace": "    return unit.get(\"ActiveState\") in (\"inactive\", \"failed\") and (ended or failed)",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A retained completed oneshot must end observation while a running success field remains nonterminal."
 },
 {
  "id": "host.compiler-diagnostic-unique-marker",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert source.count(MARKER) == 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-required-smoke",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert 'publish_llvm_target_ld_path' in after and 'smoke-toolchain.sh' in after\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-prefix-boundary",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert 'LABEL kataglyphis.step=script-modes' in before\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-engine",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert len(argv) > 8 and Path(argv[0]).name == 'nerdctl' and argv[1] == 'build'\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-context",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert argv[-1] == '.' and '--pull=false' in argv\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-no-publication",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert not any(value.startswith(('--push', '--output', '--no-cache', '--target')) for value in argv)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-unique-output-flags",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert argv.count('-t') == argv.count('-f') == 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-unverified-name",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert image.startswith('ant-local/') and 'unverified' in image and '@' not in image\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-loaded-failure",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert actual['LoadState'] == 'loaded' and actual['MainPID'] == '0'\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-failed-terminal",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert actual['ActiveState'] == actual['SubState'] == 'failed'\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.compiler-diagnostic-failed-status",
  "target": "linux/scripts/local-proof/compiler-prefix-diagnostic.py",
  "find": "    assert int(actual['ExecMainStatus']) > 0 and int(actual['ExecMainExitTimestampMonotonic']) > 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.cross-clang-link-scope",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "    assert report['status'] == 'observed-cross-Clang-link-diagnostics-only' and report['mode'] == mode\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.cross-clang-link-backends",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "    assert report['actual_backends']['returncode'] == 0 and set(report['actual_backends']['stdout'].split()) == {'X86', 'AArch64', 'RISCV', 'AMDGPU'}\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.cross-clang-link-no-preload",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "    assert not report['environment'].get('LD_PRELOAD')\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.cross-clang-link-six-tuples",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "    assert len(records) == 6 and {(row['arch'], row['language']) for row in records} == {(arch, language) for arch in ['amd64', 'arm64', 'riscv64'] for language in ['c', 'cxx']}\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.cross-clang-link-native-bytes",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "    assert report['native_clang_sha256_before'] == report['native_clang_sha256_after']\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.cross-clang-link-actual-gnu-root",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "        worker['gnu_sysroot'](row['arch'], row['gcc_sysroot'])\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "Both control modes retain the shared actual GNU sysroot and child-status checks."
 },
 {
  "id": "host.cross-clang-link-real-links",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "            assert row['minimal_link']['returncode'] == row['dynamic_link']['returncode'] == row['static_link']['returncode'] == 0\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.cross-clang-link-execution",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "            assert isinstance(row['execution'], dict) and row['execution']['returncode'] == 0 and row['execution']['stdout'].strip() == '42'\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.cross-clang-link-failed-link-status",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "            assert isinstance(row['minimal_link']['returncode'], int) and row['minimal_link']['returncode'] > 0\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "host.cross-clang-link-failed-link-evidence",
  "target": "linux/scripts/local-proof/launch-cross-clang-link-probe.py",
  "find": "            assert not row['minimal_link']['timed_out'] and row['minimal_link']['stderr'].strip()\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A removed diagnostic guard must fail an independent refusal assertion, without building or qualifying an image."
 },
 {
  "id": "lib.smoke-link-stderr",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  if printf 'int main(void){return 0;}\\n' | \"${cc_path}\" -x c - -o \"${cc_exe}\"; then",
  "replace": "  if printf 'int main(void){return 0;}\\n' | \"${cc_path}\" -x c - -o \"${cc_exe}\" 2>/dev/null; then",
  "test": "bash linux/scripts/tests/test-smoke-compiler-link.sh",
  "why": "Real linker diagnostics must remain observable on stderr."
 },
 {
  "id": "lib.smoke-link-failure-count",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    fail \"${label}: link smoke FAILED (rc=${link_status})\"",
  "replace": "    pass \"${label}: link smoke FAILED (rc=${link_status})\"",
  "test": "bash linux/scripts/tests/test-smoke-compiler-link.sh",
  "why": "A failed link must increment the actual smoke aggregate."
 },
 {
  "id": "lib.smoke-link-raw-status",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    link_status=$?\n    fail \"${label}: link smoke FAILED (rc=${link_status})\"",
  "replace": "    link_status=0\n    fail \"${label}: link smoke FAILED (rc=${link_status})\"",
  "test": "bash linux/scripts/tests/test-smoke-compiler-link.sh",
  "why": "The failure message must preserve the real linker status."
 },
 {
  "id": "lib.smoke-link-allocation-exit",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "    fail \"${label}: cannot allocate link smoke directory\"\n    return 1",
  "replace": "    fail \"${label}: cannot allocate link smoke directory\"\n    return 0",
  "test": "bash linux/scripts/tests/test-smoke-compiler-link.sh",
  "why": "Invalid temporary allocation must fail before executing the compiler."
 },
 {
  "id": "lib.smoke-link-directory-exists",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  tmpdir=\"$(mktemp -d)\" && [ -n \"${tmpdir}\" ] && [ -d \"${tmpdir}\" ] || {",
  "replace": "  tmpdir=\"$(mktemp -d)\" && [ -n \"${tmpdir}\" ] || {",
  "test": "bash linux/scripts/tests/test-smoke-compiler-link.sh",
  "why": "A successful allocator reporting a missing directory cannot enter a link probe."
 },
 {
  "id": "lib.smoke-link-cleanup-status",
  "target": "linux/scripts/06-packaging/smoke-common.sh",
  "find": "  rm -rf \"${tmpdir}\" || cleanup_status=$?",
  "replace": "  rm -rf \"${tmpdir}\" || cleanup_status=0",
  "test": "bash linux/scripts/tests/test-smoke-compiler-link.sh",
  "why": "Failed cleanup must fail the aggregate and retain its original status."
 },
 {
  "id": "gate-fixture.temp-allocation-raw-status",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "    failed) return 71 ;;\n",
  "replace": "    failed) return 0 ;;\n",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "Shared allocation fixtures retain the failed allocator's raw status without writing paths."
 },
 {
  "id": "gate-fixture.temp-allocation-missing-path",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "    missing) printf '%s' \"$2\" ;;\n",
  "replace": "    missing) printf '%s' '' ;;\n",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "A reported missing path remains distinct from a successful allocator's empty output."
 },
 {
  "id": "host.cross-clang-link-gnu-child-status",
  "target": "linux/scripts/local-proof/probe-cross-clang-link.py",
  "find": "    assert result['returncode'] == 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A failed GNU sysroot query cannot supply the diagnostic root."
 },
 {
  "id": "host.cross-clang-link-gnu-root-layout",
  "target": "linux/scripts/local-proof/probe-cross-clang-link.py",
  "find": "    assert root in ({'', '/'} if arch == 'amd64' else {'/'})\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-prefix-diagnostic.sh",
  "why": "A native empty sysroot is valid while foreign sysroots must prove the staged filesystem root."
 },
 {
  "id": "compiler-llvm-tools.wrapper-filesystem-root",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "  sysroot=\"/\"\n",
  "replace": "  sysroot=\"/usr/${triplet}\"\n",
  "test": "bash linux/scripts/tests/test-llvm-wrapper-sysroot.sh",
  "why": "Generated wrappers must not double-root Debian's absolute target linker-script paths."
 },
 {
  "id": "compiler-llvm-tools.wrapper-required-foreign-tree",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "    [ -d \"/usr/${triplet}\" ] || {\n",
  "replace": "    true || {\n",
  "test": "bash linux/scripts/tests/test-llvm-wrapper-sysroot.sh",
  "why": "Absent foreign target files must refuse before either wrapper is written."
 },
 {
  "id": "compiler-llvm-tools.wrapper-native-tree-policy",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "  if [ \"${target_label}\" != \"$(build_arch_oci)\" ]; then\n",
  "replace": "  if [ \"${target_label}\" = \"$(build_arch_oci)\" ]; then\n",
  "test": "bash linux/scripts/tests/test-llvm-wrapper-sysroot.sh",
  "why": "The host target needs no redundant foreign tree, while foreign target trees remain mandatory."
 },
 {
  "id": "compiler-llvm-tools.wrapper-conditional-tree-refusal",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "      die \"Expected cross target tree not found for ${target_label}: /usr/${triplet}\"\n      return 1\n",
  "replace": "      die \"Expected cross target tree not found for ${target_label}: /usr/${triplet}\"\n",
  "test": "bash linux/scripts/tests/test-llvm-wrapper-sysroot.sh",
  "why": "A conditional caller must still refuse absent foreign target files even when die is a returning callback."
 },
 {
  "id": "compiler-llvm-tools.image-probe-filesystem-root-arm64",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "'arm64': ('aarch64-linux-gnu', '/')",
  "replace": "'arm64': ('aarch64-linux-gnu', '/usr/aarch64-linux-gnu')",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The independent positive fixture must reject restoring the obsolete foreign sysroot expectation."
 },
 {
  "id": "compiler-llvm-tools.image-probe-filesystem-root-riscv64",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "'riscv64': ('riscv64-linux-gnu', '/')",
  "replace": "'riscv64': ('riscv64-linux-gnu', '/usr/riscv64-linux-gnu')",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The independent positive fixture must reject restoring the obsolete foreign sysroot expectation."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-arch",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert arch in SDK_TARGETS, 'An explicitly reviewed SDK target is required'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-source",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert invocation['source'] == plan['source'] and invocation['source_revision'] == plan['source_revision'], 'SDK source differs from its compiler'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-parent-source",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert invocation['parent_source_revision'] == plan['source_revision'], 'SDK compiler source differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-producer-unit",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert re.fullmatch(rf'webgpu-normal-sdk-{arch}-[0-9-]+\\.service', invocation['unit']), 'Unexpected SDK producer unit'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-launch",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert invocation['launch_status'] == 0 and invocation['publication'] is False, 'SDK launch was not a successful local invocation'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-source-flags",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert invocation['source_full_preflight_passed'] and invocation['producer_source_unchanged'], 'SDK source proof was not retained'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-parent-status",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert parent['status'] == 'passed-qualified-native-compiler-OCI-and-base-ancestry', 'SDK requires its actual qualified compiler parent'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-parent-blobs",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert parent['SDK_parent_prerequisites_passed'] and parent['all_native_blob_sizes_and_sha256_verified'], 'Compiler parent is incomplete'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-base-ancestry",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert parent['source_revision'] == plan['source_revision'] and parent['matched_base_layers_and_diffIDs'] == 12, 'Compiler ancestry differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-parent-image",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert parent['manifest'] == invocation['parent_manifest'] and parent['config'] == invocation['parent_config'], 'SDK parent identity differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-parent-layout",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert parent['index_sha256'] == invocation['parent_OCI_index_sha256'] and parent['layers'] == 26, 'SDK requires the reviewed complete compiler layout'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-parent-stop",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert parent['stopped']['ActiveState'] == 'inactive' and parent['stopped']['MainPID'] == '0', 'Compiler handoff was not sealed'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-full-source",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert full['status'] == 'passed-complete-Linux-source-preflight-only' and full['source_revision'] == plan['source_revision'], 'SDK requires the exact complete source proof'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-full-count",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert full['actual_full_registry_mutations'] == plan['full_registry'], 'SDK source mutation coverage differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-full-status",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert full['command_exit_status'] == full['cleanup_exit_status'] == full['independent_engine_query_exit_status'] == 0, 'SDK source proof contains a failure'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-full-cleanup",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert full['owned_container_absent'] and full['unit_stopped_after_seal'], 'SDK source proof lacks cleanup'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-candidate",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert repo.startswith('ant-local/webgpu-') and invocation['image'] == repo + suffix, 'Unexpected SDK candidate name'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-transport",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert command[:2] == ['systemd-run', '--user'] and '--expand-environment=no' in command, 'SDK transport differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-stage-command",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert command[-10:] == ['/bin/bash', str(Path(plan['source']) / 'linux/scripts/build-cross-stage.sh'), '--stage', 'sdk', '--arch', arch, '--image-repo', repo, '--log-dir', str(Path(invocation['output']) / 'logs')], 'SDK stage command differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-parent-command",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert command.count(expected_base) == 1 and command.count('CROSS_SDK_BASE_CONTEXT=' + parent['context']) == 1, 'SDK command is not bound to its qualified native parent'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-local-build",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert '--push' not in command and '--gates-only' not in command, 'SDK profile requires an actual local build'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-binding",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert record.get('subject', subject if not sdk else None) == subject, 'Stored proof subject differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-binding-SDK",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "        assert record.get('sdk_native_checks_required', False) == sdk, 'Stored SDK CPU requirement differs'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-binding-cross",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "        assert record.get('cross_wrapper_checks_required', False) == subject['cross_required'], 'Stored cross-wrapper requirement differs'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-known-profile",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert profile in PROFILES, 'Unknown compiler image probe profile'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-payload-profile",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert payload.get('profile', 'compiler') == profile, 'Image probe profile differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-alias-facts",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert isinstance(materialized, dict), 'SDK materialization facts are required'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-alias-target",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert materialized['alias_is_symlink'] is True and materialized['alias_target'] == '/opt/llvm-target', 'SDK native architecture alias differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-architecture-prefixes",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert materialized['architecture_prefixes'] == expected, 'SDK architecture prefixes differ'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-driver-pair",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    assert set(materialized['drivers']) == {'clang', 'clang++'}, 'Both SDK driver byte comparisons are required'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-driver-bytes",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "        assert re.fullmatch(r'[0-9a-f]{64}', row['alias_sha256']) and row['alias_sha256'] == row['target_sha256'], 'SDK architecture alias selects different compiler bytes'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-alias-dispatch",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "    if profile != 'compiler':\n        sdk_materialization(payload, arch, helpers)\n",
  "replace": "    if False:\n        sdk_materialization(payload, arch, helpers)\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-receipt-status",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "    assert proof.get(\"status\") == subject['qualification_status'], \"Fresh complete compiler qualification required\"\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-CPU-required",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "    assert proof['sdk_native_checks_required'] and proof['sdk_native_CPU_checks_passed'], 'SDK native CPU checks are required'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-both-modes",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "    assert not proof['cross_wrapper_checks_required'] and set(proof['sdk_native_modes']) == {'default','login'}, 'SDK proof requires both native modes'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-mode-identity",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "        assert result['status'] == 'passed-baked-SDK-Clang-wrappers-and-CPU-smokes-only' and result['profile'] == profile and result['mode'] == mode, 'SDK native mode identity differs'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-native-scope",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "        assert result['native_backends'] == ['AArch64','AMDGPU','RISCV','X86'] and result['wrapper_count'] == 2 and result['cross_targets'] == [arch], 'SDK native compiler scope differs'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-native-languages",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "        assert result['native_languages'] == ['c','cxx'] and result['foreign_static_executions_required'] == (0 if arch == 'amd64' else 2), 'SDK native languages or target execution coverage differ'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-ancestry-count",
  "target": "linux/scripts/local-proof/native_oci_layout.py",
  "find": "    assert count == expected_count and count >= 12 and len(manifest['layers']) >= count\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-ancestry-layers",
  "target": "linux/scripts/local-proof/native_oci_layout.py",
  "find": "    assert manifest['layers'][:count] == parent_manifest['layers'], 'Base layer ancestry differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-ancestry-diffIDs",
  "target": "linux/scripts/local-proof/native_oci_layout.py",
  "find": "    assert config['rootfs']['diff_ids'][:count] == parent_config['rootfs']['diff_ids'], 'Base diffID ancestry differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-launch-CPU-dispatch",
  "target": "linux/scripts/local-proof/compiler-image-qualification.py",
  "find": "cpu_required = cross_required or sdk_required\n",
  "replace": "cpu_required = cross_required\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_launch_transport",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-native-prefix",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "        native_prefix = '/opt/llvm-target' if arch == 'amd64' else '/opt/llvm-target-amd64'\n",
  "replace": "        native_prefix = '/opt/llvm-target-amd64'\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_launch_transport",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.sdk-profile-launch-profile-argument",
  "target": "linux/scripts/local-proof/compiler-image-qualification.py",
  "find": "            command.append(subject['cpu_profile'])\n",
  "replace": "            command.append('compiler')\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_launch_transport",
  "why": "The independently declared SDK and compiler controls must reject this broken producer, CPU or ancestry contract; fixtures do not prove a real image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-plain-directory",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert value.is_dir() and value.resolve(strict=True) == value, 'OCI context directory must have no symlink components'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-plain-metadata",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert path.is_file() and not path.is_symlink(), 'OCI proof and metadata must be regular files'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-parent-status",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "assert proof['status'] in {'passed-qualified-native-compiler-OCI-and-base-ancestry', 'passed-qualified-native-SDK-OCI-and-compiler-ancestry', 'passed-native-ROCm-GPU-OCI-and-SDK-ancestry-only', MEDIA_STATUS, ANDROID_STATUS, DEFAULT_MEDIA_STATUS, DEFAULT_ANDROID_STATUS} or proof['status'] in FOREIGN_DEFAULT_STATUSES or proof['status'] in NVIDIA_STAGE_STATUSES, 'Verified native OCI parent required'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-parent-blob-proof",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert proof['all_native_blob_sizes_and_sha256_verified'] is True, 'Parent blob verification is required'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-parent-terminal",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert proof['stopped']['ActiveState'] == 'inactive' and proof['stopped']['MainPID'] == '0', 'Parent export must be sealed'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-parent-index",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert sha(context / 'index.json') == proof['index_sha256'], 'Parent index bytes differ'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-parent-image",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert layout[0] == proof['manifest'] and layout[1]['config']['digest'] == proof['config'], 'Parent manifest or config differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-parent-count",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert len(layout[1]['layers']) == proof['layers'], 'Parent layer count differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-regular-identity",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert stat.S_ISREG(value.st_mode), 'Only regular layer files may be shared'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-empty-context",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert not any(context.iterdir()), 'Shared OCI destination must be empty'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-nonoverlap",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert not context.is_relative_to(parent) and not parent.is_relative_to(context), 'OCI parent and child contexts overlap'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-preserved-receipt",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert not receipt.exists() and not receipt.is_symlink(), 'Preserve the existing OCI seed receipt'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-receipt-schema",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert type(record['schema_version']) is int and record['schema_version'] in {1,2} and record['status'] == 'seeded-verified-parent-layer-links-only', 'Unexpected OCI seed receipt'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-receipt-proof",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert record['parent_proof'] == str(proof_path.resolve()) and record['parent_proof_sha256'] == sha(proof_path), 'OCI seed parent proof differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-receipt-context",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert record['parent_context'] == str(parent) and record['child_context'] == str(context), 'OCI seed context binding differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-receipt-parent",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert record['parent_manifest'] == layout[0] and record['parent_index_sha256'] == proof['index_sha256'], 'OCI seed parent identity differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-receipt-layers",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert [row['digest'] for row in record['linked_layers']] == [row['digest'] for row in layers], 'OCI seed layer inventory differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-receipt-path",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "        assert row['relative_path'] == str(destination.relative_to(context)), 'OCI seed layer path differs'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-receipt-inodes",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "        assert identity(source,stable=stable) == row['identity'] and identity(destination,stable=stable) == row['identity'], 'Shared OCI layer identity or parent metadata changed'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-receipt-bytes",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "    assert record['shared_unique_layer_bytes'] == sum(layer['size'] for layer in layers), 'OCI shared-byte accounting differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-private-metadata",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "        assert (context / name).stat().st_ino != (parent / name).stat().st_ino or (context / name).stat().st_dev != (parent / name).stat().st_dev, 'OCI child metadata must remain independent'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-blob-algorithm",
  "target": "linux/scripts/local-proof/native_oci_layout.py",
  "find": "    assert algorithm == 'sha256' and re.fullmatch(r'[0-9a-f]{64}', value), 'Invalid blob digest'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-blob-regular",
  "target": "linux/scripts/local-proof/native_oci_layout.py",
  "find": "    assert path.is_file() and not path.is_symlink(), 'Missing regular blob'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-blob-SHA256",
  "target": "linux/scripts/local-proof/native_oci_layout.py",
  "find": "    assert path.stat().st_size == descriptor['size'] and sha(path) == value, 'Blob bytes differ from descriptor'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-skip-shared-files",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "    tar_args+=(--skip-old-files)\n",
  "replace": "    tar_args+=()\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-fresh-destination",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "    [ ! -e \"${dest_dir}\" ] && [ ! -L \"${dest_dir}\" ] || {\n",
  "replace": "    [ ! -e \"${dest_dir}\" ] || [ ! -L \"${dest_dir}\" ] || {\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-producer-status",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "    exit \"${_oci_status[0]}\"\n",
  "replace": "    exit 0\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-extractor-status",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "    [ \"${_oci_status[1]}\" -eq 0 ] || exit \"${_oci_status[1]}\"\n",
  "replace": "    [ \"${_oci_status[1]}\" -eq 0 ] || exit 0\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-failure-receipt",
  "target": "linux/scripts/01-core/context-management.sh",
  "find": "    set +e\n",
  "replace": "    set -e\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-required-sharing",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "    assert invocation.get('parent_layer_reuse_required',False) == sdk, 'OCI parent reuse requirement differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-worker-manifest",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "    assert invocation.get('export_input_sha256',worker_inputs if not sdk else {}) == worker_inputs, 'OCI export worker bytes changed'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-transport-receipt",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "        assert transport == {'producer_status':0,'extractor_status':0}, 'OCI producer or extractor failed'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-verify-linked-layers",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "        parent, reuse = verify_seed(Path(subject['compiler_parent_proof']), args.context)\n",
  "replace": "        parent, reuse = native_layout(base_context), {}\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-parent-argument",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "    parent_proof = subject['compiler_parent_proof'] if sdk else ''\n",
  "replace": "    parent_proof = ''\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-reuse-current-helper",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "    helper = Path(__file__).resolve().parents[1] / '01-core/context-management.sh' if sdk else Path(plan['source']) / 'linux/scripts/01-core/context-management.sh'\n",
  "replace": "    helper = Path(plan['source']) / 'linux/scripts/01-core/context-management.sh'\n",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Synthetic OCI and real tar controls must reject unverified, escaping, overwritten or misreported shared layers; these controls do not accept an image."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-01",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert checked_run(['git', '-C', str(source), 'rev-parse', 'HEAD']).stdout.strip() == revision, 'Source revision differs'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Source revision differs"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-02",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert not checked_run(['git', '-C', str(source), 'status', '--porcelain']).stdout.strip(), 'Source must be clean'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Source must be clean"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-03",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert proof['status'] == 'passed-complete-Linux-source-preflight-only' and proof['source_revision'] == revision, 'Complete exact source proof required'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Complete exact source proof required"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-04",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert proof['actual_full_registry_mutations'] == len(registry) == len({row['id'] for row in registry}), 'Full mutation coverage differs'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Full mutation coverage differs"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-05",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert proof['actual_preflight_group_count'] == len(groups) == len(set(groups)) == len(preflight_slugs(source)), 'All preflight groups are required'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: All preflight groups are required"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-06",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert proof['command_exit_status'] == proof['cleanup_exit_status'] == proof['independent_engine_query_exit_status'] == 0, 'Source proof contains a failed command'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Source proof contains a failed command"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-07",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert proof['unit_stopped_after_seal'] and proof['owned_container_absent'], 'Source proof lacks cleanup'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Source proof lacks cleanup"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-08",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert proof['script_suites'] > 0 and proof['script_assertions'] > 0, 'Source proof lacks actual suite accounting'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Source proof lacks actual suite accounting"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-09",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert not {key for key in manager if key.startswith(('CROSS_', 'RUNTIME_', 'ARTIFACT_', 'WRAPPER_', 'TORCH_'))\n                or key in {'ENABLE_AMD', 'ENABLE_NVIDIA', 'ENABLE_DEEPSTREAM', 'DRY_RUN', 'APP_REF', 'ONNX_PACKAGE', 'PYTORCH_EXTRA',\n                           'HOST_PAYLOAD_ARCHES', 'BASE_PARENT_IMAGE', 'BASE_DOCKERFILE_PATH', 'PACKAGE_DOCKERFILE_PATH',\n                           'PACKAGE_DOCKERFILE_TARGET', 'ANCESTRY_STAMP_ENFORCE'}}, 'Ambient build flags must be absent'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Ambient build flags must be absent"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-10",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert checked_run(['systemctl', '--user', 'show', unit, '--property=LoadState', '--value']).stdout.strip() == 'not-found', 'Unit already exists'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Unit already exists"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-11",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert not output.exists(), 'Preserve existing stage output'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Preserve existing stage output"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-12",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert not temporary.exists() and all(not (path / '.git').exists() for path in [temporary, *temporary.parents]), 'Temporary root must be fresh and outside Git'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Temporary root must be fresh and outside Git"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-13",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert not requested.intersection({f\"{row['Repository']}:{row['Tag']}\" for row in inventory}), 'Preserve the existing image alias'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Preserve the existing image alias"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-14",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert not checked_run([engine, 'ps', '--format', '{{.ID}}']).stdout.strip(), 'Another container is running'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Another container is running"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-15",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert not [line for line in processes if re.search(r'(?:nerdctl|buildctl)\\S*\\s+build\\b|build-(?:cross-(?:chain|stage)|runtime-(?:manifest|artifacts))\\.sh', line)], 'Another build is running'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Another build is running"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-16",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert stage in {'sdk', 'gpu', 'media', 'android'} and variant in {'', 'rocm'}, 'Unreviewed stage profile'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Unreviewed stage profile"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-17",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert (stage in {'gpu', 'media', 'android'}) == bool(variant) and (stage == 'sdk' or arch == 'amd64'), 'Unreviewed GPU architecture'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Unreviewed GPU architecture"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-18",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert repo.startswith('ant-local/webgpu-') and ':' not in repo and '@' not in repo, 'Local candidate repository required'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Local candidate repository required"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-19",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert re.fullmatch(r'webgpu-normal-' + stage + '-' + arch + r'-[0-9-]+\\.service', unit), 'Unexpected stage unit'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary source, host or stage admission assertion is removed: Unexpected stage unit"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-shared-20",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    assert required_bytes >= 193273528320 and disk['available_bytes'] >= required_bytes, (\n        f'Selected disk reserve {required_bytes} bytes required; {disk[\"available_bytes\"]} available')",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "Independent stage controls refuse below the shared minimum or selected byte requirement before allocation; no physical peak-disk guarantee."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-01",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert proof['status'] == 'passed-qualified-native-SDK-OCI-and-compiler-ancestry' and proof['SDK_built'] is True, 'Actual SDK OCI required'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: Actual SDK OCI required"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-02",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert proof['source_revision'] == plan['source_revision'] and proof['subject'] == subject, 'SDK source or subject differs'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: SDK source or subject differs"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-03",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert proof['parent_layer_reuse_verified'] is True and proof['export_transport'] == {'producer_status':0, 'extractor_status':0}, 'SDK export contains an unverified transport'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: SDK export contains an unverified transport"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-04",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert proof['matched_compiler_layers_and_diffIDs'] == 26, 'Complete compiler ancestry required'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: Complete compiler ancestry required"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-05",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert parent['status'] == 'passed-qualified-native-compiler-OCI-and-base-ancestry', 'Actual compiler parent required'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: Actual compiler parent required"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-06",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert layer_ancestry(native, compiler, 26) == 26, 'Compiler descriptors or diffIDs differ'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: Compiler descriptors or diffIDs differ"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-07",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert sha(qualification) == proof['qualification_sha256'], 'SDK qualification bytes differ'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: SDK qualification bytes differ"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-08",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert qualified['actual_image_manifest'] == proof['manifest'] and qualified['image_config'] == proof['config'], 'SDK qualification identity differs'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: SDK qualification identity differs"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-09",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert actual['Id'] == proof['config'] and any(value.endswith('@' + proof['manifest']) for value in actual['RepoDigests']), 'Native engine SDK identity differs'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: Native engine SDK identity differs"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-gpu-10",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert sdk['source'] == str(source) and sdk['source_revision'] == plan['source_revision'], 'GPU must use the exact reviewed SDK source'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The synthetic positive and independent refusal controls must fail when the ordinary SDK parent admission assertion is removed: GPU must use the exact reviewed SDK source"
 },
 {
  "id": "compiler-llvm-tools.normal-stage-raw-return",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    return result.returncode",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "A failed actual unit launch must remain a failed caller result."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-raw-receipt",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "record.update(launch_status=result.returncode, stdout=result.stdout, stderr=result.stderr)",
  "replace": "record.update(launch_status=0, stdout=result.stdout, stderr=result.stderr)",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The receipt must retain the actual failed launch status independently of the return value."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-qualified-SDK",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    qualified = module['qualification'](qualification, plan, invocation)",
  "replace": "    qualified = {'actual_image_manifest':proof['manifest'], 'image_config':proof['config']}",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "An OCI identity cannot replace independent native SDK qualification; the positive fixture requires the real delegation."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-complete-source",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    full_source(source, full_path, plan['source_revision'])",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "A normal GPU launch must invoke the exact complete source proof boundary before transport."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-kill-group",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "'-p', 'KillMode=control-group'",
  "replace": "'-p', 'KillMode=process'",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "Bounded stage cancellation must cover all unit children."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-no-env-expansion",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "'--no-block', '--expand-environment=no'",
  "replace": "'--no-block'",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "Systemd argv must retain literal values without a second environment expansion."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-canonical-tag",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "{'gpu':'cross_gpu_tag', 'sdk':'cross_sdk_tag', 'media':'cross_media_tag', 'android':'cross_android_tag'}[stage]",
  "replace": "'cross_sdk_tag'",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "GPU admission must use the source's canonical cross-toolchain-rocm tag instead of a second or guessed naming schema."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-host-delegation",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    temporary = host_admission(unit, output, images or image)",
  "replace": "    temporary = output.parent / 'temporary'",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "Both normal stage launch paths must delegate to the shared idle-host and collision admission gate before allocation."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-file-1",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "    assert output.tell() + len(chunk) <= MAX_LOG, 'Cache log exceeds the reader bound'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Real file and independent refusal controls must reject removal of this bounded cache-reader guard: Cache log exceeds the reader bound"
 },
 {
  "id": "compiler-llvm-tools.cache-reader-file-2",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "            assert (current.st_dev, current.st_ino) == (identity.st_dev, identity.st_ino), 'Live cache log inode changed'",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Real file and independent refusal controls must reject removal of this bounded cache-reader guard: Live cache log inode changed"
 },
 {
  "id": "compiler-llvm-tools.cache-reader-file-3",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "    assert pid > 1 and 1 <= timeout <= 21600, 'Cache reader PID or lifetime is invalid'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Real file and independent refusal controls must reject removal of this bounded cache-reader guard: Cache reader PID or lifetime is invalid"
 },
 {
  "id": "compiler-llvm-tools.cache-reader-file-4",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "    assert PHASE_MARKERS[phase] in command, 'Cache reader process does not match its phase'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Real file and independent refusal controls must reject removal of this bounded cache-reader guard: Cache reader process does not match its phase"
 },
 {
  "id": "compiler-llvm-tools.cache-reader-file-5",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "    assert stat.S_ISREG(source.lstat().st_mode), 'Existing cache log must be a regular file'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Real file and independent refusal controls must reject removal of this bounded cache-reader guard: Existing cache log must be a regular file"
 },
 {
  "id": "compiler-llvm-tools.cache-reader-file-6",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "        assert initial.st_size <= MAX_LOG, 'Existing cache log exceeds the reader bound'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Real file and independent refusal controls must reject removal of this bounded cache-reader guard: Existing cache log exceeds the reader bound"
 },
 {
  "id": "compiler-llvm-tools.cache-reader-file-7",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "    assert len(raw) == final.st_size, 'Cache reader did not retain every file byte'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Real file and independent refusal controls must reject removal of this bounded cache-reader guard: Cache reader did not retain every file byte"
 },
 {
  "id": "compiler-llvm-tools.cache-reader-profile-1",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "    assert phase in PHASE_MARKERS, 'Unknown cache capture phase'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Real file and independent refusal controls must reject removal of this bounded cache-reader guard: Unknown cache capture phase"
 },
 {
  "id": "compiler-llvm-tools.cache-reader-profile-2",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "    assert re.fullmatch(r'webgpu-' + owner + r'[0-9]+-' + phase + r'-error-capture-[0-9-]+\\.service', unit), 'Cache capture unit and phase differ'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Real file and independent refusal controls must reject removal of this bounded cache-reader guard: Cache capture unit and phase differ"
 },
 {
  "id": "compiler-llvm-tools.cache-reader-pid-reuse",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "live = start_ticks(process) == ticks",
  "replace": "live = True",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "A reused PID must end capture of the original process instead of becoming a partial observation of its successor."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-exit-drain",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "            if not live:\n                copy_pending(handle, output)",
  "replace": "            if not live:\n                pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Late bytes written after the first read must survive the final process-exit drain."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-timeout-partial",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "return 'captured-partial-observation-timeout'",
  "replace": "return 'captured-after-phase-process-exit'",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "A timeout cannot claim complete phase observation."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-current-worker",
  "target": "linux/scripts/local-proof/replay-sccache-log-capture.py",
  "find": "script = Path(__file__).with_name(\"capture-live-sccache-log.py\")",
  "replace": "script = Path(command[command.index(\"--pid\") - 1])",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "A historical transport template must invoke the current canonical worker that implements the reviewed phase."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-fresh-unit-log",
  "target": "linux/scripts/local-proof/replay-sccache-log-capture.py",
  "find": "command[index] = value.split(\"=\", 1)[0] + \"=append:\" + str(out.parent / f\"{args.phase}-error-capture-unit.log\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Both unit streams belong beside the new invocation, never in a historical compiler log."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-worker-companion-digest",
  "target": "linux/scripts/local-proof/replay-sccache-log-capture.py",
  "find": "hashlib.sha256(path.read_bytes()).hexdigest()",
  "replace": "\"0\" * 64",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Current worker and companion content hashes must be real, not only matching filenames."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-exact-input-closure",
  "target": "linux/scripts/local-proof/seal-sccache-log-capture.py",
  "find": "    assert inv.get(\"capture_inputs_sha256\") == expected_inputs, \"GPU/Media reader requires its complete input hashes\"",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "GPU and Media reader seals require exactly their actual worker and profile companion, rejecting missing or extra input names."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-legacy-companion-digest",
  "target": "linux/scripts/local-proof/seal-sccache-log-capture.py",
  "find": "    assert hashlib.sha256(Path(filename).read_bytes()).hexdigest() == expected, \"Cache reader companion bytes changed\"",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "A present compiler reader input manifest must retain its exact companion bytes as well."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-bounded-transport",
  "target": "linux/scripts/local-proof/replay-sccache-log-capture.py",
  "find": "\"MemoryMax=256M\"",
  "replace": "\"MemoryMax=512M\"",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The replay must retain the reviewed bounded memory transport profile."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-failure-audit-IDs",
  "target": "linux/scripts/local-proof/audit-failed-source-check.py",
  "find": "    assert len(expected) == len(set(expected)) and collections.Counter(passed + survived) == collections.Counter(expected)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "A failed source audit must retain the exact passed and survived mutation identities, never an unrelated or partial set."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-failure-audit-summary",
  "target": "linux/scripts/local-proof/audit-failed-source-check.py",
  "find": "    assert summary and (int(summary[1]), int(summary[2])) == (len(survived), len(expected))",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The actual failed mutation summary must independently match its recorded survivor count and manifest size."
 },
 {
  "id": "compiler-llvm-tools.cache-reader-failure-audit-no-green",
  "target": "linux/scripts/local-proof/audit-failed-source-check.py",
  "find": "    assert 'OK: every recorded mutation is caught' not in mutation_text",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Contradictory success text cannot be retained as a completed failed-mutation audit."
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-1",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "        assert not any((root / parent).is_symlink() for parent in [Path(name),*Path(name).parents] if str(parent) != '.'), 'Configure input has a symlink component'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Configure input has a symlink component"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-2",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "        assert stat.S_ISREG(info.st_mode) and 0 < info.st_size <= max_file, 'Configure input is missing, empty, nonregular or oversized'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Configure input is missing, empty, nonregular or oversized"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-3",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "        assert total <= MAX_TOTAL, 'Configure input set exceeds the byte bound'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Configure input set exceeds the byte bound"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-4",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert pid > 1, 'Invalid source process'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Invalid source process"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-5",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert unit['Id'] == inv['unit'] and unit['LoadState'] == 'loaded' and unit['ActiveState'] in {'active','activating'} and int(unit['MainPID']) > 0, 'Actual producer must be live'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Actual producer must be live"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-6",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert PHASE_MARKERS[phase] in command, 'Process does not match the selected build phase'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent phase fixtures reject unrelated and inner child processes before snapshot output exists."
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-7",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert not relative.is_absolute() and '..' not in relative.parts, 'Invalid relative build path'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Invalid relative build path"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-8",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert relative.parts[:len(selected)] == selected, 'Build tree does not match the selected phase'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "A selected snapshot phase must reject other real build trees before allocating output."
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-9",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert root.is_dir() and not any((process / 'root' / parent).is_symlink() for parent in [relative,*relative.parents] if str(parent) != '.'), 'Build path must have regular directory components'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Build path must have regular directory components"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-10",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert not output.resolve().is_relative_to(root.resolve()) and not root.resolve().is_relative_to(output.resolve()), 'Source and snapshot roots overlap'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Source and snapshot roots overlap"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-11",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert file_hashes(root,max_file) == before == file_hashes(output,max_file), 'Source or copied configure bytes changed'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Source or copied configure bytes changed"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-guard-12",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert START_TICKS(process) == ticks, 'Source process identity changed during snapshot'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The independent stable-file/identity/refusal fixtures must reject removal of this live snapshot guard: Source process identity changed during snapshot"
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-fresh-output",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    output.mkdir(mode=0o700)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "Snapshot creation must atomically refuse a previous destination before any existing file can be overwritten."
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-all-four-files",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "'CMakeFiles/rules.ninja', 'CMakeFiles/CMakeConfigureLog.yaml'",
  "replace": "'CMakeFiles/rules.ninja'",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "A successful snapshot must retain all four independently enumerated CMake/Ninja inputs."
 },
 {
  "id": "compiler-llvm-tools.configure-snapshot-copy-bytes",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "        shutil.copy2(root / name,target)",
  "replace": "        target.write_bytes(b'wrong copy')",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "Copied bytes must match the actual observed source rather than merely create files."
 },
 {
  "id": "compiler-llvm-tools.native-AMDGPU-required",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "  printf '%s;AMDGPU' \"${result}\"",
  "replace": "  printf '%s' \"${result}\"",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "The pinned native host compiler must retain AMDGPU alongside configured CPU targets."
 },
 {
  "id": "compiler-llvm-tools.installed-backend-reuse",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "  llvm_cross_required_backends_available \"${target_label}\" \"${prefix}\" || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "A CPU-only installed prefix cannot skip rebuilding the required native GPU backend."
 },
 {
  "id": "compiler-llvm-tools.installed-backend-tokens",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "    [[ \" ${actual} \" =~ [[:space:]]${backend}[[:space:]] ]] || return 1",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "Every selected backend needs its own complete token; a substring or another CPU cannot substitute."
 },
 {
  "id": "compiler-llvm-tools.installed-backend-query-failure",
  "target": "linux/scripts/02-toolchain/llvm.sh",
  "find": "actual=\"$(llvm_cross_run_binary \"$1\" \"${config}\" --targets-built)\" || return",
  "replace": "actual=\"$(llvm_cross_run_binary \"$1\" \"${config}\" --targets-built)\"",
  "test": "bash linux/scripts/tests/test-llvm-host-selection.sh",
  "why": "Failed backend queries retain raw status rather than consuming partial output."
 },
 {
  "id": "lib.mgx-early-HIP-required",
  "target": "linux/scripts/03-media/build/migraphx/build-source-stack.sh",
  "find": "bash \"${SCRIPT_DIR}/check-hip-compiler.sh\" \"${work}/hip-compiler-check\" \"${rocm}\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-migraphx-stack.sh",
  "why": "HIP code generation must fail before dependency downloads and expensive compilation."
 },
 {
  "id": "lib.mgx-HIP-backend-token",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "grep -Eq '(^|[[:space:]])AMDGPU([[:space:]]|$)' \"${work}/backends.txt\"",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "CPU-only or partial GPU backend names cannot pass the early gate."
 },
 {
  "id": "lib.mgx-HIP-config-raw-status",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "exit \"${config_status}\"; fi",
  "replace": "exit 1; fi",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "The exact llvm-config failure remains observable."
 },
 {
  "id": "lib.mgx-HIP-source-GCC",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "\"--gcc-toolchain=${gcc_root}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "The HIP probe retains the selected source GCC toolchain and its argument boundary."
 },
 {
  "id": "lib.mgx-HIP-selected-ROCm",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "\"--rocm-path=${rocm}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "The probe checks the selected ROCm device libraries rather than an ambient SDK."
 },
 {
  "id": "lib.mgx-HIP-device-only",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "--cuda-device-only --no-gpu-bundle-output -std=c++17",
  "replace": "--no-gpu-bundle-output -std=c++17",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "A host-only object is insufficient; retain the explicit device compile mode."
 },
 {
  "id": "lib.mgx-HIP-selected-target",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "--offload-arch=gfx1030",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "The offline check uses a deliberate supported GPU architecture without requiring a device."
 },
 {
  "id": "lib.mgx-HIP-language",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "-std=c++17 -x hip",
  "replace": "-std=c++17 -x c++",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "Ordinary C++ compilation cannot prove HIP syntax and driver wiring."
 },
 {
  "id": "lib.mgx-HIP-machine-verdict",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "[[ \"${hip_machine}\" == 'AMD GPU' ]]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "The real ELF parser must refuse native CPU objects even after a successful compiler exit."
 },
 {
  "id": "lib.mgx-HIP-raw-compile-status",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "then exit \"${compile_status}\"; fi",
  "replace": "then exit 1; fi",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "The shared object lifecycle must not erase the actual compiler failure status."
 },
 {
  "id": "lib.mgx-HIP-retained-object",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "  cp -- \"$1\" \"${work}/hip-device.o\" || return",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "Successful object evidence must remain available with its checked bytes."
 },
 {
  "id": "lib.mgx-HIP-kernel",
  "target": "linux/scripts/03-media/build/migraphx/hip-compiler-probe.hip",
  "find": "extern \"C\" __global__ void",
  "replace": "extern \"C\" void",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "The tracked probe must actually contain a HIP device kernel."
 },
 {
  "id": "lib.mgx-HIP-shared-lifecycle",
  "target": "linux/scripts/script-closures/migraphx-image.txt",
  "find": "06-packaging/smoke-common.sh|06-packaging/smoke-common.sh\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-image.sh",
  "why": "The narrow GPU script bundle must carry the shared object lifecycle before its early gate."
 },
 {
  "id": "lib.mgx-rocmlir-automatic-heavy-jobs",
  "target": "linux/scripts/03-media/build/migraphx/build-source-rocmlir.sh",
  "find": "compute_cpp_heavy_jobs \"${JOBS:-}\"",
  "replace": "compute_cpp_heavy_jobs \"${JOBS:-2}\"",
  "test": "bash linux/scripts/tests/test-migraphx-rocmlir-build.sh",
  "why": "An unset request must reach the unchanged memory-capped automatic policy; explicit requests remain capped."
 },
 {
  "id": "lib.mgx-backend-automatic-heavy-jobs",
  "target": "linux/scripts/03-media/build/migraphx/build-source-backend.sh",
  "find": "compute_cpp_heavy_jobs \"${JOBS:-}\"",
  "replace": "compute_cpp_heavy_jobs \"${JOBS:-2}\"",
  "test": "bash linux/scripts/tests/test-migraphx-backend-build.sh",
  "why": "An unset request must reach the unchanged memory-capped automatic policy; explicit requests remain capped."
 },
 {
  "id": "lib.mgx-native-check-import-failure",
  "target": "linux/scripts/03-media/build/migraphx/native-check-common.sh",
  "find": "source \"${SCRIPT_DIR}/entry-common.sh\" || return",
  "replace": "source \"${SCRIPT_DIR}/entry-common.sh\"",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "Required imports must keep their raw failure before allocating or compiling, including conditional callers."
 },
 {
  "id": "lib.mgx-native-check-companion",
  "target": "linux/scripts/script-closures/migraphx-image.txt",
  "find": "03-media/build/migraphx/native-check-common.sh|03-media/build/migraphx/native-check-common.sh\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-image.sh",
  "why": "SDK and HIP checks require the same tracked native preparation companion in the narrow image bundle."
 },
 {
  "id": "lib.mgx-native-check-required-bindings",
  "target": "linux/scripts/03-media/build/migraphx/native-check-common.sh",
  "find": ": \"${rocm:?ROCm root required}\" \"${clang_root:?source Clang root required}\" \"${gcc_root:?source GCC root required}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "A missing source compiler or selected ROCm root cannot fall back to ambient device configuration."
 },
 {
  "id": "lib.mgx-native-check-setup-failure",
  "target": "linux/scripts/03-media/build/migraphx/native-check-common.sh",
  "find": "migraphx_prepare_native_work \"${work}\" work clang_root gcc_root || return",
  "replace": "migraphx_prepare_native_work \"${work}\" work clang_root gcc_root",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "A failing source toolchain resolver must keep its exact raw status before validating published bindings."
 },
 {
  "id": "compiler-llvm-tools.plan-required-transport-review",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "transport_review = reviewed_transport(source, args.profile)",
  "replace": "transport_review = None",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "Native planning must execute the pinned transport review before accepting control changes."
 },
 {
  "id": "compiler-llvm-tools.plan-required-control-review",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "control_changes = storage_changes(source, audit['files_sha256'], transport_review)",
  "replace": "control_changes = {}",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "The planner must execute all storage-control checks before recording current hashes."
 },
 {
  "id": "compiler-llvm-tools.plan-required-input-review",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "validate_input_changes(differences, args.profile, transport_review)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "The planner must reject additional source deltas rather than merely report them."
 },
 {
  "id": "compiler-llvm-tools.plan-transport-ancestor",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "    subprocess.check_output(['git', '-C', str(source), 'merge-base', '--is-ancestor', TRANSPORT_COMMIT, 'HEAD'], timeout=60)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "A blob alone cannot replace the required reviewed ancestor in the production source."
 },
 {
  "id": "compiler-llvm-tools.plan-transport-fixed-pin",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "TRANSPORT_COMMIT = '8271db71f46ab74393ff45c14864d0eaca6707a5'",
  "replace": "TRANSPORT_COMMIT = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "The native profile must request the particular reviewed transport commit."
 },
 {
  "id": "compiler-llvm-tools.plan-transport-exact-bytes",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "    assert (source / TRANSPORT).read_bytes() == expected, 'OCI transport differs from the reviewed commit'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "Current transport bytes must match the fixed committed blob before review metadata exists."
 },
 {
  "id": "compiler-llvm-tools.plan-all-five-controls",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "    assert set(previous) == CONTROLS, 'Storage audit requires exactly all five controls'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "A missing named storage control cannot disappear from the audit."
 },
 {
  "id": "compiler-llvm-tools.plan-no-extra-control",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "transport is not None and set(changes) == {TRANSPORT}",
  "replace": "transport is not None",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "A reviewed transport cannot authorize a second changed storage-control file."
 },
 {
  "id": "compiler-llvm-tools.plan-control-old-and-new",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "        assert changes[TRANSPORT] == {'previous': LEGACY_TRANSPORT_SHA, 'current': transport['sha256']}, 'Unexpected OCI control baseline'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "The sole permitted control delta binds both its known original and reviewed current hash."
 },
 {
  "id": "compiler-llvm-tools.plan-legacy-no-history-dependency",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "    if profile in ('clang-wrapper-repair', unique.NAME):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "The unchanged default profile does not acquire a native-transport history prerequisite."
 },
 {
  "id": "compiler-llvm-tools.plan-known-review-profile",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def reviewed_transport(source: Path, profile: str) -> TransportReview | None:\n    assert profile in PROFILES, 'Unknown compiler plan profile'",
  "replace": "def reviewed_transport(source: Path, profile: str) -> TransportReview | None:\n    pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "Unknown shared review profiles must refuse before behaving like native AMDGPU."
 },
 {
  "id": "compiler-llvm-tools.plan-known-input-profile",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_input_changes(differences: Json, profile: str, transport: TransportReview | None) -> None:\n    assert profile in PROFILES, 'Unknown compiler plan profile'",
  "replace": "def validate_input_changes(differences: Json, profile: str, transport: TransportReview | None) -> None:\n    pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "An unknown input profile cannot inherit the three-file default contract."
 },
 {
  "id": "compiler-llvm-tools.plan-exact-input-set",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "    assert set(differences) == expected, 'Compiler inputs differ from the reviewed profile'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "Each profile requires its complete changed-input set and refuses every extra path."
 },
 {
  "id": "compiler-llvm-tools.plan-native-review-mandatory",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "        assert transport is not None, 'Native AMDGPU planning requires reviewed OCI transport'",
  "replace": "        if transport is None:\n            return",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "Absent transport review must not skip native input validation."
 },
 {
  "id": "compiler-llvm-tools.plan-input-old-baseline",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "        assert entry['previous']['sha256'] == LEGACY_TRANSPORT_SHA, 'Unexpected OCI input baseline'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "The broader input reference retains the genuine prior transport hash."
 },
 {
  "id": "compiler-llvm-tools.plan-input-current-fingerprint",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "        assert entry['current'] == {'sha256': transport['sha256'], 'size': transport['size']}, 'OCI input fingerprint differs'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "Reviewed current transport hash and size must match the comparison row exactly."
 },
 {
  "id": "compiler-llvm-tools.plan-GNU-closure-unchanged",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "assert gnu_mounts and set(gnu_mounts) <= unchanged.keys()",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "A changed transport or any other changed input cannot be advertised as an unchanged GNU mount."
 },
 {
  "id": "compiler-llvm-tools.plan-Dockerfile-equality",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "    assert current.read_text() == expected, 'Compiler Dockerfile differs from its reviewed profile'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "Changed build instructions cannot reuse the old equal-Dockerfile cache-boundary claim."
 },
 {
  "id": "compiler-llvm-tools.plan-manager-storage-flags",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "assert all(name not in manager for name in audit['manager_keys_unset'])",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "Ambient storage flags remain refused in the new profile."
 },
 {
  "id": "compiler-llvm-tools.plan-reserve-floor",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "assert old['required_bytes'] == 193273528320",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "An unexpected predecessor disk-floor contract must refuse rather than be silently normalized."
 },
 {
  "id": "compiler-llvm-tools.plan-publication-refusal",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "assert '--push' not in command and command[-1] == str(compiler_output / 'logs')",
  "replace": "assert command[-1] == str(compiler_output / 'logs')",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "Plan preparation must not emit a publishing command with a false publication verdict."
 },
 {
  "id": "compiler-llvm-tools.plan-honest-control-verdict",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "source_control_files_equal_previous_audit=not control_changes",
  "replace": "source_control_files_equal_previous_audit=True",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "The audit must record the reviewed control change instead of laundering it as equality."
 },
 {
  "id": "compiler-llvm-tools.plan-default-profile-stable",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "choices=PROFILES, default='clang-wrapper-repair'",
  "replace": "choices=PROFILES, default='native-amdgpu'",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "The additional profile remains an explicit opt-in and preserves default callers."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-layout-version",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert json.loads(metadata['oci-layout']) == {'imageLayoutVersion': '1.0.0'}",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Unknown OCI cache layouts must refuse."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-single-manifest",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert index['schemaVersion'] == 2 and len(index['manifests']) == 1",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Ambiguous cache selections must refuse."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-manifest-type",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert selected['mediaType'] == MANIFEST",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Unsupported manifest types must refuse."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-cache-config",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert manifest['schemaVersion'] == 2 and manifest['config']['mediaType'] == CONFIG",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "An ordinary image config is not a BuildKit cache."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-nonempty-layers",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert manifest['layers']",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A layer-free cache cannot seed the intended build."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-descriptor-conflict",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert row['digest'] not in records or records[row['digest']] == row",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Repeated digests must retain one exact descriptor."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-successful-terminal",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert terminal['LoadState'] == 'loaded' and terminal['Result'] == 'success'",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A failed or missing producer cannot authorize transport."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-raw-status",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert terminal['MainPID'] == '0' and terminal['ExecMainStatus'] == '0'",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Live and failed producer command statuses remain visible."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-exited-terminal",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert terminal['ActiveState'] == 'active' and terminal['SubState'] == 'exited'",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A loaded successful exited terminal is required."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-stopped-proof",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert stopped['ActiveState'] == 'inactive' and stopped['MainPID'] == '0'",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A terminal observation is insufficient before stopping the producer."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-unit-binding",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert unit == stopped['Id'] and unit.endswith('.service') and not unit.startswith('-')",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Terminal and stopped records must name the same unit."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-current-idle",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert current == {'ActiveState': 'inactive', 'MainPID': '0'}",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A historical receipt cannot excuse a currently live producer."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-fresh-destination",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert not destination.exists() and not destination.is_symlink()",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Existing cache destinations must be preserved."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-fresh-receipt",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert not receipt.exists() and not receipt.is_symlink()",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Existing transport evidence must be preserved."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-disjoint-paths",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert not destination.is_relative_to(source) and not source.is_relative_to(destination), 'Cache paths overlap'",
  "replace": "assert True, 'Cache paths overlap'",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Parent and child cache trees cannot overlap."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-receipt-outside",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert not receipt.absolute().is_relative_to(source) and not receipt.absolute().is_relative_to(destination)",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A transport receipt cannot modify the cache source."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-same-filesystem",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert source.stat().st_dev == destination.parent.stat().st_dev",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Cross-filesystem copies cannot silently replace hard-link sharing."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-stable-metadata",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert all((source / name).read_bytes() == data for name, data in metadata.items())",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A source index changed during transfer cannot pass."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-stable-producer-proof",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert sha(proof_path) == proof_hash and stopped_producer(proof_path) == unit",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "The producer proof remains bound through the transfer."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-receipt-contract",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert record['schema_version'] == 1 and record['status'] == STATUS",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Reverification requires the declared transport receipt contract."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-proof-revalidation",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert sha(proof) == record['producer_proof_sha256'] and stopped_producer(proof) == record['producer_unit']",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A changed proof or producer identity invalidates the receipt."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-inventory-revalidation",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert metadata == source_metadata and records == source_records == record['descriptors']",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Receipt descriptors must match both real cache trees."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-metadata-revalidation",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert record['metadata_sha256'] == {name: sha(destination / name) for name in METADATA}",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Mutable metadata retains its exact recorded hashes."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-independent-metadata",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert not (source / name).samefile(destination / name)",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "The next cache export must not overwrite its source metadata."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-shared-blobs",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert descriptor_path(source, row).samefile(descriptor_path(destination, row))",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Verified transport must retain actual immutable blob sharing."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-blob-accounting",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert record['verified_unique_blobs'] == len(records)",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Duplicate descriptors cannot inflate blob accounting."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-byte-accounting",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert record['shared_unique_bytes'] == sum(row['size'] for row in records)",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Shared bytes must match the verified unique descriptors."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-no-acceptance",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert record['cache_hits_claimed'] is record['image_accepted'] is record['publication'] is False",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "Cache transport cannot become a cache-hit or image acceptance receipt."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-single-rendered-build",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert len(builds) == 1",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A supplied dry run must select exactly one build command."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-rendered-image",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert [value for flag, value in pairs if flag == '-t'] == [image]",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "The cache import check binds the intended actual image tag."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-rendered-cache-enabled",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert '--no-cache' not in command",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "A dry run that disables caching cannot pass cache-import admission."
 },
 {
  "id": "compiler-llvm-tools.cache-transfer-rendered-local-import",
  "target": "linux/scripts/local-proof/buildcache_transfer.py",
  "find": "assert imports == ['type=local,src=' + record['destination']]",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-buildcache-transfer.sh",
  "why": "The normal command must import exactly the transferred local cache namespace."
 },
 {
  "id": "lib.mgx-HIP-raw-device-output",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "--no-gpu-bundle-output ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "The ELF verifier requires raw device output rather than Clang's default HIP bundle; fixtures grade argv, not actual codegen."
 },
 {
  "id": "lib.mgx-HIP-invalid-object-diagnostic",
  "target": "linux/scripts/03-media/build/migraphx/check-hip-compiler.sh",
  "find": "printf 'HIP probe output is not a readable ELF device object\\n' >&2; ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-migraphx-hip-compiler.sh",
  "why": "A non-ELF result must fail with an explicit inspection diagnostic rather than an unexplained green compile."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-paired-proof",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "    assert bool(selected) == bool(proof_path), 'Alternate GPU source requires its complete source proof'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "Both alternate-source arguments are required; command doubles do not authenticate history or a real source proof."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-distinct-source",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "    assert source != producer.resolve(strict=True), 'Alternate GPU source must be distinct'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "An alias of the original SDK checkout cannot masquerade as the separately reviewed repair."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-frozen-SDK",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "    assert plan['source_revision'] == SDK_REVISION, 'HIP repair requires the reviewed frozen SDK source'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "The narrow HIP repair profile applies only to its fixed qualified SDK source."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-ancestor",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "    checked_run(['git', '-C', str(source), 'merge-base', '--is-ancestor', TOOL_BASE, head])",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "A source outside the reviewed tool ancestor must refuse before transport."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-base-inputs",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "    assert git_paths(source, SDK_REVISION, TOOL_BASE) == HOST_BASE_CHANGES, 'Unreviewed intervening image inputs'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "The intervening host-tool changes must match the exact reviewed set without gaining or dropping image inputs."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-current-inputs",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "    assert paths == REPAIR_CHANGES, 'Unreviewed HIP repair input changes'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "The alternate source cannot include an unreviewed production input or omit required changes; exact hash and full-source checks remain separate."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-exact-HIP-bytes",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "    assert (source / HIP).read_text() == expected_hip_repair((producer / HIP).read_text()), 'GPU source contains more than the exact HIP output-format repair'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "The HIP bytes remain exactly the raw-output flag and diagnostic even in the reviewed backend-install profile."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-original-anchors",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "        assert previous.count(before) == 1, 'Unrecognized original HIP check'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "Absent or repeated original HIP anchors must refuse instead of silently reviewing a different repair."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-Dockerfile-pins",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "        assert (source / relative).read_bytes() == (producer / relative).read_bytes(), 'SDK/GPU Dockerfile or pins differ'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "Independent file comparisons reject changed Dockerfiles or pins even when a Git double omits them."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-complete-source",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "    full = full_source(source, proof_path, head)",
  "replace": "    full = {'actual_full_registry_mutations': 1}",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "The actual new source must invoke complete-source verification; fixture metadata cannot substitute for it."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-default-source",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "        return producer, plan['source_revision'], Path(plan['full_source_preflight_proof']), None",
  "replace": "        return producer, 'wrong', Path(plan['full_source_preflight_proof']), None",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "Default invocations retain the original source revision and proof without selecting the repair."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-metadata-scope",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "name not in METADATA and not name.startswith('linux/scripts/tests/')",
  "replace": "name not in METADATA and not name.startswith(('linux/scripts/tests/', 'quality/'))",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "Quality pins remain production inputs rather than being ignored as test metadata."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-CLI-paths",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "select_gpu_source(plan, args.gpu_source, args.gpu_source_proof)",
  "replace": "select_gpu_source(plan, None, None)",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "The CLI must forward both explicit repair paths while retaining the qualified original SDK parent."
 },
 {
  "id": "compiler-llvm-tools.gpu-repair-CLI-revision",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "record = {'source_revision':revision, 'parent_source_revision':plan['source_revision']",
  "replace": "record = {'source_revision':plan['source_revision'], 'parent_source_revision':plan['source_revision']",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "A repaired GPU invocation records its actual source separately from the original qualified SDK source."
 },
 {
  "id": "lib.mgx-install-manifest-exact-repeat",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "for value in dict.fromkeys(rows):",
  "replace": "for value in rows:",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_cmake_exact_repeated_paths_keep_complete_file_and_symlink_bindings",
  "why": "Exact CMake repeats and private-layout bindings need executable positive and negative controls; fixtures do not prove an image, complete licences or GPU inference."
 },
 {
  "id": "lib.mgx-install-private-libraries",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "for directory in (\"lib\", \"lib/migraphx/lib\")",
  "replace": "for directory in (\"lib\",)",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_private_rocm_libraries_and_repeated_manifest_stage_original_notices",
  "why": "Exact CMake repeats and private-layout bindings need executable positive and negative controls; fixtures do not prove an image, complete licences or GPU inference."
 },
 {
  "id": "lib.mgx-install-ambiguous-library",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(len(candidates) == 1, \"Missing or ambiguous installed backend library: \" + library)",
  "replace": "require(bool(candidates), \"Missing or ambiguous installed backend library: \" + library)",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests.test_missing_or_ambiguous_private_libraries_refuse",
  "why": "Exact CMake repeats and private-layout bindings need executable positive and negative controls; fixtures do not prove an image, complete licences or GPU inference."
 },
 {
  "id": "lib.mgx-install-private-loader",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": "  local -a rocm_paths=(/opt/rocm/migraphx/lib /opt/rocm/migraphx/lib/migraphx/lib /opt/rocm/migraphx/lib64)\n",
  "replace": "  local -a rocm_paths=(/opt/rocm/migraphx/lib /opt/rocm/migraphx/lib64)\n",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "Exact CMake repeats and private-layout bindings need executable positive and negative controls; fixtures do not prove an image, complete licences or GPU inference."
 },
 {
  "id": "lib.mgx-install-gpu-private-environment",
  "target": "linux/Dockerfile.amd",
  "find": "/opt/rocm/migraphx/lib:/opt/rocm/migraphx/lib/migraphx/lib:/opt/rocm/migraphx/lib64:",
  "replace": "/opt/rocm/migraphx/lib:/opt/rocm/migraphx/lib64:",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Exact CMake repeats and private-layout bindings need executable positive and negative controls; fixtures do not prove an image, complete licences or GPU inference."
 },
 {
  "id": "lib.mgx-install-runtime-private-environment",
  "target": "linux/Dockerfile.package",
  "find": "/opt/rocm/migraphx/lib:/opt/rocm/migraphx/lib/migraphx/lib:/opt/rocm/migraphx/lib64:",
  "replace": "/opt/rocm/migraphx/lib:/opt/rocm/migraphx/lib64:",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py",
  "why": "Exact CMake repeats and private-layout bindings need executable positive and negative controls; fixtures do not prove an image, complete licences or GPU inference."
 },
 {
  "id": "compiler-llvm-tools.gpu-install-repair-exact-bytes",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "assert sha(source / relative) == expected, 'Backend install repair bytes differ: ' + relative",
  "replace": "assert True, 'Backend install repair bytes differ: ' + relative",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "Exact CMake repeats and private-layout bindings need executable positive and negative controls; fixtures do not prove an image, complete licences or GPU inference."
 },
 {
  "id": "compiler-llvm-tools.gpu-runtime-repair-exact-paths",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "        if paths == REPAIR_CHANGES | hashes.keys():",
  "replace": "        if REPAIR_CHANGES <= paths:",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "Runtime repair admission requires the complete exact path set before reading files; fixtures do not authenticate source history or an image."
 },
 {
  "id": "compiler-llvm-tools.gpu-runtime-repair-scope",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "('backend-runtime-load', RUNTIME_REPAIR_HASHES)",
  "replace": "('backend-install-manifest', RUNTIME_REPAIR_HASHES)",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "The new loader repair keeps an explicit proof scope instead of relabeling the historical install profile."
 },
 {
  "id": "compiler-llvm-tools.gpu-runtime-repair-current-bytes",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "'fe1e27fdd1ae4e5679c9ec79f63d516d18fde2070063aa9725137cd70131e012'",
  "replace": "'0000000000000000000000000000000000000000000000000000000000000000'",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "The runtime profile binds the actual current loader-gate bytes while preserving earlier source pins; supplied proofs do not authenticate provenance."
 },
 {
  "id": "lib.rocm-source-paths-sqlite-required",
  "target": "linux/scripts/06-packaging/media-payloads.sh",
  "find": " -o -name 'librocm_sysdeps_sqlite3.so*'",
  "replace": "",
  "test": "bash linux/scripts/tests/test-rocm-loader-paths.sh",
  "why": "The original ROCm SQLite soname must be discovered for the real backend dependency; filesystem controls do not prove native ABI or GPU inference."
 },
 {
  "id": "lib.mgx-load-prefix-absolute",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "prefix.is_absolute() and prefix.is_dir() and not prefix.is_symlink()",
  "replace": "prefix.is_dir() and not prefix.is_symlink()",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Actual library loading requires an absolute installed prefix; tiny native DSO fixtures do not prove a vendor backend or hardware acceptance."
 },
 {
  "id": "lib.mgx-load-prefix-directory",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "prefix.is_absolute() and prefix.is_dir() and not prefix.is_symlink()",
  "replace": "prefix.is_absolute() and not prefix.is_symlink()",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Missing or non-directory prefixes refuse before provenance reads; native fixture success does not establish full ABI or licence closure."
 },
 {
  "id": "lib.mgx-load-prefix-alias",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "prefix.is_absolute() and prefix.is_dir() and not prefix.is_symlink()",
  "replace": "prefix.is_absolute() and prefix.is_dir()",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "A symlinked prefix cannot masquerade as the selected installation; fixture loading is separate from actual image acceptance."
 },
 {
  "id": "lib.mgx-load-contained-target",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(path.resolve().is_relative_to(prefix.resolve()), \"Backend load path escapes its prefix\")",
  "replace": "require(True, \"Backend load path escapes its prefix\")",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Even matching bytes cannot redirect an entry-library load outside its installed prefix; selected loads do not prove the full dependency closure."
 },
 {
  "id": "lib.mgx-load-installed-bytes",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "require(digest(path) == files[name][\"sha256\"], \"Backend load bytes differ from installation\")",
  "replace": "require(True, \"Backend load bytes differ from installation\")",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Entry-library bytes must match the staged install record before loading; this does not authenticate the record or prove complete binary licences."
 },
 {
  "id": "lib.mgx-load-every-entry",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "    for name in selected_libraries(files):",
  "replace": "    for name in selected_libraries(files)[:2]:",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "All seven independently expected entry libraries must load, including the GPU target; fixture DSOs do not run GPU inference."
 },
 {
  "id": "lib.mgx-load-real-loader",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "        handles.append(ctypes.CDLL(str(path)))",
  "replace": "        handles.append(str(path))",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "Hash and path checks cannot replace an actual dynamic-library load or its missing-dependency failure; no complete ABI proof is claimed."
 },
 {
  "id": "lib.mgx-load-cli-dispatch",
  "target": "linux/scripts/03-media/build/migraphx/stage-backend-install.py",
  "find": "            verify_loads(args.prefix)",
  "replace": "            pass",
  "test": "python3 linux/scripts/tests/migraphx_backend_build_tests.py MigraphxBackendInstallTests",
  "why": "The real CLI must execute its loader gate before emitting success; command fixtures do not accept a finished image."
 },
 {
  "id": "lib.mgx-image-load-gate-required",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "\"${HOST_PYTHON_BIN}\" \"${SCRIPT_DIR}/stage-backend-install.py\" verify-loads --prefix \"${MIGRAPHX_SOURCE_PREFIX}\"\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py ImageEntryTests",
  "why": "The ordinary producer must invoke the preserved load check after publication and ldconfig; child doubles prove wiring and raw failures, not a real image."
 },
 {
  "id": "lib.mgx-image-load-gate-after-ldconfig",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "ldconfig\n\"${HOST_PYTHON_BIN}\" \"${SCRIPT_DIR}/stage-backend-install.py\" verify-loads --prefix \"${MIGRAPHX_SOURCE_PREFIX}\"\n",
  "replace": "\"${HOST_PYTHON_BIN}\" \"${SCRIPT_DIR}/stage-backend-install.py\" verify-loads --prefix \"${MIGRAPHX_SOURCE_PREFIX}\"\nldconfig\n",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py ImageEntryTests",
  "why": "The load gate observes the newly published loader configuration and retains fatal ordering; shell fixtures do not prove runtime ABI or inference."
 },
 {
  "id": "lib.mgx-image-load-gate-source-prefix",
  "target": "linux/scripts/03-media/build/migraphx/build-image.sh",
  "find": "verify-loads --prefix \"${MIGRAPHX_SOURCE_PREFIX}\"",
  "replace": "verify-loads --prefix /opt/rocm",
  "test": "python3 linux/scripts/tests/migraphx_image_tests.py ImageEntryTests",
  "why": "The producer checks the actual source installation rather than the retained distro SDK; fixture argument checks are separate from loader selection in an image."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-01",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert value['Id'] == unit and value['LoadState'] == 'loaded', 'Producer unit is missing'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-02",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert value['ActiveState'] == 'active' and value['SubState'] == 'exited', 'Producer has not succeeded'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-03",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert value['MainPID'] == value['ExecMainStatus'] == '0' and value['Result'] == 'success', 'Producer failed or remains live'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-04",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert invocation['stage'] == 'gpu' and invocation['variant'] == 'rocm' and invocation['target_arch'] == 'amd64', 'Only ordinary ROCm amd64 is reviewed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-05",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert re.fullmatch(r'webgpu-normal-' + stage + r'-amd64-[0-9-]+\\.service', invocation['unit']), 'Unexpected downstream producer unit'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-06",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert invocation['launch_status'] == 0 and invocation['publication'] is False, 'Successful unpublished downstream launch required'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-07",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert invocation['source_full_preflight_passed'] and invocation['producer_source_unchanged'], 'Downstream source proof was not retained'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-08",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert invocation['parent_' + field] == parent[field], 'Downstream parent identity differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-09",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert invocation['parent_OCI_index_sha256'] == parent['index_sha256'], 'Downstream parent index differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-10",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert invocation['SDK_layers_rehashed'] == parent['layers'] and invocation['compiler_layers_rehashed'] == 26, 'GPU ancestry coverage differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-11",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert repo.startswith('ant-local/webgpu-') and invocation['image'] == repo + suffix, 'Unexpected local downstream image'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-12",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert command[:2] == ['systemd-run', '--user'] and '--expand-environment=no' in command, 'Downstream transport differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-13",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert command[-10:] == ['/bin/bash', str(source / 'linux/scripts/build-cross-stage.sh'), '--stage', stage, '--arch', 'amd64', '--image-repo', repo, '--log-dir', str(output / 'logs')], 'Downstream stage command differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-14",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert command.count('CROSS_VARIANT=rocm') == 1 and command.count('CROSS_' + stage.upper() + '_BASE_CONTEXT=' + parent['context']) == 1, 'Downstream context or variant differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-15",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert references == [expected], 'Downstream parent must use its actual repository and digest'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-16",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert '--push' not in command and '--gates-only' not in command, 'Actual unpublished downstream build required'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-17",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert Path(invocation['output']) == invocation_path.resolve().parent, 'GPU output binding differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-18",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert sha(sdk_invocation) == invocation['SDK_invocation_sha256'] and sha(parent_path) == invocation['parent_OCI_proof_sha256'], 'GPU SDK receipt bytes changed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-19",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert str(source) == invocation['source'] and revision == invocation['source_revision'], 'GPU source differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-20",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert sha(full) == invocation['source_full_preflight_sha256'] and invocation['GPU_source_review'] == review, 'GPU source review differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-21",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert invocation['parent_source_revision'] == plan['source_revision'], 'GPU parent source differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-22",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert len(images) == 1, 'GPU engine query must select one image'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-23",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert len(digests) == 1, 'GPU image manifest is ambiguous'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-24",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert re.fullmatch(r'sha256:[0-9a-f]{64}', manifest), 'GPU manifest is malformed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-25",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert re.fullmatch(r'sha256:[0-9a-f]{64}', actual['Id']), 'GPU config is malformed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-26",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['status'] == status and proof[kind + '_invocation'] == str(invocation_path.resolve()), f'{kind} OCI proof scope differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-27",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof[kind + '_invocation_sha256'] == sha(invocation_path), f'{kind} invocation bytes changed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-28",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['source_revision'] == invocation['source_revision'], f'{kind} OCI source differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-29",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['parent_OCI_proof_sha256'] == invocation['parent_OCI_proof_sha256'], f'{kind} OCI {parent_kind} proof differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-30",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['export_transport'] == {'producer_status': 0, 'extractor_status': 0} and proof['parent_layer_reuse_verified'], f'{kind} export transport failed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-31",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['matched_' + parent_kind + '_layers_and_diffIDs'] == parent['layers'], f'{kind} {parent_kind} coverage differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-profile-32",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['manifest'] == actual['manifest'] and proof['config'] == actual['config'], f'Engine {kind} image differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-01",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert COMMON['state'](args.unit)['LoadState'] == 'not-found' and not context.exists() and not context.is_symlink(), 'Preserve existing export work'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-02",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert not path.exists(), 'Preserve existing export invocation'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-03",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert plan['required_bytes'] >= 193273528320 and disk['available_bytes'] >= plan['required_bytes'], 'Unchanged disk reserve required'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-04",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert record['unit'] == args.unit and record['context'] == str(context), f'{label} export binding differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-05",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert record[label + '_invocation'] == str(invocation_path.resolve()) and record['parent_OCI_proof_sha256'] == invocation['parent_OCI_proof_sha256'], f'{label} export input paths or parent proof differ'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-06",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert record[label + '_invocation_sha256'] == sha(invocation_path) and record['actual_image'] == actual, f'{label} export subject changed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-07",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert record['worker_inputs_sha256'] == worker_inputs(kind) and record['launch_status'] == 0, f'{label} export inputs changed or launch failed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-08",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert child[0] == actual['manifest'] and child[1]['config']['digest'] == actual['config'], f'{label} native bytes differ'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-09",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert transport == {'producer_status':0, 'extractor_status':0}, f'{label} export producer or extractor failed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-10",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert not context.with_suffix('.proof.json').exists() and not context.with_suffix('.proof-stopped.json').exists(), f'Preserve sealed {label} proofs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-11",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert proof['stopped']['ActiveState'] == 'inactive' and proof['stopped']['MainPID'] == '0', f'{label} export did not stop'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-12",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert context.parent.resolve(strict=True) == context.parent and context.name.startswith(kind + '-context-'), f'Fresh plain {label} context required'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-13",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert re.fullmatch(r'webgpu-normal-' + kind + r'-export-amd64-[0-9-]+\\.service', args.unit), f'Unexpected {label} export unit'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Independent positive/negative OCI and command fixtures must detect lost binding or failed transport; no image, provenance authentication or hardware acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-ancestry",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "    layer_ancestry(native, ancestor, parent['layers'])",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Preserve real ancestry checks, raw failures and required Wasm forwarding; fixtures do not prove image completion or hardware inference."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-raw",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "    return result.returncode",
  "replace": "    return 0",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Preserve real ancestry checks, raw failures and required Wasm forwarding; fixtures do not prove image completion or hardware inference."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-raw-receipt",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "record.update(launch_status=result.returncode, stdout=result.stdout, stderr=result.stderr)",
  "replace": "record.update(launch_status=0, stdout=result.stdout, stderr=result.stderr)",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Preserve real ancestry checks, raw failures and required Wasm forwarding; fixtures do not prove image completion or hardware inference."
 },
 {
  "id": "compiler-llvm-tools.gpu-handoff-export-reused-layers",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "    previous, reuse = verify_seed(Path(invocation['parent_OCI_proof']), context)",
  "replace": "    sdk, reuse = native_layout(Path(json.loads(Path(invocation['parent_OCI_proof']).read_text())['context'])), {}",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Preserve real ancestry checks, raw failures and required Wasm forwarding; fixtures do not prove image completion or hardware inference."
 },
 {
  "id": "compiler-llvm-tools.media-both-wasm-modes",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "        environment += ['ORT_WEB_REQUIRED=1', 'ORT_WASM_WEBGPU_FLAVORS=true']",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "Preserve real ancestry checks, raw failures and required Wasm forwarding; fixtures do not prove image completion or hardware inference."
 },
 {
  "id": "compiler-llvm-tools.gpu-local-selector-export-manifest",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "    reference = actual['manifest']",
  "replace": "    reference = actual['image'].rsplit(':', 1)[0] + '@' + actual['manifest']",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "The installed local engine resolves the immutable manifest ID for a Docker-loaded GPU image; synthetic transports do not prove an actual native export or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.gpu-local-selector-not-config",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "    reference = actual['manifest']",
  "replace": "    reference = actual['config']",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "The exported selector must be the manifest ID, not Docker inspection's config ID; metadata equality alone does not perform an OCI export."
 },
 {
  "id": "compiler-llvm-tools.gpu-local-selector-query-required",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "    resolved = json.loads(checked_run([engine, 'image', 'inspect', manifest]).stdout)",
  "replace": "    resolved = [actual]",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "The immutable local selector needs its own successful real engine query; the tag lookup cannot substitute for it, and command doubles do not authenticate image bytes."
 },
 {
  "id": "compiler-llvm-tools.gpu-local-selector-cardinality",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "len(resolved) == 1 and resolved[0]['Id'] == actual['Id']",
  "replace": "resolved[0]['Id'] == actual['Id']",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "Multiple local selector matches cannot pass by using the first config; wrong-cardinality fixtures are independent of native export and SDK ancestry."
 },
 {
  "id": "compiler-llvm-tools.gpu-local-selector-config-binding",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "len(resolved) == 1 and resolved[0]['Id'] == actual['Id']",
  "replace": "len(resolved) == 1",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "The separately resolved manifest must bind the same validated config as the tagged image; this does not prove runtime loading or inference."
 },
 {
  "id": "compiler-llvm-tools.gpu-local-selector-manifest-binding",
  "target": "linux/scripts/local-proof/gpu_handoff_profile.py",
  "find": "assert {value.rsplit('@', 1)[1] for value in resolved[0]['RepoDigests']} == {manifest}, 'Local immutable manifest digest differs'",
  "replace": "assert True, 'Local immutable manifest digest differs'",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "The local ID lookup must also retain the exact manifest identity; a matching config with another manifest cannot qualify this transport."
 },
 {
  "id": "compiler-llvm-tools.media-cache-reader-cpu-marker",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "--step cpu;'",
  "replace": "--step genai;'",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The independent actual-Dockerfile CPU command must match the selected reader profile before output is allocated."
 },
 {
  "id": "compiler-llvm-tools.media-cache-reader-gpu-marker",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "--step gpu;'",
  "replace": "--step genai;'",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The independent actual-Dockerfile GPU/plugin command must match its own reader phase."
 },
 {
  "id": "compiler-llvm-tools.media-cache-reader-web-marker",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "web-wasm-cache.sh;'",
  "replace": "web-wasm-cache.sh --verify-only;'",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Wasm compilation retention must select the real build wrapper, not the separate verify-only invocation."
 },
 {
  "id": "compiler-llvm-tools.media-cache-reader-owner",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "owner = 'media' if phase in MEDIA_PHASE_MARKERS",
  "replace": "owner = 'compiler' if phase in MEDIA_PHASE_MARKERS",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Media reader phases require their explicit Media unit family and refuse compiler-family substitutions."
 },
 {
  "id": "compiler-llvm-tools.media-cache-reader-cpu-outer-lifetime",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "--step cpu;'",
  "replace": "--step cpu'",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The CPU child command cannot replace the outer RUN lifetime that retains its final drain."
 },
 {
  "id": "compiler-llvm-tools.media-cache-reader-gpu-outer-lifetime",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "--step gpu;'",
  "replace": "--step gpu'",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The GPU/plugin child command cannot replace the outer RUN lifetime."
 },
 {
  "id": "compiler-llvm-tools.media-cache-reader-web-outer-lifetime",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "web-wasm-cache.sh;'",
  "replace": "web-wasm-cache.sh'",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The Wasm child command cannot satisfy the exact outer build-wrapper marker."
 },
 {
  "id": "compiler-llvm-tools.media-cache-reader-input-closure",
  "target": "linux/scripts/local-proof/seal-sccache-log-capture.py",
  "find": "if capture[\"phase\"] == \"migraphx\" or capture[\"phase\"] in MEDIA_PHASE_MARKERS:",
  "replace": "if capture[\"phase\"] == \"migraphx\":",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "Each Media phase must reject missing worker/profile hashes before any proof is written, while complete inputs can seal."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-cache-reader-phase",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "    'app-wheelhouse': 'bash /opt/scripts/frameworks/torch/build-app-wheelhouse.sh;',\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The actual wheelhouse outer RUN must remain an explicitly supported Media reader phase."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-cache-reader-outer-lifetime",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "'app-wheelhouse': 'bash /opt/scripts/frameworks/torch/build-app-wheelhouse.sh;'",
  "replace": "'app-wheelhouse': 'bash /opt/scripts/frameworks/torch/build-app-wheelhouse.sh'",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "An inner wheelhouse child ends before the outer final cache drain and cannot satisfy phase retention."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-configure-root",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "'app-wheelhouse': ('tmp', 'app-wheelhouse', 'iree-build-target')",
  "replace": "'app-wheelhouse': ('tmp', 'app-wheelhouse')",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The IREE target profile must reject sibling wheelhouse build directories."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-configure-owner",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert phase == 'migraphx' or re.fullmatch(r'webgpu-normal-media-(?:amd64|arm64|riscv64)-[0-9-]+\\.service', inv['unit']), 'Media snapshot requires its Media producer unit'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "A live GPU unit is not the selected Media wheelhouse producer."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-configure-supported-phase",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    assert phase in CONFIGURE_ROOTS, 'Unsupported configure snapshot phase'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "Unsupported configure phases must refuse explicitly before allocating output."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-configure-selected-root",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    selected = CONFIGURE_ROOTS[phase]",
  "replace": "    selected = CONFIGURE_ROOTS['migraphx']",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The selected IREE phase must retain its own build root rather than the legacy MIGraphX root."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-configure-receipt-phase",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "'phase':phase, 'pid':pid",
  "replace": "'phase':'migraphx', 'pid':pid",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "A Media snapshot receipt must record the actual selected phase."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-configure-cli-phase",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    record = snapshot(args.invocation,args.pid,args.relative_root,args.output,phase=args.phase)",
  "replace": "    record = snapshot(args.invocation,args.pid,args.relative_root,args.output)",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The CLI must forward the explicit Media phase rather than silently choosing MIGraphX."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-cache-reader-input-closure",
  "target": "linux/scripts/local-proof/seal-sccache-log-capture.py",
  "find": "if capture[\"phase\"] == \"migraphx\" or capture[\"phase\"] in MEDIA_PHASE_MARKERS:",
  "replace": "if capture[\"phase\"] in {\"migraphx\", \"ort-cpu\", \"ort-gpu\", \"ort-web\"}:",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The wheelhouse reader must also reject missing worker/profile hashes before any sealed proof is written."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-configure-file-limit",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    max_file = MAX_TOTAL if phase == 'app-wheelhouse' else MAX_FILE",
  "replace": "    max_file = MAX_FILE",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "The explicit IREE profile permits its real large Ninja file within the unchanged aggregate byte bound."
 },
 {
  "id": "compiler-llvm-tools.wheelhouse-configure-legacy-file-limit",
  "target": "linux/scripts/local-proof/snapshot-live-configure.py",
  "find": "    max_file = MAX_TOTAL if phase == 'app-wheelhouse' else MAX_FILE",
  "replace": "    max_file = MAX_TOTAL",
  "test": "bash linux/scripts/tests/test-live-configure-snapshot.sh",
  "why": "Adding the IREE profile must preserve the original MIGraphX per-file byte bound."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-01",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert invocation['parent_source_revision'] == previous['source_revision'], 'Downstream parent source differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-02",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert invocation[parent_kind + '_layers_rehashed'] == parent['layers'], 'Downstream parent layer coverage differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-03",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert invocation[ancestor_kind + '_layers_matched'] == parent['matched_' + ancestor_kind + '_layers_and_diffIDs'], 'Downstream ancestry differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-04",
  "target": "linux/scripts/local-proof/media_handoff_profile.py",
  "find": "assert invocation['ORT_WEB_REQUIRED'] == 1 and invocation['ORT_WASM_WEBGPU_FLAVORS'] is True, 'Both required Media Wasm modes must be retained'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-05",
  "target": "linux/scripts/local-proof/media_handoff_profile.py",
  "find": "assert invocation['command'].count('ORT_WEB_REQUIRED=1') == invocation['command'].count('ORT_WASM_WEBGPU_FLAVORS=true') == 1, 'Media Wasm command flags differ'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-06",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert Path(invocation['output']) == invocation_path.resolve().parent, f'{kind} output binding differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-07",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert sha(parent_path) == invocation[parent_kind + '_invocation_sha256'] and sha(proof_path) == invocation['parent_OCI_proof_sha256'], f'{kind} parent receipt bytes changed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-08",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['status'] == status and proof[kind + '_invocation'] == str(invocation_path.resolve()), f'{kind} OCI proof scope differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-09",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof[kind + '_invocation_sha256'] == sha(invocation_path), f'{kind} invocation bytes changed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-10",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['source_revision'] == invocation['source_revision'], f'{kind} OCI source differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-11",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['parent_OCI_proof_sha256'] == invocation['parent_OCI_proof_sha256'], f'{kind} OCI {parent_kind} proof differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-12",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['export_transport'] == {'producer_status': 0, 'extractor_status': 0} and proof['parent_layer_reuse_verified'], f'{kind} export transport failed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-13",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['matched_' + parent_kind + '_layers_and_diffIDs'] == parent['layers'], f'{kind} {parent_kind} coverage differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-14",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['manifest'] == actual['manifest'] and proof['config'] == actual['config'], f'Engine {kind} image differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-profile-15",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert invocation[field] == previous[field], 'Downstream must retain its exact proven parent source'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent real-byte and command fixtures reject lost Media source, GPU parent, Wasm flags, receipt or engine binding; no real build or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-stage-domain",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert stage in {'gpu', 'media', 'android'} and invocation['target_arch'] == 'amd64', 'Unreviewed ordinary downstream stage'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-parent-record-domain",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "assert parent_kind in {'SDK', 'GPU', 'Media', 'Android'}, 'Unreviewed downstream parent kind'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-source-record-sha",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "'source_full_preflight_sha256': invocation['source_full_preflight_sha256']",
  "replace": "'source_full_preflight_sha256': 'wrong'",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-source-record-flags",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "'source_full_preflight_passed': True, 'producer_source_unchanged': True",
  "replace": "'source_full_preflight_passed': False, 'producer_source_unchanged': False",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-parent-invocation-sha",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "parent_kind + '_invocation_sha256': sha(invocation_path)",
  "replace": "parent_kind + '_invocation_sha256': sha(proof_path)",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-parent-proof-sha",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "'parent_OCI_proof_sha256': sha(proof_path)",
  "replace": "'parent_OCI_proof_sha256': sha(invocation_path)",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-export-kind-domain",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert kind in EXPORTS, 'Unreviewed native downstream export'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-export-parent-scope",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "'media': ('Media', 'GPU', MEDIA_STATUS)",
  "replace": "'media': ('Media', 'SDK', STATUS)",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-export-worker-closure",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "if kind in {'media', 'android', *DEFAULT_EXPORTS, *NVIDIA_EXPORTS}:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-export-dispatch-kind",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "return launch(args, plan, invocation, actual, kind) if args.action == 'launch' else seal(args, invocation, parent, actual, kind)",
  "replace": "return launch(args, plan, invocation, actual) if args.action == 'launch' else seal(args, invocation, parent, actual)",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-export-entry-kind",
  "target": "linux/scripts/local-proof/media-oci-handoff.py",
  "find": "return TRANSPORT['main_for']('media', load_media)",
  "replace": "return TRANSPORT['main_for']('gpu', load_media)",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-android-load-binding",
  "target": "linux/scripts/local-proof/launch-normal-android.py",
  "find": "load_media(args.compiler_plan, args.media_invocation)",
  "replace": "load_media(args.compiler_plan, args.parent_proof)",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-android-native-binding",
  "target": "linux/scripts/local-proof/launch-normal-android.py",
  "find": "media_layout(args.parent_proof, args.media_invocation, invocation, gpu)",
  "replace": "media_layout(args.parent_proof, args.compiler_plan, invocation, gpu)",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-android-stage",
  "target": "linux/scripts/local-proof/launch-normal-android.py",
  "find": "'android', 'amd64',",
  "replace": "'media', 'amd64',",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-android-record-parent",
  "target": "linux/scripts/local-proof/launch-normal-android.py",
  "find": "parent, 'Media')",
  "replace": "parent, 'GPU')",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-android-canonical-tag",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "'android':'cross_android_tag'",
  "replace": "'android':'cross_media_tag'",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-native-media-parent",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": ", MEDIA_STATUS, ANDROID_STATUS, DEFAULT_MEDIA_STATUS, DEFAULT_ANDROID_STATUS}",
  "replace": ", ANDROID_STATUS, DEFAULT_MEDIA_STATUS, DEFAULT_ANDROID_STATUS}",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Independent native-byte and command fixtures must reject changed Media/Android scope, parent/source identity or failed transport; this proves no real build, authenticated receipt or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.media-handoff-native-ancestry",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "    layer_ancestry(native, ancestor, parent['layers'])",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-media-handoff.sh",
  "why": "Valid but unrelated Media blobs must not replace the exact recorded GPU layer descriptors and diffIDs."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-01",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert invocation[field] == previous[field], 'Downstream must retain its exact proven parent source'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-02",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert invocation['parent_source_revision'] == previous['source_revision'], 'Downstream parent source differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-03",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert invocation[parent_kind + '_layers_rehashed'] == parent['layers'], 'Downstream parent layer coverage differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-04",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert invocation[ancestor_kind + '_layers_matched'] == parent['matched_' + ancestor_kind + '_layers_and_diffIDs'], 'Downstream ancestry differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-05",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert Path(invocation['output']) == invocation_path.resolve().parent, f'{kind} output binding differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-06",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert sha(parent_path) == invocation[parent_kind + '_invocation_sha256'] and sha(proof_path) == invocation['parent_OCI_proof_sha256'], f'{kind} parent receipt bytes changed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-07",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['status'] == status and proof[kind + '_invocation'] == str(invocation_path.resolve()), f'{kind} OCI proof scope differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-08",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof[kind + '_invocation_sha256'] == sha(invocation_path), f'{kind} invocation bytes changed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-09",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['source_revision'] == invocation['source_revision'], f'{kind} OCI source differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-10",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['parent_OCI_proof_sha256'] == invocation['parent_OCI_proof_sha256'], f'{kind} OCI {parent_kind} proof differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-11",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['export_transport'] == {'producer_status': 0, 'extractor_status': 0} and proof['parent_layer_reuse_verified'], f'{kind} export transport failed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-12",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['matched_' + parent_kind + '_layers_and_diffIDs'] == parent['layers'], f'{kind} {parent_kind} coverage differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-guard-13",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert proof['manifest'] == actual['manifest'] and proof['config'] == actual['config'], f'Engine {kind} image differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-command",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "    validate_stage_invocation(invocation, parent, stage, previous['image'])",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-shared-native-ancestry",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "    layer_ancestry(native, ancestor, parent['layers'])",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-stage-and-variant",
  "target": "linux/scripts/local-proof/android_handoff_profile.py",
  "find": "assert invocation['stage'] == 'android' and invocation['variant'] == 'rocm', 'Only ordinary ROCm Android is reviewed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-inherited-source-call",
  "target": "linux/scripts/local-proof/android_handoff_profile.py",
  "find": "    validate_inherited_source(invocation, parent, media, 'android', 'Media', 'GPU')",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-load-validation",
  "target": "linux/scripts/local-proof/android_handoff_profile.py",
  "find": "    validate_android(invocation, parent, media)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-load-media-parent",
  "target": "linux/scripts/local-proof/android_handoff_profile.py",
  "find": "'Android', 'Media', load_media, media_layout",
  "replace": "'Android', 'GPU', load_media, media_layout",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-native-layout-subject",
  "target": "linux/scripts/local-proof/android_handoff_profile.py",
  "find": "'Android', 'Media', STATUS, actual_image",
  "replace": "'Media', 'Media', STATUS, actual_image",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-native-layout-parent",
  "target": "linux/scripts/local-proof/android_handoff_profile.py",
  "find": "'Android', 'Media', STATUS, actual_image",
  "replace": "'Android', 'GPU', STATUS, actual_image",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-export-scope",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "'android': ('Android', 'Media', ANDROID_STATUS)",
  "replace": "'android': ('Android', 'GPU', STATUS)",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-worker-closure",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "if kind in {'android', 'nvidia-android'}:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-inherited-worker-closure",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "if kind in {'media', 'android', *DEFAULT_EXPORTS, *NVIDIA_EXPORTS}:",
  "replace": "if kind == 'media':",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-entry-kind",
  "target": "linux/scripts/local-proof/android-oci-handoff.py",
  "find": "return TRANSPORT['main_for']('android', load_android)",
  "replace": "return TRANSPORT['main_for']('media', load_android)",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.android-handoff-native-parent-status",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": ", MEDIA_STATUS, ANDROID_STATUS, DEFAULT_MEDIA_STATUS, DEFAULT_ANDROID_STATUS}",
  "replace": ", MEDIA_STATUS, DEFAULT_MEDIA_STATUS, DEFAULT_ANDROID_STATUS}",
  "test": "bash linux/scripts/tests/test-android-handoff.sh",
  "why": "Independent Android controls bind actual source/Media ancestry, exact bytes, recursive workers and raw statuses; no real Android build, authenticated provenance or FINAL acceptance follows."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-1",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert actual['image'].startswith('ant-local/webgpu-'), 'Reviewed local Android image required'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-2",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert re.fullmatch(r'sha256:[0-9a-f]{64}', actual['manifest']) and re.fullmatch(r'sha256:[0-9a-f]{64}', actual['config']), 'Exact Android manifest/config required'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-3",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert not path.exists() and not path.is_symlink(), 'Preserve prior local alias evidence'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-4",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert len(rows) <= 1, 'Local immutable alias is ambiguous'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-5",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert len(rows) == 1 and rows[0]['Digest'] == actual['manifest'] and rows[0]['Platform'] == platform, 'Local immutable alias differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-6",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert len(resolved) == 1 and resolved[0]['Id'] == actual['config'], 'Local immutable alias config differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-7",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert {value.rsplit('@', 1)[1] for value in resolved[0]['RepoDigests']} == {actual['manifest']}, 'Local immutable manifest differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-8",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert len(values) == len(set(values)) == 3, 'Canonical runtime tags must be distinct'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-9",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert re.fullmatch(r'webgpu-normal-runtime-amd64-[0-9-]+\\.service', unit), 'Unexpected runtime producer unit'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-10",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert re.fullmatch(r'ant-local/webgpu-[a-z0-9][a-z0-9-]*:runtime-rocm-[A-Za-z0-9][A-Za-z0-9_.-]{0,90}', prefix), 'Fresh local ROCm runtime prefix required'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-11",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert re.fullmatch(r'[0-9a-f]{40}', app_ref), 'Runtime app ref must be one exact commit'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-12",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert context.name.endswith(suffix), 'Native Android context must retain the runtime architecture suffix'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-13",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert not checked_run(['git', '-C', str(host_root), 'status', '--porcelain']).stdout.strip(), 'Commit host tools before runtime launch'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-14",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert rows[0]['Digest'] == actual['manifest'] and rows[0]['Platform'] == platform, 'Preserve a foreign existing alias'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-runtime-launch-profile-assert-15",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert result.returncode == 0, 'Local immutable alias creation failed'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-owned-nerdctl-args-assert-1",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "assert Path(engine).is_absolute(), 'Runtime engine must be an absolute executable path'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-owned-nerdctl-args-assert-2",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "assert arguments, 'Pass one explicit nerdctl command'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-owned-nerdctl-args-assert-3",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "assert not arguments[0].startswith('-') or arguments in [['--help'], ['-h'], ['--version'], ['-v']], 'Unreviewed global nerdctl options'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-owned-nerdctl-args-assert-4",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "assert not any(value == '--label-file' or value.startswith('--label-file=') for value in arguments[position:]), 'Label files cannot override runtime ownership'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-owned-nerdctl-args-assert-5",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "assert not assigned.startswith(label + '='), 'Caller cannot override runtime ownership'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-owned-nerdctl-assert-1",
  "target": "linux/scripts/owned-nerdctl.py",
  "find": "assert Path(command[0]).resolve() != Path(__file__).resolve(), 'The runtime engine cannot recurse into its wrapper'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-1",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'CROSS_VARIANT=rocm'",
  "replace": "'CROSS_VARIANT=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-2",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'CROSS_NO_PUSH=1'",
  "replace": "'CROSS_NO_PUSH=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-3",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'ENABLE_AMD=true'",
  "replace": "'ENABLE_AMD=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-4",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'ENABLE_NVIDIA=false'",
  "replace": "'ENABLE_NVIDIA=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-5",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'ENABLE_DEEPSTREAM=false'",
  "replace": "'ENABLE_DEEPSTREAM=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-6",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'ENABLE_TENSORRT=false'",
  "replace": "'ENABLE_TENSORRT=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-7",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'ENABLE_ROCM_ASAN=false'",
  "replace": "'ENABLE_ROCM_ASAN=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-8",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'BUILD_TYPE=Release'",
  "replace": "'BUILD_TYPE=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-9",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'TORCH_APP_MODE=all'",
  "replace": "'TORCH_APP_MODE=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-10",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'ONNX_PACKAGE=onnxruntime'",
  "replace": "'ONNX_PACKAGE=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-11",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'PYTORCH_EXTRA=pytorch-rocm10'",
  "replace": "'PYTORCH_EXTRA=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-12",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'ARTIFACT_CONTEXT_MODE=oci'",
  "replace": "'ARTIFACT_CONTEXT_MODE=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-13",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'RUNTIME_WHEELS_SOURCE=image'",
  "replace": "'RUNTIME_WHEELS_SOURCE=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-14",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'RUNTIME_USE_LOCAL_CONTEXT_CHAIN=true'",
  "replace": "'RUNTIME_USE_LOCAL_CONTEXT_CHAIN=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-15",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'RUNTIME_REUSE_CHILDREN=0'",
  "replace": "'RUNTIME_REUSE_CHILDREN=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-16",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'RUNTIME_IMAGE_SMOKE=1'",
  "replace": "'RUNTIME_IMAGE_SMOKE=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-17",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'RUNTIME_INPUT_PREFLIGHT=1'",
  "replace": "'RUNTIME_INPUT_PREFLIGHT=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-18",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'WRAPPER_CONTENT_GATE=1'",
  "replace": "'WRAPPER_CONTENT_GATE=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-environment-19",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'ANCESTRY_STAMP_ENFORCE=1'",
  "replace": "'ANCESTRY_STAMP_ENFORCE=wrong'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-app-binding",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'APP_REF=' + app_ref",
  "replace": "'APP_REF=develop'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-native-root",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "str(context).removesuffix(suffix)",
  "replace": "str(context)",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-android-pin",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'RUNTIME_ANDROID_PIN_' + arch + '=' + reference",
  "replace": "'RUNTIME_ANDROID_PIN_' + arch + '=mutable'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-three-tags",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "images=images, prepare=",
  "replace": "images=(), prepare=",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-alias-preparation",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "prepare=lambda: prepare_local_alias(actual, output / 'local-alias.json')",
  "replace": "prepare=lambda: {}",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-worker-binding",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'cleanup-owned-containers.py', 'host_commands.py']]",
  "replace": "'cleanup-owned-containers.py', 'owned_containers.py']]",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-driver",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "str(source / 'linux/scripts/build-runtime-manifest.sh')",
  "replace": "str(source / 'linux/scripts/build-cross-stage.sh')",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-driver-skip-manifest",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'cross', '--skip-manifest'",
  "replace": "'cross', '--push'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-raw-profile-status",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "return launch_build(",
  "replace": "launch_build(",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-owned-engine",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "engine_path=wrapper, cleanup=cleanup",
  "replace": "engine_path=engine, cleanup=cleanup",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-owned-cleanup",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "engine_path=wrapper, cleanup=cleanup",
  "replace": "engine_path=wrapper, cleanup=None",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-owned-label",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'org.kataglyphis.normal-runtime'",
  "replace": "'org.kataglyphis.foreign'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-fresh-token",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "uuid.uuid4().hex, 'org.kataglyphis.normal-runtime'",
  "replace": "'e' * 32, 'org.kataglyphis.normal-runtime'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-expected-run-id",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "expected_runtime_run_id='runtime-' + run_id",
  "replace": "expected_runtime_run_id='foreign-' + run_id",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-cleanup-real-engine",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'--engine', engine, '--owner-label'",
  "replace": "'--engine', wrapper, '--owner-label'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-alias-name",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "if row['Name'] == reference",
  "replace": "if row['Name'] != reference",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-alias-source",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'tag', actual['image'], reference",
  "replace": "'tag', actual['manifest'], reference",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-host-all-three",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "images or image",
  "replace": "image",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-prepare-call",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "record.update(prepare())",
  "replace": "record.update({})",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-cleanup-install",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "if cleanup is not None:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-engine-forward",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "engine = engine_path or str(Path.home() / '.local/bin/nerdctl')",
  "replace": "engine = str(Path.home() / '.local/bin/nerdctl')",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-cli-parent",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "parent, context = android_layout(args.parent_proof, args.android_invocation, invocation, media)",
  "replace": "parent, context = android_layout(args.output, args.android_invocation, invocation, media)",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-cli-android",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "load_android(args.compiler_plan, args.android_invocation)",
  "replace": "load_android(args.compiler_plan, args.parent_proof)",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-cli-app",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "args.output.resolve(), args.unit, args.image_prefix, args.app_ref,\n",
  "replace": "args.output.resolve(), args.unit, args.image_prefix, 'develop',\n",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-cli-status",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "return launch_runtime(",
  "replace": "launch_runtime(",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-ownership-label-injection",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "arguments = [*arguments[:position], '--label', label + '=' + run_id, *arguments[position:]]",
  "replace": "arguments = list(arguments)",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-ownership-validation",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "OwnedContainers(engine, label, run_id)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-exec-status",
  "target": "linux/scripts/owned-nerdctl.py",
  "find": "os.execv(command[0], command)",
  "replace": "raise SystemExit(0)",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent command/native fixtures must reject weakened runtime admission, identity, ownership or transport; no actual runtime, registry, licence or hardware acceptance is proved."
 },
 {
  "id": "python-types.runtime-owned-nerdctl-args-1",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/owned_containers.py' 'linux/scripts/cleanup-owned-containers.py' \\\n  'linux/scripts/owned_nerdctl_args.py' 'linux/scripts/owned-nerdctl.py' \\\n",
  "replace": "  'linux/scripts/owned_containers.py' 'linux/scripts/cleanup-owned-containers.py' \\\n   'linux/scripts/owned-nerdctl.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Independent fixture type and annotation errors must fail when either runtime ownership companion leaves its mandatory scope; no runtime or cleanup execution is proved."
 },
 {
  "id": "python-types.runtime-owned-nerdctl-args-2",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n  'linux/scripts/owned_nerdctl_args.py' 'linux/scripts/owned-nerdctl.py' \\\n",
  "replace": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n  'linux/scripts/owned-nerdctl.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Independent fixture type and annotation errors must fail when either runtime ownership companion leaves its mandatory scope; no runtime or cleanup execution is proved."
 },
 {
  "id": "python-types.runtime-owned-nerdctl-1",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/owned_containers.py' 'linux/scripts/cleanup-owned-containers.py' \\\n  'linux/scripts/owned_nerdctl_args.py' 'linux/scripts/owned-nerdctl.py' \\\n",
  "replace": "  'linux/scripts/owned_containers.py' 'linux/scripts/cleanup-owned-containers.py' \\\n  'linux/scripts/owned_nerdctl_args.py'  \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Independent fixture type and annotation errors must fail when either runtime ownership companion leaves its mandatory scope; no runtime or cleanup execution is proved."
 },
 {
  "id": "python-types.runtime-owned-nerdctl-2",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n  'linux/scripts/owned_nerdctl_args.py' 'linux/scripts/owned-nerdctl.py' \\\n",
  "replace": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n  'linux/scripts/owned_nerdctl_args.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Independent fixture type and annotation errors must fail when either runtime ownership companion leaves its mandatory scope; no runtime or cleanup execution is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-label-long-equals",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "('--label=', '-l=')",
  "replace": "('missing-long=', '-l=')",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent long and short label controls reject ownership overrides in every reviewed form; no real container or cleanup success is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-label-short-equals",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "('--label=', '-l=')",
  "replace": "('--label=', 'missing-short=')",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent long and short label controls reject ownership overrides in every reviewed form; no real container or cleanup success is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-label-short-joined",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "if value.startswith('-l') and value != '-l':",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent long and short label controls reject ownership overrides in every reviewed form; no real container or cleanup success is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-label-separate-label",
  "target": "linux/scripts/owned_nerdctl_args.py",
  "find": "if value in {'--label', '-l'} and index + 1 < len(arguments):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-owned-nerdctl.sh",
  "why": "Independent long and short label controls reject ownership overrides in every reviewed form; no real container or cleanup success is proved."
 },
 {
  "id": "compiler-llvm-tools.runtime-cleanup-cid-argument",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'--run-id', run_id, '--cidfile', str(output / 'container.cid'), '--output'",
  "replace": "'--run-id', run_id, '--output'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The actual cleanup CLI must run with its required CID-file argument and invocation label; an empty engine double proves parsing and status, not real container cleanup."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-assert-1",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "        assert proof_path is None, 'Alternate runtime proof requires its selected source'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent paired-selection, parent-lane and complete-proof controls must refuse before engine preparation; fixtures prove no actual runtime or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-assert-2",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "    assert proof_path is not None, 'Alternate runtime source requires its complete source proof'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent paired-selection, parent-lane and complete-proof controls must refuse before engine preparation; fixtures prove no actual runtime or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-assert-3",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "    assert source != producer.resolve(strict=True), 'Alternate runtime source must be distinct'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent paired-selection, parent-lane and complete-proof controls must refuse before engine preparation; fixtures prove no actual runtime or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-assert-4",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "        return _host_only_delta(invocation, producer.resolve(strict=True), source, proof_path)",
  "replace": "        return source, None",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "A runtime source on any other Android revision must pass the host-only review instead of skipping it; fixtures prove no actual runtime or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-assert-5",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "    assert invocation['stage'] == 'android' and invocation['variant'] == 'rocm' and invocation['target_arch'] == 'amd64', 'Reviewed Android lane required'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent paired-selection, parent-lane and complete-proof controls must refuse before engine preparation; fixtures prove no actual runtime or FINAL acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-reviewed-runtime-pin",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "RUNTIME_REVISION = '2aa1a7780861db8012cb769e04d3de474dddca37'",
  "replace": "RUNTIME_REVISION = 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-original-android-pin",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "ANDROID_REVISION = '8c4e13b01fb43f8f55e5ca39aa7c0109d23504e5'",
  "replace": "ANDROID_REVISION = 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-full-proof-delegation",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "    complete = full_source(source, proof_path, RUNTIME_REVISION)",
  "replace": "    complete = {'actual_full_registry_mutations':6512, 'actual_preflight_group_count':42}",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-selected-checkout",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "    return source, _review(invocation, RUNTIME_REVISION, proof_path, complete, 'stable-wheel-context-without-smoke-import')",
  "replace": "    return producer, _review(invocation, RUNTIME_REVISION, proof_path, complete, 'stable-wheel-context-without-smoke-import')",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-proof-bytes",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "'runtime_full_source_proof_sha256': sha(proof_path)",
  "replace": "'runtime_full_source_proof_sha256': 'unverified'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-parent-identity",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "'Android_source_revision': invocation['source_revision']",
  "replace": "'Android_source_revision': RUNTIME_REVISION",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-source-accounting",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "'full_registry_mutations': complete['actual_full_registry_mutations']",
  "replace": "'full_registry_mutations': 0",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-group-accounting",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "'all_preflight_groups': complete['actual_preflight_group_count']",
  "replace": "'all_preflight_groups': 0",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-no-cache-claim",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "'cache_hits_claimed': False",
  "replace": "'cache_hits_claimed': True",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-selection-required",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "    source, review = select_runtime_source(invocation, selected_source, source_proof)",
  "replace": "    source, review = Path(invocation['source']), None",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-source-forwarding",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "select_runtime_source(invocation, selected_source, source_proof)",
  "replace": "select_runtime_source(invocation, None, source_proof)",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-proof-forwarding",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "select_runtime_source(invocation, selected_source, source_proof)",
  "replace": "select_runtime_source(invocation, selected_source, None)",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-record-runtime-head",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "source_revision=review['runtime_source_revision']",
  "replace": "source_revision=invocation['source_revision']",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-record-runtime-proof",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "source_full_preflight_proof=review['runtime_full_source_proof']",
  "replace": "source_full_preflight_proof=invocation['source_full_preflight_proof']",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-record-runtime-proof-sha",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "source_full_preflight_sha256=review['runtime_full_source_proof_sha256']",
  "replace": "source_full_preflight_sha256=invocation['source_full_preflight_sha256']",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-record-reviewed-selection",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "runtime_source_selection=review)",
  "replace": "runtime_source_selection={})",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-worker-companion",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'android_handoff_profile.py', 'runtime_source_profile.py'",
  "replace": "'android_handoff_profile.py'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-cli-selected-source",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "selected_source=args.runtime_source",
  "replace": "selected_source=None",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-cli-selected-proof",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "source_proof=args.runtime_source_proof",
  "replace": "source_proof=None",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent source-routing fixtures preserve the exact reviewed runtime proof separately from original Android/native parent bindings; no image or hardware acceptance."
 },
 {
  "id": "image-acceptance.local-require-1",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(module.__file__ is not None and Path(module.__file__).resolve() == directory / (name + '.py'), 'Local producer API belongs to another checkout')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-2",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(result.returncode == 0, f'Local subject query failed ({result.returncode}): {result.stdout}{result.stderr}')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-3",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(isinstance(value, dict), 'Local producer evidence must be an object')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-4",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(LOCAL_REF.fullmatch(image) is not None, 'Local acceptance needs an immutable docker.io/ant-local/webgpu reference')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-5",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require({**plan, 'platform': canonical['platform']} == canonical, 'Local FINAL acceptance requires the complete canonical consumer contract')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-6",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(command[:2] == ['systemd-run', '--user'] and command[-11:] == expected, 'Local runtime driver differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-7",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require('--expand-environment=no' in command and '--unit=' + invocation['unit'] in command, 'Local runtime transport differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-8",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(invocation.get('image') == prefix + '-' + arch, 'Local subject is not the final runtime wrapper')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-9",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "        require([value for value in command if value.startswith(name + '=')] == [name + '=' + expected_value], 'Local runtime gate or pin differs: ' + name)\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-10",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require('--push' not in command and '--gates-only' not in command, 'Actual unpublished local runtime required')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-11",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require([value for value in command if value.startswith(key)] == [key + parent], 'Runtime Android pin differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-12",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(platform in {'linux/amd64', 'linux/arm64', 'linux/riscv64'} and invocation.get('target_arch') == arch, 'Local runtime platform differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-13",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(invocation.get('stage') == 'runtime' and isinstance(variant, str) and (variant, arch) in LANES, 'Local FINAL producer must be a supported ordinary Linux runtime lane')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-14",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(type(invocation.get('launch_status')) is int and invocation['launch_status'] == 0 and invocation.get('publication') is False, 'Actual unpublished producer launch required')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-15",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(Path(text(invocation, 'output')).resolve() == path.parent, 'Local runtime invocation directory differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-16",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(invocation.get('source_full_preflight_passed') is True and invocation.get('producer_source_unchanged') is True, 'Complete runtime source proof required')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-17",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(fingerprint(proof) == text(invocation, 'source_full_preflight_sha256', HASH), 'Runtime complete source proof changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-18",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(raw.isdigit() and int(raw) > 0, 'Local runtime never exited')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-19",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(wrapper.name == 'owned-nerdctl.py' and wrapper.parent.name == 'scripts' and wrapper.parent.parent.name == 'linux', 'Runtime engine wrapper layout differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-20",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(output(['git', '-C', str(host), 'rev-parse', 'HEAD']).strip() == text(invocation, 'host_tools_revision', SHA), 'Runtime host source revision differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-21",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(not output(['git', '-C', str(host), 'status', '--porcelain']).strip(), 'Runtime host source changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-22",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(invocation.get('selected_host_workers_sha256') == {str(path): fingerprint(path) for path in workers}, 'Runtime worker closure changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-23",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(fingerprint(android_path) == text(invocation, 'Android_invocation_sha256', HASH) and fingerprint(proof_path) == text(invocation, 'parent_OCI_proof_sha256', HASH), 'Original Android evidence changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-24",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(android.get('stage') == 'android' and android.get('target_arch') == platform.removeprefix('linux/') and android.get('variant') == invocation['variant'], 'Original Android lane differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-25",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(android.get('source_revision') == proof.get('source_revision') == text(invocation, 'parent_source_revision', SHA), 'Original Android source differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-26",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(proof.get('manifest') == text(invocation, 'parent_manifest', DIGEST) and proof.get('config') == text(invocation, 'parent_config', DIGEST), 'Original Android image differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-27",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(invocation.get('expected_runtime_run_id') == 'runtime-' + run_id and invocation.get('owner_label') == 'org.kataglyphis.normal-runtime', 'Runtime ownership differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-28",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(type(cleanup.get('exit_status')) is int and cleanup['exit_status'] == 0 and cleanup.get('run_id') == run_id and cleanup.get('owner_label') == invocation['owner_label'], 'Runtime cleanup did not succeed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-29",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(not raw.strip(), 'Runtime still owns containers: ' + raw)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-30",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(isinstance(values, list) and len(values) == 1 and isinstance(values[0], dict), 'Local engine query must select one image object')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-31",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require({value.rsplit('@', 1)[1] for value in actual.get('RepoDigests', [])} == {manifest}, 'Local runtime manifest differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-32",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(actual.get('Os') == 'linux' and actual.get('Architecture') == platform.removeprefix('linux/'), 'Local engine image platform differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-33",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(all(labels.get(key) == value for key, value in required.items()), 'Local runtime provenance or app label differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-34",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(resolved.get('Id') == config and {value.rsplit('@', 1)[1] for value in resolved.get('RepoDigests', [])} == {manifest}, 'Local immutable manifest/config differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-35",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(local_api('runtime_launch_profile').local_reference(subject) == image, 'Local reference belongs to another repository')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-36",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(len(rows) == 1 and rows[0].get('Digest') == subject['manifest'] and rows[0].get('Platform') == platform, 'Local digest alias differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-37",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(after == before, 'Local runtime identity or producer evidence changed during consumer checks')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-38",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(before.get('image') == image and before.get('platform') == platform, 'Local subject/platform differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-39",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(isinstance(variant, str) and (variant, platform.removeprefix('linux/')) in LANES, 'Local receipt runtime lane is unsupported')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-40",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(terminal.get('LoadState') == 'loaded' and terminal.get('ActiveState') == 'active' and terminal.get('SubState') == 'exited', 'Local receipt producer was not terminal')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-41",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(terminal.get('MainPID') == terminal.get('ExecMainStatus') == '0' and terminal.get('Result') == 'success', 'Local receipt producer failed or was live')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-42",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(type(before.get('exit_timestamp_monotonic')) is int and before['exit_timestamp_monotonic'] > 0, 'Local receipt producer never exited')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-require-43",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(Path(text(before, 'producer_invocation')).is_absolute(), 'Local producer invocation path must be absolute')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-subject-41",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    if not isinstance(result, str) or not result or (pattern is not None and not pattern.fullmatch(result)):\n        raise ValueError('Missing or invalid local producer field: ' + key)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-subject-63",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    if not isinstance(command, list) or not all(isinstance(value, str) for value in command):\n        raise ValueError('Local runtime command is missing')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-subject-149",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(isinstance(config_data, dict) and isinstance(config_data.get('Labels'), dict), 'Local runtime image config labels are malformed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-subject-204",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    if not isinstance(before, dict) or before != after or before.get('kind') != KIND:\n        raise ValueError('Local subject evidence is missing or changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-subject-216",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(isinstance(terminal, dict), 'Local receipt producer unit is malformed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-runner-380",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    if module.__file__ is None or Path(module.__file__).resolve() != directory / 'image_acceptance_local.py':\n        raise ValueError('Local acceptance companion belongs to another checkout')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-runner-255",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        if receipt.get('image_transport') != 'local':\n            raise ValueError('Local receipt transport is missing')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-runner-260",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        if any(key.startswith('local_') for key in receipt):\n            raise ValueError('Local subject evidence cannot authorize registry promotion')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-runner-262",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        if receipt.get('image_transport', 'registry') != 'registry':\n            raise ValueError('Local acceptance cannot authorize registry promotion')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-runner-390",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        if any(path.exists() or path.is_symlink() for path in [Path(args.workspace), Path(args.receipt)]):\n            raise ValueError('Local acceptance requires a fresh workspace and receipt')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-refusal-runner-404",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        if previous and previous['local_subject'] != receipt['local_subject']:\n            raise ValueError('Local replay producer or image identity changed')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-explicit-mode-off",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    local = bool(getattr(args, 'local_runtime_invocation', None))",
  "replace": "    local = False",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-explicit-mode-on",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    local = bool(getattr(args, 'local_runtime_invocation', None))",
  "replace": "    local = True",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-validate-full-plan",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        local_module().complete_plan(plan, read_plan(DEFAULT_PLAN))\n        local_module().validate_receipt",
  "replace": "        pass\n        local_module().validate_receipt",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-start-full-plan",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        local_module().complete_plan(plan, read_plan(DEFAULT_PLAN))\n        if any",
  "replace": "        pass\n        if any",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-before-prune-validation",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        validate_receipt(receipt, args.image, args.plan, allow_local=local)\n    except ",
  "replace": "        pass\n    except ",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-failed-status-retained",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        receipt[\"status\"] = \"failed\"\n        receipt[\"error\"] = str(exc)",
  "replace": "        receipt[\"error\"] = str(exc)",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-replay-origin",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        if previous and previous['local_subject'] != receipt['local_subject']:\n            raise ValueError('Local replay producer or image identity changed')",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-prepare-subject",
  "target": "linux/scripts/image-acceptance.py",
  "find": "receipt['local_subject'] = local_module().prepare(args.engine, args.image, plan['platform'],\n                                                        args.local_runtime_invocation, work)",
  "replace": "receipt['local_subject'] = {}",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-post-observation",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        receipt['local_subject_after'] = local_module().recheck(args.engine, args.image, plan['platform'],\n                                                              args.local_runtime_invocation, receipt['local_subject'])",
  "replace": "        receipt['local_subject_after'] = receipt['local_subject']",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-registry-mode-finish",
  "target": "linux/scripts/image-acceptance.py",
  "find": "def finish_acceptance_image(args: CheckArgs, plan: AcceptancePlan, receipt: dict[str, Any], local: bool) -> None:\n    if local:",
  "replace": "def finish_acceptance_image(args: CheckArgs, plan: AcceptancePlan, receipt: dict[str, Any], local: bool) -> None:\n    if True:",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-prepare-observe-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    origin, subject = observe(engine, image, platform, Path(invocation))",
  "replace": "    origin, subject = {}, {'image':'unused', 'manifest':image.rsplit('@', 1)[1], 'config':'sha256:' + 'a' * 64}",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-host-source-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    host_binding(invocation)\n    android, parent = parent_binding(invocation, platform)\n",
  "replace": "    pass\n    android, parent = parent_binding(invocation, platform)\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-full-source-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "        local_api('normal_stage_launch').full_source(source, proof, text(invocation, 'source_revision', SHA))",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-loaded-terminal-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "        terminal = local_api('gpu_handoff_profile').terminal(unit)",
  "replace": "        terminal = {}",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-command-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    command_binding(invocation, android, platform, parent)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-cleanup-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    cleanup = cleanup_binding(invocation, invocation_path.parent, engine)",
  "replace": "    cleanup = 'a' * 64",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-shared-alias-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    local_api('runtime_launch_profile').prepare_local_alias(subject, workspace / 'local-image-alias.json', platform=platform, engine=engine)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-shared-alias-platform",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "platform=platform, engine=engine)",
  "replace": "platform='linux/amd64', engine=engine)",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-shared-alias-engine",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "platform=platform, engine=engine)",
  "replace": "platform=platform)",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-retained-observation",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    after, subject = observe(engine, image, platform, Path(invocation))",
  "replace": "    after, subject = before, {'image':'unused', 'manifest':image.rsplit('@', 1)[1], 'config':before['config']}",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-post-alias-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    verify_alias(engine, image, platform, subject)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-kind",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "KIND = 'local-runtime-final'",
  "replace": "KIND = 'unbound-local-image'",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "image-acceptance.local-unsupported-alias-platform",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "    assert platform in {'linux/amd64', 'linux/arm64', 'linux/riscv64'}, 'Unsupported local alias platform'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic producer/engine/receipt controls must reject the broken binding; no actual FINAL image, consumer execution, full licences or GPU inference is proved."
 },
 {
  "id": "python-types.image-acceptance-local-strict-type-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py'",
  "replace": "'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated real type fixture must catch removal of the local FINAL module from strict ty; no real consumer/image proof."
 },
 {
  "id": "python-types.image-acceptance-local-strict-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py'",
  "replace": "'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py'",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated annotation fixture must catch removal of the local FINAL module from mandatory ANN001/ANN201; coverage expands without diagnostic exceptions."
 },
 {
  "id": "disk-guard.runtime-storage-source-binding-1",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(isinstance(record.get('unit'), str) and GUARD_UNIT.fullmatch(record['unit']), 'Storage guardian unit identity differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-source-binding-2",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(record['source'] == str(ROOT), 'Storage guardian belongs to another checkout')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-source-binding-3",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(checked_output(['git', '-C', str(ROOT), 'rev-parse', 'HEAD']).strip() == record['revision'], 'Storage guardian revision changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-source-binding-4",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(not checked_output(['git', '-C', str(ROOT), 'status', '--porcelain']).strip(), 'Commit storage guardian tools before use')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-source-binding-5",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(record['workers_sha256'] == {str(path):fingerprint(path) for path in workers()}, 'Storage guardian worker closure changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-source-binding-6",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(fingerprint(Path(record['authorization'])) == record['authorization_sha256'], 'Storage authorization changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-source-binding-7",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(fingerprint(Path(record['runtime_invocation'])) == record['runtime_invocation_sha256'], 'Watched runtime invocation changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-source-binding-8",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(type(record['keep_gb']) is int and record['keep_gb'] == KEEP_GB and type(record['timeout_seconds']) is int and record['timeout_seconds'] == TIMEOUT, 'Storage guardian profile changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-producer-state-1",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(state.get('Id') == record['producer_unit'] and state.get('LoadState') == 'loaded', 'Watched runtime unit is missing')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-producer-state-2",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(state.get('MainPID') == str(record['producer_pid']) and state.get('ActiveState') in {'active', 'activating'}, 'Watched runtime PID changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-producer-state-3",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(local_api('capture-live-sccache-log').start_ticks(process) == record['producer_start_ticks'], 'Watched runtime process identity changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-candidate-1",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "        require(type(row.get('size')) is int and row['size'] >= 0 and isinstance(row.get('id'), str) and bool(row['id']), 'Malformed regular cache record')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-candidate-2",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "        require(type(row.get('inUse')) is bool and type(row.get('shared')) is bool, 'Malformed regular cache ownership')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-reclaim-1",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(not destination.exists() and not destination.is_symlink(), 'Preserve an earlier storage cleanup')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-reclaim-2",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(result.returncode == 0, 'Canonical storage cleanup failed: ' + str(result.returncode))\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-reclaim-3",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "        require(proof['status'] == 'skipped-reserve-already-sufficient' and proof['reclaim_performed'] is False and proof['free_bytes'] >= REQUIRED_BYTES and proof['canonical_free_gib'] >= 180, 'Canonical storage skip proof differs')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-reclaim-4",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "        require(proof['status'] == 'passed-authorized-canonical-layer-cleanup' and proof['keep_layer_gb'] == KEEP_GB, 'Canonical storage cleanup proof differs')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-1",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(GUARD_UNIT.fullmatch(unit), 'Explicit bounded storage guardian unit required')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-2",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(UNIT_API(unit).get('LoadState') == 'not-found', 'Preserve an existing storage guardian unit')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-3",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(not directory.exists() and not directory.is_symlink(), 'Preserve previous storage observations')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-4",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(runtime.get('stage') == 'runtime' and type(runtime.get('launch_status')) is int and runtime['launch_status'] == 0, 'Actual runtime launch required')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-5",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(isinstance(variant, str) and (variant, arch) in LANES, 'Supported ordinary runtime lane required')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-6",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(producer_unit('runtime', arch, variant).fullmatch(runtime['unit']), 'Ordinary runtime unit required')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-7",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require('agents may run the existing \\x60linux/host-config/prune-safe.sh\\x60 autonomously' in authorization.read_text(), 'Standing canonical cleanup authorization required')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-8",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(state.get('Id') == runtime['unit'] and state.get('LoadState') == 'loaded' and state.get('ActiveState') in {'active', 'activating'}, 'Runtime is not live')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-9",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(not TERMINAL(state) and state.get('MainPID', '').isdigit() and int(state['MainPID']) > 0, 'Runtime already ended')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-10",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require((process / 'cmdline').read_bytes().rstrip(b'\\0').split(b'\\0') == [word.encode() for word in runtime['command'][-11:]], 'Runtime process command differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-11",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(not temporary.exists() and all(not (path / '.git').exists() for path in [temporary, *temporary.parents]), 'Storage guardian TMPDIR must be fresh and outside Git')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-12",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(result.returncode == 0, 'Storage guardian launch failed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-seal-1",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(not (directory / 'proof-stopped.json').exists(), 'Preserve prior storage guardian seal')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-seal-2",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(before.get('Id') == record['unit'] and before.get('LoadState') == 'loaded' and TERMINAL(before) and int(before.get('ExecMainExitTimestampMonotonic') or '0') > 0, 'Storage guardian has not actually ended')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-seal-3",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(before.get('MainPID') == '0' and before.get('ExecMainStatus') == str(result['exit_status']) and result['exit_status'] in {0, 1} and before.get('Result') == ('success' if result['exit_status'] == 0 else 'exit-code'), 'Storage guardian raw result differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-seal-4",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(result['status'] == 'observed-producer-terminal' and TERMINAL(result['producer']), 'Producer terminal observation missing')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-seal-5",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(result['exit_status'] == int(result['producer'].get('Result') != 'success' or result['producer'].get('ExecMainStatus') != '0'), 'Producer and guardian outcomes differ')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-seal-6",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(after.get('MainPID') == '0' and after.get('ActiveState') in stopped_states, 'Storage guardian did not stop')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-seal-7",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "        require(proof_path in [Path(prune['directory']) / name for name in ['proof.json', 'skip-proof.json']], 'Storage cleanup proof path differs')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-seal-8",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "        require(fingerprint(proof_path) == prune['proof_sha256'], 'Storage cleanup proof changed')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-cli-main-1",
  "target": "linux/scripts/launch-runtime-storage-guard.py",
  "find": "    guard.require(Path(guard.__file__).resolve() == Path(__file__).resolve().with_name('runtime_storage_guard.py'), 'Storage watcher companion belongs to another checkout')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic lifecycle controls must reject a missing storage, source, PID, transport or receipt guarantee; they prove neither real reclamation timing nor a completed image or GPU inference."
 },
 {
  "id": "disk-guard.runtime-storage-cache-type",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "row.get('recordType', 'regular') == 'regular'",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-active-cache",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "not row['inUse']",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-shared-cache",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "not row['shared']",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-reserve-threshold",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "free < REQUIRED_BYTES",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-candidate-latch",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "key and key not in seen",
  "replace": "key",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-skip-latch",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "if not action['skipped']:\n                    seen.add(key)",
  "replace": "if True:\n                    seen.add(key)",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-initial-source-call",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    source_binding(record)\n    os.environ",
  "replace": "    pass\n    os.environ",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-dispatch-source-call",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "                source_binding(record)\n                state = producer_state(record)",
  "replace": "                pass\n                state = producer_state(record)",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-launch-source-call",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    source_binding(record)\n    directory.mkdir()",
  "replace": "    pass\n    directory.mkdir()",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-dispatch-producer-call",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "                state = producer_state(record)\n                if TERMINAL(state):\n                    return finish(directory, state, prunes)\n                action = reclaim",
  "replace": "                pass\n                if TERMINAL(state):\n                    return finish(directory, state, prunes)\n                action = reclaim",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-one-second-poll",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "time.sleep(1)",
  "replace": "time.sleep(2)",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-rootless-store",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'unix:///run/user/' + str(os.getuid()) + '/buildkit/buildkitd.sock'",
  "replace": "'unix:///foreign.sock'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-canonical-worker-mode",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "str(CONTROLLER), 'worker', '--directory'",
  "replace": "str(CONTROLLER), 'launch', '--directory'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-canonical-keep",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'--keep-gb', str(KEEP_GB)",
  "replace": "'--keep-gb', '1'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-canonical-unit",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'--unit', record['unit']",
  "replace": "'--unit', record['producer_unit']",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-cli-worker-status",
  "target": "linux/scripts/launch-runtime-storage-guard.py",
  "find": "        return guard.worker(args.directory)",
  "replace": "        guard.worker(args.directory)\n        return 0",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-cli-launch-call",
  "target": "linux/scripts/launch-runtime-storage-guard.py",
  "find": "        guard.launch(args.runtime_invocation, args.directory, args.unit, args.authorization)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-cli-seal-call",
  "target": "linux/scripts/launch-runtime-storage-guard.py",
  "find": "        guard.seal(args.directory)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-transport-1",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'--no-block'",
  "replace": "'changed-1'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-transport-2",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'--expand-environment=no'",
  "replace": "'changed-2'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-transport-3",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'TimeoutStartSec=21630'",
  "replace": "'changed-3'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-transport-4",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'TimeoutStopSec=60'",
  "replace": "'changed-4'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-transport-5",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'KillMode=control-group'",
  "replace": "'changed-5'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-transport-6",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'MemoryMax=256M'",
  "replace": "'changed-6'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-transport-7",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'CPUQuota=25%'",
  "replace": "'changed-7'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "disk-guard.runtime-storage-transport-8",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "'LC_ALL=C'",
  "replace": "'changed-8'",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent synthetic controls preserve the bounded rootless observer, synchronous canonical cleanup and raw outcomes; they do not prove actual disk capacity, cleanup timing, image acceptance or hardware inference."
 },
 {
  "id": "python-types.runtime-storage-module-strict-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "replace": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated fixture must reject a real bad return and missing parameter or public-return annotation when either storage guardian helper leaves mandatory coverage; no actual pruning or runtime proof."
 },
 {
  "id": "python-types.runtime-storage-cli-strict-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "replace": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated fixture must reject a real bad return and missing parameter or public-return annotation when either storage guardian helper leaves mandatory coverage; no actual pruning or runtime proof."
 },
 {
  "id": "python-types.runtime-storage-module-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "replace": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated fixture must reject a real bad return and missing parameter or public-return annotation when either storage guardian helper leaves mandatory coverage; no actual pruning or runtime proof."
 },
 {
  "id": "python-types.runtime-storage-cli-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "replace": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated fixture must reject a real bad return and missing parameter or public-return annotation when either storage guardian helper leaves mandatory coverage; no actual pruning or runtime proof."
 },
 {
  "id": "image-acceptance.bounded.clean-source-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(checked_output(['git', '-C', str(ROOT), 'rev-parse', 'HEAD']).strip() == revision, 'FINAL launcher revision changed')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.clean-source-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(not checked_output(['git', '-C', str(ROOT), 'status', '--porcelain']).strip(), 'Commit FINAL tooling before use')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.binding-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(record['source'] == str(ROOT) and record['engine'] == ENGINE, 'FINAL tooling or engine belongs elsewhere')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.binding-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(record['owner_label'] == OWNER, 'FINAL ownership label differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.binding-3",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(type(record['timeout_seconds']) is int and record['timeout_seconds'] == TIMEOUT, 'FINAL deadline profile differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.binding-4",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(re.fullmatch(r'webgpu-local-final-' + record['platform'].removeprefix('linux/') + r'-[0-9-]+\\.service', record['unit']), 'FINAL unit identity differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.binding-5",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(record['workers_sha256'] == {str(path):fingerprint(path) for path in workers(record['local_subject']['variant'])}, 'FINAL launcher worker closure changed')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.binding-6",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(fingerprint(Path(record['runtime_invocation'])) == record['runtime_invocation_sha256'], 'FINAL runtime invocation changed')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.binding-7",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(fingerprint(directory / 'plan.json') == record['plan_sha256'], 'FINAL plan bytes changed')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.binding-8",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(plan['platform'] == record['platform'], 'FINAL plan platform differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.launch-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(not directory.exists() and not directory.is_symlink(), 'Preserve existing FINAL output')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.launch-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(runtime['target_arch'] in {'amd64', 'arm64', 'riscv64'}, 'Unsupported FINAL architecture')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.launch-3",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(re.fullmatch(r'webgpu-local-final-' + runtime['target_arch'] + r'-[0-9-]+\\.service', unit), 'Explicit bounded FINAL unit required')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.launch-4",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(UNIT_STATE(unit).get('LoadState') == 'not-found', 'Preserve an existing FINAL unit')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.launch-5",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(not temporary.exists() and all(not (path / '.git').exists() for path in [temporary, *temporary.parents]), 'FINAL TMPDIR must be fresh and outside Git')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.launch-6",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(not owner.ids(owned=True), 'FINAL invocation ownership already exists')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.launch-7",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(result.returncode == 0, 'FINAL bounded unit launch failed')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.worker-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(state.get('Id') == record['unit'] and state.get('LoadState') == 'loaded' and state.get('ActiveState') in {'active', 'activating'} and state.get('MainPID') == str(os.getpid()), 'FINAL worker is outside its bounded unit')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.worker-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(all(os.environ.get(key) == value for key, value in expected.items()), 'FINAL container ownership environment differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.worker-3",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(origin == record['local_subject'], 'FINAL producer changed before consumers')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.worker-4",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(receipt['hub_revision'] == record['revision'] and receipt['local_subject'] == record['local_subject'], 'FINAL consumer receipt changed source or producer')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.consumer-result-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(result['status'] == 'completed-consumers-cleanup-pending' and type(result['exit_status']) is int and result['exit_status'] == 0 and result['receipt_sha256'] == fingerprint(directory / 'receipt.json'), 'FINAL worker result differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.consumer-result-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(receipt['hub_revision'] == record['revision'] and receipt['local_subject'] == record['local_subject'] and result['consumer_names'] == [row['name'] for row in receipt['consumers']], 'FINAL sealed source, producer or consumer order differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.cleanup-evidence-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(type(cleanup.get('exit_status')) is int and cleanup['exit_status'] == 0 and cleanup.get('owner_label') == OWNER and cleanup.get('run_id') == record['run_id'], 'FINAL owned cleanup failed or differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.cleanup-evidence-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(query.returncode == 0 and not query.stdout.strip(), 'FINAL owned containers remain or query failed')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.seal-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(not (directory / 'proof-stopped.json').exists(), 'Preserve previous FINAL proof')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.seal-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(before.get('Id') == record['unit'] and before.get('LoadState') == 'loaded' and TERMINAL(before) and int(before.get('ExecMainExitTimestampMonotonic') or '0') > 0 and before.get('MainPID') == '0', 'FINAL unit has not actually terminated')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.seal-3",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require((before.get('Result') == 'success') == (status == 0), 'FINAL unit raw outcome differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.seal-4",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(after.get('MainPID') == '0' and after.get('ActiveState') in {'inactive', 'failed'}, 'FINAL unit did not stop')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded.seal-5",
  "target": "linux/scripts/launch-local-final.py",
  "find": "require(status != 0 or (after.get('ActiveState') == 'inactive' and after.get('Result') == 'success'), 'FINAL successful unit failed during stop')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic lifecycle and real receipt-schema controls reject lost source, producer, unit, ownership and cleanup guarantees; they prove no actual FINAL consumers, complete licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-binding-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def binding(directory: Path, record: dict[str, Any]) -> None:\n    require(record['source'] == str(ROOT) and record['engine'] == ENGINE, 'FINAL tooling or engine belongs elsewhere')\n    require(record['owner_label'] == OWNER, 'FINAL ownership label differs')\n    require(type(record['timeout_seconds']) is int and record['timeout_seconds'] == TIMEOUT, 'FINAL deadline profile differs')\n    OwnedContainers(ENGINE, OWNER, record['run_id'])\n",
  "replace": "def binding(directory: Path, record: dict[str, Any]) -> None:\n    require(record['source'] == str(ROOT) and record['engine'] == ENGINE, 'FINAL tooling or engine belongs elsewhere')\n    require(record['owner_label'] == OWNER, 'FINAL ownership label differs')\n    require(type(record['timeout_seconds']) is int and record['timeout_seconds'] == TIMEOUT, 'FINAL deadline profile differs')\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-binding-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def binding(directory: Path, record: dict[str, Any]) -> None:\n    require(record['source'] == str(ROOT) and record['engine'] == ENGINE, 'FINAL tooling or engine belongs elsewhere')\n    require(record['owner_label'] == OWNER, 'FINAL ownership label differs')\n    require(type(record['timeout_seconds']) is int and record['timeout_seconds'] == TIMEOUT, 'FINAL deadline profile differs')\n    OwnedContainers(ENGINE, OWNER, record['run_id'])\n    require(re.fullmatch(r'webgpu-local-final-' + record['platform'].removeprefix('linux/') + r'-[0-9-]+\\.service', record['unit']), 'FINAL unit identity differs')\n    clean_source(record['revision'])\n",
  "replace": "def binding(directory: Path, record: dict[str, Any]) -> None:\n    require(record['source'] == str(ROOT) and record['engine'] == ENGINE, 'FINAL tooling or engine belongs elsewhere')\n    require(record['owner_label'] == OWNER, 'FINAL ownership label differs')\n    require(type(record['timeout_seconds']) is int and record['timeout_seconds'] == TIMEOUT, 'FINAL deadline profile differs')\n    OwnedContainers(ENGINE, OWNER, record['run_id'])\n    require(re.fullmatch(r'webgpu-local-final-' + record['platform'].removeprefix('linux/') + r'-[0-9-]+\\.service', record['unit']), 'FINAL unit identity differs')\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-binding-3",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def binding(directory: Path, record: dict[str, Any]) -> None:\n    require(record['source'] == str(ROOT) and record['engine'] == ENGINE, 'FINAL tooling or engine belongs elsewhere')\n    require(record['owner_label'] == OWNER, 'FINAL ownership label differs')\n    require(type(record['timeout_seconds']) is int and record['timeout_seconds'] == TIMEOUT, 'FINAL deadline profile differs')\n    OwnedContainers(ENGINE, OWNER, record['run_id'])\n    require(re.fullmatch(r'webgpu-local-final-' + record['platform'].removeprefix('linux/') + r'-[0-9-]+\\.service', record['unit']), 'FINAL unit identity differs')\n    clean_source(record['revision'])\n    require(record['workers_sha256'] == {str(path):fingerprint(path) for path in workers(record['local_subject']['variant'])}, 'FINAL launcher worker closure changed')\n    require(fingerprint(Path(record['runtime_invocation'])) == record['runtime_invocation_sha256'], 'FINAL runtime invocation changed')\n    require(fingerprint(directory / 'plan.json') == record['plan_sha256'], 'FINAL plan bytes changed')\n    plan = API['read_plan'](directory / 'plan.json')\n    API['local_module']().complete_plan(plan, API['read_plan'](API['DEFAULT_PLAN']))\n",
  "replace": "def binding(directory: Path, record: dict[str, Any]) -> None:\n    require(record['source'] == str(ROOT) and record['engine'] == ENGINE, 'FINAL tooling or engine belongs elsewhere')\n    require(record['owner_label'] == OWNER, 'FINAL ownership label differs')\n    require(type(record['timeout_seconds']) is int and record['timeout_seconds'] == TIMEOUT, 'FINAL deadline profile differs')\n    OwnedContainers(ENGINE, OWNER, record['run_id'])\n    require(re.fullmatch(r'webgpu-local-final-' + record['platform'].removeprefix('linux/') + r'-[0-9-]+\\.service', record['unit']), 'FINAL unit identity differs')\n    clean_source(record['revision'])\n    require(record['workers_sha256'] == {str(path):fingerprint(path) for path in workers(record['local_subject']['variant'])}, 'FINAL launcher worker closure changed')\n    require(fingerprint(Path(record['runtime_invocation'])) == record['runtime_invocation_sha256'], 'FINAL runtime invocation changed')\n    require(fingerprint(directory / 'plan.json') == record['plan_sha256'], 'FINAL plan bytes changed')\n    plan = API['read_plan'](directory / 'plan.json')\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-launch-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def launch(runtime_path: Path, image: str, directory: Path, unit: str) -> None:\n    require(not directory.exists() and not directory.is_symlink(), 'Preserve existing FINAL output')\n    directory = directory.resolve()\n    runtime_path = runtime_path.resolve(strict=True)\n    runtime = read(runtime_path)\n    platform = 'linux/' + runtime['target_arch']\n    require(runtime['target_arch'] in {'amd64', 'arm64', 'riscv64'}, 'Unsupported FINAL architecture')\n    require(re.fullmatch(r'webgpu-local-final-' + runtime['target_arch'] + r'-[0-9-]+\\.service', unit), 'Explicit bounded FINAL unit required')\n    require(UNIT_STATE(unit).get('LoadState') == 'not-found', 'Preserve an existing FINAL unit')\n    revision = checked_output(['git', '-C', str(ROOT), 'rev-parse', 'HEAD']).strip()\n    clean_source(revision)\n",
  "replace": "def launch(runtime_path: Path, image: str, directory: Path, unit: str) -> None:\n    require(not directory.exists() and not directory.is_symlink(), 'Preserve existing FINAL output')\n    directory = directory.resolve()\n    runtime_path = runtime_path.resolve(strict=True)\n    runtime = read(runtime_path)\n    platform = 'linux/' + runtime['target_arch']\n    require(runtime['target_arch'] in {'amd64', 'arm64', 'riscv64'}, 'Unsupported FINAL architecture')\n    require(re.fullmatch(r'webgpu-local-final-' + runtime['target_arch'] + r'-[0-9-]+\\.service', unit), 'Explicit bounded FINAL unit required')\n    require(UNIT_STATE(unit).get('LoadState') == 'not-found', 'Preserve an existing FINAL unit')\n    revision = checked_output(['git', '-C', str(ROOT), 'rev-parse', 'HEAD']).strip()\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-launch-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def launch(runtime_path: Path, image: str, directory: Path, unit: str) -> None:\n    require(not directory.exists() and not directory.is_symlink(), 'Preserve existing FINAL output')\n    directory = directory.resolve()\n    runtime_path = runtime_path.resolve(strict=True)\n    runtime = read(runtime_path)\n    platform = 'linux/' + runtime['target_arch']\n    require(runtime['target_arch'] in {'amd64', 'arm64', 'riscv64'}, 'Unsupported FINAL architecture')\n    require(re.fullmatch(r'webgpu-local-final-' + runtime['target_arch'] + r'-[0-9-]+\\.service', unit), 'Explicit bounded FINAL unit required')\n    require(UNIT_STATE(unit).get('LoadState') == 'not-found', 'Preserve an existing FINAL unit')\n    revision = checked_output(['git', '-C', str(ROOT), 'rev-parse', 'HEAD']).strip()\n    clean_source(revision)\n    origin, _ = API['local_module']().observe(ENGINE, image, platform, runtime_path)\n    temporary = Path.home() / '.cache' / unit.removesuffix('.service')\n    require(not temporary.exists() and all(not (path / '.git').exists() for path in [temporary, *temporary.parents]), 'FINAL TMPDIR must be fresh and outside Git')\n    owner = OwnedContainers(ENGINE, OWNER, uuid.uuid4().hex)\n    require(not owner.ids(owned=True), 'FINAL invocation ownership already exists')\n    directory.mkdir(parents=True)\n    temporary.mkdir(mode=0o700)\n    API['materialize_plan'](str(API['DEFAULT_PLAN']), str(directory / 'plan.json'), platform)\n    cleanup = [sys.executable, str(HERE / 'cleanup-owned-containers.py'), '--engine', ENGINE, '--owner-label', OWNER,\n               '--run-id', owner.run_id, '--cidfile', str(directory / 'container.cid'), '--output', str(directory / 'cleanup.json')]\n    command = ['systemd-run', '--user', '--no-block', '--expand-environment=no', '--unit=' + unit]\n    properties = ['Type=oneshot', 'RemainAfterExit=yes', 'TimeoutStartSec=' + str(TIMEOUT), 'TimeoutStopSec=300',\n                  'KillMode=control-group', 'WorkingDirectory=' + str(ROOT), 'ExecStopPost=' + shlex.join(cleanup),\n                  'StandardOutput=append:' + str(directory / 'unit.log'), 'StandardError=append:' + str(directory / 'unit.log')]\n    for value in properties:\n        command += ['-p', value]\n    for value in ['LC_ALL=C', 'HOME=' + str(Path.home()), 'TMPDIR=' + str(temporary),\n                  'PATH=' + str(Path.home() / '.local/bin') + ':/usr/local/bin:/usr/bin:/bin',\n                  'ANT_RUNTIME_ENGINE=' + ENGINE, 'ANT_RUNTIME_OWNER_LABEL=' + OWNER, 'ANT_RUNTIME_RUN_ID=' + owner.run_id]:\n        command += ['-E', value]\n    command += [sys.executable, str(Path(__file__).resolve()), 'worker', '--directory', str(directory)]\n    record = {'source':str(ROOT), 'revision':revision, 'workers_sha256':{str(path):fingerprint(path) for path in workers(origin['variant'])},\n              'unit':unit, 'engine':ENGINE, 'owner_label':OWNER, 'run_id':owner.run_id, 'platform':platform, 'image':image,\n              'runtime_invocation':str(runtime_path), 'runtime_invocation_sha256':fingerprint(runtime_path), 'local_subject':origin,\n              'plan_sha256':fingerprint(directory / 'plan.json'), 'command':command, 'cleanup_command':cleanup,\n              'created_at':timestamp(), 'timeout_seconds':TIMEOUT, 'scope':__doc__}\n    save(directory / 'invocation.json', record)\n    binding(directory, record)\n",
  "replace": "def launch(runtime_path: Path, image: str, directory: Path, unit: str) -> None:\n    require(not directory.exists() and not directory.is_symlink(), 'Preserve existing FINAL output')\n    directory = directory.resolve()\n    runtime_path = runtime_path.resolve(strict=True)\n    runtime = read(runtime_path)\n    platform = 'linux/' + runtime['target_arch']\n    require(runtime['target_arch'] in {'amd64', 'arm64', 'riscv64'}, 'Unsupported FINAL architecture')\n    require(re.fullmatch(r'webgpu-local-final-' + runtime['target_arch'] + r'-[0-9-]+\\.service', unit), 'Explicit bounded FINAL unit required')\n    require(UNIT_STATE(unit).get('LoadState') == 'not-found', 'Preserve an existing FINAL unit')\n    revision = checked_output(['git', '-C', str(ROOT), 'rev-parse', 'HEAD']).strip()\n    clean_source(revision)\n    origin, _ = API['local_module']().observe(ENGINE, image, platform, runtime_path)\n    temporary = Path.home() / '.cache' / unit.removesuffix('.service')\n    require(not temporary.exists() and all(not (path / '.git').exists() for path in [temporary, *temporary.parents]), 'FINAL TMPDIR must be fresh and outside Git')\n    owner = OwnedContainers(ENGINE, OWNER, uuid.uuid4().hex)\n    require(not owner.ids(owned=True), 'FINAL invocation ownership already exists')\n    directory.mkdir(parents=True)\n    temporary.mkdir(mode=0o700)\n    API['materialize_plan'](str(API['DEFAULT_PLAN']), str(directory / 'plan.json'), platform)\n    cleanup = [sys.executable, str(HERE / 'cleanup-owned-containers.py'), '--engine', ENGINE, '--owner-label', OWNER,\n               '--run-id', owner.run_id, '--cidfile', str(directory / 'container.cid'), '--output', str(directory / 'cleanup.json')]\n    command = ['systemd-run', '--user', '--no-block', '--expand-environment=no', '--unit=' + unit]\n    properties = ['Type=oneshot', 'RemainAfterExit=yes', 'TimeoutStartSec=' + str(TIMEOUT), 'TimeoutStopSec=300',\n                  'KillMode=control-group', 'WorkingDirectory=' + str(ROOT), 'ExecStopPost=' + shlex.join(cleanup),\n                  'StandardOutput=append:' + str(directory / 'unit.log'), 'StandardError=append:' + str(directory / 'unit.log')]\n    for value in properties:\n        command += ['-p', value]\n    for value in ['LC_ALL=C', 'HOME=' + str(Path.home()), 'TMPDIR=' + str(temporary),\n                  'PATH=' + str(Path.home() / '.local/bin') + ':/usr/local/bin:/usr/bin:/bin',\n                  'ANT_RUNTIME_ENGINE=' + ENGINE, 'ANT_RUNTIME_OWNER_LABEL=' + OWNER, 'ANT_RUNTIME_RUN_ID=' + owner.run_id]:\n        command += ['-E', value]\n    command += [sys.executable, str(Path(__file__).resolve()), 'worker', '--directory', str(directory)]\n    record = {'source':str(ROOT), 'revision':revision, 'workers_sha256':{str(path):fingerprint(path) for path in workers(origin['variant'])},\n              'unit':unit, 'engine':ENGINE, 'owner_label':OWNER, 'run_id':owner.run_id, 'platform':platform, 'image':image,\n              'runtime_invocation':str(runtime_path), 'runtime_invocation_sha256':fingerprint(runtime_path), 'local_subject':origin,\n              'plan_sha256':fingerprint(directory / 'plan.json'), 'command':command, 'cleanup_command':cleanup,\n              'created_at':timestamp(), 'timeout_seconds':TIMEOUT, 'scope':__doc__}\n    save(directory / 'invocation.json', record)\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-worker-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def worker(directory: Path) -> None:\n    record = read(directory / 'invocation.json')\n    binding(directory, record)\n",
  "replace": "def worker(directory: Path) -> None:\n    record = read(directory / 'invocation.json')\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-worker-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def worker(directory: Path) -> None:\n    record = read(directory / 'invocation.json')\n    binding(directory, record)\n    state = UNIT_STATE(record['unit'])\n    require(state.get('Id') == record['unit'] and state.get('LoadState') == 'loaded' and state.get('ActiveState') in {'active', 'activating'} and state.get('MainPID') == str(os.getpid()), 'FINAL worker is outside its bounded unit')\n    expected = {'ANT_RUNTIME_ENGINE':ENGINE, 'ANT_RUNTIME_OWNER_LABEL':OWNER, 'ANT_RUNTIME_RUN_ID':record['run_id']}\n    require(all(os.environ.get(key) == value for key, value in expected.items()), 'FINAL container ownership environment differs')\n    origin, _ = API['local_module']().observe(ENGINE, record['image'], record['platform'], Path(record['runtime_invocation']))\n    require(origin == record['local_subject'], 'FINAL producer changed before consumers')\n    args = SimpleNamespace(image=record['image'], plan=str(directory / 'plan.json'), workspace=str(directory / 'consumers'),\n                           receipt=str(directory / 'receipt.json'), engine=str(HERE / 'owned-nerdctl.py'), replay=None,\n                           local_runtime_invocation=record['runtime_invocation'])\n    API['check'](args)\n",
  "replace": "def worker(directory: Path) -> None:\n    record = read(directory / 'invocation.json')\n    binding(directory, record)\n    state = UNIT_STATE(record['unit'])\n    require(state.get('Id') == record['unit'] and state.get('LoadState') == 'loaded' and state.get('ActiveState') in {'active', 'activating'} and state.get('MainPID') == str(os.getpid()), 'FINAL worker is outside its bounded unit')\n    expected = {'ANT_RUNTIME_ENGINE':ENGINE, 'ANT_RUNTIME_OWNER_LABEL':OWNER, 'ANT_RUNTIME_RUN_ID':record['run_id']}\n    require(all(os.environ.get(key) == value for key, value in expected.items()), 'FINAL container ownership environment differs')\n    origin, _ = API['local_module']().observe(ENGINE, record['image'], record['platform'], Path(record['runtime_invocation']))\n    require(origin == record['local_subject'], 'FINAL producer changed before consumers')\n    args = SimpleNamespace(image=record['image'], plan=str(directory / 'plan.json'), workspace=str(directory / 'consumers'),\n                           receipt=str(directory / 'receipt.json'), engine=str(HERE / 'owned-nerdctl.py'), replay=None,\n                           local_runtime_invocation=record['runtime_invocation'])\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-worker-3",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def worker(directory: Path) -> None:\n    record = read(directory / 'invocation.json')\n    binding(directory, record)\n    state = UNIT_STATE(record['unit'])\n    require(state.get('Id') == record['unit'] and state.get('LoadState') == 'loaded' and state.get('ActiveState') in {'active', 'activating'} and state.get('MainPID') == str(os.getpid()), 'FINAL worker is outside its bounded unit')\n    expected = {'ANT_RUNTIME_ENGINE':ENGINE, 'ANT_RUNTIME_OWNER_LABEL':OWNER, 'ANT_RUNTIME_RUN_ID':record['run_id']}\n    require(all(os.environ.get(key) == value for key, value in expected.items()), 'FINAL container ownership environment differs')\n    origin, _ = API['local_module']().observe(ENGINE, record['image'], record['platform'], Path(record['runtime_invocation']))\n    require(origin == record['local_subject'], 'FINAL producer changed before consumers')\n    args = SimpleNamespace(image=record['image'], plan=str(directory / 'plan.json'), workspace=str(directory / 'consumers'),\n                           receipt=str(directory / 'receipt.json'), engine=str(HERE / 'owned-nerdctl.py'), replay=None,\n                           local_runtime_invocation=record['runtime_invocation'])\n    API['check'](args)\n    receipt = read(directory / 'receipt.json')\n    API['validate_receipt'](receipt, record['image'], directory / 'plan.json', allow_local=True)\n",
  "replace": "def worker(directory: Path) -> None:\n    record = read(directory / 'invocation.json')\n    binding(directory, record)\n    state = UNIT_STATE(record['unit'])\n    require(state.get('Id') == record['unit'] and state.get('LoadState') == 'loaded' and state.get('ActiveState') in {'active', 'activating'} and state.get('MainPID') == str(os.getpid()), 'FINAL worker is outside its bounded unit')\n    expected = {'ANT_RUNTIME_ENGINE':ENGINE, 'ANT_RUNTIME_OWNER_LABEL':OWNER, 'ANT_RUNTIME_RUN_ID':record['run_id']}\n    require(all(os.environ.get(key) == value for key, value in expected.items()), 'FINAL container ownership environment differs')\n    origin, _ = API['local_module']().observe(ENGINE, record['image'], record['platform'], Path(record['runtime_invocation']))\n    require(origin == record['local_subject'], 'FINAL producer changed before consumers')\n    args = SimpleNamespace(image=record['image'], plan=str(directory / 'plan.json'), workspace=str(directory / 'consumers'),\n                           receipt=str(directory / 'receipt.json'), engine=str(HERE / 'owned-nerdctl.py'), replay=None,\n                           local_runtime_invocation=record['runtime_invocation'])\n    API['check'](args)\n    receipt = read(directory / 'receipt.json')\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-consumer-result-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def consumer_result(directory: Path, record: dict[str, Any]) -> None:\n    result = read(directory / 'worker-result.json')\n    require(result['status'] == 'completed-consumers-cleanup-pending' and type(result['exit_status']) is int and result['exit_status'] == 0 and result['receipt_sha256'] == fingerprint(directory / 'receipt.json'), 'FINAL worker result differs')\n    receipt = API['validate_receipt'](read(directory / 'receipt.json'), record['image'], directory / 'plan.json', allow_local=True)\n    require(receipt['hub_revision'] == record['revision'] and receipt['local_subject'] == record['local_subject'] and result['consumer_names'] == [row['name'] for row in receipt['consumers']], 'FINAL sealed source, producer or consumer order differs')\n    API['local_module']().recheck(ENGINE, record['image'], record['platform'], record['runtime_invocation'], record['local_subject'])\n",
  "replace": "def consumer_result(directory: Path, record: dict[str, Any]) -> None:\n    result = read(directory / 'worker-result.json')\n    require(result['status'] == 'completed-consumers-cleanup-pending' and type(result['exit_status']) is int and result['exit_status'] == 0 and result['receipt_sha256'] == fingerprint(directory / 'receipt.json'), 'FINAL worker result differs')\n    receipt = API['validate_receipt'](read(directory / 'receipt.json'), record['image'], directory / 'plan.json', allow_local=True)\n    require(receipt['hub_revision'] == record['revision'] and receipt['local_subject'] == record['local_subject'] and result['consumer_names'] == [row['name'] for row in receipt['consumers']], 'FINAL sealed source, producer or consumer order differs')\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-seal-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def seal(directory: Path) -> int:\n    require(not (directory / 'proof-stopped.json').exists(), 'Preserve previous FINAL proof')\n    record = read(directory / 'invocation.json')\n    binding(directory, record)\n",
  "replace": "def seal(directory: Path) -> int:\n    require(not (directory / 'proof-stopped.json').exists(), 'Preserve previous FINAL proof')\n    record = read(directory / 'invocation.json')\n    pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-call-seal-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "def seal(directory: Path) -> int:\n    require(not (directory / 'proof-stopped.json').exists(), 'Preserve previous FINAL proof')\n    record = read(directory / 'invocation.json')\n    binding(directory, record)\n    before = UNIT_STATE(record['unit'])\n    require(before.get('Id') == record['unit'] and before.get('LoadState') == 'loaded' and TERMINAL(before) and int(before.get('ExecMainExitTimestampMonotonic') or '0') > 0 and before.get('MainPID') == '0', 'FINAL unit has not actually terminated')\n    status = int(before['ExecMainStatus'])\n    require((before.get('Result') == 'success') == (status == 0), 'FINAL unit raw outcome differs')\n    receipt_path = directory / 'receipt.json'\n    if status == 0:\n        consumer_result(directory, record)\n",
  "replace": "def seal(directory: Path) -> int:\n    require(not (directory / 'proof-stopped.json').exists(), 'Preserve previous FINAL proof')\n    record = read(directory / 'invocation.json')\n    binding(directory, record)\n    before = UNIT_STATE(record['unit'])\n    require(before.get('Id') == record['unit'] and before.get('LoadState') == 'loaded' and TERMINAL(before) and int(before.get('ExecMainExitTimestampMonotonic') or '0') > 0 and before.get('MainPID') == '0', 'FINAL unit has not actually terminated')\n    status = int(before['ExecMainStatus'])\n    require((before.get('Result') == 'success') == (status == 0), 'FINAL unit raw outcome differs')\n    receipt_path = directory / 'receipt.json'\n    if status == 0:\n        pass\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-observe-worker",
  "target": "linux/scripts/launch-local-final.py",
  "find": "    origin, _ = API['local_module']().observe(ENGINE, record['image'], record['platform'], Path(record['runtime_invocation']))",
  "replace": "    origin, _ = record['local_subject'], {}",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-consumer-schema",
  "target": "linux/scripts/launch-local-final.py",
  "find": "    receipt = API['validate_receipt'](read(directory / 'receipt.json'), record['image'], directory / 'plan.json', allow_local=True)",
  "replace": "    receipt = read(directory / 'receipt.json')",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-owned-engine",
  "target": "linux/scripts/launch-local-final.py",
  "find": "engine=str(HERE / 'owned-nerdctl.py')",
  "replace": "engine=ENGINE",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-cleanup-phase",
  "target": "linux/scripts/launch-local-final.py",
  "find": "    evidence = cleanup_evidence(directory, record)",
  "replace": "    evidence = {}",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-seal-status",
  "target": "linux/scripts/launch-local-final.py",
  "find": "        return seal(args.directory)",
  "replace": "        seal(args.directory)",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-cli-worker",
  "target": "linux/scripts/launch-local-final.py",
  "find": "        worker(args.directory)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-cli-launch",
  "target": "linux/scripts/launch-local-final.py",
  "find": "        launch(args.runtime_invocation, args.image, args.directory, args.unit)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-exec-stop-post",
  "target": "linux/scripts/launch-local-final.py",
  "find": "'ExecStopPost=' + shlex.join(cleanup)",
  "replace": "'Description=' + shlex.join(cleanup)",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-timeout-profile",
  "target": "linux/scripts/launch-local-final.py",
  "find": "TIMEOUT = 21600",
  "replace": "TIMEOUT = 21601",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-transport-1",
  "target": "linux/scripts/launch-local-final.py",
  "find": "'--no-block'",
  "replace": "'--quiet'",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-transport-2",
  "target": "linux/scripts/launch-local-final.py",
  "find": "'--expand-environment=no'",
  "replace": "'--expand-environment=yes'",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-transport-3",
  "target": "linux/scripts/launch-local-final.py",
  "find": "'Type=oneshot'",
  "replace": "'Type=simple'",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-transport-4",
  "target": "linux/scripts/launch-local-final.py",
  "find": "'RemainAfterExit=yes'",
  "replace": "'RemainAfterExit=no'",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-transport-5",
  "target": "linux/scripts/launch-local-final.py",
  "find": "'TimeoutStopSec=300'",
  "replace": "'TimeoutStopSec=1'",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-transport-6",
  "target": "linux/scripts/launch-local-final.py",
  "find": "'KillMode=control-group'",
  "replace": "'KillMode=process'",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "image-acceptance.bounded-transport-7",
  "target": "linux/scripts/launch-local-final.py",
  "find": "'LC_ALL=C'",
  "replace": "'LC_ALL=C.UTF-8'",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent synthetic unit, ownership and receipt controls retain the complete bounded FINAL transport; they prove no actual consumer execution, full licences or GPU inference."
 },
 {
  "id": "python-types.bounded-local-final-strict-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "replace": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated real bad-return and annotation controls must keep the FINAL launcher in fatal coverage; this proves no actual image or consumer acceptance."
 },
 {
  "id": "python-types.bounded-local-final-annotation-scope",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "replace": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'docs/scripts/verify_mutations.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated real bad-return and annotation controls must keep the FINAL launcher in fatal coverage; this proves no actual image or consumer acceptance."
 },
 {
  "id": "python.require-recipe-empty-scope",
  "target": "docs/scripts/generate_require_mutations.py",
  "find": "    if not entries:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-require-mutation-recipes.sh",
  "why": "Independent source and output fixtures must reject empty or wrong selection and replacement of retained recipe data; generating recipes alone does not prove mutants bite."
 },
 {
  "id": "python.require-recipe-named-require",
  "target": "docs/scripts/generate_require_mutations.py",
  "find": "node.value.func.id != 'require'",
  "replace": "node.value.func.id == 'require'",
  "test": "bash linux/scripts/tests/test-require-mutation-recipes.sh",
  "why": "Independent source and output fixtures must reject empty or wrong selection and replacement of retained recipe data; generating recipes alone does not prove mutants bite."
 },
 {
  "id": "python.require-recipe-no-overwrite",
  "target": "docs/scripts/generate_require_mutations.py",
  "find": "args.output.open('x', encoding='utf-8')",
  "replace": "args.output.open('w', encoding='utf-8')",
  "test": "bash linux/scripts/tests/test-require-mutation-recipes.sh",
  "why": "Independent source and output fixtures must reject empty or wrong selection and replacement of retained recipe data; generating recipes alone does not prove mutants bite."
 },
 {
  "id": "disk-guard.runtime-storage-successful-failed-stop",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    stopped_states = {'inactive'} if result['exit_status'] == 0 else {'inactive', 'failed'}",
  "replace": "    stopped_states = {'inactive', 'failed'}",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "A successful guardian cannot accept a failed post-stop state; failed worker observations preserve their actual failure without accepting the image."
 },
 {
  "id": "disk-guard.runtime-serial-smoke-env",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "        environment.append('RUNTIME_SMOKE_OVERLAP=0')",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent default and explicit scheduling cases retain the identical enabled smoke, driver, parent and cleanup bindings; ordering fixtures prove no actual completed runtime."
 },
 {
  "id": "disk-guard.runtime-serial-smoke-default",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "serial_smoke: bool = False",
  "replace": "serial_smoke: bool = True",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent default and explicit scheduling cases retain the identical enabled smoke, driver, parent and cleanup bindings; ordering fixtures prove no actual completed runtime."
 },
 {
  "id": "disk-guard.runtime-serial-smoke-forward",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "serial_smoke=args.serial_smoke",
  "replace": "serial_smoke=False",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Independent default and explicit scheduling cases retain the identical enabled smoke, driver, parent and cleanup bindings; ordering fixtures prove no actual completed runtime."
 },
 {
  "id": "compiler-llvm-tools.runtime-source-refuses-prior-wheel-proof",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "RUNTIME_REVISION = '2aa1a7780861db8012cb769e04d3de474dddca37'",
  "replace": "RUNTIME_REVISION = 'ec3be1855d2adee3622e36ac99cc76afcbfc5795'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The earlier runtime source and its full receipt must not qualify the unused-smoke-export repair."
 },
 {
  "id": "compiler-llvm-tools.runtime-rocm-starting-reserve",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "RUNTIME_REQUIRED_BYTES = 300 * 1024**3",
  "replace": "RUNTIME_REQUIRED_BYTES = 180 * 1024**3",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The independent driver expectation must retain the stronger ROCm starting budget after the real serial-smoke import failure; no peak-space sufficiency claim."
 },
 {
  "id": "compiler-llvm-tools.runtime-rocm-preserves-larger-plan",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "max(plan['required_bytes'], RUNTIME_REQUIRED_BYTES)",
  "replace": "min(plan['required_bytes'], RUNTIME_REQUIRED_BYTES)",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "A larger independent parent budget must survive the runtime minimum; fixtures do not authenticate parent receipts or guarantee physical capacity."
 },
 {
  "id": "compiler-llvm-tools.runtime-rocm-reserve-delegation",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "return launch_build(source, output, unit, images[-1], arch, required_bytes, record, environment, driver,",
  "replace": "return launch_build(source, output, unit, images[-1], arch, plan['required_bytes'], record, environment, driver,",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The real shared transport must receive the selected stronger runtime budget, not merely compute it for display; no actual build is performed."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-higher-reserve-refusal",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "disk['available_bytes'] >= required_bytes",
  "replace": "disk['available_bytes'] >= 193273528320",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The real failed 204-GB admission and one-byte-under boundary must refuse before outputs, preparation and unit start; synthetic budgets do not reserve disk."
 },
 {
  "id": "compiler-llvm-tools.normal-stage-selected-reserve-report",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "    disk['required_bytes'] = required_bytes",
  "replace": "    disk['required_bytes'] = 193273528320",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The passing-boundary invocation must report the same independent byte requirement actually checked; it proves reporting, not image acceptance."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-require-source-assert-1",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert head == SOURCE_REVISION, 'GNU_UNIQUE requires its exact reviewed source'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The require_source boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-require-source-assert-2",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert set(changes) == FIXTURE_CHANGES, 'Unreviewed changes after the compiler repair'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The require_source boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-require-source-assert-3",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "        assert (source / name).read_bytes() == expected, 'Reviewed compiler repair bytes differ: ' + name\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The require_source boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-fingerprint-assert-1",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert not relative.is_absolute() and '..' not in relative.parts, 'Input path escapes its source'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The fingerprint boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reference-inputs-assert-1",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert previous['source_revision'] == REFERENCE_REVISION, 'GNU_UNIQUE requires the reviewed compiler6 baseline'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The reference_inputs boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reference-inputs-assert-2",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert git(source, 'rev-parse', 'HEAD').decode().strip() == REFERENCE_REVISION, 'Compiler6 source head differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The reference_inputs boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reference-inputs-assert-3",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert not git(source, 'status', '--porcelain').strip(), 'Compiler6 source is dirty'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The reference_inputs boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reference-inputs-assert-4",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert report['source_revision'] == REFERENCE_REVISION, 'Compiler6 input report source differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The reference_inputs boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reference-inputs-assert-5",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert unchanged and not (unchanged.keys() & changed.keys()), 'Compiler6 input groups overlap or are empty'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The reference_inputs boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reference-inputs-assert-6",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert ADDED_INPUT not in inputs and not (source / ADDED_INPUT).exists(), 'New companion already appears in the baseline'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The reference_inputs boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reference-inputs-assert-7",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "        assert fingerprint(source, name) == expected, 'Compiler6 input fingerprint differs: ' + name\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The reference_inputs boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-changes-assert-1",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert set(differences) == INPUTS, 'Compiler inputs differ from the reviewed GNU_UNIQUE profile'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_changes boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-changes-assert-2",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert differences[ADDED_INPUT]['previous'] is None, 'New companion needs an explicit absent baseline'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_changes boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-changes-assert-3",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert all(value['previous'] is not None for name, value in differences.items() if name != ADDED_INPUT), 'Existing compiler input lost its baseline'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_changes boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-expected-dockerfile-assert-1",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert text.count(anchor) == 1, 'Unrecognized compiler6 LLVM companion anchor'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The expected_dockerfile boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-hook-count-assert-1",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    assert matched > 0, 'GNU_UNIQUE source commit has no matching normal hook mutations'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The hook_count boundary must reject the corresponding independently controlled invalid input."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-input-reference-assert-1",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def input_reference(source: Path, head: str, template: Path, previous: Json, profile: str) -> Json:\n    \"\"\"Keep historical references separate from the exact compiler6 baseline.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        return unique.reference_inputs(template, previous)\n    return json.loads(Path(previous['expensive_inputs_proof']).read_text())['unchanged_bind_files']\n\n\n",
  "replace": "def input_reference(source: Path, head: str, template: Path, previous: Json, profile: str) -> Json:\n    \"\"\"Keep historical references separate from the exact compiler6 baseline.\"\"\"\n    pass\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        return unique.reference_inputs(template, previous)\n    return json.loads(Path(previous['expensive_inputs_proof']).read_text())['unchanged_bind_files']\n\n\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The input_reference scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-input-reference-source-review-call",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def input_reference(source: Path, head: str, template: Path, previous: Json, profile: str) -> Json:\n    \"\"\"Keep historical references separate from the exact compiler6 baseline.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        return unique.reference_inputs(template, previous)\n    return json.loads(Path(previous['expensive_inputs_proof']).read_text())['unchanged_bind_files']\n\n\n",
  "replace": "def input_reference(source: Path, head: str, template: Path, previous: Json, profile: str) -> Json:\n    \"\"\"Keep historical references separate from the exact compiler6 baseline.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    if profile == unique.NAME:\n        pass\n        return unique.reference_inputs(template, previous)\n    return json.loads(Path(previous['expensive_inputs_proof']).read_text())['unchanged_bind_files']\n\n\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "Both shared entrypoint helpers actually apply the exact reviewed source pin."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reviewed-dockerfile-assert-1",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def reviewed_dockerfile(source: Path, previous: Path, profile: str) -> Json:\n    \"\"\"Retain old Dockerfile equality or the one reviewed new LLVM bind.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    materializer = 'linux/scripts/02-toolchain/materialize-llvm-target.sh'\n    commit = unique.REPAIR_REVISION if profile == unique.NAME else 'e7ca4436dbb5e58d8f9e0fb49105b6d3b636e9e9'\n    accepted = subprocess.check_output(['git','-C',str(source),'show',commit + ':' + materializer],timeout=60)\n    assert (source / materializer).read_bytes() == accepted, 'Materializer differs from its reviewed compiler repair'\n    current = source / unique.DOCKERFILE\n    expected = unique.expected_dockerfile(previous) if profile == unique.NAME else (previous / unique.DOCKERFILE).read_text()\n    assert current.read_text() == expected, 'Compiler Dockerfile differs from its reviewed profile'\n    if profile == unique.NAME:\n        return {'Dockerfile_sha256':sha(current), 'reviewed_Dockerfile_change':'one readonly LLVM GNU_UNIQUE companion bind'}\n    return {'identical_Dockerfile_sha256':sha(current)}\n\n\n",
  "replace": "def reviewed_dockerfile(source: Path, previous: Path, profile: str) -> Json:\n    \"\"\"Retain old Dockerfile equality or the one reviewed new LLVM bind.\"\"\"\n    pass\n    materializer = 'linux/scripts/02-toolchain/materialize-llvm-target.sh'\n    commit = unique.REPAIR_REVISION if profile == unique.NAME else 'e7ca4436dbb5e58d8f9e0fb49105b6d3b636e9e9'\n    accepted = subprocess.check_output(['git','-C',str(source),'show',commit + ':' + materializer],timeout=60)\n    assert (source / materializer).read_bytes() == accepted, 'Materializer differs from its reviewed compiler repair'\n    current = source / unique.DOCKERFILE\n    expected = unique.expected_dockerfile(previous) if profile == unique.NAME else (previous / unique.DOCKERFILE).read_text()\n    assert current.read_text() == expected, 'Compiler Dockerfile differs from its reviewed profile'\n    if profile == unique.NAME:\n        return {'Dockerfile_sha256':sha(current), 'reviewed_Dockerfile_change':'one readonly LLVM GNU_UNIQUE companion bind'}\n    return {'identical_Dockerfile_sha256':sha(current)}\n\n\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The reviewed_dockerfile scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reviewed-materializer",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "    assert (source / materializer).read_bytes() == accepted, 'Materializer differs from its reviewed compiler repair'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-plan-profile.sh",
  "why": "A frozen compiler materializer must not follow mutated current fixture bytes."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-patch-binding-assert-1",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "replace": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    pass\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_patch_binding scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-patch-binding-assert-2",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "replace": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    pass\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_patch_binding scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-patch-binding-assert-3",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "replace": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    pass\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_patch_binding scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-patch-binding-assert-4",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "replace": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    pass\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_patch_binding scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-patch-binding-assert-5",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "replace": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    pass\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_patch_binding scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-patch-binding-assert-6",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "replace": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    pass\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_patch_binding scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-patch-binding-assert-7",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "replace": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    pass\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_patch_binding scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-patch-binding-assert-8",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "replace": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The validate_patch_binding scope and receipt facts remain mandatory under direct helpers and ordinary planning."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-validate-patch-binding-source-review-call",
  "target": "linux/scripts/local-proof/compiler_plan_profile.py",
  "find": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        unique.require_source(source, head)\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "replace": "def validate_patch_binding(source: Path, head: str, profile: str, targeted: Json, commit: Json) -> None:\n    \"\"\"Require the exact targeted patch and unchanged normal hook policy for each source.\"\"\"\n    assert profile in PROFILES, 'Unknown compiler plan profile'\n    key = 'operational-tools' if profile == unique.NAME else 'native-clang-wrappers'\n    assert targeted['status'] == TARGETED_STATUSES[key]\n    assert targeted['owner_source'] == str(source) and targeted['quality_group_count'] == 26\n    assert targeted['cleanup_exit_status'] == targeted['independent_engine_query_exit_status'] == 0 and targeted['owned_container_absent']\n    assert commit['head'] == head and commit['source'] == str(source)\n    assert commit['status'] == 'passed-local-source-commit-normal-hooks-only' and commit['normal_hook_status'] == 0\n    required_hooks = 16\n    if profile == unique.NAME:\n        pass\n        required_hooks = unique.hook_count(source)\n    assert commit['actual_hook_mutations'] == required_hooks and commit['clean'] and commit['exact_committed_patch_match']\n    assert commit['patch_sha256'] == targeted['patch_sha256']\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "Both shared entrypoint helpers actually apply the exact reviewed source pin."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-hook-cap",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "    return min(16, matched)\n",
  "replace": "    return matched\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "Normal hooks retain their existing sixteen-entry cap when more files match."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-source-revision",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "SOURCE_REVISION = 'a4741df72654abd91008f75ced01f57e7b4a1461'\n",
  "replace": "SOURCE_REVISION = 'cccccccccccccccccccccccccccccccccccccccc'\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The compiler profile retains its independently reviewed source lineage."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-reference-revision",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "REFERENCE_REVISION = '652e5440c9cbbecee486ff86dab873b9ace967ec'\n",
  "replace": "REFERENCE_REVISION = 'cccccccccccccccccccccccccccccccccccccccc'\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The compiler profile retains its independently reviewed source lineage."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-repair-revision",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "REPAIR_REVISION = '60ce0c91e8831fbf1e2886b887a75dafbf4c2910'\n",
  "replace": "REPAIR_REVISION = 'cccccccccccccccccccccccccccccccccccccccc'\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The compiler profile retains its independently reviewed source lineage."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-required-mount",
  "target": "linux/scripts/local-proof/compiler_unique_profile.py",
  "find": "MOUNT = '    --mount=type=bind,source=' + ADDED_INPUT + ',target=/opt/scripts/toolchain/llvm-gnu-unique.sh,ro \\\\\\n'\n",
  "replace": "MOUNT = ''\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The current Dockerfile comparison requires the real narrow LLVM companion mount."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-planner-patch-call",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "validate_patch_binding(source, head, args.profile, targeted, commit)\n",
  "replace": "pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "Both normal entrypoints call the shared patch validator unconditionally."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-launcher-patch-call",
  "target": "linux/scripts/local-proof/launch-normal-compiler-plan.py",
  "find": "validate_patch_binding(source, plan['source_revision'], plan.get('planner_profile','clang-wrapper-repair'), targeted, commit)\n",
  "replace": "pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "Both normal entrypoints call the shared patch validator unconditionally."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-all-production-inputs",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "    production = sorted(set(production) | unique.INPUTS)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The plan records every reviewed new compiler input rather than only its earlier subset."
 },
 {
  "id": "compiler-llvm-tools.unique-plan-honest-comparison-status",
  "target": "linux/scripts/local-proof/prepare-next-compiler-plan.py",
  "find": "    comparison['status'] = 'reviewed-GNU-closure-equal-exact-GNU-UNIQUE-lineage-only'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-compiler-unique-profile.sh",
  "why": "The GNU_UNIQUE receipt states its actual reviewed lineage instead of an older transport profile."
 },
 {
  "id": "image-acceptance.terminal-require-1",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(isinstance(value, dict), 'Terminal evidence must be an object')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-2",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(isinstance(value, str) and value.isdecimal() and int(value) > 0, 'Invalid terminal clock or process identity')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-3",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(isinstance(value, dict), 'Terminal unit must be an object')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-4",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(all(value.get(key) == item for key, item in expected.items()), 'Retained unit was not terminal successful')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-5",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(isinstance(rows, list), 'Guardian cleanup evidence is malformed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-6",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(record['source'] == str(host) and record['revision'] == invocation['host_tools_revision'], 'Guardian host differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-7",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(record['runtime_invocation'] == str(path.resolve()) and record['runtime_invocation_sha256'] == fingerprint(path)\n            and record['producer_unit'] == invocation['unit'], 'Guardian watched another runtime')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-8",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(type(record['producer_pid']) is int and record['producer_pid'] > 0, 'Guardian process binding is missing')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-9",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(worker['status'] == 'observed-producer-terminal' and type(worker['exit_status']) is int\n            and worker['exit_status'] == 0 and proof['status'] == 'completed-storage-observation-only', 'Guardian did not finish successfully')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-10",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(proof['stopped'].get('MainPID') == '0' and proof['stopped'].get('ActiveState') == 'inactive', 'Guardian is not stopped')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-11",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(proof['producer_result'] == producer and proof['prunes'] == worker['prunes'], 'Guardian seal differs from its worker')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-12",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require([row.get('MESSAGE_ID') for row in rows] == list(IDS), 'Journal lifecycle is missing, duplicated or reused')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-13",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(isinstance(identity, str) and re.fullmatch(r'[0-9a-f]{32}', identity) is not None\n            and all(row.get('USER_INVOCATION_ID') == identity for row in rows), 'Journal invocation differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-14",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(len({row.get('_PID') for row in rows}) == 1, 'Journal manager PID changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-15",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(rows[0]['JOB_ID'] == rows[1]['JOB_ID'] and rows[2]['JOB_ID'] == rows[3]['JOB_ID'], 'Journal job identities differ')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-16",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    if not (isinstance(rows, list) and all(isinstance(row, dict) for row in rows)):\n        raise ValueError('Journal records are malformed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-17",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    if not (isinstance(boot, str) and re.fullmatch(r'[0-9a-f]{32}', boot) is not None\n            and type(uid) is int and uid >= 0):\n        raise ValueError('Journal boot or owner is malformed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-18",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    if not (isinstance(driver, list) and len(driver) == 11 and all(isinstance(word, str) and word for word in driver)):\n        raise ValueError('Journal driver is malformed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-19",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(type(exit_timestamp) is int and clocks[0] <= exit_timestamp <= clocks[1]\n            and clocks[0] < clocks[1] < clocks[2] < clocks[3], 'Journal and actual exit clocks differ')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-20",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(created.tzinfo is not None, 'Runtime creation time has no timezone')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-21",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(wall[0] - clocks[0] <= created_us <= wall[0] and all(a < b for a, b in pairwise(wall)), 'Journal predates or reorders the runtime')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-22",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(state == {'Id':unit, 'LoadState':'not-found', 'ActiveState':'inactive', 'SubState':'dead', 'MainPID':'0'}, 'Only a genuinely unloaded runtime may recover evidence')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-23",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    if not (unit.get('observation_source') == OBSERVATION and isinstance(evidence, dict)\n            and evidence.get('kind') == KIND):\n        raise ValueError('Retained terminal evidence is missing or unknown')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-24",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(isinstance(evidence.get('guard_directory'), str) and Path(evidence['guard_directory']).is_absolute(), 'Guardian evidence path is not absolute')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-25",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(isinstance(hashes, dict) and set(hashes) == {'invocation.json', 'worker-result.json', 'proof-stopped.json'}\n            and all(isinstance(value, str) and HASH.fullmatch(value) for value in hashes.values()), 'Guardian evidence hashes are missing')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-26",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    require(isinstance(evidence.get('journal'), dict)\n            and journal_proof(evidence['journal'], unit['Id'], origin['exit_timestamp_monotonic']) == evidence['journal'], 'Terminal journal evidence changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-27",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        require(isinstance(row, dict), 'Guardian cleanup entry is malformed')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-28",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        require(path.is_relative_to(directory) and path.parent == Path(row['directory']).resolve()\n                and path.name in {'proof.json', 'skip-proof.json'}, 'Guardian cleanup path differs')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-29",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        require(fingerprint(path) == row['proof_sha256'], 'Guardian cleanup proof changed')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-30",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        require(all(row.get(key) == value for key, value in expected.items())\n                and row.get('_EXE') in {'/usr/lib/systemd/systemd', '/lib/systemd/systemd'}, 'Journal sender or unit differs')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-31",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        require(row.get('JOB_TYPE') == ('start' if index < 2 else 'stop'), 'Journal job type differs')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-32",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        require(row.get('JOB_RESULT') == ('done' if index % 2 else None), 'Journal job failed or result differs')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-33",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        require(row.get('UNIT_RESULT') in (None, 'success'), 'Journal unit result failed')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-34",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        if not (isinstance(message, str) and message.count('[systemd-run] ') == 1 and message.endswith(suffix)):\n            raise ValueError('Journal command description is missing')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-35",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        require(shlex.split(body) == driver, 'Journal ran another driver')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-require-36",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        require(evidence is None, 'Unexpected terminal evidence on a live observation')\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-original-source-api",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    guard_source(host)['source_binding'](record)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-producer-clock",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    _positive(value.get('ExecMainExitTimestampMonotonic'))\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-guardian-clock",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    _positive(record.get('producer_start_ticks'))\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-guardian-terminal",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    successful_unit(proof['terminal'], record['unit'])\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-prune-proofs",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    _prune_proofs(proof['prunes'], directory)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-manager-pid",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "    _positive(rows[0].get('_PID'))\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-job-id",
  "target": "linux/scripts/runtime_terminal_evidence.py",
  "find": "        _positive(row.get('JOB_ID'))\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-before-import-host",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "        host_binding(invocation)\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-nonmissing-refusal",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "        if str(error) != 'Producer unit is missing':\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-receipt-companion",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    terminal_evidence.validate(before)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-runtime-terminal.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-closure-runtime_storage_guard",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "            HERE / 'image_acceptance_local.py', HERE / 'runtime_terminal_evidence.py', HERE / 'source_ci/common.py',\n",
  "replace": "            HERE / 'image_acceptance_local.py', HERE / 'source_ci/common.py',\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.terminal-closure-launch-local-final",
  "target": "linux/scripts/launch-local-final.py",
  "find": "    return sorted({*runtime, Path(__file__), HERE / 'image-acceptance.py', HERE / 'image_acceptance_local.py', HERE / 'runtime_terminal_evidence.py',\n",
  "replace": "    return sorted({*runtime, Path(__file__), HERE / 'image-acceptance.py', HERE / 'image_acceptance_local.py',\n",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "python-types.runtime-terminal-scope-1",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "replace": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "python-types.runtime-terminal-scope-2",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "replace": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Independent sealed-observer and journal controls must reject a broken binding; no real runtime, consumer acceptance, licence closure or GPU inference is established."
 },
 {
  "id": "image-acceptance.consumer-sources-consumer-log-readiness",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "            or not (checkouts / (name + \".log\")).is_file()\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "image-acceptance.consumer-sources-no-object-hardlinks",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "            \"--no-hardlinks\",\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "image-acceptance.consumer-sources-cached-worktree-clean",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "        not git(\n            root,\n            \"status\",",
  "replace": "        True or not git(\n            root,\n            \"status\",",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "image-acceptance.consumer-sources-cached-index",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "index_sha256 is None or digest == index_sha256",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "image-acceptance.consumer-sources-object-independence",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "objects.is_relative_to(root)\n        and not (objects / \"info/alternates\").exists()\n        and not list((objects / \"pack\").glob(\"*.promisor\"))",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "image-acceptance.consumer-sources-cached-fsck",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    git(root, \"fsck\", \"--full\", \"--strict\", \"--no-reflogs\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "image-acceptance.consumer-sources-cached-nonempty-roots",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "record[\"roots\"]\n                and record[\"roots\"][0][\"preserved\"] == str(directory / name)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "image-acceptance.consumer-sources-cached-child-boundary",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "root.is_relative_to(directory / name),",
  "replace": "True,",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "image-acceptance.consumer-sources-cached-byte-verification",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "                verify_tree(root, row[\"head\"], row[\"versioned_index_sha256\"])\n",
  "replace": "                pass\n",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "image-acceptance.consumer-sources-retained-successful-checkouts",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        validate_receipt(receipt, args.image, args.plan, allow_local=local)\n    except ",
  "replace": "        validate_receipt(receipt, args.image, args.plan, allow_local=local)\n        for spec in plan[\"consumers\"]:\n            __import__(\"shutil\").rmtree(work / spec[\"name\"])\n    except ",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Real local Git controls must reject unsafe preservation; this proves neither source authentication, build outputs nor GPU execution."
 },
 {
  "id": "python-types.consumer-source-preserver-scope-1",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "replace": "  'linux/scripts/develop_red.py' 'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The new source preserver remains in strict ty and parameter/return annotation scopes; the isolated fixture must reject a wrong return type or missing annotations."
 },
 {
  "id": "python-types.consumer-source-preserver-scope-2",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/preserve-consumer-sources.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "replace": "  'linux/scripts/image-acceptance.py' 'linux/scripts/image-acceptance-ci.py' 'linux/scripts/image_acceptance_local.py' 'linux/scripts/runtime_terminal_evidence.py' 'linux/scripts/runtime_storage_guard.py' 'linux/scripts/launch-runtime-storage-guard.py' 'linux/scripts/launch-local-final.py' 'docs/scripts/verify_mutations.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The new source preserver remains in strict ty and parameter/return annotation scopes; the isolated fixture must reject a wrong return type or missing annotations."
 },
 {
  "id": "lib.app-packaging-declared-selection",
  "target": "linux/scripts/lib/app-packaging-entrypoint.sh",
  "find": "  if [[ -n \"$declared\" ]]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-app-packaging-entrypoint.sh",
  "why": "Declared application selection must reach real rendered launcher targets; stub builders do not prove compression, installation or GPU execution."
 },
 {
  "id": "lib.app-packaging-declared-basename",
  "target": "linux/scripts/lib/app-packaging-entrypoint.sh",
  "find": "    if [[ ! \"$declared\" =~ ^[a-zA-Z0-9_.+-]+$ || \"$declared\" == . || \"$declared\" == .. ]]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-app-packaging-entrypoint.sh",
  "why": "Declared application selection must reach real rendered launcher targets; stub builders do not prove compression, installation or GPU execution."
 },
 {
  "id": "lib.app-packaging-declared-executable",
  "target": "linux/scripts/lib/app-packaging-entrypoint.sh",
  "find": "    if [[ ! -f \"$bundle_dir/$declared\" || ! -x \"$bundle_dir/$declared\" || -L \"$bundle_dir/$declared\" ]]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-app-packaging-entrypoint.sh",
  "why": "Declared application selection must reach real rendered launcher targets; stub builders do not prove compression, installation or GPU execution."
 },
 {
  "id": "lib.app-packaging-declared-dispatch",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "  binary_name=\"$(app_packaging_detect_bundle_binary \"$bundle_dir\")\"",
  "replace": "  binary_name=aaa-helper",
  "test": "bash linux/scripts/tests/test-app-packaging-entrypoint.sh",
  "why": "Declared application selection must reach real rendered launcher targets; stub builders do not prove compression, installation or GPU execution."
 },
 {
  "target": "linux/scripts/lib/app-packaging.sh",
  "test": "bash linux/scripts/tests/test-app-packaging-entrypoint.sh",
  "why": "Copied packaging libraries must import the canonical executable selector and require its export before rendering; no package or GPU acceptance is established.",
  "id": "lib.app-packaging-entrypoint-required-import",
  "find": "source \"${_APP_PACKAGING_DIR}/app-packaging-entrypoint.sh\" || return $?\n",
  "replace": ":\n"
 },
 {
  "target": "linux/scripts/lib/app-packaging.sh",
  "test": "bash linux/scripts/tests/test-app-packaging-entrypoint.sh",
  "why": "Copied packaging libraries must import the canonical executable selector and require its export before rendering; no package or GPU acceptance is established.",
  "id": "lib.app-packaging-entrypoint-required-export",
  "find": "declare -F app_packaging_detect_bundle_binary >/dev/null || { echo 'Error: app-packaging-entrypoint.sh lacks app_packaging_detect_bundle_binary' >&2; return 1; }\n",
  "replace": ":\n"
 },
 {
  "id": "lib.deb-control-readelf-raw-failure",
  "target": "linux/scripts/tests/test-deb-control-rendering.sh",
  "find": "[ \"${READELF_FAIL:-0}\" = 0 ] || exit 9",
  "replace": ": \"${READELF_FAIL:-0}\"",
  "test": "bash linux/scripts/tests/test-deb-control-rendering.sh",
  "why": "The readelf control must fail after successful real ELF and deterministic package discovery; a swallowed failure cannot satisfy the negative control."
 },
 {
  "id": "lib.app-packaging-entrypoint-logging-import",
  "target": "linux/scripts/lib/app-packaging-entrypoint.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/log-bootstrap.sh\" || return $?",
  "replace": ": \"missing canonical logging import\"",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "The declared-entrypoint selector must import canonical logging when sourced standalone; a caller already loading logging cannot satisfy that library contract. This does not prove a real package or GPU execution."
 },
 {
  "id": "lib.app-packaging-artifacts-logging-import",
  "target": "linux/scripts/lib/app-packaging-artifacts.sh",
  "find": "source \"$(dirname \"${BASH_SOURCE[0]}\")/log-bootstrap.sh\" || return $?",
  "replace": ": \"missing canonical logging import\"",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "The artifact selector must import canonical logging when sourced standalone."
 },
 {
  "id": "lib.app-packaging-single-artifact-count",
  "target": "linux/scripts/lib/app-packaging-artifacts.sh",
  "find": "\"${#found[@]}\" -eq 1 &&",
  "replace": "\"${#found[@]}\" -ge 1 &&",
  "test": "bash linux/scripts/tests/test-app-packaging-artifacts.sh",
  "why": "A second artifact of one kind must fail rather than be picked."
 },
 {
  "id": "lib.app-packaging-single-artifact-unmatched",
  "target": "linux/scripts/lib/app-packaging-artifacts.sh",
  "find": "    if [[ -e \"$path\" || -L \"$path\" ]]; then found+=(\"$path\"); fi",
  "replace": "    found+=(\"$path\")",
  "test": "bash linux/scripts/tests/test-app-packaging-artifacts.sh",
  "why": "An unmatched pattern is no artifact, so an empty or missing directory reports found 0 without nullglob."
 },
 {
  "id": "lib.app-packaging-single-artifact-regular",
  "target": "linux/scripts/lib/app-packaging-artifacts.sh",
  "find": " && -f \"${found[0]}\" && ! -L \"${found[0]}\" ]]",
  "replace": " && -e \"${found[0]}\" && ! -L \"${found[0]}\" ]]",
  "test": "bash linux/scripts/tests/test-app-packaging-artifacts.sh",
  "why": "A directory that matches the suffix is not a package artifact."
 },
 {
  "id": "lib.app-packaging-single-artifact-link",
  "target": "linux/scripts/lib/app-packaging-artifacts.sh",
  "find": " && ! -L \"${found[0]}\" ]]",
  "replace": " ]]",
  "test": "bash linux/scripts/tests/test-app-packaging-artifacts.sh",
  "why": "A link that matches the suffix is not a package artifact; it can point outside the package directory."
 },
 {
  "id": "lib.app-packaging-linux-artifacts-all-reported",
  "target": "linux/scripts/lib/app-packaging-artifacts.sh",
  "find": "  _ala_deb=\"$(app_packaging_single_artifact \"$_ala_dir\" .deb)\" || _ala_rc=1",
  "replace": "  _ala_deb=\"$(app_packaging_single_artifact \"$_ala_dir\" .deb)\" || return 1",
  "test": "bash linux/scripts/tests/test-app-packaging-artifacts.sh",
  "why": "One run reports every miscounted format, not only the first."
 },
 {
  "id": "lib.app-packaging-linux-artifacts-verdict",
  "target": "linux/scripts/lib/app-packaging-artifacts.sh",
  "find": "  if [[ \"$_ala_rc\" -ne 0 ]]; then return 1; fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-app-packaging-artifacts.sh",
  "why": "A miscounted format fails the set and leaves the caller's variables unset."
 },
 {
  "id": "python.compile-cache.command-required",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "[[ $# -gt 0 ]]",
  "replace": "[[ $# -ge 0 ]]",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "A missing build command must refuse, not report a successful empty scope."
 },
 {
  "id": "python.compile-cache.mode-validation",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "*) printf 'PYTHON_BUILD_COMPILER_CACHE must be on or off\\n' >&2; return 2 ;;",
  "replace": "*) return 0 ;;",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "Unknown cache modes must not silently succeed."
 },
 {
  "id": "python.compile-cache.explicit-compilers",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "[[ -n ${CC:-} && -n ${CXX:-} ]]",
  "replace": "[[ 1 == 1 ]]",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "Missing compiler configuration must report the explicit prerequisite before lookup."
 },
 {
  "id": "python.compile-cache.single-executables",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "type -P -- \"$CC\" >/dev/null && type -P -- \"$CXX\" >/dev/null",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "Cache mode refuses multiword compiler commands and missing executable files."
 },
 {
  "id": "python.compile-cache.source-raw-failure",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "source \"${_PYTHON_CI_CACHE_CORE}/common.sh\" || return $?",
  "replace": "source \"${_PYTHON_CI_CACHE_CORE}/common.sh\"",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "A failing required core import retains its raw status."
 },
 {
  "id": "python.compile-cache.required-api",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "declare -F compiler_cache_launcher_env >/dev/null && declare -F compiler_cache_launcher >/dev/null || {",
  "replace": "true || {",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "The imported core must export both required cache APIs."
 },
 {
  "id": "python.compile-cache.published-environment",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  compiler_cache_launcher_env || return $?\n",
  "replace": "  (compiler_cache_launcher_env) || return $?\n",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "The cache server address and other setup state must publish in the calling shell."
 },
 {
  "id": "python.compile-cache.environment-raw-failure",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  compiler_cache_launcher_env || return $?\n",
  "replace": "  compiler_cache_launcher_env || true\n",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "A failed cache environment setup must retain its raw status."
 },
 {
  "id": "python.compile-cache.prepare-parent-scope",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  python_ci_cache_prepare || return $?",
  "replace": "  (python_ci_cache_prepare) || return $?",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "Required cache preparation must retain caller-visible setup state."
 },
 {
  "id": "python.compile-cache.prepare-raw-failure",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  python_ci_cache_prepare || return $?",
  "replace": "  python_ci_cache_prepare",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "A refused preparation must not continue to a later unrelated verdict."
 },
 {
  "id": "python.compile-cache.resolver-raw-failure",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "_py_ci_cache_launcher=\"$(compiler_cache_launcher)\" || return $?",
  "replace": "_py_ci_cache_launcher=\"$(compiler_cache_launcher)\"",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "A failed canonical cache resolver must preserve its actual status."
 },
 {
  "id": "python.compile-cache.launcher-executable",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "[[ -n \"${_py_ci_cache_launcher}\" ]] && type -P -- \"${_py_ci_cache_launcher}\" >/dev/null",
  "replace": "[[ -n \"${_py_ci_cache_launcher}\" ]]",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "A nonexistent selected launcher cannot reach a purported cached build."
 },
 {
  "id": "python.compile-cache.c-quoting",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  _py_ci_cache_cc=\"$(python3 -c 'import shlex, sys; print(shlex.join(sys.argv[1:]))' \"${_py_ci_cache_launcher}\" \"$CC\")\" || return $?",
  "replace": "  _py_ci_cache_cc=\"${_py_ci_cache_launcher} ${CC}\"",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "Compiler and launcher paths retain spaces and apostrophes as distinct argv entries."
 },
 {
  "id": "python.compile-cache.cxx-quoting",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  _py_ci_cache_cxx=\"$(python3 -c 'import shlex, sys; print(shlex.join(sys.argv[1:]))' \"${_py_ci_cache_launcher}\" \"$CXX\")\" || return $?",
  "replace": "  _py_ci_cache_cxx=\"${_py_ci_cache_launcher} ${CXX}\"",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "Compiler and launcher paths retain spaces and apostrophes as distinct argv entries."
 },
 {
  "id": "python.compile-cache.complete-argv",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  CC=\"${_py_ci_cache_cc}\" CXX=\"${_py_ci_cache_cxx}\" \"$@\"",
  "replace": "  CC=\"${_py_ci_cache_cc}\" CXX=\"${_py_ci_cache_cxx}\" \"$@\" \"\"",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "The selected build receives every original argument and no extra one."
 },
 {
  "id": "python.compile-cache.callback-parent-scope",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  CC=\"${_py_ci_cache_cc}\" CXX=\"${_py_ci_cache_cxx}\" \"$@\"",
  "replace": "  (CC=\"${_py_ci_cache_cc}\" CXX=\"${_py_ci_cache_cxx}\" \"$@\")",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "Function callbacks publish their venv and ORT state without a subshell."
 },
 {
  "id": "python.compile-cache.callback-raw-failure",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  CC=\"${_py_ci_cache_cc}\" CXX=\"${_py_ci_cache_cxx}\" \"$@\"",
  "replace": "  CC=\"${_py_ci_cache_cc}\" CXX=\"${_py_ci_cache_cxx}\" \"$@\" || true",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "Raw build failures remain failures and do not disable Bash errexit."
 },
 {
  "id": "python.compile-cache.restore-compilers",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  CC=\"${_py_ci_cache_cc}\" CXX=\"${_py_ci_cache_cxx}\" \"$@\"",
  "replace": "  export CC=\"${_py_ci_cache_cc}\" CXX=\"${_py_ci_cache_cxx}\"\n  \"$@\"",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "Cache-prefixed compiler strings must not escape into package assembly."
 },
 {
  "id": "python.compile-cache.off-raw-failure",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "off) \"$@\"; return ;;",
  "replace": "off) \"$@\"; return 0 ;;",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "The default mode retains a failed command status."
 },
 {
  "id": "python.compile-cache.off-parent-scope",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "off) \"$@\"; return ;;",
  "replace": "off) (\"$@\"); return ;;",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "The default mode retains callback publication with unset compiler variables."
 },
 {
  "id": "python.compile-cache.enabled-build",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "on) ;;",
  "replace": "on) \"$@\"; return ;;",
  "test": "bash linux/scripts/tests/test-python-ci-compiler-cache.sh",
  "why": "An enabled build must actually receive the cache prefix."
 },
 {
  "id": "python.compile-cache.required-companion",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "source \"$SCRIPT_DIR/ci-compiler-cache.sh\" || { echo \"Error: failed to source ci-compiler-cache.sh\" >&2; exit 1; }",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "A copied packaging driver refuses its missing companion with the required import diagnostic."
 },
 {
  "id": "python.compile-cache.companion-api",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "declare -F python_ci_cached_command >/dev/null || { echo \"Error: ci-compiler-cache.sh lacks its command API\" >&2; exit 1; }",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "A stale companion without its command API refuses before builds."
 },
 {
  "id": "python.compile-cache.sdist-scope",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "    python_ci_cached_command uv build --sdist",
  "replace": "    uv build --sdist",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "Every selected wheel-building branch retains compiler-cache transport."
 },
 {
  "id": "python.compile-cache.cross-wheel-scope",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "      _PYTHON_HOST_PLATFORM=\"${PYTHON_HOST_PLATFORM_TARGET}\" python_ci_cached_command \"${venv}/bin/python\" -m pip wheel . --no-deps -w dist",
  "replace": "      _PYTHON_HOST_PLATFORM=\"${PYTHON_HOST_PLATFORM_TARGET}\" \"${venv}/bin/python\" -m pip wheel . --no-deps -w dist",
  "test": "bash linux/scripts/tests/test-python-ci-packaging-arm.sh",
  "why": "Every selected wheel-building branch retains compiler-cache transport."
 },
 {
  "id": "python.compile-cache.native-wheel-scope",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "    python_ci_cached_command uv build --python \"$(uv_python_request \"${PYTHON_VERSION}\")\"",
  "replace": "    uv build --python \"$(uv_python_request \"${PYTHON_VERSION}\")\"",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "Every selected wheel-building branch retains compiler-cache transport."
 },
 {
  "id": "python.compile-cache.ft-wheel-scope",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "  python_ci_cached_command uv build --python \"${FT_PYTHON}\" --out-dir \"${out}\" || err \"the free-threaded build failed\"",
  "replace": "  uv build --python \"${FT_PYTHON}\" --out-dir \"${out}\" || err \"the free-threaded build failed\"",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "Every selected wheel-building branch retains compiler-cache transport."
 },
 {
  "id": "python.compile-cache.source-sync",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "python_ci_cached_command uv_sync_project\n\npackage_build \"$VENV_SOURCES\"",
  "replace": "uv_sync_project\n\npackage_build \"$VENV_SOURCES\"",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "Every editable sync can compile and therefore receives the same cache scope."
 },
 {
  "id": "python.compile-cache.binary-sync",
  "target": "linux/scripts/02-toolchain/python/ci_packaging.sh",
  "find": "python_ci_cached_command uv_sync_project\n\npackage_build \"$VENV_BINARIES\"",
  "replace": "uv_sync_project\n\npackage_build \"$VENV_BINARIES\"",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "Every editable sync can compile and therefore receives the same cache scope."
 },
 {
  "id": "python.compile-cache.copied-helper",
  "target": "linux/scripts/tests/python-ci-fixture.sh",
  "find": "02-toolchain/python/ci-compiler-cache.sh \"${@:3}\"",
  "replace": "\"${@:3}\"",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "Copied Python packaging fixtures carry the required production companion."
 },
 {
  "id": "python.compile-cache.shared-ci-context",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "source \"${_PYTHON_CI_CACHE_DIR}/ci-common.sh\" || { echo 'Error: failed to source ci-common.sh' >&2; return 1; }",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-free-threaded-wheel.sh",
  "why": "The packaging companion must initialize the shared CI context and retain its failed-import diagnostic."
 },
 {
  "id": "python.compile-cache.site-ownership",
  "target": "linux/scripts/02-toolchain/python/ci-compiler-cache.sh",
  "find": "  compiler_cache_launcher_env || return $?\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "why": "Every resolver retains a directly preceding parent-shell environment call; strict callers preserve the raw failure. Source fixtures do not prove compilation or cache hits."
 },
 {
  "id": "compiler-llvm-tools.image-profile-known-selector",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert profile in (None, 'compiler-cross-cpu'), 'Unknown image qualification profile'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k current_compiler_profile",
  "why": "Synthetic current and historical controls must reject a missing or unknown selector and retain the complete CPU scope; no actual image acceptance."
 },
 {
  "id": "compiler-llvm-tools.image-profile-current-selector-required",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "        assert profile == 'compiler-cross-cpu', 'Current source plans require the complete compiler CPU profile'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k current_compiler_profile",
  "why": "Synthetic current and historical controls must reject a missing or unknown selector and retain the complete CPU scope; no actual image acceptance."
 },
 {
  "id": "compiler-llvm-tools.image-profile-explicit-cross-required",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    return profile == 'compiler-cross-cpu' or plan.get('launcher_contract') == 2\n",
  "replace": "    return plan.get('launcher_contract') == 2\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k current_compiler_profile",
  "why": "Synthetic current and historical controls must reject a missing or unknown selector and retain the complete CPU scope; no actual image acceptance."
 },
 {
  "id": "compiler-llvm-tools.image-profile-historical-cross-retained",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    return profile == 'compiler-cross-cpu' or plan.get('launcher_contract') == 2\n",
  "replace": "    return profile == 'compiler-cross-cpu'\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k current_compiler_profile",
  "why": "Synthetic current and historical controls must reject a missing or unknown selector and retain the complete CPU scope; no actual image acceptance."
 },
 {
  "id": "compiler-llvm-tools.image-profile-OCI-cross-required",
  "target": "linux/scripts/local-proof/native-oci-handoff.py",
  "find": "    elif subject['cross_required']:\n",
  "replace": "    elif plan.get('launcher_contract') == 2:\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k receipt_refusals",
  "why": "The current explicit profile must retain every original incomplete cross-wrapper parent refusal, with no historical launcher-contract label."
 },
 {
  "id": "python-types.profile-root-runtime",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  --extra-search-path linux/scripts/03-media/runtime\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Real ty fixtures must fail when a required sibling root or compiler-profile strict scope is removed; runtime imports and image acceptance remain separate."
 },
 {
  "id": "python-types.profile-root-packaging",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  --extra-search-path linux/scripts/06-packaging\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Real ty fixtures must fail when a required sibling root or compiler-profile strict scope is removed; runtime imports and image acceptance remain separate."
 },
 {
  "id": "python-types.profile-root-tests",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  --extra-search-path linux/scripts/tests\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Real ty fixtures must fail when a required sibling root or compiler-profile strict scope is removed; runtime imports and image acceptance remain separate."
 },
 {
  "id": "python-types.profile-root-gateway",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  --extra-search-path linux/llm-stack/tests/gateway_e2e\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Real ty fixtures must fail when a required sibling root or compiler-profile strict scope is removed; runtime imports and image acceptance remain separate."
 },
 {
  "id": "python-types.profile-root-local-proof",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  --extra-search-path linux/scripts/local-proof)\n",
  "replace": ")\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Real ty fixtures must fail when a required sibling root or compiler-profile strict scope is removed; runtime imports and image acceptance remain separate."
 },
 {
  "id": "python-types.profile-quality-subject",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/local-proof/proof_subject.py' 'linux/scripts/local-proof/native-oci-handoff.py' \\\n",
  "replace": "  'linux/scripts/local-proof/native-oci-handoff.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Real ty fixtures must fail when a required sibling root or compiler-profile strict scope is removed; runtime imports and image acceptance remain separate."
 },
 {
  "id": "python-types.profile-annotations-subject",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/local-proof/proof_subject.py' \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Real ty fixtures must fail when a required sibling root or compiler-profile strict scope is removed; runtime imports and image acceptance remain separate."
 },
 {
  "id": "python-types.profile-quality-oci",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/local-proof/proof_subject.py' 'linux/scripts/local-proof/native-oci-handoff.py' \\\n",
  "replace": "  'linux/scripts/local-proof/proof_subject.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Real ty fixtures must fail when a required sibling root or compiler-profile strict scope is removed; runtime imports and image acceptance remain separate."
 },
 {
  "id": "python-types.profile-annotations-oci",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/local-proof/native-oci-handoff.py' \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "Real ty fixtures must fail when a required sibling root or compiler-profile strict scope is removed; runtime imports and image acceptance remain separate."
 },
 {
  "id": "compiler-llvm-tools.direct-failure-assertion-evidence",
  "target": "linux/scripts/local-proof/audit-failed-source-check.py",
  "find": "        assert reports, 'Missing direct suite failure evidence'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k direct_failure_audit",
  "why": "Failure preservation requires actual direct assertion evidence before the mutator/preflight stages; a retained failure never accepts source."
 },
 {
  "id": "compiler-llvm-tools.direct-failure-no-later-preflight",
  "target": "linux/scripts/local-proof/audit-failed-source-check.py",
  "find": "        assert not (out / 'preflight.log').exists(), 'Direct failure cannot contain a preflight report'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k direct_failure_audit",
  "why": "Failure preservation requires actual direct assertion evidence before the mutator/preflight stages; a retained failure never accepts source."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-schema2-writer",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "result = {'schema_version':2,",
  "replace": "result = {'schema_version':1,",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "New receipts must use the stable schema while legacy readers retain their policy."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-schema-exact-type",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "type(record['schema_version']) is int and ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "A boolean must not impersonate a legacy schema with matching full identities."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-stable-schema2",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "stable = record['schema_version'] == 2",
  "replace": "stable = False",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Sibling and descendant links must preserve a new receipt without dropping stable identity checks."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-strict-schema1",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "stable = record['schema_version'] == 2",
  "replace": "stable = True",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Legacy receipts retain exact ctime and cannot be silently reinterpreted as schema 2."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-ctime-exclusion",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": " if not stable or name != 'st_ctime_ns'",
  "replace": "",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "Only schema 2 excludes ctime so ordinary future links cannot invalidate its stable identity."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-source-identity",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "identity(source,stable=stable) == row['identity'] and identity(destination,stable=stable) == row['identity']",
  "replace": "identity(destination,stable=stable) == row['identity']",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "A same-byte replacement of the parent inode must still refuse."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-child-identity",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "identity(source,stable=stable) == row['identity'] and identity(destination,stable=stable) == row['identity']",
  "replace": "identity(source,stable=stable) == row['identity']",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "A same-byte replacement of the child inode must still refuse."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-default-media-parent",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": ", DEFAULT_MEDIA_STATUS, DEFAULT_ANDROID_STATUS}",
  "replace": ", DEFAULT_ANDROID_STATUS}",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "The default native Media parent uses its own verified byte status rather than a fabricated ROCm status."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-default-android-parent",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": ", DEFAULT_MEDIA_STATUS, DEFAULT_ANDROID_STATUS}",
  "replace": ", DEFAULT_MEDIA_STATUS}",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "The default native Android parent uses its own verified byte status rather than a fabricated ROCm status."
 },
 {
  "id": "compiler-llvm-tools.oci-parent-replay-recorded-inode",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": "for name in STAT_FIELDS if not stable or name != 'st_ctime_ns'",
  "replace": "for name in STAT_FIELDS if name != 'st_ino' and (not stable or name != 'st_ctime_ns')",
  "test": "bash linux/scripts/tests/test-native-oci-seed.sh",
  "why": "New receipts must retain every stable identity field, including the original inode."
 },
 {
  "id": "image-acceptance.export-wheel-mode",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(wheels in [['RUNTIME_WHEELS_SOURCE=image'], ['RUNTIME_WHEELS_SOURCE=export']], 'Runtime wheelhouse delivery mode differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Synthetic producer and engine controls must reject invalid delivery, host or wrapper identity; no real FINAL consumers, image, hardware or legal acceptance is proved."
 },
 {
  "id": "image-acceptance.export-host-mapping",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(isinstance(selected, dict) and all(isinstance(path, str) for path in selected), 'Runtime worker mapping is malformed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Synthetic producer and engine controls must reject invalid delivery, host or wrapper identity; no real FINAL consumers, image, hardware or legal acceptance is proved."
 },
 {
  "id": "image-acceptance.export-host-profile",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(len(profiles) == 1 and profiles[0].is_absolute() and len(profiles[0].parents) >= 4, 'Runtime host profile is missing or ambiguous')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Synthetic producer and engine controls must reject invalid delivery, host or wrapper identity; no real FINAL consumers, image, hardware or legal acceptance is proved."
 },
 {
  "id": "image-acceptance.export-wrapper-clean",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(not output(['git', '-C', str(wrapper.parents[2]), 'status', '--porcelain']).strip(), 'Runtime wrapper source changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Synthetic producer and engine controls must reject invalid delivery, host or wrapper identity; no real FINAL consumers, image, hardware or legal acceptance is proved."
 },
 {
  "id": "image-acceptance.export-wrapper-companions",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "            require(actual.is_file() and fingerprint(actual) == fingerprint(path), 'Runtime executed wrapper companion differs: ' + path.name)\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Synthetic producer and engine controls must reject invalid delivery, host or wrapper identity; no real FINAL consumers, image, hardware or legal acceptance is proved."
 },
 {
  "id": "image-acceptance.export-unit-lane",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    return re.compile(r'webgpu-normal-' + stage + r'-(?:' + (variant or 'default') + r'-)?' + arch + r'-[0-9-]+\\.service\\Z')\n",
  "replace": "    return re.compile(r'webgpu-normal-' + stage + r'-(?:[a-z]+-)?' + arch + r'-[0-9-]+\\.service\\Z')\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent lane refusals reject a runtime unit whose explicit vendor differs from its declared variant; no actual runtime or consumer proof."
 },
 {
  "id": "image-acceptance.android-command-lane",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(isinstance(variant, str) and (variant, arch) in LANES, 'Undeclared Android lane differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic Android command, source and parent controls must reject the broken binding; original receipt bytes remain untouched and no real FINAL, hardware or licence acceptance is proved."
 },
 {
  "id": "image-acceptance.android-command-command-shape",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(isinstance(command, list) and all(isinstance(value, str) for value in command), 'Undeclared Android command is missing')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic Android command, source and parent controls must reject the broken binding; original receipt bytes remain untouched and no real FINAL, hardware or licence acceptance is proved."
 },
 {
  "id": "image-acceptance.android-command-driver",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(repo.startswith('ant-local/webgpu-') and command[:2] == ['systemd-run', '--user'] and command[-10:] == expected, 'Undeclared Android driver differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic Android command, source and parent controls must reject the broken binding; original receipt bytes remain untouched and no real FINAL, hardware or licence acceptance is proved."
 },
 {
  "id": "image-acceptance.android-command-transport",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require('--expand-environment=no' in command and [value for value in command if value.startswith('--unit=')] == ['--unit=' + unit]\n            and '--push' not in command and '--gates-only' not in command, 'Undeclared Android transport differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic Android command, source and parent controls must reject the broken binding; original receipt bytes remain untouched and no real FINAL, hardware or licence acceptance is proved."
 },
 {
  "id": "image-acceptance.android-command-variant",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require([value for value in command if value.startswith('CROSS_VARIANT=')] == ['CROSS_VARIANT=' + cast(str, variant)], 'Undeclared Android variant flag differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic Android command, source and parent controls must reject the broken binding; original receipt bytes remain untouched and no real FINAL, hardware or licence acceptance is proved."
 },
 {
  "id": "image-acceptance.android-command-launch",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(type(android.get('launch_status')) is int and android['launch_status'] == 0 and android.get('publication') is False\n            and android.get('source_full_preflight_passed') is True and android.get('producer_source_unchanged') is True, 'Undeclared Android source or launch differs')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic Android command, source and parent controls must reject the broken binding; original receipt bytes remain untouched and no real FINAL, hardware or licence acceptance is proved."
 },
 {
  "id": "image-acceptance.android-command-source-hash",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    require(fingerprint(proof) == text(android, 'source_full_preflight_sha256', HASH), 'Undeclared Android complete source proof changed')\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic Android command, source and parent controls must reject the broken binding; original receipt bytes remain untouched and no real FINAL, hardware or licence acceptance is proved."
 },
 {
  "id": "image-acceptance.android-command-source-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "        local_api('normal_stage_launch').full_source(source, proof, text(android, 'source_revision', SHA))\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic Android command, source and parent controls must reject the broken binding; original receipt bytes remain untouched and no real FINAL, hardware or licence acceptance is proved."
 },
 {
  "id": "image-acceptance.android-command-stage-call",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    android = android_input(android, platform)\n",
  "replace": "    android = android\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent synthetic Android command, source and parent controls must reject the broken binding; original receipt bytes remain untouched and no real FINAL, hardware or licence acceptance is proved."
 },
 {
  "id": "image-acceptance.android-command-dispatch",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    source = android_command(android, platform)\n",
  "replace": "    source = Path(text(android, 'source'))\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Independent Android argv refusals must still execute after separating command and source validation; no actual FINAL, hardware or licence proof."
 },
 {
  "id": "host.consumer-command-seal-fresh-seals",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "not output.exists() and not stopped_output.exists()",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal fresh-seals control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-exclusive-cleanup",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "not cleanup_path.exists()",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal exclusive-cleanup control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-unit-name",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "re.fullmatch(r\"[A-Za-z0-9][A-Za-z0-9_.@:-]*\\.service\", args.unit)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal unit-name control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-invocation-unit",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "invocation[\"unit\"] == args.unit",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal invocation-unit control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-run-id",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "re.fullmatch(r\"[0-9a-f]{32}\", invocation[\"run_id\"])",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal run-id control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-evidence-files",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "all(path.is_file() and not path.is_symlink() for path in paths)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal evidence-files control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-success-markers",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "args.success_marker and all(marker and marker in lines for marker in args.success_marker)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal success-markers control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-raw-status",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "paths[2].read_text() == \"command_status=0\\ncache_stats_status=0\\n\"",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal raw-status control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-cache-structure",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "isinstance(statistics.get(\"stats\"), dict)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal cache-structure control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-terminal-result",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "terminal = successful_unit(unit_state(args.unit), args.unit)",
  "replace": "terminal = unit_state(args.unit)",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal terminal-result control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-stopped-result",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "stopped.get(\"MainPID\") == \"0\" and stopped.get(\"ActiveState\") == \"inactive\"",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal stopped-result control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-cleanup-result",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "cleanup.get(\"exit_status\") == 0 and cleanup.get(\"run_id\") == invocation[\"run_id\"]\n            and cleanup.get(\"owner_label\") == invocation[\"owner_label\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal cleanup-result control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-preserve-cache-counts",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "\"cache_statistics\": statistics",
  "replace": "\"cache_statistics\": {\"stats\": {}}",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal preserve-cache-counts control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-acceptance-scope",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "\"acceptance_claimed\": False",
  "replace": "\"acceptance_claimed\": True",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal acceptance-scope control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "host.consumer-command-seal-input-hashes",
  "target": "linux/scripts/seal-command-unit.py",
  "find": "fingerprint(path) for path in paths",
  "replace": "\"0\" * 64 for path in paths",
  "test": "bash linux/scripts/tests/test-seal-command-unit.sh",
  "why": "Retain the command seal input-hashes control; mocked metadata is not proof of real build, container, cache or GPU acceptance."
 },
 {
  "id": "packaging.bundle-tar-selected-tree",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "app_packaging_package_bundle_outputs_tar \"$bundle_source_dir\" \"$app_name\" \"$matrix_arch\"",
  "replace": "app_packaging_package_bundle_outputs_tar \"build/linux/${matrix_arch}/release/bundle\" \"$app_name\" \"$matrix_arch\"",
  "test": "bash linux/scripts/tests/test-app-packaging-api.sh",
  "why": "The TAR must carry the selected relocated tree and its original ORT notices, including paths with spaces."
 },
 {
  "id": "packaging.bundle-tar-resolver-status",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "bundle_source_dir=\"$(app_packaging_detect_bundle_dir \"$matrix_arch\")\" || return $?",
  "replace": "bundle_source_dir=\"$(app_packaging_detect_bundle_dir \"$matrix_arch\")\"",
  "test": "bash linux/scripts/tests/test-app-packaging-api.sh",
  "why": "A resolver error must retain its raw status before staging or archive creation."
 },
 {
  "id": "packaging.bundle-tar-resolver-arch",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "bundle_source_dir=\"$(app_packaging_detect_bundle_dir \"$matrix_arch\")\"",
  "replace": "bundle_source_dir=\"$(app_packaging_detect_bundle_dir)\"",
  "test": "bash linux/scripts/tests/test-app-packaging-api.sh",
  "why": "The shared resolver must receive the requested architecture for default bundle selection."
 },
 {
  "id": "packaging.bundle-tar-empty-selection",
  "target": "linux/scripts/lib/app-packaging.sh",
  "find": "${APP_PACKAGING_BUNDLE_DIR:-build/linux/${matrix_arch}/release/bundle}",
  "replace": "${APP_PACKAGING_BUNDLE_DIR-build/linux/${matrix_arch}/release/bundle}",
  "test": "bash linux/scripts/tests/test-app-packaging-api.sh",
  "why": "An empty override retains the documented default Flutter tree rather than becoming an empty path."
 },
 {
  "id": "packaging.ort-loader-profile-binding",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "pid, digest = profile_identity(args.profile, args.device, args.min_runs) if args.profile else (None, None)",
  "replace": "pid, digest = None, None",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "Trace paths alone cannot replace the canonical provider/run verdict and inference process binding."
 },
 {
  "id": "packaging.ort-loader-matching-trace-file",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "traces = [Path(f\"{prefix}.{pid}\")] if pid is not None else sorted(prefix.parent.glob(prefix.name + \".*\"))",
  "replace": "traces = sorted(prefix.parent.glob(prefix.name + \".*\"))",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "A different trace filename cannot supply the profiled process origins."
 },
 {
  "id": "packaging.ort-loader-trace-process",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "if expected_pid is not None and not re.fullmatch(rf\"\\s*{expected_pid}:\\s*\", prefix):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "Every selected ORT core and requested plugin record must name the actual profiled process, including duplicate records."
 },
 {
  "id": "packaging.ort-loader-canonical-path",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "path = normalized_path(value, absolute=True, allow_parent=real_root is not None)",
  "replace": "path = PurePosixPath(value)",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "Only explicitly resolved parent segments may normalize; repeated/dot separators, malformed paths and unresolved traversal remain refused."
 },
 {
  "id": "packaging.ort-loader-package-directory",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "if not directory.fullmatch(str(path.parent)):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "A foreign core or plugin cannot satisfy package origin checks."
 },
 {
  "id": "packaging.ort-loader-required-libraries",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "if any(not paths for paths in found.values()):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "Both the ORT core and every requested plugin need real loader records."
 },
 {
  "id": "packaging.ort-loader-core-soname",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "if not CORE_NAME.fullmatch(name):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "A malformed ORT soname is not the selected runtime core."
 },
 {
  "id": "packaging.ort-loader-linked-trace",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "if trace.is_symlink() or not trace.is_file():",
  "replace": "if not trace.is_file():",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "Linked trace inputs cannot masquerade as retained regular evidence."
 },
 {
  "id": "packaging.ort-loader-resolved-root",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "if not Path(value).resolve(strict=True).is_relative_to(real_root.resolve(strict=True)):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "Optional live resolution must reject a library symlink escaping the bundle."
 },
 {
  "id": "packaging.ort-loader-appimage-nonce",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "/appimage_extracted_[0-9a-f]{32}/",
  "replace": "/appimage_extracted_[0-9a-f]+/",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "AppImage origins retain the exact extraction directory shape."
 },
 {
  "id": "packaging.ort-loader-profile-status",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "stdout=sys.stderr, check=True, timeout=60,",
  "replace": "stdout=sys.stderr, check=False, timeout=60,",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "The canonical provider/run failure must abort origin acceptance."
 },
 {
  "id": "packaging.ort-loader-profile-byte-binding",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "hashlib.sha256(payload).hexdigest()",
  "replace": "\"0\" * 64",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "The output must bind the exact profile bytes sent to the canonical verifier."
 },
 {
  "id": "packaging.amdgpu-provenance-forward",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "    _ort_package_amdgpu_provenance \"$operation\" \"$root\" \"$licenses\" \"$5\" || return",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "An explicitly requested provenance file remains required."
 },
 {
  "id": "packaging.amdgpu-provenance-source-present",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  [ -s \"$source\" ] && [ ! -L \"$source\" ] || {",
  "replace": "  [ ! -L \"$source\" ] || {",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Empty provenance cannot be staged as an original text."
 },
 {
  "id": "packaging.amdgpu-provenance-source-regular",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  [ -s \"$source\" ] && [ ! -L \"$source\" ] || {",
  "replace": "  [ -s \"$source\" ] || {",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Linked image provenance cannot attest its bytes."
 },
 {
  "id": "packaging.amdgpu-provenance-destination-inside",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  _ort_package_inside \"$root\" \"$parent\" 'Plugin provenance destination escapes package' || return 1",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Escaping parents refuse before any outside file is written."
 },
 {
  "id": "packaging.amdgpu-provenance-license-separate",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  case \"$resolved/\" in \"$license_root/\"*)",
  "replace": "  case \"$resolved/\" in /impossible-root/*)",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Provenance cannot contaminate the exact license inventory."
 },
 {
  "id": "packaging.amdgpu-provenance-no-overwrite",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "    [ ! -e \"$destination\" ] && [ ! -L \"$destination\" ] || {",
  "replace": "    true || {",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Existing provenance is not overwritten by a later stage."
 },
 {
  "id": "packaging.amdgpu-provenance-copy-status",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "    cp \"$source\" \"$destination\" || return",
  "replace": "    cp \"$source\" \"$destination\" || true",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Conditional callers retain a failed copy raw status."
 },
 {
  "id": "packaging.amdgpu-provenance-destination-regular",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  [ -f \"$destination\" ] && [ ! -L \"$destination\" ] || {",
  "replace": "  [ -f \"$destination\" ] || {",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "A linked packaged provenance file refuses even with matching text."
 },
 {
  "id": "packaging.amdgpu-provenance-exact-bytes",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "  cmp \"$source\" \"$destination\"",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-ort-package-proof.sh",
  "why": "Packaged provenance must match the original image bytes."
 },
 {
  "id": "python.mutation-merge-ascii-safe",
  "target": "docs/scripts/merge_mutation_recipes.py",
  "find": "            json.dump(records, output, indent=1, ensure_ascii=True)",
  "replace": "            json.dump(records, output, indent=1, ensure_ascii=False)",
  "test": "bash linux/scripts/tests/test-merge-mutation-recipes.sh",
  "why": "Escaped negative-test strings must round-trip without contaminating the registry source."
 },
 {
  "id": "image-acceptance.working-source-selected-base",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    clone_checkout(source, destination, revision)\n    if patch:",
  "replace": "    clone_checkout(source, destination, original_head)\n    if patch:",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "The destination retains the selected committed base while applying later working bytes."
 },
 {
  "id": "image-acceptance.working-source-staged-input",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    require(\n        not git(source, \"diff\", \"--name-only\", \"--ignore-submodules=all\").strip(),\n        \"Stage every tracked source edit before preservation\",\n    )",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Unstaged edits refuse before evidence allocation."
 },
 {
  "id": "image-acceptance.working-source-full-base",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    require(\n        re.fullmatch(r\"[0-9a-f]{40}\", revision) is not None,\n        \"Working base must be a full commit\",\n    )",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "A mutable or abbreviated revision cannot identify the selected base."
 },
 {
  "id": "image-acceptance.working-source-linked-output",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    require(\n        not destination.is_symlink() and not directory.is_symlink(),\n        \"Working destination must not be linked\",\n    )",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Linked destinations and evidence roots cannot redirect writes."
 },
 {
  "id": "image-acceptance.working-source-child-overlap",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "not output.is_relative_to(source) and not source.is_relative_to(output)",
  "replace": "not source.is_relative_to(output)",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "A descendant of the original source cannot become its copied destination."
 },
 {
  "id": "image-acceptance.working-source-parent-overlap",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "not output.is_relative_to(source) and not source.is_relative_to(output)",
  "replace": "not output.is_relative_to(source)",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "An ancestor containing the source cannot become a destination."
 },
 {
  "id": "image-acceptance.working-source-nonempty-files",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    require(bool(files), \"Working source has no versioned files\")",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "An empty versioned manifest cannot grant source preservation."
 },
 {
  "id": "image-acceptance.working-source-fresh-evidence",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    directory.mkdir(parents=True, exist_ok=False)",
  "replace": "    directory.mkdir(parents=True, exist_ok=True)",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Existing evidence cannot be reused."
 },
 {
  "id": "image-acceptance.working-source-apply-overlay",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "        git(destination, \"apply\", \"--index\", str(patch_path))",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "The exact staged overlay must reach the independent copy."
 },
 {
  "id": "image-acceptance.working-source-index",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    require(\n        git(destination, \"ls-files\", \"--stage\", \"-z\") == index,\n        \"Working source index differs\",\n    )",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "The complete original index and its unchanged gitlink IDs must match."
 },
 {
  "id": "image-acceptance.working-source-bytes",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    require(\n        working_files(destination) == files,\n        \"Working source bytes, modes or links differ\",\n    )",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Actual copied file bytes, modes and links must match the owner independently of Git objects."
 },
 {
  "id": "image-acceptance.working-source-objects",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    verify_objects(destination)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Working copies need independent complete Git objects, not only readable tracked files."
 },
 {
  "id": "image-acceptance.working-source-source-race",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    require(\n        working_snapshot(source) == (original_head, index, files),\n        \"Working source changed during preparation\",\n    )",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "A changing source cannot receive an exact-copy receipt."
 },
 {
  "id": "image-acceptance.working-source-unresolved-index",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "        require(stage == \"0\", \"Working source index has unresolved stages\")",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Unresolved index entries cannot define a single source snapshot."
 },
 {
  "id": "image-acceptance.working-source-external-parent",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "            require(\n                path.resolve().is_relative_to(root),\n                \"Working source file escapes its root: \" + name,\n            )",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "A regular file reached through an external parent symlink cannot enter the source manifest."
 },
 {
  "id": "image-acceptance.working-source-file-modes",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "    restore_working_modes(destination, files)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Actual source permissions survive a clone with a different umask."
 },
 {
  "id": "image-acceptance.working-source-index-only-patch",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "        \"--cached\",\n        \"--binary\",",
  "replace": "        \"--binary\",",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Three different base, staged and child-checkout revisions must retain the index rather than the actual child HEAD."
 },
 {
  "id": "image-acceptance.working-source-staged-gitlinks",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "        \"--cached\",\n        \"--binary\",",
  "replace": "        \"--cached\",\n        \"--ignore-submodules=all\",\n        \"--binary\",",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "An index-only patch must retain staged gitlink changes, with actual child trees bound separately."
 },
 {
  "target": "shared/python/verify_ort_loader_trace.py",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "id": "packaging.ort-loader-parent-needs-resolution",
  "find": "allow_parent=real_root is not None",
  "replace": "allow_parent=True",
  "why": "Parent segments cannot be accepted from archived trace strings without existing-file root resolution."
 },
 {
  "target": "shared/python/verify_ort_loader_trace.py",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "id": "packaging.ort-loader-parent-normalization",
  "find": "    path = PurePosixPath(posixpath.normpath(str(path)))",
  "replace": "    path = PurePosixPath(str(path))",
  "why": "A legitimate package origin with a parent segment must match its normalized expected directory only after input validation; raw evidence remains unchanged."
 },
 {
  "id": "host.operational-memory-prefix",
  "target": "linux/scripts/operational_memory.py",
  "find": "require(len(before) == expected_bytes and digest(before) == expected_sha256, 'Memory prefix differs')",
  "replace": "require(True, 'Memory prefix differs')",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "An unexpected size or SHA256 must refuse before any append."
 },
 {
  "id": "host.operational-memory-terminal-state",
  "target": "linux/scripts/operational_memory_guard.py",
  "find": "terminal = {('inactive', 'dead'), ('failed', 'failed'), ('active', 'exited')}",
  "replace": "terminal = {('inactive', 'dead'), ('failed', 'failed'), ('active', 'exited'), ('active', 'running')}",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "A running controller is not an idle terminal observation even if its listed PID is zero."
 },
 {
  "id": "host.operational-memory-controller-PIDs",
  "target": "linux/scripts/operational_memory_guard.py",
  "find": "and state['MainPID'] == state['ControlPID'] == '0'",
  "replace": "and True",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "Both controller PIDs must prove zero, including for a nominally terminal state."
 },
 {
  "id": "host.operational-memory-process-refusal",
  "target": "linux/scripts/operational_memory_guard.py",
  "find": "require(not processes, 'Storage controller process IDs are live: '",
  "replace": "require(True, 'Storage controller process IDs are live: '",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "A named live process, including an ancestor or underscore spelling, must refuse."
 },
 {
  "id": "host.operational-memory-unreadable-proc",
  "target": "linux/scripts/operational_memory_guard.py",
  "find": "except FileNotFoundError:",
  "replace": "except OSError:",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "An unreadable process is unknown, whereas an actually disappeared process may be skipped."
 },
 {
  "id": "host.operational-memory-append-flag",
  "target": "linux/scripts/operational_memory.py",
  "find": "with opened(memory, os.O_RDWR | os.O_APPEND) as stream:",
  "replace": "with opened(memory, os.O_RDWR) as stream:",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "A concurrent suffix must never be overwritten even when the final append verdict fails."
 },
 {
  "id": "host.operational-memory-prefix-backup",
  "target": "linux/scripts/operational_memory.py",
  "find": "persist(directory / 'prefix-before.bin', before)",
  "replace": "persist(directory / 'prefix-before.bin', before[:1])",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "The preserved prefix snapshot must contain every original byte."
 },
 {
  "id": "host.operational-memory-recheck-prefix",
  "target": "linux/scripts/operational_memory.py",
  "find": "require(stream.read() == before, 'Memory changed before the append')",
  "replace": "require(True, 'Memory changed before the append')",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "A prefix changed while backups are written must refuse before adding our suffix."
 },
 {
  "id": "host.operational-memory-result-bytes",
  "target": "linux/scripts/operational_memory.py",
  "find": "require(after == before + addition, 'Memory changed during the append')",
  "replace": "require(True, 'Memory changed during the append')",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "Another suffix cannot produce a passed exact-result receipt."
 },
 {
  "id": "host.operational-memory-file-identity",
  "target": "linux/scripts/operational_memory.py",
  "find": "require((current.st_dev, current.st_ino) == (original.st_dev, original.st_ino), 'Memory file identity changed')",
  "replace": "require(True, 'Memory file identity changed')",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "Replacing the visible memory path must not authenticate an append to the old inode."
 },
 {
  "id": "host.operational-memory-single-link",
  "target": "linux/scripts/operational_memory.py",
  "find": "stat.S_ISREG(info.st_mode) and info.st_nlink == 1",
  "replace": "stat.S_ISREG(info.st_mode)",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "Hardlinked inputs are refused before any memory mutation."
 },
 {
  "id": "host.operational-memory-no-follow",
  "target": "linux/scripts/operational_memory.py",
  "find": "flags | os.O_NOFOLLOW | os.O_NONBLOCK | os.O_CLOEXEC",
  "replace": "flags | os.O_NONBLOCK | os.O_CLOEXEC",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "A symlink append input must not be followed into a regular file."
 },
 {
  "id": "host.operational-memory-short-writes",
  "target": "linux/scripts/operational_memory.py",
  "find": "        position += written\n",
  "replace": "        position = len(data)\n",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "Partial appends must write the complete reviewed suffix."
 },
 {
  "id": "host.operational-memory-write-progress",
  "target": "linux/scripts/operational_memory.py",
  "find": "require(0 < written <= len(data) - position, 'Append made no valid progress')",
  "replace": "require(True, 'Append made no valid progress')",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "A zero write must fail immediately; the independent fixture bounds a faulty retry."
 },
 {
  "id": "host.operational-memory-file-sync",
  "target": "linux/scripts/operational_memory.py",
  "find": "        position += written\n    os.fsync(descriptor)\n",
  "replace": "        position += written\n",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "A failed memory synchronization must remain fatal after data was written."
 },
 {
  "id": "python-types.operational-memory-strict",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/source-ci.py' 'linux/scripts/source_ci/*.py' \\\n  'linux/scripts/append-operational-memory.py' 'linux/scripts/operational_memory*.py' \\\n",
  "replace": "  'linux/scripts/source-ci.py' 'linux/scripts/source_ci/*.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The appender and both companions must remain inside this enforced type scope."
 },
 {
  "id": "python-types.operational-memory-annotations",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  'linux/scripts/develop_red.py' 'linux/scripts/layer-audit.py' \\\n  'linux/scripts/append-operational-memory.py' 'linux/scripts/operational_memory*.py' \\\n",
  "replace": "  'linux/scripts/develop_red.py' 'linux/scripts/layer-audit.py' \\\n",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The appender and both companions must remain inside this enforced type scope."
 },
 {
  "id": "python-types.shared-test-sibling-root",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "  --extra-search-path shared/python/tests\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The complete independent fixture import chain needs the shared Python test sibling root; a missing root must fail rather than suppress unresolved fixture imports."
 },
 {
  "id": "host.operational-memory-prewrite-snapshots",
  "target": "linux/scripts/operational_memory.py",
  "find": "        sync_directory(directory.parent)\n        verify_snapshots(directory, before, addition)\n",
  "replace": "        sync_directory(directory.parent)\n",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "Both snapshots must remain exact at this phase; missing pre-write checks must not modify memory and missing post-write checks must not produce a passed receipt."
 },
 {
  "id": "host.operational-memory-postwrite-snapshots",
  "target": "linux/scripts/operational_memory.py",
  "find": "        require(after == before + addition, 'Memory changed during the append')\n        verify_snapshots(directory, before, addition)\n",
  "replace": "        require(after == before + addition, 'Memory changed during the append')\n",
  "test": "bash linux/scripts/tests/test-operational-memory.sh",
  "why": "Both snapshots must remain exact at this phase; missing pre-write checks must not modify memory and missing post-write checks must not produce a passed receipt."
 },
 {
  "id": "lib.webgpu-media-acceptance-exact-native-revision",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "if receipt[\"source\"] != source:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "same ref with a different native revision must refuse before any child"
 },
 {
  "id": "lib.webgpu-media-acceptance-enabled-static-native",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "or receipt[\"phases\"][phase][\"configured_flags\"] != dict.fromkeys(build.FLAGS, \"ON\")):",
  "replace": "or False):",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "a valid disabled delivery cannot stand for enabled static WebGPU"
 },
 {
  "id": "lib.webgpu-media-acceptance-both-native-python-deliveries",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "for phase in (\"gil\", \"free-threaded\"):",
  "replace": "for phase in (\"gil\",):",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "a changed free-threaded manifest must refuse before any native work, independently of global pending checks"
 },
 {
  "id": "lib.webgpu-media-acceptance-complete-wasm-before-native",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "compiled = wasm.checked_receipt(wasm_arguments(args), True)",
  "replace": "compiled = wasm.checked_receipt(wasm_arguments(args), False)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "missing JSPI must refuse before native children start"
 },
 {
  "id": "lib.webgpu-media-acceptance-fresh-flavor-cardinality",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "if tuple(row.get(\"flavor\") for row in results) != wasm.FLAVORS:",
  "replace": "if tuple(row.get(\"flavor\") for row in results) == wasm.FLAVORS:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "both fresh flavors must pass the cardinality gate"
 },
 {
  "id": "lib.webgpu-media-acceptance-fresh-runtime-verdicts",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "for flavor, result in zip(wasm.FLAVORS, results, strict=True):",
  "replace": "for flavor, result in ():",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "zero transport status cannot hide a failed WASM factory verdict"
 },
 {
  "id": "lib.webgpu-media-acceptance-post-replay-input-binding",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "if source_bindings(args, wasm) != (before, compiled):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "a changed valid native receipt cannot produce an overall receipt"
 },
 {
  "id": "lib.webgpu-media-acceptance-execute-native-phases",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "native = media.prove_media(native_args)",
  "replace": "native = {\"phases\": []}",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "combined success requires actual native/GIL/FT dispatch"
 },
 {
  "id": "lib.webgpu-media-acceptance-raw-status",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "return media.run_cli(lambda: prove_acceptance(arguments()), \"WEBGPU-MEDIA-ACCEPTANCE\")",
  "replace": "return 0",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "failed fresh WASM children retain their raw outer status"
 },
 {
  "id": "lib.webgpu-media-acceptance-required-wasm-prefix",
  "target": "linux/scripts/03-media/runtime/ort_webgpu_acceptance.py",
  "find": "parser.add_argument(\"--wasm-prefix\", required=True, type=Path)",
  "replace": "parser.add_argument(\"--wasm-prefix\", type=Path)",
  "test": "bash linux/scripts/tests/test-onnx-webgpu-acceptance.sh",
  "why": "the combined entry cannot silently omit its WASM input"
 },
 {
  "id": "compiler-llvm-tools.media-lane-domain",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "    assert (variant, arch) in LANES, 'Unreviewed WebGPU Media lane'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Independent six-tuple command and actual stage-graph controls reject lost selection, bindings or scope. This does not prove parent ancestry, a build or hardware execution."
 },
 {
  "id": "compiler-llvm-tools.media-lane-parent",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "    assert parent_stage == expected_parent, 'Media parent stage differs from its variant'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Independent six-tuple command and actual stage-graph controls reject lost selection, bindings or scope. This does not prove parent ancestry, a build or hardware execution."
 },
 {
  "id": "compiler-llvm-tools.media-lane-repository",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "    assert re.fullmatch(r'ant-local/webgpu-[a-z0-9][a-z0-9._/-]*', repo), 'Local Media candidate repository required'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Independent six-tuple command and actual stage-graph controls reject lost selection, bindings or scope. This does not prove parent ancestry, a build or hardware execution."
 },
 {
  "id": "compiler-llvm-tools.media-lane-digest",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "    assert re.fullmatch(r'ant-local/webgpu-[a-z0-9][a-z0-9._/-]*@sha256:[0-9a-f]{64}', reference), 'Immutable local Media parent required'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Independent six-tuple command and actual stage-graph controls reject lost selection, bindings or scope. This does not prove parent ancestry, a build or hardware execution."
 },
 {
  "id": "compiler-llvm-tools.media-lane-paths",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "    assert all(path.is_absolute() for path in (source, output, context)), 'Media paths must be absolute'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Independent six-tuple command and actual stage-graph controls reject lost selection, bindings or scope. This does not prove parent ancestry, a build or hardware execution."
 },
 {
  "id": "compiler-llvm-tools.media-lane-build-platform",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "    environment += ['CROSS_BUILD_PLATFORM=linux/amd64']",
  "replace": "    environment += ['CROSS_BUILD_PLATFORM=linux/arm64']",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Independent six-tuple command and actual stage-graph controls reject lost selection, bindings or scope. This does not prove parent ancestry, a build or hardware execution."
 },
 {
  "id": "compiler-llvm-tools.media-lane-sbsa",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "    if (variant, arch) == ('nvidia', 'arm64'):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Independent six-tuple command and actual stage-graph controls reject lost selection, bindings or scope. This does not prove parent ancestry, a build or hardware execution."
 },
 {
  "id": "compiler-llvm-tools.media-lane-no-ancestry-claim",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "'parent_ancestry_verified':False",
  "replace": "'parent_ancestry_verified':True",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Independent six-tuple command and actual stage-graph controls reject lost selection, bindings or scope. This does not prove parent ancestry, a build or hardware execution."
 },
 {
  "id": "compiler-llvm-tools.media-lane-no-launch-claim",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "'launched':False",
  "replace": "'launched':True",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Independent six-tuple command and actual stage-graph controls reject lost selection, bindings or scope. This does not prove parent ancestry, a build or hardware execution."
 },
 {
  "id": "compiler-llvm-tools.media-lane-ambient-tag-isolation",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "['env', '-u', 'ENABLE_AMD', '-u', 'ENABLE_NVIDIA', 'bash', '-euo', 'pipefail', '-c',",
  "replace": "['bash', '-euo', 'pipefail', '-c',",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Actual source command controls reject inherited accelerator selection and missing explicit profiles. No image build or parent/hardware proof."
 },
 {
  "id": "compiler-llvm-tools.media-lane-explicit-accelerators",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "    environment += ['ENABLE_AMD=' + ('true' if variant == 'rocm' else 'false'),\n                    'ENABLE_NVIDIA=' + ('true' if variant == 'nvidia' else 'false')]",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Actual source command controls reject inherited accelerator selection and missing explicit profiles. No image build or parent/hardware proof."
 },
 {
  "id": "compiler-llvm-tools.media-lane-default-variant-clear",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "        environment += ['CROSS_VARIANT=']",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Actual source command controls reject inherited accelerator selection and missing explicit profiles. No image build or parent/hardware proof."
 },
 {
  "id": "compiler-llvm-tools.media-lane-native-cross-enabled",
  "target": "linux/scripts/local-proof/webgpu_media_lanes.py",
  "find": "    environment += ['ORT_ENABLE_WEBGPU=true', 'ORT_WEBGPU_ALLOW_CROSS=true']",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-webgpu-media-lanes.sh",
  "why": "Every required Media profile forwards explicit enabled native and cross WebGPU flags through the canonical version argument builder; no compiled provider or hardware proof."
 },
 {
  "id": "compiler-llvm-tools.media-lane-fake-uds-chain",
  "target": "linux/scripts/tests/test-sccache-s3-level.sh",
  "find": "SCCACHE_SERVER_UDS=\"${WORK}/no.sock\" env -u SCCACHE_MULTILEVEL_CHAIN bash -c",
  "replace": "SCCACHE_SERVER_UDS=\"${WORK}/no.sock\" bash -c",
  "test": "bash linux/scripts/tests/test-sccache-s3-level-environment.sh",
  "why": "The original fake startup/fallback assertions must pass under an explicitly inherited cache chain. This does not configure a real compiler server or prove S3 uploads."
 },
 {
  "id": "compiler-llvm-tools.media-lane-fake-tcp-chain",
  "target": "linux/scripts/tests/test-sccache-s3-level.sh",
  "find": "SCCACHE_S3_SECRET_FILE=\"${WORK}/secret\" env -u SCCACHE_MULTILEVEL_CHAIN bash -c",
  "replace": "SCCACHE_S3_SECRET_FILE=\"${WORK}/secret\" bash -c",
  "test": "bash linux/scripts/tests/test-sccache-s3-level-environment.sh",
  "why": "The original fake startup/fallback assertions must pass under an explicitly inherited cache chain. This does not configure a real compiler server or prove S3 uploads."
 },
 {
  "id": "compiler-llvm-tools.media-controls-proof-inputs",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": "test -d \"${proof_dir}\"\ntest -f \"${selected_manifest}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Isolated command fixtures require fresh inputs, original evidence, raw child failure and source drift refusal before success. They do not execute actual source suites, build images or qualify GPU hardware."
 },
 {
  "id": "compiler-llvm-tools.media-controls-preserve-patch",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": "test ! -e \"${proof_dir}/as-tested-source.patch\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Isolated command fixtures require fresh inputs, original evidence, raw child failure and source drift refusal before success. They do not execute actual source suites, build images or qualify GPU hardware."
 },
 {
  "id": "compiler-llvm-tools.media-controls-preserve-manifest",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": "test ! -e \"${proof_dir}/selected-mutations.json\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Isolated command fixtures require fresh inputs, original evidence, raw child failure and source drift refusal before success. They do not execute actual source suites, build images or qualify GPU hardware."
 },
 {
  "id": "compiler-llvm-tools.media-controls-raw-phase-status",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": "set -euo pipefail",
  "replace": "set -uo pipefail",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Isolated command fixtures require fresh inputs, original evidence, raw child failure and source drift refusal before success. They do not execute actual source suites, build images or qualify GPU hardware."
 },
 {
  "id": "compiler-llvm-tools.media-controls-patch-drift",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": "cmp \"${proof_dir}/as-tested-source.patch\" \"${proof_dir}/source-after.patch\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Isolated command fixtures require fresh inputs, original evidence, raw child failure and source drift refusal before success. They do not execute actual source suites, build images or qualify GPU hardware."
 },
 {
  "id": "compiler-llvm-tools.media-controls-index-drift",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": "cmp \"${proof_dir}/index-before.bin\" \"${proof_dir}/index-after.bin\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Isolated command fixtures require fresh inputs, original evidence, raw child failure and source drift refusal before success. They do not execute actual source suites, build images or qualify GPU hardware."
 },
 {
  "id": "compiler-llvm-tools.media-controls-worktree-drift",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": "test -z \"${dirty_worktree}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Isolated command fixtures require fresh inputs, original evidence, raw child failure and source drift refusal before success. They do not execute actual source suites, build images or qualify GPU hardware."
 },
 {
  "id": "compiler-llvm-tools.media-controls-raw-git-status",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": "dirty_worktree=\"$(git diff --name-only --ignore-submodules=all)\"",
  "replace": "dirty_worktree=\"$(git diff --name-only --ignore-submodules=all || true)\"",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "A failing final Git probe must retain its raw47 status and cannot publish a success sentinel. Isolated command fixtures do not prove actual source or image acceptance."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-url-type",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "type=mirror_url, help=",
  "replace": "help=",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-port",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "        _ = parsed.port",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-url-refusal",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "    if (parsed.scheme not in {\"http\", \"https\"} or not parsed.hostname or parsed.username is not None\n            or parsed.password is not None or parsed.query or parsed.fragment or any(char.isspace() for char in value)):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-forward",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "{args.fast_ubuntu_mirror_url or ''}",
  "replace": "{''}",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-default-clear",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "            \"--env\", f\"ISOLATED_PREFLIGHT_UBUNTU_MIRROR_URL={args.fast_ubuntu_mirror_url or ''}\",\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-record",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "\"fast_ubuntu_mirror_url\": args.fast_ubuntu_mirror_url,",
  "replace": "\"fast_ubuntu_mirror_url\": None,",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-bootstrap-enabled",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "if [ -n \"${ISOLATED_PREFLIGHT_UBUNTU_MIRROR_URL:-}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-bootstrap-optin",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "USE_FAST_UBUNTU_MIRROR=true",
  "replace": "USE_FAST_UBUNTU_MIRROR=false",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-bootstrap-order",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "configure_preflight_mirror /source/linux/scripts\napt-get update",
  "replace": "apt-get update\nconfigure_preflight_mirror /source/linux/scripts",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.preflight-mirror-bootstrap-raw-failure",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "      bash \"$1/01-core/use-fast-ubuntu-mirror.sh\"",
  "replace": "      bash \"$1/01-core/use-fast-ubuntu-mirror.sh\" || true",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-01",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert source.is_absolute() and source == source.resolve(strict=True) and not source.is_symlink(), 'Environment path must be literal and absolute'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-02",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert source.name == '.venv' and source.parent.name == 'quality' and (source / 'pyvenv.cfg').is_file(), 'Select only a quality virtual environment'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-03",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert (repo / 'AGENTS.md').is_file() and (repo / 'quality/uv.lock').is_file(), 'Owning source and lock are required'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-04",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert not tracked, 'Never relocate versioned files'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-05",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert target.is_absolute() and target.parent == target.parent.resolve(strict=True), 'Destination parent must be literal and absolute'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-06",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert target.name.startswith('ant-quality-venv-') and not target.exists() and not target.is_symlink(), 'Preserve existing destinations'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-07",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert not output.exists() and not output.is_symlink(), 'Preserve existing relocation evidence'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-08",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert kinds == {'tmpfs'} and source.stat().st_dev != device, 'Select a different existing tmpfs filesystem'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-09",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "                assert entry.st_nlink == 1, 'Preserve shared cache inodes'",
  "replace": "                pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-10",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "                assert stat.S_ISDIR(entry.st_mode) or stat.S_ISLNK(entry.st_mode), 'Only directories, regular files and links are supported'",
  "replace": "                pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-11",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert free.f_bavail * free.f_frsize >= allocated + 1024**3, 'Retain one GiB of tmpfs headroom'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-12",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert not source.exists() and target.is_dir() and not target.is_symlink(), 'Relocation did not complete'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-admission-13",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "    assert tree_digest(target) == before, 'Retained environment bytes or metadata differ'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-ignore-policy",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "'quality/.venv'], check=True, timeout=20)",
  "replace": "'quality/.venv'], check=False, timeout=20)",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-archive-raw-failure",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "        if status:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.media-controls-mirror-suite",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": " proof-workflows relocate-quality-venv; do",
  "replace": " relocate-quality-venv; do",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.media-controls-relocation-suite",
  "target": "linux/scripts/local-proof/run-media-lane-controls.sh",
  "find": " proof-workflows relocate-quality-venv; do",
  "replace": " proof-workflows; do",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh",
  "why": "Synthetic refusal and transport controls must fail when the guarded rule is removed; no network availability, host reclamation, image acceptance or hardware inference is proved."
 },
 {
  "id": "compiler-llvm-tools.quality-venv-archive-content-hash",
  "target": "linux/host-config/relocate-quality-venv.py",
  "find": "            digest.update(chunk)",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Real GNU tar controls change file bytes with identical size and mtime, restore them, and change permissions. A constant empty-stream digest must fail; this does not prove host reclamation, concurrent writers or reboot persistence."
 },
 {
  "id": "packaging.ort-loader-unrelated-fork-child",
  "target": "shared/python/verify_ort_loader_trace.py",
  "find": "name = selected_library(value, required)\n            if name is not None:",
  "replace": "name = selected_library(value, required)\n            if expected_pid is not None and not re.fullmatch(rf\"\\s*{expected_pid}:\\s*\", prefix):\n                raise ValueError(\"loader trace process differs from profile\")\n            if name is not None:",
  "test": "bash linux/scripts/tests/test-verify-ort-loader-trace.sh",
  "why": "Unrelated HIP child records may share a parent trace without supplying required ORT/plugin evidence."
 },
 {
  "id": "ort-census.bundle-loader-argument-boundary",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "\"${probe_path}\")\" \"${loader_args}\" \"$@\"",
  "replace": "\"${probe_path}\")\" \"$@\"",
  "test": "bash linux/scripts/tests/test-ort-census.sh",
  "why": "Both explicit bundle loader interfaces must retain the loader slot before exemptions; filesystem fixtures do not prove an installed launcher or GPU inference."
 },
 {
  "id": "host.qairt-crypto-status",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if result.returncode:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Failed cryptography cannot return valid-looking stale plaintext."
 },
 {
  "id": "host.qairt-outside-git",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if any((parent / \".git\").exists() for parent in (resolved, *resolved.parents)):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Private handoff material must refuse every Git checkout."
 },
 {
  "id": "host.qairt-directory-mode",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "directory.mkdir(mode=0o700, parents=True)",
  "replace": "directory.mkdir(mode=0o755, parents=True)",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Recipient key directories remain private to the owner."
 },
 {
  "id": "host.qairt-file-mode",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "os.O_NOFOLLOW, 0o600",
  "replace": "os.O_NOFOLLOW, 0o644",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Private key and endpoint files must have mode0600."
 },
 {
  "id": "host.qairt-public-pem",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if not pem.startswith(b\"-----BEGIN PUBLIC KEY-----\\n\") or b\"PRIVATE KEY\" in pem:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "A private PEM never reaches the public-key adapter."
 },
 {
  "id": "host.qairt-rsa-bits",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if not description.startswith(b\"Public-Key: (3072 bit)\\n\"):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "The public key must actually be RSA3072, not just labelled3072."
 },
 {
  "id": "host.qairt-directory-symlink",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if directory.is_symlink():",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Private state cannot be selected through a symlink."
 },
 {
  "id": "host.qairt-private-permissions",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if not correct_type or info.st_uid != os.geteuid() or stat.S_IMODE(info.st_mode) & 0o077:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Publicly readable or symlinked private keys are refused."
 },
 {
  "id": "host.qairt-key-pair",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if record != public_record((directory / \"public.pem\").read_bytes()):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "The retained private key must match the posted public key."
 },
 {
  "id": "host.qairt-fingerprint",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if not re.fullmatch(r\"[0-9a-f]{64}\", expected) or expected != record[\"sha256_spki\"]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Decryption binds the explicit published SPKI fingerprint."
 },
 {
  "id": "host.qairt-cipher-size",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if len(cipher) != 384:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Malformed packets refuse before private RSA decryption."
 },
 {
  "id": "host.qairt-oaep-sha256",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "rsa_oaep_md:sha256",
  "replace": "rsa_oaep_md:sha1",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "OAEP uses SHA256 consistently with the peer protocol."
 },
 {
  "id": "host.qairt-mgf1-sha256",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "rsa_mgf1_md:sha256",
  "replace": "rsa_mgf1_md:sha1",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "MGF1 is explicitly SHA256 rather than a different digest."
 },
 {
  "id": "host.qairt-no-overwrite",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW",
  "replace": "os.O_WRONLY | os.O_CREAT | os.O_NOFOLLOW",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Existing private endpoints are never overwritten."
 },
 {
  "id": "host.qairt-endpoint-size",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if not 0 < len(value) <= 318:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "The payload limit is the actual RSA3072/SHA256 OAEP byte boundary."
 },
 {
  "id": "host.qairt-endpoint-url",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if parsed.scheme not in (\"http\", \"https\") or not parsed.hostname:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Only a WebDAV HTTP(S) endpoint may be materialized."
 },
 {
  "id": "host.qairt-endpoint-credentials",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if parsed.username is not None or parsed.password is not None or parsed.query or parsed.fragment:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "The agreed endpoint payload excludes credentials and signed URLs."
 },
 {
  "id": "host.qairt-endpoint-controls",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "if any(ord(character) <= 32 or ord(character) == 127 for character in text):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Control characters cannot hide in the endpoint payload."
 },
 {
  "id": "host.qairt-status-only",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "return {\"status\": \"decrypted-locally\", \"sha256_spki\": expected}",
  "replace": "return {\"status\": \"decrypted-locally\", \"sha256_spki\": expected, \"endpoint\": plain.decode()}",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Successful decryption must not print its private plaintext."
 },
 {
  "id": "host.qairt-error-redaction",
  "target": "linux/scripts/qairt-key-handoff.py",
  "find": "except (OSError, ValueError, subprocess.TimeoutExpired):\n        print(\"qairt-key-handoff: operation failed; no secret output disclosed\", file=sys.stderr)",
  "replace": "except (OSError, ValueError, subprocess.TimeoutExpired) as error:\n        print(str(error), file=sys.stderr)",
  "test": "bash linux/scripts/tests/test-qairt-key-handoff.sh",
  "why": "Even a child exception containing the endpoint must remain redacted."
 },
 {
  "id": "lib.qairt-transfer-fingerprint",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "if fingerprint != record[\"sha256_spki\"]:",
  "replace": "if False:",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "The recipient fingerprint must match before the private route is used.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-private-mode",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": " or stat.S_IMODE(info.st_mode) & 0o077",
  "replace": "",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "Public endpoint/lock permissions cannot be accepted.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-private-address",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "if not address.is_private or address.is_unspecified or address.is_multicast:",
  "replace": "if address.is_unspecified or address.is_multicast:",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "A global IP must fail before resolution or a network request.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-object-scope",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "if not re.fullmatch(r\"/preseed/[A-Za-z0-9][A-Za-z0-9_.-]*\\.zip\", object_path):",
  "replace": "if False:",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "Only one preseed ZIP target is permitted.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-source-pin",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "if identity[2] != size or hash_stream(source, size, deadline) != (size, digest):",
  "replace": "if identity[2] != size:",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "Source hash mismatch must fail before any HTTP request.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-existing-refusal",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "if status == 404:",
  "replace": "if status in (200, 404):",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "A known existing object must be read back, never PUT again.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-conditional-put",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "connection.putheader(\"If-None-Match\", \"*\")",
  "replace": "connection.putheader(\"X-Mutation-Ignore-Condition\", \"*\")",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "The upload needs the no-replace HTTP precondition.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-remote-pin",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "if response.status != 200 or hash_stream(response, size, self.deadline) != (size, digest):",
  "replace": "if response.status != 200:",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "Successful GET status or length alone cannot prove remote bytes.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-stream-pin",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "if sent != size or actual.hexdigest() != digest:",
  "replace": "if sent != size:",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "The sent stream must match the hash independently of its size.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-source-stability",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "remote.verify(size, digest)\n        if file_identity(source) != identity:",
  "replace": "remote.verify(size, digest)\n        if False:",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "A changed source cannot produce a successful completion receipt.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-local-lock",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)",
  "replace": "fcntl.flock(lock, fcntl.LOCK_UN)",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "Concurrent local transfer attempts must refuse rather than overlap.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-deadline",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "signal.setitimer(signal.ITIMER_REAL, args.timeout)",
  "replace": "signal.setitimer(signal.ITIMER_REAL, 0)",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "A stalled response must be interrupted by the whole-operation deadline.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-receipt-no-replace",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "os.open(args.receipt, os.O_RDWR | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600)",
  "replace": "os.open(args.receipt, os.O_RDWR | os.O_CREAT | os.O_NOFOLLOW, 0o600)",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "An existing receipt must refuse before any request.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-redaction",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "record.update(status=\"failed\", error_type=type(error).__name__)",
  "replace": "record.update(status=\"failed\", error_type=str(error))",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "Exception text containing a private endpoint must never enter output or receipts.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-endpoint-no-follow",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "os.open(path, os.O_RDONLY | os.O_NOFOLLOW)",
  "replace": "os.open(path, os.O_RDONLY)",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "A symlinked endpoint must refuse before it can select a route.",
  "timeout": 45
 },
 {
  "id": "lib.qairt-transfer-source-no-follow",
  "target": "linux/scripts/qairt-private-transfer.py",
  "find": "os.open(archive, os.O_RDONLY | os.O_NOFOLLOW)",
  "replace": "os.open(archive, os.O_RDONLY)",
  "test": "python3 linux/scripts/tests/qairt_private_transfer_tests.py linux/scripts/qairt-private-transfer.py",
  "why": "The archive path cannot be a symlink to another local source.",
  "timeout": 45
 },
 {
  "id": "mutations.workspace-absolute",
  "target": "docs/scripts/mutation_workspace.py",
  "find": "if not root.is_absolute() or os.path.abspath(requested) != requested:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-literal-parent",
  "target": "docs/scripts/mutation_workspace.py",
  "find": "if root.parent.resolve(strict=True) != root.parent:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-source-overlap",
  "target": "docs/scripts/mutation_workspace.py",
  "find": "if root.is_relative_to(source_path) or source_path.is_relative_to(root):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-exclusive-root",
  "target": "docs/scripts/mutation_workspace.py",
  "find": "explicit.mkdir(mode=0o700)",
  "replace": "explicit.mkdir(mode=0o700, exist_ok=True)",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-fixed-slots",
  "target": "docs/scripts/mutation_workspace.py",
  "find": "f\"worker-{len(roots)}\"",
  "replace": "f\"worker-{len(roots) + 1}\"",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-root-identity",
  "target": "docs/scripts/mutation_workspace.py",
  "find": "(current.st_dev, current.st_ino) != identity",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-parent-identity",
  "target": "docs/scripts/mutation_workspace.py",
  "find": "explicit.parent.resolve(strict=True) != explicit.parent",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-cleanup-fatal",
  "target": "docs/scripts/mutation_workspace.py",
  "find": "shutil.rmtree(explicit)",
  "replace": "shutil.rmtree(explicit, ignore_errors=True)",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-option-binding",
  "target": "docs/scripts/verify_mutations.py",
  "find": "getattr(args, \"workspace_root\", None)",
  "replace": "None",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-prover-allocator",
  "target": "docs/scripts/verify_mutations.py",
  "find": "costs, allocate=allocate)",
  "replace": "costs)",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-worker-allocator",
  "target": "docs/scripts/verify_mutations.py",
  "find": "allocate() if allocate else tempfile.mkdtemp(prefix=\"mutation-gate-\")",
  "replace": "tempfile.mkdtemp(prefix=\"mutation-gate-\")",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "mutations.workspace-in-place-refusal",
  "target": "docs/scripts/verify_mutations.py",
  "find": "if args.in_place and args.workspace_root:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-mutation-workspaces.sh",
  "why": "Private workspace controls must reject unsafe allocation, retain fixed worker bindings and fail changed-identity or failed cleanup. They use disposable fixtures and do not prove cache hits, concurrent-writer authentication or build acceptance."
 },
 {
  "id": "image-acceptance.consumer-archive-manifest-digest",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "hashlib.sha256(manifest.read_bytes()).hexdigest() == expected",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Digest-bound parent restoration must retain original shallow metadata and exact staged bytes/index plus required object checks; real temporary repositories do not prove source authenticity, recursive dependencies or builds."
 },
 {
  "id": "image-acceptance.consumer-archive-input-digest",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "hashlib.sha256(data).hexdigest() == digest",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Digest-bound parent restoration must retain original shallow metadata and exact staged bytes/index plus required object checks; real temporary repositories do not prove source authenticity, recursive dependencies or builds."
 },
 {
  "id": "image-acceptance.consumer-archive-shallow-metadata",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "    if spec[\"shallow\"]:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Digest-bound parent restoration must retain original shallow metadata and exact staged bytes/index plus required object checks; real temporary repositories do not prove source authenticity, recursive dependencies or builds."
 },
 {
  "id": "image-acceptance.consumer-archive-index",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "index == expected_index",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Digest-bound parent restoration must retain original shallow metadata and exact staged bytes/index plus required object checks; real temporary repositories do not prove source authenticity, recursive dependencies or builds."
 },
 {
  "id": "image-acceptance.consumer-archive-working-files",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "actual == files",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Digest-bound parent restoration must retain original shallow metadata and exact staged bytes/index plus required object checks; real temporary repositories do not prove source authenticity, recursive dependencies or builds."
 },
 {
  "id": "image-acceptance.consumer-archive-objects",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "    PRESERVER[\"verify_objects\"](destination)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Digest-bound parent restoration must retain original shallow metadata and exact staged bytes/index plus required object checks; real temporary repositories do not prove source authenticity, recursive dependencies or builds."
 },
 {
  "id": "image-acceptance.consumer-archive-existing-destination",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "not destination.exists()",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Digest-bound parent restoration must retain original shallow metadata and exact staged bytes/index plus required object checks; real temporary repositories do not prove source authenticity, recursive dependencies or builds."
 },
 {
  "id": "image-acceptance.consumer-archive-overlap",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "not destination.is_relative_to(archive)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Digest-bound parent restoration must retain original shallow metadata and exact staged bytes/index plus required object checks; real temporary repositories do not prove source authenticity, recursive dependencies or builds."
 },
 {
  "id": "image-acceptance.consumer-archive-post-inputs",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "    read_archive(archive, expected)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Digest-bound parent restoration must retain original shallow metadata and exact staged bytes/index plus required object checks; real temporary repositories do not prove source authenticity, recursive dependencies or builds."
 },
 {
  "id": "python-types.consumer-archive-strict-types",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "quality_files+=(\"${archive_proof_files[@]}\")",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The existing isolated type fixture must retain the archive restorer in strict types and public annotations; this does not restore sources or execute builds."
 },
 {
  "id": "python-types.consumer-archive-public-annotations",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "parameter_return_files+=(\"${archive_proof_files[@]}\")",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The existing isolated type fixture must retain the archive restorer in strict types and public annotations; this does not restore sources or execute builds."
 },
 {
  "id": "image-acceptance.consumer-archive-metadata-paths",
  "target": "linux/scripts/restore-consumer-archive.py",
  "find": "    validate_metadata(destination, files)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Archive metadata must not select outside files, change indexed kinds or supply invalid modes before chmod; isolated fixtures do not authenticate sources or prove builds."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-manifest",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "require(sha(review) == expected, \"Candidate manifest digest differs\")",
  "replace": "require(True, \"Candidate manifest digest differs\")",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-bytes",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "cache[key] == path.name",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-owner",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "before.st_uid == os.getuid()",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-receipt-inodes",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "inode in protected",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-receipt-parent",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "row[\"parent_inode\"] in protected",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-external-links",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "row[\"links\"] != len(aliases)",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-mtime",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "if key != \"st_ino\"",
  "replace": "if key not in {\"st_ino\", \"st_mtime_ns\"}",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-preview-pin",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "sha(preview) == expected",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-planned-state",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "actual == expected",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-receipt-recheck",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "receipts == plan[\"protected_receipt_sha256\"]\n        and sorted(protected) == plan[\"protected_identity_numbers\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-post-verifier",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "    verify_applied(plan, directory)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-idle-preview",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "    observe_idle(engine, directory, \"preview\")",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-idle-apply",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "    observe_idle(engine, directory, \"apply\")",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-buildkit-busy",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "not row[\"inUse\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-container-state",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "row[\"Status\"].lower().startswith((\"created\", \"exited\", \"dead\"))",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-temporary-cleanup",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "        temporary.unlink(missing_ok=True)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-replacement",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "        os.replace(temporary, destination)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-authorization",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "\"oci-archive-dedup\" in record[\"allowed_actions\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-receipt-scan",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "protected.update(identity_numbers(json.loads(data)))",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-receipt-bytes",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "fingerprints[str(path)] = fingerprint",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Temporary real-file controls must preserve reviewed hashes, stable metadata, receipt-bound identities and idle admission; they do not authenticate receipt roots or lock malicious writers."
 },
 {
  "id": "python-types.oci-archive-dedup-annotations",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "parameter_return_files+=(\"${oci_archive_files[@]}\")",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated type fixture retains both archive cleanup modules and the cross-owner test import; it does not modify real archives."
 },
 {
  "id": "python-types.oci-archive-dedup-imports",
  "target": "linux/scripts/lint-python-types.sh",
  "find": "--extra-search-path linux/host-config",
  "replace": "--extra-search-path linux/scripts/tests",
  "test": "bash linux/scripts/tests/test-python-types.sh",
  "why": "The isolated type fixture retains both archive cleanup modules and the cross-owner test import; it does not modify real archives."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-source-checkout",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "(ancestor / \".git\").exists()",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Archive cleanup must exclude source trees and retain JSON aliases, their targets and unchanged reads; temporary fixtures do not authenticate receipt roots or lock other writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-receipt-alias",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "data, fingerprint = receipt_data(path.resolve(strict=False))",
  "replace": "data, fingerprint = None, \"missing\"",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Archive cleanup must exclude source trees and retain JSON aliases, their targets and unchanged reads; temporary fixtures do not authenticate receipt roots or lock other writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-dangling-alias",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "except FileNotFoundError:",
  "replace": "except NotADirectoryError:",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Archive cleanup must exclude source trees and retain JSON aliases, their targets and unchanged reads; temporary fixtures do not authenticate receipt roots or lock other writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-receipt-read-race",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "all(getattr(before, name) == getattr(after, name) for name in STAT_FIELDS)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Archive cleanup must exclude source trees and retain JSON aliases, their targets and unchanged reads; temporary fixtures do not authenticate receipt roots or lock other writers."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-receipt-key-selection",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "if not identity_key_present(data):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "Unrelated source-manifest values must not become identity records; malformed identity and escaped-key fixtures must still refuse. This does not authenticate receipt roots."
 },
 {
  "id": "image-acceptance.oci-archive-dedup-bounded-key-scan",
  "target": "linux/host-config/oci_archive_dedup.py",
  "find": "for match in re.finditer(rb'\"((?:[^\"\\\\]|\\\\.)*)\"(\\s*:)?', data)",
  "replace": "for match in re.finditer(rb'\"((?:[^\"\\\\]|\\\\.)*)\"(\\s*:)', data)",
  "test": "bash linux/scripts/tests/test-oci-archive-dedup.sh",
  "why": "The real scanner must consume large escaped JSON values in bounded time; a five-second child bound kills the old quadratic scanner. This fixture does not prove an arbitrary receipt-root runtime."
 },
 {
  "id": "lint-gates.hook-fixture-mutation-workspace",
  "target": "linux/scripts/tests/test-consumer-hooks.sh",
  "find": "docs/scripts/mutation_push.py docs/scripts/mutation_workspace.py linux/scripts/verify-shell-eol.sh)",
  "replace": "docs/scripts/mutation_push.py linux/scripts/verify-shell-eol.sh)",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh",
  "why": "The real local consumer hook pair must retain every required mutation-runner companion. Removing its copied workspace module must fail clean-push and stale-recipe assertions; this does not qualify downloaded linters or public remotes."
 },
 {
  "id": "lint-gates.hook-fixture-git-config-parameters",
  "target": "linux/scripts/tests/test-consumer-hooks.sh",
  "find": "unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX GIT_CEILING_DIRECTORIES GIT_CONFIG_PARAMETERS GIT_CONFIG_COUNT CI",
  "replace": "unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX GIT_CEILING_DIRECTORIES GIT_CONFIG_COUNT CI",
  "test": "env GIT_CONFIG_PARAMETERS=\"'core.hooksPath'='/missing-consumer-fixture-hooks'\" GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.hooksPath GIT_CONFIG_VALUE_0=/missing-consumer-fixture-hooks bash linux/scripts/tests/test-consumer-hooks.sh",
  "why": "Consumer hook fixtures must isolate inherited per-command Git settings before configuring real local hooks. The seeded nonexistent hook path must not suppress clean-commit, clean-push or refusal assertions; this proves neither public remotes nor downloaded linters."
 },
 {
  "id": "lint-gates.hook-fixture-git-config-count",
  "target": "linux/scripts/tests/test-consumer-hooks.sh",
  "find": "unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX GIT_CEILING_DIRECTORIES GIT_CONFIG_PARAMETERS GIT_CONFIG_COUNT CI",
  "replace": "unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX GIT_CEILING_DIRECTORIES GIT_CONFIG_PARAMETERS CI",
  "test": "env GIT_CONFIG_PARAMETERS=\"'core.hooksPath'='/missing-consumer-fixture-hooks'\" GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.hooksPath GIT_CONFIG_VALUE_0=/missing-consumer-fixture-hooks bash linux/scripts/tests/test-consumer-hooks.sh",
  "why": "Consumer hook fixtures must isolate inherited per-command Git settings before configuring real local hooks. The seeded nonexistent hook path must not suppress clean-commit, clean-push or refusal assertions; this proves neither public remotes nor downloaded linters."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-optimizer",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "require(__debug__, 'Optimization disables prerequisite safety assertions')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-protected-path",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "require(not any(path.is_relative_to(p.resolve()) or p.resolve().is_relative_to(path) for p in protected),\n            'Selected environment overlaps a protected path')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-embedded-checkout",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "require('.git' not in directories + files, 'A QA tree contains a versioned source checkout')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-recreation-metadata",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "require((path.parent / 'pyproject.toml').is_file(), 'Recreation project metadata is missing')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-authorization-scope",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "require(record.get('scope') == 'standing-automatic-cleanup-of-unused-reproducible-QA-outputs'\n            and 'ignored-quality-venv' in record.get('approved_categories', []), 'QA removal is not in the supplied authorization')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-authorization-root",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "require(record.get('allowed_root') == str(root), 'Authorization allowed root differs')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-safe-delete",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "require(shutil.rmtree.avoids_symlink_attacks, 'Symlink-resistant deletion is required')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-source-after-delete",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "require(source_state(path.parent.parent) == row['source'], 'Owning versioned source or lock changed')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-preserve-evidence",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "require(not output.exists() and not output.is_symlink(), 'Preserve existing cleanup evidence')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-observation-status",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(result.returncode == 0 and not result.stderr.strip(), f\"Observation failed: {command[0]}\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-observation-shape",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(isinstance(rows, list) and all(isinstance(row, dict) for row in rows), \"Malformed observation records\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-unit-pids",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require((state['ActiveState'], state['SubState']) in terminal\n                and state['MainPID'] == state['ControlPID'] == '0', 'A build or QA unit is active')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-container-identity",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(re.fullmatch(r'[0-9a-f]{64}', str(row.get('ID', ''))), 'Truncated container identity')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-container-state",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(isinstance(status, str) and (status == 'Created' or status.startswith(('Exited ', 'Dead'))),\n                'An engine container is active or unknown')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-container-source",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(not any(str(path.parent.parent) in json.dumps(row) for path in paths), 'A container references a QA source')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-buildkit-unknown",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(all(type(row.get('inUse')) is bool for row in records), 'Unknown BuildKit use state')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-buildkit-in-use",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(not any(row['inUse'] for row in records), 'BuildKit has in-use records')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-process-use",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(not any(root in data for root in roots), f'QA source in use by PID {process.name}')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-process-incomplete",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(not process.exists(), 'A live process has incomplete use observations')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-mounted-tree",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "require(not any(mount.is_relative_to(path) for path in paths), 'A selected QA tree contains a mount')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-source-validator",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "    api['validate_source'](path)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-last-usage",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "    usage = observe_usage(paths, engine)\n    verify_candidate(row)",
  "replace": "    usage = {}\n    verify_candidate(row)",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-last-candidate",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "    verify_candidate(row)\n    verify_inputs(inputs)",
  "replace": "    pass\n    verify_inputs(inputs)",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-last-inputs",
  "target": "linux/host-config/qa_venv_cleanup.py",
  "find": "    verify_inputs(inputs)\n    path = Path(row['environment'])",
  "replace": "    pass\n    path = Path(row['environment'])",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-process-dispatch",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "    processes = idle_processes(paths, proc_root)",
  "replace": "    processes = 0",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "compiler-llvm-tools.qa-cleanup-mount-dispatch",
  "target": "linux/scripts/qa_venv_usage.py",
  "find": "    idle_mounts(paths, proc_root)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-relocate-quality-venv.sh",
  "why": "Disposable-tree and fake-host controls must reject removal of this safety check; they do not authenticate authorization, lock concurrent writers or prove host idleness, builds or runtime acceptance."
 },
 {
  "id": "lib.isolated-clock.zero-errno",
  "target": "shared/native/isolated_helper.c",
  "find": "return errno != 0 ? errno : EIO;",
  "replace": "return errno != 0 ? errno : EINVAL;",
  "test": "bash linux/scripts/tests/test-isolated-helper-clock.sh",
  "why": "A failing initial or elapsed clock with errno zero must report EIO and never success.",
  "timeout": 45
 },
 {
  "id": "lib.isolated-clock.preserve-errno",
  "target": "shared/native/isolated_helper.c",
  "find": "return errno != 0 ? errno : EIO;",
  "replace": "return EIO;",
  "test": "bash linux/scripts/tests/test-isolated-helper-clock.sh",
  "why": "Preserve actual EACCES and ERANGE rather than replace them with the fallback.",
  "timeout": 45
 },
 {
  "id": "lib.isolated-clock.initial-error",
  "target": "shared/native/isolated_helper.c",
  "find": "error = monotonic_time(&started);",
  "replace": "error = monotonic_time(&started) != 0 ? EINVAL : 0;",
  "test": "bash linux/scripts/tests/test-isolated-helper-clock.sh",
  "why": "The initial clock error must survive before any worker is launched.",
  "timeout": 45
 },
 {
  "id": "lib.isolated-clock.elapsed-error",
  "target": "shared/native/isolated_helper.c",
  "find": "const int error = monotonic_time(&now);\n  if (error != 0) {\n    return error;\n  }",
  "replace": "const int error = monotonic_time(&now);\n  if (error != 0) {\n    return EAGAIN;\n  }",
  "test": "bash linux/scripts/tests/test-isolated-helper-clock.sh",
  "why": "The elapsed clock error must survive worker teardown and reach its caller unchanged.",
  "timeout": 45
 },
 {
  "id": "lib.isolated-clock.error-reaping",
  "target": "shared/native/isolated_helper.c",
  "find": "const int waited = reap_worker(worker, &packet->status);",
  "replace": "const int waited = error == 0 ? reap_worker(worker, &packet->status) : EIO;",
  "test": "bash linux/scripts/tests/test-isolated-helper-clock.sh",
  "why": "A failed elapsed clock still requires actual worker reaping before return.",
  "timeout": 45
 },
 {
  "id": "lib.isolated-clock.timeout-bound",
  "target": "shared/native/isolated_helper.c",
  "find": "error == 0 && !cancelled && elapsed < timeout_ms",
  "replace": "error == 0 && !cancelled && elapsed < (int64_t)timeout_ms * 1000",
  "test": "bash linux/scripts/tests/test-isolated-helper-clock.sh",
  "why": "An ordinary finite timeout must kill and reap instead of letting the sleeping worker exit normally.",
  "timeout": 45
 },
 {
  "id": "lib.isolated-clock.fixture-compiler-status",
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "find": "_ih_c_object \"$1\" \"$2\" clock-fixture shared/native/tests/isolated_helper_clock_test.c clock-fixture || return",
  "replace": "_ih_c_object \"$1\" \"$2\" clock-fixture shared/native/tests/isolated_helper_clock_test.c clock-fixture",
  "test": "bash linux/scripts/tests/test-isolated-helper-clock.sh",
  "why": "A compiler failure cannot fall through to a successful stale-object link and hide raw status43.",
  "timeout": 45
 },
 {
  "id": "lib.hook-host-red-log-bootstrap",
  "target": "linux/scripts/lib/hook-host-red.sh",
  "find": "source \"${BASH_SOURCE[0]%/*}/log-bootstrap.sh\" || return",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-lib-modules.sh",
  "why": "The shared hook helper must import the real logging module; positive library controls cannot be bypassed or counted as a vacuous mutation bite."
 },
 {
  "id": "rust.cargo-release-json.api-marker",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "# ANT_CARGO_RELEASE_JSON_API=1",
  "replace": "# old release API",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "Callers must be able to refuse an older release driver before stale metadata can be used.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.whole-workspace",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "cargo build --message-format=json-render-diagnostics --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"",
  "replace": "cargo build --message-format=json-render-diagnostics --release -p kataglyphis_cli \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "Capturing metadata must retain every workspace member, including the native root library.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.explicit-cli",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "cargo build --message-format=json-render-diagnostics --release -p kataglyphis_cli \"$@\" > \"${CARGO_RELEASE_CLI_MESSAGES}\"",
  "replace": "cargo build --message-format=json-render-diagnostics --release -p oxidant \"$@\" > \"${CARGO_RELEASE_CLI_MESSAGES}\"",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "The second call must still build the actual CLI instead of silently changing its package.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.json-format",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "cargo build --message-format=json-render-diagnostics --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"",
  "replace": "cargo build --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "A metadata stream must be actual Cargo JSON rather than ordinary console output.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.separate-streams",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "cargo build --message-format=json-render-diagnostics --release -p kataglyphis_cli \"$@\" > \"${CARGO_RELEASE_CLI_MESSAGES}\"",
  "replace": "cargo build --message-format=json-render-diagnostics --release -p kataglyphis_cli \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "The later CLI call cannot overwrite the workspace metadata or leave the CLI stream empty.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.invalidate-old-streams",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": ": > \"${_crj_messages}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "Both old streams must be empty before wrapper setup, even if the wrapper immediately fails.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.paired-paths",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "*) printf 'Both Cargo release JSON paths are required\\n' >&2; return 2 ;;",
  "replace": "*) return 0 ;;",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "One requested stream must fail rather than silently mixing capture and console modes.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.distinct-paths",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "if [[ \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\" == \"${CARGO_RELEASE_CLI_MESSAGES}\" ||\n        \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\" -ef \"${CARGO_RELEASE_CLI_MESSAGES}\" ]]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "Canonical aliases and hardlinked outputs cannot overwrite another invocation.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.regular-paths",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "if [[ -e \"${_crj_messages}\" && ! -f \"${_crj_messages}\" ]]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "Directories and FIFOs must refuse before output redirection or wrapper setup.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.workspace-raw-status",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "cargo build --message-format=json-render-diagnostics --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"",
  "replace": "cargo build --message-format=json-render-diagnostics --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\" || true",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "Workspace failure preserves status43 and prevents the CLI phase.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.cli-raw-status",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "cargo build --message-format=json-render-diagnostics --release -p kataglyphis_cli \"$@\" > \"${CARGO_RELEASE_CLI_MESSAGES}\"",
  "replace": "cargo build --message-format=json-render-diagnostics --release -p kataglyphis_cli \"$@\" > \"${CARGO_RELEASE_CLI_MESSAGES}\" || true",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "CLI failure preserves status47 rather than producing a successful release.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.wrapper-raw-status",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "source \"$SCRIPT_DIR/_cargo_wrapper.sh\"",
  "replace": "source \"$SCRIPT_DIR/_cargo_wrapper.sh\" || true",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "Wrapper failure preserves status51 and cannot start Cargo with partially initialized state.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.argv-boundaries",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "cargo build --message-format=json-render-diagnostics --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"",
  "replace": "cargo build --message-format=json-render-diagnostics --release --workspace $* > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "Spaced and empty Cargo arguments retain their exact original boundaries.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.caller-bindings",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "cargo build --message-format=json-render-diagnostics --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"",
  "replace": "cargo_release_mutant_scope() { local messages=hidden; cargo build --message-format=json-render-diagnostics --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"; }; cargo_release_mutant_scope \"$@\"",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "A supplied Cargo shell function must retain caller-visible configuration instead of inheriting a generic metadata local.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.wrapper-aliases",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "source \"$SCRIPT_DIR/_cargo_wrapper.sh\"",
  "replace": "source \"$SCRIPT_DIR/_cargo_wrapper.sh\"\nunalias cargo 2>/dev/null || true",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "Preserve aliases selected by the wrapper for both ordinary and JSON releases.",
  "timeout": 45
 },
 {
  "id": "rust.cargo-release-json.phase-parse-boundary",
  "target": "linux/scripts/02-toolchain/rust/cargo_release.sh",
  "find": "info \"Running cargo release build...\"\n# Build all workspace members including binaries\nif [[ -n \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\" ]]; then\n  cargo build --message-format=json-render-diagnostics --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"\nelse\n  cargo build --release --workspace \"$@\"\nfi\n\n# Explicitly build the CLI binary to ensure it's available for packaging\ninfo \"Building CLI binary...\"\nif [[ -n \"${CARGO_RELEASE_CLI_MESSAGES}\" ]]; then\n  cargo build --message-format=json-render-diagnostics --release -p kataglyphis_cli \"$@\" > \"${CARGO_RELEASE_CLI_MESSAGES}\"\nelse\n  cargo build --release -p kataglyphis_cli \"$@\"\nfi",
  "replace": "{\ninfo \"Running cargo release build...\"\n# Build all workspace members including binaries\nif [[ -n \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\" ]]; then\n  cargo build --message-format=json-render-diagnostics --release --workspace \"$@\" > \"${CARGO_RELEASE_WORKSPACE_MESSAGES}\"\nelse\n  cargo build --release --workspace \"$@\"\nfi\n\n# Explicitly build the CLI binary to ensure it's available for packaging\ninfo \"Building CLI binary...\"\nif [[ -n \"${CARGO_RELEASE_CLI_MESSAGES}\" ]]; then\n  cargo build --message-format=json-render-diagnostics --release -p kataglyphis_cli \"$@\" > \"${CARGO_RELEASE_CLI_MESSAGES}\"\nelse\n  cargo build --release -p kataglyphis_cli \"$@\"\nfi\n}",
  "test": "bash linux/scripts/tests/test-cargo-release-messages.sh",
  "why": "A Cargo alias changed by the workspace callback must be read again for the later CLI phase, as in the original driver.",
  "timeout": 45
 },
 {
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "test": "bash linux/scripts/tests/test-isolated-helper-cache.sh",
  "timeout": 180,
  "id": "lib.isolated-cache.guarded-c",
  "find": "_ih_cached_compile \"${_ih_root}\" \"${_ih_output}\" \"${_ih_stem}\" cc",
  "replace": "bash \"${_ih_root}/linux/scripts/capture-sccache-command.sh\" \"${_ih_output}/${_ih_stem}-cache\" -- sccache cc",
  "why": "Both fixture compiler branches must use the guarded cache route; a fake own-error still requires real C output, not cache performance."
 },
 {
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "test": "bash linux/scripts/tests/test-isolated-helper-cache.sh",
  "timeout": 180,
  "id": "lib.isolated-cache.guarded-cpp",
  "find": "_ih_cached_compile \"${_ih_root}\" \"${_ih_output}\" \"${_ih_stem}\" c++",
  "replace": "bash \"${_ih_root}/linux/scripts/capture-sccache-command.sh\" \"${_ih_output}/${_ih_stem}-cache\" -- sccache c++",
  "why": "The ASAN C++ branch must retain the guarded resolver and raw real-compiler status under cache infrastructure failures."
 },
 {
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "test": "bash linux/scripts/tests/test-isolated-helper-cache.sh",
  "timeout": 180,
  "id": "lib.isolated-cache.parent-env",
  "find": "  compiler_cache_launcher_env || return $?\n",
  "replace": "  :\n",
  "why": "The selected server address must be published in the actual compiling shell before resolver substitution."
 },
 {
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "test": "bash linux/scripts/tests/test-isolated-helper-cache.sh",
  "timeout": 180,
  "id": "lib.isolated-cache.import-status",
  "find": "source \"${_ih_root}/linux/scripts/01-core/common.sh\" || return",
  "replace": "source \"${_ih_root}/linux/scripts/01-core/common.sh\"",
  "why": "A required cache owner import must retain its raw failure even when it declared usable-looking exports."
 },
 {
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "test": "bash linux/scripts/tests/test-isolated-helper-cache.sh",
  "timeout": 180,
  "id": "lib.isolated-cache.exports",
  "find": "declare -F compiler_cache_launcher_env >/dev/null || { err \"Missing required compiler cache API: compiler_cache_launcher_env\"; return 1; }",
  "replace": ":",
  "why": "The required environment export must be validated before invoking it; a missing API must retain its explicit refusal."
 },
 {
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "test": "bash linux/scripts/tests/test-isolated-helper-cache.sh",
  "timeout": 180,
  "id": "lib.isolated-cache.resolver-status",
  "find": "_ih_launcher=\"$(compiler_cache_launcher)\" || return",
  "replace": "_ih_launcher=\"$(compiler_cache_launcher)\"",
  "why": "The caller must not replace a failed resolver status with an attempted empty launcher command."
 },
 {
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "test": "bash linux/scripts/tests/test-isolated-helper-cache.sh",
  "timeout": 180,
  "id": "lib.isolated-cache.capture-status",
  "find": "\"${_ih_launcher}\" \"$@\"",
  "replace": "\"${_ih_launcher}\" \"$@\" || true",
  "why": "A real compiler failure cannot become success through the statistics wrapper."
 },
 {
  "id": "lib.isolated-cache.env-status",
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "find": "compiler_cache_launcher_env || return $?",
  "replace": "compiler_cache_launcher_env",
  "test": "bash linux/scripts/tests/test-isolated-helper-cache.sh",
  "timeout": 180,
  "why": "A failing required environment owner must retain raw status71 before cache resolution or compiler execution."
 },
 {
  "id": "lib.isolated-cache.resolver-export",
  "target": "linux/scripts/lib/isolated-helper-compile.sh",
  "find": "declare -F compiler_cache_launcher >/dev/null || { err \"Missing required compiler cache API: compiler_cache_launcher\"; return 1; }",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-isolated-helper-cache.sh",
  "timeout": 180,
  "why": "The separate required resolver export must fail explicitly before an absent command can replace the intended status and diagnostic."
 },
 {
  "id": "sccache.env-policy-canonical-root",
  "target": "linux/scripts/tests/test-compiler-cache-launcher.sh",
  "find": "  root=\"$(cd \"$1\" && pwd)\" || return",
  "replace": "  root=\"$1\"",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "timeout": 180,
  "why": "A tests/.. root must not cause the test-path exclusion to hide every production call; the bare-call fixture must actually fail the policy scan."
 },
 {
  "id": "sccache.env-policy-inherited-address",
  "target": "linux/scripts/tests/test-compiler-cache-launcher.sh",
  "find": "  unset SCCACHE_SERVER_UDS SCCACHE_SERVER_PORT\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-compiler-cache-launcher.sh",
  "timeout": 180,
  "why": "The fake subshell-loss control must clear its explicitly inherited socket and port in its own child, without altering the real parent cache environment."
 },
 {
  "id": "package.binary-linux-tar-dispatch",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "elif tarfile.is_tarfile(args.package):",
  "replace": "elif False:",
  "test": "bash linux/scripts/tests/test-package-binary-linux.sh",
  "why": "Actual TAR payloads must reach the streaming exact-byte reader."
 },
 {
  "id": "package.binary-linux-deb-dispatch",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "elif args.package.suffix.lower() == \".deb\":",
  "replace": "elif False:",
  "test": "bash linux/scripts/tests/test-package-binary-linux.sh",
  "why": "Actual Debian payloads must reach the checked native transport."
 },
 {
  "id": "package.binary-linux-directory-dispatch",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "if args.package.is_dir():",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-package-binary-linux.sh",
  "why": "Native extracted files must reach the exact directory reader."
 },
 {
  "id": "package.binary-complete-stream",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "while chunk := stream.read(1024 * 1024):",
  "replace": "if chunk := stream.read(1024 * 1024):",
  "test": "bash linux/scripts/tests/test-package-binary-verifier.sh",
  "why": "A final-byte change beyond the first buffer must remain visible in both source and package hashes."
 },
 {
  "id": "package.binary-unique-member",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "def require_member_count(name: str, count: int) -> None:\n    if count != 1:",
  "replace": "def require_member_count(name: str, count: int) -> None:\n    if False:",
  "test": "bash linux/scripts/tests/test-package-binary-linux.sh",
  "why": "Duplicate TAR and directory aliases must not stand for one selected member."
 },
 {
  "id": "package.binary-exact-member-name",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "if actual_name != name:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-package-binary-linux.sh",
  "why": "A normalized matching key does not authorize an aliased raw selected path."
 },
 {
  "id": "package.binary-regular-member",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "if not regular:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-package-binary-verifier.sh",
  "why": "Selected ZIP symlinks cannot substitute for delivered regular binary members."
 },
 {
  "id": "package.binary-exact-hash",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "if actual != expected:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-package-binary-linux.sh",
  "why": "A changed final byte cannot satisfy an exact selected native payload rule."
 },
 {
  "id": "package.binary-case-conflicts",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "return names.get(canonical.casefold())",
  "replace": "return names.get(canonical)",
  "test": "bash linux/scripts/tests/test-package-binary-verifier.sh",
  "why": "Case-conflicting entries remain part of the selected-member ambiguity check."
 },
 {
  "id": "package.binary-deb-transport-status",
  "target": "linux/scripts/verify_package_license.py",
  "find": "if status != 0:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-package-binary-linux.sh",
  "why": "A complete payload with a failed dpkg reader remains a fatal result with its status visible."
 },
 {
  "id": "package.binary-native-appimage-call",
  "target": "linux/scripts/06-packaging/verify-native-appimage-binary.sh",
  "find": "appimage_verify_file \"${script_dir}/../verify_package_binary.py\" \"$@\"",
  "replace": ": \"${script_dir}/../verify_package_binary.py\" \"$@\"",
  "test": "bash linux/scripts/tests/test-verify-native-appimage-binary.sh",
  "why": "Native extraction must reach the exact binary reader rather than certify an unchecked member."
 },
 {
  "id": "package.binary-native-extraction-status",
  "target": "linux/scripts/06-packaging/appimage-verification.sh",
  "find": "    \"$image\" --appimage-extract \"$entry\" > /dev/null || exit $?",
  "replace": "    \"$image\" --appimage-extract \"$entry\" > /dev/null || true",
  "test": "bash linux/scripts/tests/test-verify-native-appimage-binary.sh",
  "why": "The native extractor failure retains its actual status through the shared transport."
 },
 {
  "id": "package.binary-native-architecture",
  "target": "linux/scripts/06-packaging/appimage-verification.sh",
  "find": "  appimage_require_native \"$2\" || return $?",
  "replace": "  : \"$2\"",
  "test": "bash linux/scripts/tests/test-verify-native-appimage-binary.sh",
  "why": "A native AppImage binary check refuses another architecture before execution."
 },
 {
  "id": "package.binary-deb-reader-drain",
  "target": "linux/scripts/verify_package_license.py",
  "find": "            while proc.stdout.read(1024 * 1024):\n                pass",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-package-binary-linux.sh",
  "why": "Drain unselected trailing transport bytes so closing the reader cannot replace the actual native failure with SIGPIPE."
 },
 {
  "id": "package.binary-zip-file-kind",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "not entry.is_dir() and mode_type in (0, stat.S_IFREG)",
  "replace": "not entry.is_dir() and mode_type != stat.S_IFLNK",
  "test": "bash linux/scripts/tests/test-package-binary-verifier.sh",
  "why": "An explicitly special ZIP member cannot stand for a delivered regular binary."
 },
 {
  "id": "package.binary-directory-root",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "if path.is_symlink():",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-package-binary-linux.sh",
  "why": "An extracted package root cannot redirect selection through a symlink."
 },
 {
  "id": "package.native-extraction-root",
  "target": "linux/scripts/06-packaging/appimage-verification.sh",
  "find": "if [[ ! -d squashfs-root || -L squashfs-root ]]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-verify-native-appimage-license.sh",
  "why": "The native extraction root itself must be a real directory before reading selected payload files."
 },
 {
  "id": "packaging.closed-staging.validate-observation-1",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(0 <= time.time() - observed[\"observed_unix\"] <= 120, \"Require fresh host observations\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-observation-2",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(state[\"Id\"] == plan[\"unit\"], \"Observed producer identity differs\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-observation-3",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(quiet, \"Producer must be closed, including its stop work\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-observation-4",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(observed[\"mount_conflicts\"] == [] and observed[\"nested_mounts\"] == [], \"Preserve registered or mounted staging\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-observation-5",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(len(queries) == 2 and {q[\"filter\"] for q in queries} == expected, \"Require exact CID and owner queries\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-observation-6",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(all(type(q[\"exit_status\"]) is int and q[\"exit_status\"] == 0 and q[\"stdout\"] == q[\"stderr\"] == \"\" for q in queries), \"Producer container absence is unproved\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-1",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(plan[\"schema\"] == 1, \"Unsupported staging admission schema\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-2",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(re.fullmatch(r\"[0-9a-f]{32}\", token) is not None, \"Invalid producer nonce\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-3",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(re.fullmatch(r\"[0-9a-f]{64}\", plan[\"CID\"]) is not None, \"Invalid full producer CID\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-4",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(plan[\"owner_label\"] == \"org.kataglyphis.current-rust-packages\", \"Select only the recorded package producer\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-5",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(re.fullmatch(r\"/home/[^/]+/gpu/run-tmp/amd-package-\" + token + r\"/package-work\", plan[\"host_staging\"]) is not None, \"Select only private AMD package staging\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-6",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(plan[\"closed_main_pid\"] == plan[\"closed_control_pid\"] == 0, \"Saved producer is not terminal\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-7",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(plan[\"cache_status\"] == plan[\"producer_cleanup_status\"] == 0, \"Preserve incomplete producer cleanup\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-8",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(type(plan[\"producer_status\"]) is int and plan[\"producer_status\"] >= 0, \"Missing raw producer status\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-9",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(not root.is_symlink() and root.is_dir(), \"Require a literal staging directory\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-10",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require([identity.st_dev, identity.st_ino] == plan[\"staging_identity\"], \"Staging mount identity differs\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-11",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(SELECTED <= names <= SELECTED | {\"home\"}, \"Preserve unknown staging entries\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.validate-subject-12",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(all((root / name).is_dir() and not (root / name).is_symlink() for name in SELECTED), \"Copied staging roots must be directories\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.verify-archives-1",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(len(records) == 3 and len({r[\"name\"] for r in records}) == 3, \"Retain all three distinct package archives\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.verify-archives-2",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(kinds == {\"tar\", \".deb\", \".AppImage\"}, \"Retain TAR, DEB and AppImage archives\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.verify-archives-3",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(re.fullmatch(r\"oxidant[-_][A-Za-z0-9_.+-]+\", name) is not None, \"Invalid retained archive name\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.verify-archives-4",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(stat.S_ISREG(archive.lstat().st_mode) and record[\"bytes\"] > 0, \"Retain regular nonempty archives\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.verify-archives-5",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(archive.stat().st_size == record[\"bytes\"] and fingerprint(archive) == record[\"sha256\"], \"Retained package bytes differ\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.tree-1",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(not protected_names or FORBIDDEN.isdisjoint(Path(relative).parts), \"Preserve source or cache entries\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.tree-2",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(info.st_nlink == 1, \"Preserve shared file inodes\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.execute-1",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(not output.exists() and not output.is_symlink(), \"Preserve existing retirement evidence\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.execute-2",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(not output.is_relative_to(root) and not output.is_relative_to(archives), \"Keep evidence outside retained inputs\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.execute-3",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(all(any(row[\"kind\"] == \"file\" for row in rows) for rows in selected.values()), \"Copied staging is empty\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.execute-4",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(preview[\"status\"] == \"preview-only\" and preview[\"snapshot_sha256\"] == signature, \"Changed or already-applied retirement preview\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.execute-5",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(shutil.rmtree.avoids_symlink_attacks, \"Require descriptor-based directory removal\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.execute-6",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(tree(root / \"home\", False) == preserved_home, \"Unselected private cache changed\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.execute-7",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require([current.st_dev, current.st_ino] == plan[\"staging_identity\"], \"Staging root changed before removal\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "packaging.closed-staging.execute-8",
  "target": "linux/scripts/local-proof/cleanup-package-staging.py",
  "find": "require(SELECTED.isdisjoint(os.listdir(descriptor)), \"Copied staging removal is incomplete\")",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-package-staging-cleanup.sh",
  "why": "Copied staging retirement must preserve sources, caches, archives and live producers."
 },
 {
  "id": "sccache.fixture-default-report-isolates-inherited-address",
  "target": "linux/scripts/tests/test-compiler-cache.sh",
  "find": "_cache_setup_report() (\n  # Temporary call assignments reveal outer bindings when unset, so set only the child exports.\n  export SCCACHE_SERVER_UDS=\"${2:?controlled socket required}\" SCCACHE_SERVER_PORT=24226\n  if [ \"${1:?address mode required}\" = automatic ]; then\n    unset SCCACHE_SERVER_UDS SCCACHE_SERVER_PORT",
  "replace": "_cache_setup_report() (\n  # Temporary call assignments reveal outer bindings when unset, so set only the child exports.\n  export SCCACHE_SERVER_UDS=\"${2:?controlled socket required}\" SCCACHE_SERVER_PORT=24226\n  if [ \"${1:?address mode required}\" = automatic ]; then\n    :",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "The default-address diagnostic controls its inherited socket/port while the explicit caller-address case remains honored; it never changes the parent capture address."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.sdk-media-parent-1",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "require(__debug__, 'Optimization disables shared parent safety assertions')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.sdk-media-parent-2",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "require(invocation['target_arch'] == arch, f'Default Media requires the reviewed {arch} SDK')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.sdk-media-parent-3",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "require(invocation['source'] == str(source) and invocation['source_revision'] == plan['source_revision'],\n            'Media must retain its exact SDK source')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.sdk-media-parent-4",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "require(callable(api.get('sdk_parent')), 'The qualified SDK parent API is missing')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.sdk-media-parent-5",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "require(parent['subject']['sdk_invocation_sha256'] == sha(invocation_path), 'SDK invocation changed after qualification')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.sdk-media-parent-6",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "require(parent['subject']['source_proof_sha256'] == full_sha, 'SDK source proof changed after qualification')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.launch-1",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "require(arch in SDK_TARGETS and re.fullmatch(rf'webgpu-normal-media-default-{arch}-[0-9-]+\\.service', unit) is not None,\n            f'Explicit default {arch} Media unit required')",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.complete-source-call",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "full_source(source, Path(plan['full_source_preflight_proof']), plan['source_revision'])",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.sdk-proof-argument",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "api['sdk_parent'](plan, invocation_path, proof_path, arch=arch)",
  "replace": "api['sdk_parent'](plan, invocation_path, invocation_path, arch=arch)",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.minimum-media-reserve",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "max(MEDIA_REQUIRED_BYTES, plan['required_bytes'])",
  "replace": "plan['required_bytes']",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.stricter-caller-reserve",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "max(MEDIA_REQUIRED_BYTES, plan['required_bytes'])",
  "replace": "MEDIA_REQUIRED_BYTES",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.default-variant",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "repo, 'default', arch, 'sdk'",
  "replace": "repo, 'rocm', arch, 'sdk'",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.raw-build-status",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "return launch_build(",
  "replace": "return 0 and launch_build(",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "compiler-llvm-tools.default-amd64-media.raw-cli-status",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "return launch(args.compiler_plan,",
  "replace": "return 0 and launch(args.compiler_plan,",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "Synthetic callers must reject unqualified or changed SDK/source bindings and retain canonical default flags and storage limits; no image, OCI provenance, factory, licence or FINAL acceptance is proved."
 },
 {
  "id": "image-acceptance.consumer-sources-origin-write",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "            git(destination, \"config\", \"--add\", \"--\", \"remote.origin.url\", origin)",
  "replace": "            pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git fixtures preserve configured origin identity and literal ordered values; required configuration failures remain fatal. No remote authentication, workflow acceptance or build is proved."
 },
 {
  "id": "image-acceptance.consumer-sources-origin-source",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "for entry in git(source, \"config\", \"--local\", \"--null\", \"--list\").split(b\"\\0\")",
  "replace": "for entry in git(destination, \"config\", \"--local\", \"--null\", \"--list\").split(b\"\\0\")",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git fixtures preserve configured origin identity and literal ordered values; required configuration failures remain fatal. No remote authentication, workflow acceptance or build is proved."
 },
 {
  "id": "image-acceptance.consumer-sources-origin-literal-boundaries",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "entry.split(b\"\\n\", 1)[1].decode()",
  "replace": "entry.split(b\"\\n\", 1)[1].decode().strip()",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git fixtures preserve configured origin identity and literal ordered values; required configuration failures remain fatal. No remote authentication, workflow acceptance or build is proved."
 },
 {
  "id": "image-acceptance.consumer-sources-origin-replaces-clone-reference",
  "target": "linux/scripts/preserve-consumer-sources.py",
  "find": "        git(destination, \"config\", \"--unset-all\", \"remote.origin.url\")",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-preserve-consumer-sources.sh",
  "why": "Real local Git fixtures preserve configured origin identity and literal ordered values; required configuration failures remain fatal. No remote authentication, workflow acceptance or build is proved."
 },
 {
  "id": "lib.gcc-runtime-notices-runtime-required",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "  for notice in COPYING3 COPYING.RUNTIME; do\n    _gcc_notice_required_file",
  "replace": "  for notice in COPYING3; do\n    _gcc_notice_required_file",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "Both original text inputs are validated before publication."
 },
 {
  "id": "lib.gcc-runtime-notices-nonempty-original",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "[ -s \"$1\" ] && ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "An empty original archive member is not an original licence text."
 },
 {
  "id": "lib.gcc-runtime-notices-regular-original",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": " && [ ! -L \"$1\" ]",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "Linked notice inputs refuse even when their target bytes match."
 },
 {
  "id": "lib.gcc-runtime-notices-archive-byte-match",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "    tar -xOf \"${archive}\" \"gcc-${GCC_VERSION}/${notice}\" | cmp - \"${source}/${notice}\" || {\n      local -a notice_status=(\"${PIPESTATUS[@]}\")\n      return \"$(( notice_status[0] != 0 ? notice_status[0] : notice_status[1] ))\"\n    }",
  "replace": "    : \"archive comparison omitted\"",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "A rewritten extracted notice must not replace the original archive member."
 },
 {
  "id": "lib.gcc-runtime-notices-destination-unlinked",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "[ ! -L \"$1\" ] && ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "A linked notice directory must not redirect installed notices."
 },
 {
  "id": "lib.gcc-runtime-notices-copy-runtime",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "  for notice in COPYING3 COPYING.RUNTIME; do\n    ${SUDO} install",
  "replace": "  for notice in COPYING3; do\n    ${SUDO} install",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "The runtime exception is copied beside the GPL original."
 },
 {
  "id": "lib.gcc-runtime-notices-copy-failure",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "\"${destination}/${notice}\" || return $?",
  "replace": "\"${destination}/${notice}\" || :",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "Raw copy failures survive a conditional caller."
 },
 {
  "id": "lib.gcc-runtime-notices-hash-failure",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "checksum=\"$(sha512sum < \"${archive}\")\" || return $?",
  "replace": "checksum=\"$(sha512sum < \"${archive}\")\" || :",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "A failed archive hash cannot become an empty successful source receipt."
 },
 {
  "id": "lib.gcc-runtime-notices-checksum-failure",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "\"${destination}/source.sha512\" >/dev/null || return $?",
  "replace": "\"${destination}/source.sha512\" >/dev/null || :",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "A failed checksum-record write cannot be hidden by the following URL write."
 },
 {
  "id": "lib.gcc-runtime-notices-url-failure",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "\"${destination}/source.url\" >/dev/null || return $?",
  "replace": "\"${destination}/source.url\" >/dev/null || :",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "The final source URL write remains a required operation."
 },
 {
  "id": "lib.gcc-runtime-notices-exact-source-hash",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "printf '%s  %s\\n' \"${checksum%% *}\" \"${TARBALL}\"",
  "replace": "printf '%s  %s\\n' stale \"${TARBALL}\"",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "The checksum record contains the current measured archive digest."
 },
 {
  "id": "lib.gcc-runtime-notices-canonical-source-url",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "\"${TARBALL_URL}\" | ${SUDO} tee",
  "replace": "\"https://example.invalid/wrong-source\" | ${SUDO} tee",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "The retained source pointer comes from the actual canonical release URL."
 },
 {
  "id": "lib.gcc-runtime-notices-builder-aborts",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "_gcc_stage_runtime_notices || exit \"$?\"",
  "replace": "_gcc_stage_runtime_notices || :",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "A staging failure cannot continue to source cleanup even when the builder is conditionally sourced."
 },
 {
  "id": "lib.gcc-runtime-notices-archive-failure-status",
  "target": "linux/scripts/02-toolchain/build-gcc.sh",
  "find": "notice_status[0] != 0 ? notice_status[0] : notice_status[1]",
  "replace": "notice_status[1]",
  "test": "bash linux/scripts/tests/test-gcc-runtime-notices.sh",
  "why": "The text comparator's EOF failure cannot replace the archive reader's original raw failure status."
 },
 {
  "id": "lib.gstreamer-original-notices-release",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "policy.get(\"release\") == version",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "A requested build pin must match the reviewed release policy."
 },
 {
  "id": "lib.gstreamer-original-notices-paths",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "isinstance(profile[\"files\"], dict) and set(profile[\"files\"]) == expected",
  "replace": "isinstance(profile[\"files\"], dict)",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "A policy cannot drop a required selected original silently."
 },
 {
  "id": "lib.gstreamer-original-notices-commit",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "revision == profile[\"commit\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The actual checkout must match the reviewed release commit."
 },
 {
  "id": "lib.gstreamer-original-notices-tag",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "selected == revision",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The selected release tag cannot point at another commit."
 },
 {
  "id": "lib.gstreamer-original-notices-hash",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "hashlib.sha256(data).hexdigest() == expected",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The exact original notice hash must match its reviewed source policy."
 },
 {
  "id": "lib.gstreamer-original-notices-git-bytes",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "git(tree, \"show\", \"HEAD:\" + relative) == data",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "A changed working original is not an original Git file even if a supplied hash agrees."
 },
 {
  "id": "lib.gstreamer-original-notices-regular",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "stat.S_ISREG(info.st_mode) and info.st_nlink == 1",
  "replace": "info.st_nlink == 1",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "A symlink is not a selected original regular file."
 },
 {
  "id": "lib.gstreamer-original-notices-single-link",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "stat.S_ISREG(info.st_mode) and info.st_nlink == 1",
  "replace": "stat.S_ISREG(info.st_mode)",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "Shared original inodes are refused before staging."
 },
 {
  "id": "lib.gstreamer-original-notices-nonempty",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "int(not allow_empty) <= info.st_size <= max_bytes",
  "replace": "0 <= info.st_size <= max_bytes",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "An empty committed original with a matching hash still cannot satisfy the notice contract."
 },
 {
  "id": "lib.gstreamer-original-notices-bounded-original",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "int(not allow_empty) <= info.st_size <= max_bytes",
  "replace": "int(not allow_empty) <= info.st_size",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "Selected notice inputs stay bounded before reading."
 },
 {
  "id": "lib.gstreamer-original-notices-source-parents",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "    plain_parents(path)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "A selected notice cannot traverse a symlinked source directory."
 },
 {
  "id": "lib.gstreamer-original-notices-output-parents",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "    plain_parents(destination)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "A linked output parent cannot redirect the original-text payload."
 },
 {
  "id": "lib.gstreamer-original-notices-fresh-output",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "    destination.mkdir()",
  "replace": "    destination.mkdir(exist_ok=True)",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "An existing output cannot be refreshed while retaining stale provenance or payloads."
 },
 {
  "id": "lib.gstreamer-original-notices-rust-version",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "version == profile[\"gtk4_package_version\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The Rust workspace package version remains distinct from the GStreamer release tag."
 },
 {
  "id": "lib.gstreamer-original-notices-rust-license",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "package[\"license\"] == profile[\"gtk4_license_expression\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The GTK4 manifest license expression must match its reviewed source metadata."
 },
 {
  "id": "lib.gstreamer-original-notices-unique-policy",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "len(result) == len(pairs)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "Duplicate policy keys cannot hide replaced review inputs."
 },
 {
  "id": "lib.gstreamer-original-notices-git-root",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "        == str(tree),",
  "replace": "        is not None,",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "A nested directory cannot borrow its parent repository identity."
 },
 {
  "id": "lib.gstreamer-original-notices-outside-source",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "not destination.is_relative_to(source)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "Staged originals must survive deletion of the temporary source tree."
 },
 {
  "id": "lib.gstreamer-original-notices-bounded-patch",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "len(patch) <= 8 * 1024 * 1024",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "Tracked patch retention refuses oversized input before allocation."
 },
 {
  "id": "lib.gstreamer-original-notices-limited-scope",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "\"binary_linkage_or_complete_license_source_closure_proven\": False",
  "replace": "\"binary_linkage_or_complete_license_source_closure_proven\": True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "Selected original texts must never certify complete binary licence or source closure."
 },
 {
  "id": "lib.gstreamer-original-notices-patch-bytes",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "payloads[\"source.patch\"] = patch",
  "replace": "payloads[\"source.patch\"] = b\"\"",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The actual tracked patch bytes are retained rather than an empty placeholder."
 },
 {
  "id": "lib.gstreamer-original-notices-fatal-monorepo",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "stage_gstreamer_original_notices \"${BUILD_DIR}/gstreamer\" monorepo monorepo || exit \"$?\"",
  "replace": "stage_gstreamer_original_notices \"${BUILD_DIR}/gstreamer\" monorepo monorepo",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The actual selected handoff must fail before cleanup even when setup is conditionally sourced."
 },
 {
  "id": "lib.gstreamer-original-notices-fatal-cross-rust",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  stage_gstreamer_original_notices \"${BUILD_DIR}/gstreamer/subprojects/gst-plugins-rs\" rust rust-monorepo || exit \"$?\"",
  "replace": "  stage_gstreamer_original_notices \"${BUILD_DIR}/gstreamer/subprojects/gst-plugins-rs\" rust rust-monorepo",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The actual selected handoff must fail before cleanup even when setup is conditionally sourced."
 },
 {
  "id": "lib.gstreamer-original-notices-fatal-native-rust",
  "target": "linux/scripts/03-media/build/gstreamer/common/setup-gstreamer.sh",
  "find": "  stage_gstreamer_original_notices /opt/gst-plugins-rs rust rust-standalone || exit \"$?\"",
  "replace": "  stage_gstreamer_original_notices /opt/gst-plugins-rs rust rust-standalone",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The actual selected handoff must fail before cleanup even when setup is conditionally sourced."
 },
 {
  "id": "lib.gstreamer-original-notices-reviewed-context",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "if relative in CONTEXT_PATHS[kind]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "Build-context changes retain the reviewed upstream original while preserving the actual working bytes separately."
 },
 {
  "id": "lib.gstreamer-original-notices-working-payload",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "payloads.update(",
  "replace": "dict.fromkeys(",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The actual selected build context must be preserved as payloads, not only recorded as metadata."
 },
 {
  "id": "lib.gstreamer-original-notices-working-identity",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "rust_package(working_context, profile)",
  "replace": "rust_package(originals, profile)",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The actual working Cargo package identity is checked even when original upstream manifests remain unchanged."
 },
 {
  "id": "lib.image-source-originals-gcc-release",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "policy.get(\"release\") == version",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "A different GCC version refuses before output allocation."
 },
 {
  "id": "lib.image-source-originals-gcc-hash",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "sha(payloads[name]) == expected",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "A rewritten original GCC notice cannot pass transport."
 },
 {
  "id": "lib.image-source-originals-gcc-checksum",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "payloads[\"source.sha512\"] == checksum.encode()",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "The image archive record must match the reviewed official checksum."
 },
 {
  "id": "lib.image-source-originals-gcc-url",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "payloads[\"source.url\"] == url.encode()",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "The original source URL record must match the selected release."
 },
 {
  "id": "lib.image-source-originals-exact-tree",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "actual == names",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "Missing and unexpected original tree members fail transport."
 },
 {
  "id": "lib.image-source-originals-gst-identity",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "all(record.get(name) == value for name, value in expected.items())",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "A changed GStreamer source record is rejected."
 },
 {
  "id": "lib.image-source-originals-gst-scope",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "record.get(\"binary_linkage_or_complete_license_source_closure_proven\") is False",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "An input record must not certify complete binary or source closure."
 },
 {
  "id": "lib.image-source-originals-gst-record-paths",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "set(record[\"files\"]) == set(profile[\"files\"])",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "Every selected original needs a matching record."
 },
 {
  "id": "lib.image-source-originals-gst-hash",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "sha(data) == expected",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "Modified GStreamer original bytes must fail."
 },
 {
  "id": "lib.image-source-originals-gst-file-record",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "record[\"files\"][name]\n            == {\"sha256\": expected, \"bytes\": len(data), \"kind\": role}",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "The file record must match the original bytes and role."
 },
 {
  "id": "lib.image-source-originals-working-hash",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "{name: sha(data) for name, data in working.items()}\n        == record[\"working_context_sha256\"]",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "Changed working manifest bytes must be detected."
 },
 {
  "id": "lib.image-source-originals-working-gtk",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "_gst[\"rust_package\"](working, profile) == record.get(\"gtk4_package\")",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "The GTK4 identity record must match the actual working manifests."
 },
 {
  "id": "lib.image-source-originals-patch-hash",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "sha(payloads[\"source.patch\"]) == record.get(\"source_patch_sha256\")",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "An altered source patch must not be transported as the original."
 },
 {
  "id": "lib.image-source-originals-patch-limit",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "max_bytes=8 * 1024 * 1024",
  "replace": "max_bytes=16 * 1024 * 1024",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "Oversized source patches refuse independently of their recorded hash."
 },
 {
  "id": "lib.image-source-originals-rust-selection",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "len(rust) == 1 and children == {\"monorepo\"} | rust",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "Ambiguous or missing Rust producer trees must fail."
 },
 {
  "id": "lib.image-source-originals-paired-version",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "(prefix is None) == (version is None)",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "An explicitly selected component also needs its version."
 },
 {
  "id": "lib.image-source-originals-output-scope",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "\"binary_linkage_or_complete_license_source_closure_proven\": False",
  "replace": "\"binary_linkage_or_complete_license_source_closure_proven\": True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "Transported originals cannot certify binary or full licence acceptance."
 },
 {
  "id": "lib.image-source-originals-companion-api",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "_shared.get(\"SOURCE_ORIGINALS_API\") != 1",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "An incompatible required original-file module fails before entrypoint parsing."
 },
 {
  "id": "lib.image-source-originals-companion-export",
  "target": "linux/scripts/03-media/build/gstreamer/common/stage-original-notices.py",
  "find": "not callable(_shared.get(_name))",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The required module exports are checked even for a help-only entry."
 },
 {
  "id": "lib.image-source-originals-outside-prefix",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "not destination.is_relative_to(prefix.absolute())",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "An output inside a selected image prefix refuses before writing."
 },
 {
  "id": "lib.image-source-originals-selection",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "args.gcc_prefix is not None or args.gstreamer_prefix is not None",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "An empty component selection cannot produce a successful receipt."
 },
 {
  "id": "lib.image-source-originals-gst-companion-api",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "_gst.get(\"GSTREAMER_SOURCE_NOTICES_API\") != 1",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "An incompatible required GStreamer contract refuses before parsing."
 },
 {
  "id": "lib.image-source-originals-gst-companion-export",
  "target": "linux/scripts/06-packaging/stage-image-source-originals.py",
  "find": "not callable(_gst.get(_name))",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k transport",
  "why": "Missing required GStreamer contract functions refuse before parsing."
 },
 {
  "id": "lib.image-source-originals-media-companion-mount",
  "target": "linux/Dockerfile.media",
  "find": "    --mount=type=bind,source=linux/scripts/01-core/source_originals.py,target=/opt/scripts/01-core/source_originals.py,readonly \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The producer's selected media RUN carries the required original-file module at its actual import location."
 },
 {
  "id": "lib.image-source-originals-media-smoke-common-copy",
  "target": "linux/Dockerfile.media",
  "find": "COPY --chmod=755 linux/scripts/06-packaging/smoke-common.sh linux/scripts/06-packaging/smoke-media.sh /opt/scripts/packaging/",
  "replace": "COPY --chmod=755 linux/scripts/06-packaging/smoke-media.sh /opt/scripts/packaging/",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The merged smoke closure still ships its shared companion."
 },
 {
  "id": "lib.image-source-originals-media-smoke-copy",
  "target": "linux/Dockerfile.media",
  "find": "COPY --chmod=755 linux/scripts/06-packaging/smoke-common.sh linux/scripts/06-packaging/smoke-media.sh /opt/scripts/packaging/",
  "replace": "COPY --chmod=755 linux/scripts/06-packaging/smoke-common.sh /opt/scripts/packaging/",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The merged smoke closure still ships its selected caller."
 },
 {
  "id": "lib.image-source-originals-relative-output",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "not Path(relative).is_absolute()\n            and all(part not in (\"\", \".\", \"..\") for part in relative.split(\"/\"))",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "The shared fresh writer rejects absolute and traversing payload paths before allocation."
 },
 {
  "id": "lib.image-source-originals-changed-size",
  "target": "linux/scripts/01-core/source_originals.py",
  "find": "len(data) == info.st_size",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k notice",
  "why": "A changed read size must fail even when the regular-file metadata was initially valid."
 },
 {
  "id": "package.image-source-originals-empty-default",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "if not expected[1] and name not in (allow_empty or set()):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-package-binary-verifier.sh",
  "why": "An empty archive source still refuses without explicit exact-member permission."
 },
 {
  "id": "package.image-source-originals-empty-specific",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "name not in (allow_empty or set())",
  "replace": "not allow_empty",
  "test": "bash linux/scripts/tests/test-package-binary-verifier.sh",
  "why": "Permission for one selected member cannot permit another empty member."
 },
 {
  "id": "package.image-source-originals-empty-selected",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "if allow_empty and not allow_empty <= rules.keys():",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-package-binary-verifier.sh",
  "why": "An allowance cannot refer to a member outside the selected rule set."
 },
 {
  "id": "package.image-source-originals-empty-duplicate",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "len(args.allow_empty) != len(set(args.allow_empty))",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-package-binary-verifier.sh",
  "why": "Duplicate empty-source permissions are rejected before verification."
 },
 {
  "id": "package.image-source-originals-flatpak-dispatch",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "elif args.package.suffix.lower() == \".flatpak\":",
  "replace": "elif args.package.suffix.lower() == \".unused\":",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "Exact Flatpak bytes use the shared private checkout rather than an unsupported fallback."
 },
 {
  "id": "package.image-source-originals-native-empty-forward",
  "target": "linux/scripts/06-packaging/appimage-verification.sh",
  "find": "empty_args=(--allow-empty \"$entry\")",
  "replace": "empty_args=()",
  "test": "bash linux/scripts/tests/test-verify-native-appimage-binary.sh",
  "why": "Native extraction retains explicit permission for the one selected empty member."
 },
 {
  "id": "package.image-source-originals-required-api",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "_module.get(_api) != 1",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "An incompatible required companion is rejected before argument parsing."
 },
 {
  "id": "package.image-source-originals-required-export",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "not callable(_module.get(_name))",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "Required companion callables are validated even for help."
 },
 {
  "id": "package.image-source-originals-record-identity",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "record.get(\"status\") == \"selected-image-source-originals-preserved\"",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "An unrelated record status cannot certify source-original transport."
 },
 {
  "id": "package.image-source-originals-record-scope",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "record.get(\"binary_linkage_or_complete_license_source_closure_proven\") is False",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "A source-original record must retain its explicit limited scope."
 },
 {
  "id": "package.image-source-originals-nonempty-record",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "isinstance(files, dict) and bool(files)",
  "replace": "isinstance(files, dict)",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "A metadata-only package cannot satisfy a selected original payload proof."
 },
 {
  "id": "package.image-source-originals-record-hash",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "expected == {\"sha256\": _originals[\"sha\"](data), \"bytes\": len(data)}",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "Changing both staged and packaged bytes still fails the retained original-file record."
 },
 {
  "id": "package.image-source-originals-record-byte-type",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "type(expected.get(\"bytes\")) is int",
  "replace": "True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "Boolean byte counts cannot masquerade as an integer file-size record."
 },
 {
  "id": "package.image-source-originals-empty-only-patch",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "allow_empty=patch",
  "replace": "allow_empty=True",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "Even a matching zero-size record cannot permit an empty GNU notice."
 },
 {
  "id": "package.image-source-originals-patch-bound",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "max_bytes=8 * 1024 * 1024 if patch",
  "replace": "max_bytes=16 * 1024 * 1024 if patch",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "A recorded and packaged oversized source patch still refuses before artifact verification."
 },
 {
  "id": "package.image-source-originals-exact-input-tree",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "_originals[\"exact_tree\"](root, set(files) | {\"source-originals.json\"})",
  "replace": "None",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "Unlisted staged input files cannot be silently excluded from the selected proof."
 },
 {
  "id": "package.image-source-originals-manifest-member",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "    rules.append(\n        (prefix + \"/source-originals.json\", root / \"source-originals.json\", False)\n    )",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "The original staging record itself must be read back from the artifact."
 },
 {
  "id": "package.image-source-originals-native-all-members",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "native = Path(__file__).with_name(\"verify-native-appimage-binary.sh\")\n        for member, source, empty in rules:",
  "replace": "native = Path(__file__).with_name(\"verify-native-appimage-binary.sh\")\n        for member, source, empty in rules[:1]:",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "Native readback checks later empty-patch and record members as well as the first notice."
 },
 {
  "id": "package.image-source-originals-archive-all-members",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "command = [sys.executable, \"-B\", str(BINARY), str(args.package)]\n        for member, source, empty in rules:",
  "replace": "command = [sys.executable, \"-B\", str(BINARY), str(args.package)]\n        for member, source, empty in rules[:1]:",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "Every selected archive member reaches the shared byte verifier."
 },
 {
  "id": "package.image-source-originals-native-empty-permission",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "command.append(\"--allow-empty-source\")",
  "replace": "None",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "The native reader receives the explicit empty-patch permission."
 },
 {
  "id": "package.image-source-originals-archive-empty-permission",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "command.extend((\"--allow-empty\", member))",
  "replace": "None",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "The generic reader receives the explicit permission for each recorded empty patch."
 },
 {
  "id": "package.image-source-originals-native-raw-failure",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "            if result.returncode:\n                return result.returncode",
  "replace": "            if result.returncode:\n                return 0",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "Native extraction or byte-verifier failure remains fatal with its raw status."
 },
 {
  "id": "package.image-source-originals-archive-raw-failure",
  "target": "linux/scripts/06-packaging/verify-image-source-originals.py",
  "find": "        if result.returncode:\n            return result.returncode",
  "replace": "        if result.returncode:\n            return 0",
  "test": "bash linux/scripts/tests/test-gstreamer-original-notices.sh -k package",
  "why": "A failed shared archive verifier cannot become a green source-original receipt."
 },
 {
  "id": "runtime-push.zstd-before-push",
  "target": "linux/scripts/01-core/runtime-push.sh",
  "find": "[ \"${CROSS_LAYER_COMPRESSION:-zstd}\" != zstd ] || _runtime_zstd_convert \"${tag}\"",
  "replace": "true || _runtime_zstd_convert \"${tag}\"",
  "test": "bash linux/scripts/tests/test-runtime-push.sh",
  "why": "the published runtime layers leave as zstd, as the owner decided for CON99"
 },
 {
  "id": "runtime-push.failed-conversion-stops",
  "target": "linux/scripts/01-core/runtime-push.sh",
  "find": "image convert --zstd --oci \"${tag}\" \"${staged}\" || return 1",
  "replace": "image convert --zstd --oci \"${tag}\" \"${staged}\" || true",
  "test": "bash linux/scripts/tests/test-runtime-push.sh",
  "why": "a conversion that failed must not push the image as built under a name that promises zstd"
 },
 {
  "id": "cmake-arch.cfg-bit-linked",
  "target": "cmake/Hardening.cmake",
  "find": "      /DYNAMICBASE\n      /guard:cf)",
  "replace": "      /DYNAMICBASE)",
  "test": "bash linux/scripts/tests/test-cmake-windows-arch.sh",
  "why": "without the linker's /guard:cf a Windows image carries no CFG bit, however the code was compiled"
 },
 {
  "id": "lib.ctest-run-log-pattern-output-only",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "            elif in_output and name and pattern.search(line):",
  "replace": "            elif name and pattern.search(line):",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "a test's Command line holds its own echo text; only its output may trip --fail-on-log-pattern"
 },
 {
  "id": "lib.ctest-run-log-pattern-verdict",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "    _ctest_run_check_log_pattern \"${CTEST_RUN_LOG_MARKER}\" || [[ \"${rc}\" -ne 0 ]] || rc=1",
  "replace": "    _ctest_run_check_log_pattern \"${CTEST_RUN_LOG_MARKER}\" || true",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "a passing ctest whose test logged a GStreamer-CRITICAL must still fail the run (CON291)"
 },
 {
  "id": "lib.ctest-run-log-pattern-this-run",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "-name 'LastTest*.log' -newer \"$1\"",
  "replace": "-name 'LastTest*.log'",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "an earlier run's LastTest log must not stand in for this one's"
 },
 {
  "id": "lib.gates-failure-is-annotated",
  "target": "linux/scripts/01-core/gates.sh",
  "find": "  _gate_annotate \"${name}\" \"${status}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gates-annotations.sh",
  "why": "on GitHub a failed gate must name itself among the run's annotations (CON293)"
 },
 {
  "id": "lib.gates-annotation-title-escaped",
  "target": "linux/scripts/01-core/gates.sh",
  "find": "title=\"${title//:/%3A}\"; ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gates-annotations.sh",
  "why": "an unescaped : in a gate name cuts the annotation's title short"
 },
 {
  "id": "cmake-arch.linux-relro-now-linked",
  "target": "cmake/Hardening.cmake",
  "find": "        -Wl,-z,relro\n        -Wl,-z,now)",
  "replace": "        -Wl,-z,relro)",
  "test": "bash linux/scripts/tests/test-cmake-hardening-linux.sh",
  "why": "without -z now a Linux image binds lazily and keeps its GOT writable (CON294)"
 },
 {
  "id": "cmake-arch.linux-pie",
  "target": "cmake/Hardening.cmake",
  "find": "      set(CMAKE_POSITION_INDEPENDENT_CODE ON)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cmake-hardening-linux.sh",
  "why": "a Linux executable without PIE loads at a fixed address"
 },
 {
  "id": "cmake-arch.linux-flags-linux-only",
  "target": "cmake/Hardening.cmake",
  "find": "    if(CMAKE_SYSTEM_NAME STREQUAL \"Linux\")\n      get_property(_hardening_languages",
  "replace": "    if(TRUE)\n      get_property(_hardening_languages",
  "test": "bash linux/scripts/tests/test-cmake-hardening-linux.sh",
  "why": "ld64 knows no -z relro: an Apple link must not get the Linux flags"
 },
 {
  "id": "cmake-arch.global-link-flags-joined",
  "target": "cmake/Hardening.cmake",
  "find": "    set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS} ${_hardening_link_flags}\")",
  "replace": "    set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS} ${NEW_LINK_OPTIONS}\")",
  "test": "bash linux/scripts/tests/test-cmake-hardening-linux.sh",
  "why": "a list's semicolons in the global linker flags end the link command line"
 },
 {
  "id": "packaging.elf-hardening-pie",
  "target": "linux/scripts/06-packaging/verify-elf-hardening.sh",
  "find": "    if grep -Eq '^ *Type: +DYN ' <<< \"${header}\" && grep -Eq '^ *INTERP ' <<< \"${program}\"; then",
  "replace": "    if true; then",
  "test": "bash linux/scripts/tests/test-verify-elf-hardening.sh",
  "why": "an executable that is not PIE must fail the gate"
 },
 {
  "id": "packaging.elf-hardening-relro",
  "target": "linux/scripts/06-packaging/verify-elf-hardening.sh",
  "find": "  if grep -Eq '^ *GNU_RELRO ' <<< \"${program}\"; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-verify-elf-hardening.sh",
  "why": "an ELF without a GNU_RELRO segment must fail the gate"
 },
 {
  "id": "packaging.elf-hardening-bind-now",
  "target": "linux/scripts/06-packaging/verify-elf-hardening.sh",
  "find": "  if grep -Eq '\\(FLAGS\\).*\\bBIND_NOW\\b|\\(FLAGS_1\\).*\\bNOW\\b' <<< \"${dynamic}\"; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-verify-elf-hardening.sh",
  "why": "a lazily bound ELF must fail the gate"
 },
 {
  "id": "packaging.elf-hardening-stack-protector",
  "target": "linux/scripts/06-packaging/verify-elf-hardening.sh",
  "find": "  if grep -qx '__stack_chk_fail' <<< \"${imports}\"; then",
  "replace": "  if true; then",
  "test": "bash linux/scripts/tests/test-verify-elf-hardening.sh",
  "why": "an ELF built without the stack protector must fail the gate"
 },
 {
  "id": "packaging.elf-hardening-fortify",
  "target": "linux/scripts/06-packaging/verify-elf-hardening.sh",
  "find": "  elif [[ \"${fortify}\" == fortify ]]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-verify-elf-hardening.sh",
  "why": "an ELF without a __*_chk import must fail unless its spec says no-fortify"
 },
 {
  "id": "packaging.elf-hardening-verdict",
  "target": "linux/scripts/06-packaging/verify-elf-hardening.sh",
  "find": "  printf 'hardening: %d check(s) failed\\n' \"${failures}\" >&2\n  exit 1",
  "replace": "  printf 'hardening: %d check(s) failed\\n' \"${failures}\" >&2\n  exit 0",
  "test": "bash linux/scripts/tests/test-verify-elf-hardening.sh",
  "why": "a failed check must end the gate with exit 1"
 },
 {
  "id": "lib.ort-plugin-native-existing-forward-optin",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "        if (!ensure_registered(plugin, bundled_directory, error, reuse_existing)) { return false; }",
  "replace": "        if (!ensure_registered(plugin, bundled_directory, error, (static_cast<void>(reuse_existing), false))) { return false; }",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "The explicit append opt-in must reach registration policy."
 },
 {
  "id": "lib.ort-plugin-native-existing-append-default",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "      const ProviderOptions &provider_options,\n      std::string &error,\n      bool reuse_existing = false) -> bool",
  "replace": "      const ProviderOptions &provider_options,\n      std::string &error,\n      bool reuse_existing = true) -> bool",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Ordinary append retains strict native registration."
 },
 {
  "id": "lib.ort-plugin-native-existing-explicit-default",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "    auto ensure_registered(const PluginLibrary &plugin,\n      const std::filesystem::path &bundled_directory,\n      std::string &error,\n      bool reuse_existing = false) -> bool",
  "replace": "    auto ensure_registered(const PluginLibrary &plugin,\n      const std::filesystem::path &bundled_directory,\n      std::string &error,\n      bool reuse_existing = true) -> bool",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Explicit register_library must not adopt an external device."
 },
 {
  "id": "lib.ort-plugin-native-existing-enumeration-status",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "            const auto *existing = select_device(plugin.name, 0, error, false);\n            if (!error.empty()) { return false; }",
  "replace": "            const auto *existing = select_device(plugin.name, 0, error, false);\n            error.clear();",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "An external device query failure cannot become absent-device registration."
 },
 {
  "id": "lib.ort-plugin-native-existing-external-ownership",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "            if (existing != nullptr) { return true; }",
  "replace": "            if (existing != nullptr) { registered_.emplace(name, *path); return true; }",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "Reused external factories must not enter the owned registration report."
 },
 {
  "id": "lib.ort-plugin-native-existing-absent-device",
  "target": "shared/native/ort_plugin_eps.hpp",
  "find": "            const auto *existing = select_device(plugin.name, 0, error, false);",
  "replace": "            const auto *existing = select_device(plugin.name, 0, error, true);",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "A genuinely absent external device requires registration before final selection."
 },
 {
  "id": "lib.ort-plugin-native-existing-suite-reuse",
  "target": "shared/native/tests/ort_plugin_eps_test.cpp",
  "find": "        existing_device_reuse(bundle);",
  "replace": "        static_cast<void>(&existing_device_reuse);",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "The independent external-case counter rejects a compile-valid omitted fixture group."
 },
 {
  "id": "lib.ort-plugin-native-existing-suite-errors",
  "target": "shared/native/tests/ort_plugin_eps_test.cpp",
  "find": "        existing_device_failures(bundle);",
  "replace": "        static_cast<void>(&existing_device_failures);",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "The independent external-case counter rejects a compile-valid omitted fixture group."
 },
 {
  "id": "lib.ort-plugin-native-existing-suite-paths",
  "target": "shared/native/tests/ort_plugin_eps_test.cpp",
  "find": "        existing_device_paths(root, bundle);",
  "replace": "        static_cast<void>(&existing_device_paths);",
  "test": "bash linux/scripts/tests/test-ort-plugin-native.sh",
  "why": "The independent external-case counter rejects a compile-valid omitted fixture group."
 },
 {
  "id": "lib.ort-plugin-native-mutation-compile-status",
  "target": "linux/scripts/tests/ort_plugin_native_tests.py",
  "find": "        if result.returncode:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-ort-plugin-native-mutation-controls.sh",
  "why": "A compiler or linker failure cannot satisfy a semantic control."
 },
 {
  "id": "lib.ort-plugin-native-mutation-fatal-warning",
  "target": "linux/scripts/tests/ort_plugin_native_tests.py",
  "find": "\"-Wall\", \"-Wextra\", \"-Werror\", \"-pthread\"",
  "replace": "\"-Wall\", \"-Wextra\", \"-pthread\"",
  "test": "bash linux/scripts/tests/test-ort-plugin-native-mutation-controls.sh",
  "why": "The unused-parameter negative control requires fatal compiler warnings."
 },
 {
  "id": "lib.ort-plugin-native-mutation-abnormal-status",
  "target": "linux/scripts/tests/ort_plugin_native_tests.py",
  "find": "    if result.returncode not in (0, 1):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-native-mutation-controls.sh",
  "why": "Crashes cannot count as assertion failures."
 },
 {
  "id": "lib.ort-plugin-native-mutation-assertion-diagnostic",
  "target": "linux/scripts/tests/ort_plugin_native_tests.py",
  "find": "    if result.returncode == 1 and not result.stderr.startswith(\"CHECK failed:\"):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-native-mutation-controls.sh",
  "why": "An unexplained native failure cannot count as a policy assertion."
 },
 {
  "id": "lib.ort-plugin-native-mutation-count-report",
  "target": "linux/scripts/tests/ort_plugin_native_tests.py",
  "find": "    if result.returncode == 0 and POLICY_REPORT.fullmatch(result.stdout) is None:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-ort-plugin-native-mutation-controls.sh",
  "why": "Malformed output cannot count as a lower independent check counter."
 },
 {
  "id": "lib.ort-plugin-native-mutation-execute-cases",
  "target": "linux/scripts/tests/ort_plugin_native_tests.py",
  "find": "        for row in self.cases:\n",
  "replace": "        for row in []:\n",
  "test": "bash linux/scripts/tests/test-ort-plugin-native-mutation-controls.sh",
  "why": "The executed count rejects an empty native mutation loop."
 },
 {
  "id": "lib.ort-plugin-native-mutation-select-suite",
  "target": "linux/scripts/tests/ort_plugin_native_tests.py",
  "find": "        selection = \"NativeMutationControls\"",
  "replace": "        selection = \"NativePluginTests\"",
  "test": "bash linux/scripts/tests/test-ort-plugin-native-mutation-controls.sh",
  "why": "The shell suite requires the explicit semantic-case marker."
 },
 {
  "id": "lib.ort-plugin-native-mutation-require-semantic-red",
  "target": "linux/scripts/tests/ort_plugin_native_tests.py",
  "find": "    with test.assertRaises(AssertionError):\n        assert_native_policy(test, result)",
  "replace": "    if False:\n        assert_native_policy(test, result)",
  "test": "bash linux/scripts/tests/test-ort-plugin-native-mutation-controls.sh",
  "why": "An unchanged passing fixture cannot satisfy the negative-control validator."
 },
 {
  "id": "host.direct-preflight-groups",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(all(passes[name] == headings[name] == 1 for name in groups),",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "A missing or repeated outer canonical group must refuse."
 },
 {
  "id": "host.direct-preflight-suites",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(suites == len(names) == len(set(names)) == invocation[\"expected_script_suites\"]\n            and set(names) == discovered and assertions > 0,",
  "replace": "require(assertions > 0,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "A duplicated suite cannot replace a missing discovered suite."
 },
 {
  "id": "host.direct-preflight-terminal",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "successful_unit(seal[\"terminal\"], invocation[\"unit\"])",
  "replace": "str(seal[\"terminal\"])",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "Retained positive terminal identity is mandatory even after unit disappearance."
 },
 {
  "id": "host.direct-preflight-raw-status",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require((directory / \"compiler-cache/exit-status.txt\").read_text() == \"command_status=0\\ncache_stats_status=0\\n\",",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "A failed raw command cannot be accepted from passing inner logs."
 },
 {
  "id": "host.direct-preflight-sealed-inputs",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(seal[\"inputs\"] == {str(path): fingerprint(path) for path in (manifest, mutations)},",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "Changed strict-seal inputs must refuse before source acceptance."
 },
 {
  "id": "host.direct-preflight-slice",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(extraction[\"source_sha256\"] == hashlib.sha256(raw).hexdigest()\n            and raw[extraction[\"start_byte\"]:extraction[\"end_byte_exclusive\"]] == mutations.read_bytes()\n            and extraction[\"mutation_job_sha256\"] == fingerprint(mutations),",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "The mutation slice must be exact original log bytes."
 },
 {
  "id": "host.direct-preflight-cleanup-status",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(cleanup[\"exit_status\"] == 0 and cleanup[\"finished_at\"],",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "An original cleanup failure cannot produce an accepted receipt."
 },
 {
  "id": "host.direct-preflight-cleanup-owner",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(cleanup[\"run_id\"] == invocation[\"run_id\"] and cleanup[\"owner_label\"] == invocation[\"owner_label\"]\n            and cleanup[\"cidfile\"] == str(directory / \"container.cid\"),",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "Cleanup must belong to the exact original invocation."
 },
 {
  "id": "host.direct-preflight-reports",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(directory.stat().st_mode & 0o777 == 0o700 and (directory / \"reports\").stat().st_mode & 0o777 == 0o755,",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "Closed reports must not retain their temporary world-writable mode."
 },
 {
  "id": "host.direct-preflight-filters",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require([value for value in environment if value.startswith(name + \"=\")] == [name + \"=\"],",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "Observed preflight filters cannot stand for complete source coverage."
 },
 {
  "id": "host.direct-preflight-query",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(all(row[\"returncode\"] == 0 and not row[\"stdout\"].strip() for row in rows),",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "Failed or nonempty independent queries cannot prove container absence."
 },
 {
  "id": "host.direct-preflight-input-drift",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(PRESERVER[\"working_snapshot\"](source) == snapshot and all(fingerprint(Path(path)) == digest for path, digest in hashes.items()),",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "A changed input after validation must refuse final publication of the local receipt."
 },
 {
  "id": "host.direct-preflight-cache-statistics",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(isinstance(read(directory / \"compiler-cache/cache-stats.json\").get(\"stats\"), dict),",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "A malformed captured cache record cannot become a complete source receipt from a zero status alone."
 },
 {
  "id": "host.direct-preflight-runner-policy",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "require(runner == (Path(reference[\"source_snapshot\"]) / runner_name).read_bytes(),",
  "replace": "require(True,",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "Suite discovery must use the same canonical runner as the accepted reference."
 },
 {
  "id": "host.direct-preflight-harness-library",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "    excluded = set(re.findall(r'^\\s*\\[ \"\\$\\(basename \"\\$\\{suite\\}\"\\)\" = \"([^\"\\n]+)\" \\] && continue\\b', runner.decode(), re.MULTILINE))",
  "replace": "    excluded = set()",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "The canonical runner excludes its harness library; the receipt must not count it as a test."
 },
 {
  "id": "host.direct-preflight-suite-file",
  "target": "linux/scripts/local-proof/complete-direct-preflight.py",
  "find": "if path.is_file()} - excluded",
  "replace": "} - excluded",
  "test": "bash linux/scripts/tests/test-direct-preflight-receipt.sh",
  "why": "A directory named like a shell suite is not run by the canonical runner."
 },
 {
  "id": "packaging.immutable-helper-library-paths",
  "target": "cmake/CPackCommon.cmake",
  "find": "if(NOT\n         _directory\n         MATCHES\n         \"^[A-Za-z0-9_./+ -]+$\"\n         OR IS_ABSOLUTE \"${_directory}\"\n         OR _directory MATCHES \"(^|/)\\\\.\\\\.?(/|$)|/$\")",
  "replace": "if(FALSE)",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Immutable helper library directories must be safe relative paths."
 },
 {
  "id": "packaging.immutable-helper-helper-paths",
  "target": "cmake/CPackCommon.cmake",
  "find": "if(NOT\n       _path\n       MATCHES\n       \"^[A-Za-z0-9_./+ -]+$\"\n       OR IS_ABSOLUTE \"${_path}\"\n       OR _path MATCHES \"(^|/)\\\\.\\\\.?(/|$)|/$\")",
  "replace": "if(FALSE)",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Immutable helper paths must refuse traversal and absolute selections."
 },
 {
  "id": "packaging.immutable-helper-unique-basename",
  "target": "cmake/CPackCommon.cmake",
  "find": "if(_name IN_LIST _names)",
  "replace": "if(FALSE)",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Different installed directories cannot collide in one private native payload name."
 },
 {
  "id": "packaging.immutable-helper-requires-loader",
  "target": "cmake/CPackCommon.cmake",
  "find": "if(ARG_IMMUTABLE_HELPERS AND NOT ARG_LOADER)",
  "replace": "if(FALSE)",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "An immutable helper declaration requires the shared portable launcher."
 },
 {
  "id": "packaging.immutable-helper-preserve-forwarding",
  "target": "cmake/CPackCommon.cmake",
  "find": "--preserve-bytes ${_external}",
  "replace": "${_external}",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "CMake must actually request byte-preserving helper transport."
 },
 {
  "id": "packaging.immutable-helper-protect-native-path",
  "target": "cmake/CPackCommon.cmake",
  "find": "  list(APPEND ARG_PROTECT ${_helper_protect})",
  "replace": "  set(_helper_protection_removed TRUE)",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "The ELF closure must not rewrite the exact private helper payload."
 },
 {
  "id": "packaging.immutable-helper-final-staged-hash",
  "target": "cmake/CPackCommon.cmake",
  "find": "${_helper_verify}\")",
  "replace": "\")",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "A successful closure that altered a helper must still fail installation."
 },
 {
  "id": "packaging.immutable-helper-appimage-helper-list",
  "target": "cmake/CPackCommon.cmake",
  "find": "${_keep_ort}${_helper_keep}",
  "replace": "${_keep_ort}",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "One AppImage patcher must preserve helpers together with optional ORT files."
 },
 {
  "id": "packaging.immutable-helper-library-only-targets",
  "target": "cmake/CPackCommon.cmake",
  "find": "if(_loader_args OR NOT ARG_IMMUTABLE_HELPERS)",
  "replace": "if(TRUE)",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "A non-bin helper with library-only targets must not run an empty ordinary launcher step."
 },
 {
  "id": "packaging.immutable-helper-external-sdk-forwarding",
  "target": "cmake/CPackCommon.cmake",
  "find": "set(_external \"--external-library-path\")",
  "replace": "set(_external \"\")",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Opted-in helpers must retain the host SDK library path on both branches."
 },
 {
  "id": "packaging.immutable-helper-library-containment",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "[[ \"${LIB_DIR}\" == \"${BUNDLE}/\"* ]] || err \"immutable helper libraries must stay inside the bundle\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "An escaping helper library directory must fail before allocation."
 },
 {
  "id": "packaging.immutable-helper-executable-mode",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "[ -x \"${exe}\" ] && [ ! -L \"${exe}\" ]",
  "replace": "[ -e \"${exe}\" ] && [ ! -L \"${exe}\" ]",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "A regular helper input must be executable before staging."
 },
 {
  "id": "packaging.immutable-helper-input-symlink",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "[ ! -L \"${exe}\" ] && [[ \"${resolved}\"",
  "replace": "[ -e \"${exe}\" ] && [[ \"${resolved}\"",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Even an internal absolute symlink cannot be a selected original helper."
 },
 {
  "id": "packaging.immutable-helper-source-containment",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "[[ \"${resolved}\" == \"${BUNDLE}/\"* ]]",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "An executable selected through traversal must stay outside the staged transport."
 },
 {
  "id": "packaging.immutable-helper-legacy-rpath",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "if grep -q '(RPATH)' <<< \"${dynamic}\"; then err \"${rel} has legacy RPATH which precedes the private library path\"; fi",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Legacy RPATH would precede the private library path and must refuse immutable transport."
 },
 {
  "id": "packaging.immutable-helper-payload-collision",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "[ ! -e \"${home}/${real}\" ] && [ ! -L \"${home}/${real}\" ] || err \"payload already exists at ${home}/${real}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "An existing private native payload must remain unchanged."
 },
 {
  "id": "packaging.immutable-helper-post-move-hash",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "[ \"$(sha256sum < \"${home}/${real}\")\" = \"${original_hash}\" ] || err \"${rel}: original executable bytes changed\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "A successful move that altered bytes cannot publish a launcher."
 },
 {
  "id": "packaging.immutable-helper-skip-runpath-rewrite",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "    byte_policy=$'\\n# Original executable bytes must survive package hash checks.'",
  "replace": "    move_runpath \"${exe_dir}\" \"${home}/${real}\"\n    byte_policy=$'\\n# Original executable bytes must survive package hash checks.'",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Byte preservation must not rewrite a helper RUNPATH during relocation."
 },
 {
  "id": "packaging.immutable-helper-host-private-path",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "external_setup=\"$(printf '\\nexport LD_LIBRARY_PATH=\"$here/%s%s\"' \"${to_lib}\" \"${library_suffix}\")\"",
  "replace": "external_setup=\"\"",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "The host loader must find the private dependencies of an unchanged helper."
 },
 {
  "id": "packaging.immutable-helper-policy-boundary",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "[ \"${PRESERVE_BYTES}\" = \"${preserved}\" ] || err \"${rel} has a different byte-preservation policy; restage the executable\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Dropping byte preservation on an existing immutable launcher must refuse."
 },
 {
  "id": "packaging.immutable-helper-patcher-final-target",
  "target": "linux/scripts/06-packaging/patchelf-keep-glibc.sh",
  "find": "target=\"${!#}\"",
  "replace": "target=\"$2\"",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "A patchelf flag value with a preserved name must not suppress an unrelated patch."
 },
 {
  "id": "packaging.immutable-helper-patcher-literal-names",
  "target": "linux/scripts/06-packaging/patchelf-keep-glibc.sh",
  "find": "[[ $# -ge 2 && \"$2\" =~ ^[a-zA-Z0-9_.+\\ -]+$ && \"$2\" != . && \"$2\" != .. ]]",
  "replace": "[[ $# -ge 2 ]]",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Malformed or nonliteral preserved basenames must return the explicit usage status."
 },
 {
  "id": "packaging.immutable-helper-patcher-raw-status",
  "target": "linux/scripts/06-packaging/patchelf-keep-glibc.sh",
  "find": "exec \"${KATAGLYPHIS_PATCHELF:-patchelf}\" \"$@\"",
  "replace": "\"${KATAGLYPHIS_PATCHELF:-patchelf}\" \"$@\" || true",
  "test": "bash linux/scripts/tests/test-linux-immutable-helpers.sh",
  "why": "Unselected targets retain the real patchelf failure status."
 },
 {
  "id": "compiler-llvm-tools.opencv-cache-reader-phase",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "    'opencv': 'bash /opt/scripts/03-media/build/opencv/build-opencv.sh ',\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The original OpenCV Dockerfile RUN needs an explicit Media phase."
 },
 {
  "id": "compiler-llvm-tools.opencv-cache-reader-component",
  "target": "linux/scripts/local-proof/cache_capture_profile.py",
  "find": "'opencv': 'bash /opt/scripts/03-media/build/opencv/build-opencv.sh '",
  "replace": "'opencv': 'bash /opt/scripts/03-media/build/opencv/install-deps.sh '",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The OpenCV build and dependency setup must remain distinct."
 },
 {
  "id": "compiler-llvm-tools.opencv-cache-reader-drain-lifetime",
  "target": "linux/scripts/local-proof/capture-live-sccache-log.py",
  "find": "        assert drain == 'bash /opt/scripts/core/sccache-s3-level.sh drain', 'OpenCV requires the outer RUN through its final drain'",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-live-cache-capture.sh",
  "why": "The child build and an unrelated tail cannot supply the outer drain lifetime."
 },
 {
  "id": "lib.onnx-wasm-proof-delivery-factory-replay",
  "target": "linux/scripts/03-media/build/onnxruntime/build/web-wasm-cache.sh",
  "find": "then action=replay; fi",
  "replace": "then action=verify; fi",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "A populated output cache still needs an actual Asyncify and JSPI factory replay after JS."
 },
 {
  "id": "lib.onnx-wasm-proof-delivery-disabled-core",
  "target": "linux/scripts/03-media/build/onnxruntime/build/web-wasm-cache.sh",
  "find": "&& [ \"${ORT_WASM_WEBGPU_FLAVORS}\" = true ]; then action=replay; fi",
  "replace": "; then action=replay; fi",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "Explicitly disabled optional flavors keep strict artifact verification without requiring a missing plugin."
 },
 {
  "id": "lib.onnx-wasm-proof-delivery-factory-status",
  "target": "linux/scripts/03-media/build/onnxruntime/build/web-wasm-cache.sh",
  "find": "exec \"${proof[@]}\" \"${action}\" --prefix \"${WASM_OUTPUT_DIR}\" \"${options[@]}\"",
  "replace": "\"${proof[@]}\" \"${action}\" --prefix \"${WASM_OUTPUT_DIR}\" \"${options[@]}\" || true; exit 0",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "A post-JS factory failure must fail the Media delivery RUN."
 },
 {
  "id": "lib.onnx-wasm-proof-delivery-recheck-all",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/ort-webgpu-wasm-proof.py",
  "find": "    if checked_receipt(args, True) != receipt:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "A later Node probe must not be able to change the earlier flavor while leaving a green delivery verdict."
 },
 {
  "id": "lib.onnx-wasm-proof-docker-delivery-strict",
  "target": "linux/Dockerfile.media",
  "find": "if [ \"${ORT_WEB_REQUIRED}\" = 1 ]; then",
  "replace": "if [ \"${ORT_WEB_REQUIRED}\" = 0 ]; then",
  "test": "bash linux/scripts/tests/test-onnx-web-cache.sh",
  "why": "Only strict builds run the post-JS delivery gate."
 },
 {
  "id": "compiler-llvm-tools.foreign-sdk-target-driver-elf",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "            assert re.search(rf'^\\s*Machine:\\s+{machine}\\s*$', helpers['output'](row['elf']), re.MULTILINE), 'Target-native SDK driver has the wrong ELF machine'\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "Foreign SDK driver bytes must match its target architecture."
 },
 {
  "id": "compiler-llvm-tools.foreign-sdk-retain-host-toolchain",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "        assert materialized['host_prefix_is_real'] is True, 'Foreign SDK must retain its host-native tool prefix'\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The build host must retain its original native LLVM prefix."
 },
 {
  "id": "compiler-llvm-tools.foreign-sdk-image-host-architecture",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "    assert image['Os'] == 'linux' and image['Architecture'] == 'amd64', 'Foreign SDK must use the Linux amd64 build image'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "An OCI tag naming a foreign target still selects the native Linux amd64 SDK build image."
 },
 {
  "id": "compiler-llvm-tools.foreign-sdk-image-target-environment",
  "target": "linux/scripts/local-proof/proof_subject.py",
  "find": "        assert [row for row in environment if row.startswith(key + '=')] == [key + '=' + expected], 'Foreign SDK image environment differs: ' + key\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "The image must retain one exact target architecture and build mode."
 },
 {
  "id": "compiler-llvm-tools.foreign-sdk-launch-image-binding",
  "target": "linux/scripts/local-proof/compiler-image-qualification.py",
  "find": "        validate_foreign_sdk_image(image, subject)\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_launch_transport",
  "why": "The real SDK launch path rejects the wrong baked target before allocating output."
 },
 {
  "id": "compiler-llvm-tools.foreign-sdk-caller-target-bound",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "    assert subject['kind'] == 'sdk-' + arch, 'SDK parent target differs'\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "An amd64 caller must not receive another target SDK even with valid OCI bytes."
 },
 {
  "id": "compiler-llvm-tools.foreign-sdk-media-arch",
  "target": "linux/scripts/local-proof/default_media_launch.py",
  "find": "repo, 'default', arch, 'sdk'",
  "replace": "repo, 'default', 'amd64', 'sdk'",
  "test": "bash linux/scripts/tests/test-default-media-launch.sh",
  "why": "The ordinary default Media stage must keep the exact target selected in the proved SDK."
 },
 {
  "id": "compiler-llvm-tools.foreign-sdk-static-executions",
  "target": "linux/scripts/local-proof/probe-cross-clang-image.py",
  "find": "2 * len(targets.keys() - {'amd64'})",
  "replace": "2 * (len(targets) - 1)",
  "test": "bash linux/scripts/tests/test-local-proof-tools.sh -k sdk_image_profile_refusals",
  "why": "A selected foreign SDK needs both target static executions even when there is only one active target."
 },
 {
  "id": "compiler-llvm-tools.default-handoff-stage-scope",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert invocation['variant'] == variant and invocation['stage'] == stage, 'Stage profile scope differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "Default stage receipts must identify their actual lane."
 },
 {
  "id": "compiler-llvm-tools.default-handoff-same-target",
  "target": "linux/scripts/local-proof/default_handoff_profile.py",
  "find": "assert previous['target_arch'] == arch, 'Default parent target differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "The AMD64 build host cannot stand in for a matching artifact target."
 },
 {
  "id": "compiler-llvm-tools.default-handoff-environment",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "assert selected_values == [expected], 'Stage environment binding differs: ' + prefix",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "A second conflicting environment flag must refuse."
 },
 {
  "id": "compiler-llvm-tools.default-handoff-baked-reader",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "        validate_config(native[2])",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "The reader must verify the baked target from the rehashed OCI configuration."
 },
 {
  "id": "compiler-llvm-tools.default-handoff-baked-seal",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "        default_image_config(child[2], invocation['target_arch'])",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "The original export seal must check the actual baked target before writing a receipt."
 },
 {
  "id": "compiler-llvm-tools.default-handoff-sdk-parent",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "'default-media': ('Media', 'SDK')",
  "replace": "'default-media': ('Media', 'GPU')",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "Default Media must link every SDK ancestor."
 },
 {
  "id": "compiler-llvm-tools.default-handoff-native-status",
  "target": "linux/scripts/local-proof/native_oci_seed.py",
  "find": " or proof['status'] in FOREIGN_DEFAULT_STATUSES or proof['status'] in NVIDIA_STAGE_STATUSES, 'Verified native OCI parent required'",
  "replace": " or proof['status'] in NVIDIA_STAGE_STATUSES, 'Verified native OCI parent required'",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "The canonical byte reader must recognize the exact reviewed foreign default statuses."
 },
 {
  "id": "compiler-llvm-tools.default-handoff-android-variant",
  "target": "linux/scripts/local-proof/launch-normal-android.py",
  "find": "if args.variant == 'default':",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "The explicit default Android entry must invoke the matching qualified Media profile."
 },
 {
  "id": "compiler-llvm-tools.default-handoff-worker-closure",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "'default_handoff_profile.py', 'default_media_launch.py',",
  "replace": "'default_media_launch.py',",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "Default workers bind the shared profile bytes."
 },
 {
  "id": "compiler-llvm-tools.default-runtime-cli",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "if args.variant == 'default':",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The explicit default CLI must load and consume the same-target default Android proof."
 },
 {
  "id": "compiler-llvm-tools.default-runtime-wheel-export",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'PYTORCH_EXTRA=pytorch-cpu', 'RUNTIME_WHEELS_SOURCE=export'",
  "replace": "'PYTORCH_EXTRA=pytorch-cpu', 'RUNTIME_WHEELS_SOURCE=image'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The reviewed default lane uses the canonical sealed wheelhouse export."
 },
 {
  "id": "compiler-llvm-tools.default-runtime-host-platform",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'CROSS_BUILD_PLATFORM=linux/amd64', 'CROSS_BUILDKIT_KEEP_GB=120'",
  "replace": "'CROSS_BUILD_PLATFORM=linux/arm64', 'CROSS_BUILDKIT_KEEP_GB=120'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Default Android remains an amd64 build-host image even for a foreign runtime target."
 },
 {
  "id": "compiler-llvm-tools.default-runtime-export-platform",
  "target": "linux/scripts/lib-runtime-wheels.sh",
  "find": "    platform=\"$(runtime_artifact_platform \"${arch}\")\" || return 1\n",
  "replace": "    platform=\"linux/${arch}\"\n",
  "test": "bash linux/scripts/tests/test-runtime-wheels-source.sh",
  "why": "A local OCI wheel-only build resolves the Android platform while the wrapper keeps its own target."
 },
 {
  "id": "compiler-llvm-tools.default-runtime-final-parent",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    default_parent_binding(invocation, android, proof, android_path)\n",
  "replace": "    pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Local FINAL retains the declared default Android provenance and checked scope."
 },
 {
  "id": "compiler-llvm-tools.default-runtime-final-target",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "default_status('android', arch)",
  "replace": "default_status('android', 'amd64')",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "An ARM64 local runtime must not consume an amd64-scoped Android receipt."
 },
 {
  "id": "compiler-llvm-tools.default-runtime-worker",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'default_handoff_profile.py', 'default_media_launch.py',",
  "replace": "'default_media_launch.py',",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The default host launcher binds the checked default handoff module."
 },
 {
  "id": "compiler-llvm-tools.default-runtime-final-normalization",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "        android = {**android, 'variant': ''}\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Default Android invocation scope must map to the canonical default runtime variant."
 },
 {
  "id": "compiler-llvm-tools.default-runtime-scope-android",
  "target": "linux/scripts/local-proof/default_handoff_profile.py",
  "find": "default_layout(proof_path, invocation_path, invocation, parent, 'android', 'Media')",
  "replace": "default_layout(proof_path, invocation_path, invocation, parent, 'media', 'SDK')",
  "test": "bash linux/scripts/tests/test-default-handoff.sh",
  "why": "Default Android reader keeps the matching Media parent and the Android producer scope."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-gpu-entry",
  "target": "linux/scripts/local-proof/launch-normal-gpu.py",
  "find": "if args.variant == 'nvidia':",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "Each public launcher must dispatch the explicit NVIDIA profile on the selected target."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-media-entry",
  "target": "linux/scripts/local-proof/launch-normal-media.py",
  "find": "if args.variant == 'nvidia':",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "Each public launcher must dispatch the explicit NVIDIA profile on the selected target."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-export-route",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "elif args.variant == 'nvidia':",
  "replace": "elif False:",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "Each native OCI exporter must select the matching NVIDIA stage reader."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-export-baked",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "        nvidia_image_config(child[2], invocation['target_arch'], media=kind != 'nvidia-gpu')",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The seal refuses a different baked target or disabled Media TensorRT before writing a receipt."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-media-worker",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "'nvidia_handoff_profile.py', 'default_media_launch.py', 'webgpu_media_lanes.py',",
  "replace": "'default_media_launch.py', 'webgpu_media_lanes.py',",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The export worker closure binds the exact NVIDIA profile bytes."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-sdk-target",
  "target": "linux/scripts/local-proof/nvidia_handoff_profile.py",
  "find": "    assert previous['target_arch'] == arch, 'NVIDIA parent target differs'",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "A Linux amd64 host manifest cannot stand in for the same SDK or GPU target."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-arm64-sbsa",
  "target": "linux/scripts/local-proof/nvidia_handoff_profile.py",
  "find": "environment.append('CROSS_NVIDIA_SBSA=1')",
  "replace": "environment.append('CROSS_NVIDIA_SBSA=0')",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The ordinary arm64 GPU invocation must select NVIDIA cross SBSA."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-wasm",
  "target": "linux/scripts/local-proof/nvidia_handoff_profile.py",
  "find": "    validate_wasm_modes(invocation)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The Media reader requires both Wasm modes on the receipt it is exporting."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-media-disk",
  "target": "linux/scripts/local-proof/nvidia_handoff_profile.py",
  "find": "max(plan['required_bytes'], MEDIA_REQUIRED_BYTES)",
  "replace": "plan['required_bytes']",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "An eligible 180-GiB GPU plan cannot lower NVIDIA Media build admission."
 },
 {
  "id": "compiler-llvm-tools.nvidia-handoff-media-export-disk",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert disk['available_bytes'] >= MEDIA_REQUIRED_BYTES, 'NVIDIA Media export requires 300 GiB'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "Media export must refuse one byte below the unchanged chain reserve."
 },
 {
  "id": "compiler-llvm-tools.rocm-handoff-media-disk",
  "target": "linux/scripts/local-proof/launch-normal-media.py",
  "find": "max(plan['required_bytes'], MEDIA_REQUIRED_BYTES)",
  "replace": "plan['required_bytes']",
  "test": "bash linux/scripts/tests/test-gpu-handoff.sh",
  "why": "The ordinary ROCm Media entry also retains the chain disk floor."
 },
 {
  "id": "compiler-llvm-tools.nvidia-android-entry",
  "target": "linux/scripts/local-proof/launch-normal-android.py",
  "find": "if args.variant == 'nvidia':",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The ordinary Android launcher must dispatch the explicit NVIDIA profile."
 },
 {
  "id": "compiler-llvm-tools.nvidia-android-profile-parent",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "'nvidia-android': ('Android', 'Media', NVIDIA_ANDROID_STATUSES)",
  "replace": "'nvidia-android': ('Android', 'GPU', NVIDIA_ANDROID_STATUSES)",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The NVIDIA Android seal binds the native Media receipt as its direct parent."
 },
 {
  "id": "compiler-llvm-tools.nvidia-android-export-suffix",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "assert context.name.endswith('-' + invocation['target_arch']), 'NVIDIA Android context must retain the runtime target suffix'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The exporter must reject an Android context that addresses the wrong runtime target."
 },
 {
  "id": "compiler-llvm-tools.nvidia-android-reader-suffix",
  "target": "linux/scripts/local-proof/nvidia_handoff_profile.py",
  "find": "assert context.name.endswith('-' + arch), 'NVIDIA Android context target suffix differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The stopped Android proof reader checks the operating context target before downstream use."
 },
 {
  "id": "compiler-llvm-tools.nvidia-android-export-accelerators",
  "target": "linux/scripts/local-proof/gpu-oci-handoff.py",
  "find": "media=kind != 'nvidia-gpu'",
  "replace": "media=kind == 'nvidia-media'",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "NVIDIA Android must retain the baked Media accelerator configuration."
 },
 {
  "id": "compiler-llvm-tools.nvidia-android-parent-layer-coverage",
  "target": "linux/scripts/local-proof/nvidia_handoff_profile.py",
  "find": "assert invocation['Media_layers_rehashed'] == parent['layers'], 'NVIDIA Android Media coverage differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The NVIDIA Android producer receipt retains the complete same-target Media layer coverage."
 },
 {
  "id": "compiler-llvm-tools.nvidia-android-gpu-ancestor-coverage",
  "target": "linux/scripts/local-proof/nvidia_handoff_profile.py",
  "find": "assert invocation['GPU_layers_matched'] == parent['matched_GPU_layers_and_diffIDs'], 'NVIDIA Android GPU coverage differs'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "The Android profile retains the Media receipt\u2019s matched GPU ancestry."
 },
 {
  "id": "compiler-llvm-tools.nvidia-android-disk",
  "target": "linux/scripts/local-proof/nvidia_handoff_profile.py",
  "find": "required = max(MEDIA_REQUIRED_BYTES, plan['required_bytes'])",
  "replace": "required = plan['required_bytes']",
  "test": "bash linux/scripts/tests/test-nvidia-handoff.sh",
  "why": "A smaller valid compiler plan cannot lower ordinary NVIDIA Android disk admission."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-cli",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "elif args.variant == 'nvidia':",
  "replace": "elif False:",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The ordinary runtime entry selects the sealed NVIDIA Android profile."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-layout",
  "target": "linux/scripts/local-proof/launch-normal-runtime.py",
  "find": "parent, context = nvidia_android_layout(args.parent_proof, args.android_invocation, invocation, media)",
  "replace": "parent, context = media, args.parent_proof.parent",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The runtime entry must verify the NVIDIA Android OCI export before scheduling."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-unit",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "        nvidia_unit(unit, 'runtime', arch)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The launch scope must name the same NVIDIA platform as the Android export."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-prefix",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "assert re.fullmatch(r'ant-local/webgpu-[a-z0-9][a-z0-9-]*:runtime-nvidia-[A-Za-z0-9][A-Za-z0-9_.-]{0,90}', prefix), 'Fresh local NVIDIA runtime prefix required'",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The NVIDIA producer may reserve only the reviewed local wrapper names."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-ort",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'ONNX_PACKAGE':'onnxruntime-gpu'",
  "replace": "'ONNX_PACKAGE':'onnxruntime'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "NVIDIA runtime uses the CUDA-enabled ONNX Runtime distribution."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-torch",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'PYTORCH_EXTRA':'pytorch-cu130'",
  "replace": "'PYTORCH_EXTRA':'pytorch-cpu'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The NVIDIA runtime must not silently build against CPU Torch."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-sbsa",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'CROSS_NVIDIA_SBSA':'1' if arch == 'arm64' else '0'",
  "replace": "'CROSS_NVIDIA_SBSA':'0'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Only the NVIDIA arm64 target selects the SBSA CUDA packaging path."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-wheel-export",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'RUNTIME_WHEELS_SOURCE':'export'",
  "replace": "'RUNTIME_WHEELS_SOURCE':'image'",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The runtime exports its exact Android wheelhouse with the local artifact platform."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-worker-deps",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "'nvidia_handoff_profile.py', 'gpu_source_profile.py', 'proof_types.py',",
  "replace": "'gpu_source_profile.py', 'proof_types.py',",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "The runtime binds all NVIDIA worker inputs."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-receipt-declaration",
  "target": "linux/scripts/local-proof/runtime_launch_profile.py",
  "find": "record.update(nvidia_android_ancestry_verified=True,",
  "replace": "record.update(nvidia_android_ancestry_verified=False,",
  "test": "bash linux/scripts/tests/test-normal-runtime-launch.sh",
  "why": "Emit the NVIDIA ancestry scope on the actual runtime invocation."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-final-baked-command",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "        require_nvidia_transport(command, invocation['unit'], {**flags, 'RUNTIME_ANDROID_PIN_' + arch:parent})",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "NVIDIA FINAL requires real exact environment binding and the explicit NVIDIA unit."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-final-env-arity",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    environment = [value for option, value in pairwise(command[:-11]) if option == '-E']",
  "replace": "    environment = command",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "A bare token cannot supply a selected systemd environment setting."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-final-parent",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "    nvidia_parent_binding(invocation, android, proof, android_path)",
  "replace": "    pass",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Local NVIDIA FINAL must consume its exact stopped Android and Media proof."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-final-context-index",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "and fingerprint(context / 'index.json') == proof['index_sha256']",
  "replace": "and True",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Changes to the sealed Android OCI index must refuse before local consumers run."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-final-media-receipt",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "require(fingerprint(media) == text(android, 'parent_OCI_proof_sha256', HASH)",
  "replace": "require(text(android, 'parent_OCI_proof_sha256', HASH)",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "Local NVIDIA FINAL rechecks the original Media proof bytes."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-final-export-status",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "'MainPID':'0', 'Result':'success', 'ExecMainStatus':'0',",
  "replace": "'MainPID':'0', 'Result':'success',",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "An Android export with a failing raw status cannot become local FINAL input."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-final-explicit-android",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "elif 'stage' in android and android.get('variant') != 'nvidia':",
  "replace": "elif 'stage' in android:",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "An explicit NVIDIA Android stage still needs its actual command and exact source proof."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-final-current-workers",
  "target": "linux/scripts/image_acceptance_local.py",
  "find": "nvidia=invocation.get('variant') == 'nvidia')",
  "replace": "nvidia=False)",
  "test": "bash linux/scripts/tests/test-image-acceptance-local.sh",
  "why": "The local NVIDIA check compares the entire original variant-specific worker closure."
 },
 {
  "id": "compiler-llvm-tools.nvidia-runtime-final-bounded-worker",
  "target": "linux/scripts/launch-local-final.py",
  "find": "for path in workers(origin['variant'])",
  "replace": "for path in workers()",
  "test": "bash linux/scripts/tests/test-local-final-launch.sh",
  "why": "The bounded FINAL invocation retains worker hashes for the observed NVIDIA variant."
 },
 {
  "id": "lib.ort-source-verify-head",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "if [ \"$head\" != \"$commit\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k moved_tag",
  "why": "a fetched checkout must sit at the pinned commit, whatever source served it"
 },
 {
  "id": "lib.ort-source-moved-tag-no-fallback",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "_ort_source_verified \"$name\" \"$commit\" \"$dir\" \"$primary\"\n    return $?",
  "replace": "_ort_source_verified \"$name\" \"$commit\" \"$dir\" \"$primary\" && return 0",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k moved_tag",
  "why": "an upstream tag at another commit is a supply-chain alarm, not a reason to try forks"
 },
 {
  "id": "lib.ort-source-stale-pin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "if [ \"$tag\" != \"$version\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k stale_pin",
  "why": "a version bump without a new pinned commit must fail before any fetch"
 },
 {
  "id": "lib.ort-source-single-pin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "if [ \"$count\" -ne 1 ]; then",
  "replace": "if [ \"$count\" -lt 1 ]; then",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k bad_pins",
  "why": "a duplicated pin name is ambiguous and must be refused"
 },
 {
  "id": "lib.ort-source-full-commit",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "^[0-9a-f]{40}\\|",
  "replace": "^[0-9a-f]+\\|",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k bad_pins",
  "why": "a short commit is not a content hash and must be refused"
 },
 {
  "id": "lib.ort-source-dep-commit",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "if [ \"$dep_commit\" != \"$commit\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k deps",
  "why": "GenAI's own deps.txt commit must equal the extensions pin it is replaced by"
 },
 {
  "id": "lib.ort-source-fallback-tag",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "git -C \"$dir\" tag \"$tag\" HEAD || return 1",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k fallback",
  "why": "a fork checkout keeps the upstream tag name so later tag reads resolve"
 },
 {
  "id": "lib.ort-source-commit-only-flag",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "_ort_source_by_commit \"$primary\" \"$commit\" \"$dir\" \"$tag\" && fetched=1",
  "replace": "_ort_source_by_commit \"$primary\" \"$commit\" \"$dir\" \"$tag\"; [ -d \"$dir/.git\" ] && fetched=1",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k commit_only",
  "why": "a failed commit-only primary leaves an empty repository that must not count as fetched"
 },
 {
  "id": "lib.ort-source-partial-cleanup",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "  rm -rf \"$dir\"\n  _ort_source_say \"$name $commit is unavailable",
  "replace": "  _ort_source_say \"$name $commit is unavailable",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k unavailable",
  "why": "an unavailable commit must not leave a half-initialised checkout for a later existing-tree skip"
 },
 {
  "id": "lib.ort-source-fallback-loop",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/source-fetch.sh",
  "find": "    if _ort_source_by_commit \"$url\" \"$commit\" \"$dir\" \"$tag\"; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k fallback",
  "why": "the pinned commit must be fetched from the fallback repositories when the primary is gone"
 },
 {
  "id": "lib.onnx-fetch-helper-source",
  "target": "linux/scripts/03-media/build/onnxruntime/build/20-fetch.sh",
  "find": "source \"${SCRIPT_DIR}/lib/source-fetch.sh\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k wiring",
  "why": "the Media fetch must use the verified source helper"
 },
 {
  "id": "lib.onnx-fetch-extensions-pinned",
  "target": "linux/scripts/03-media/build/onnxruntime/build/20-fetch.sh",
  "find": "onnxruntime-extensions - \"${_genai_extensions_url}\" \"$(genai_extensions_src_dir)\"",
  "replace": "onnxruntime-extensions - \"${_genai_extensions_url}\" \"/tmp/elsewhere\"",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k wiring",
  "why": "GenAI's extensions dependency is fetched where 60-build-genai.sh points FetchContent"
 },
 {
  "id": "lib.genai-extensions-source-define",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "GENAI_BASE_ARGS+=(--cmake_extra_defines \"FETCHCONTENT_SOURCE_DIR_ONNXRUNTIME_EXTENSIONS=${_genai_extensions_src}\")",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k wiring",
  "why": "without the define GenAI's FetchContent clones the removed Microsoft repository"
 },
 {
  "id": "lib.genai-extensions-source-required",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "[ -d \"${_genai_extensions_src}/.git\" ] || err",
  "replace": "[ -d \"${_genai_extensions_src}/.git\" ] || true",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k wiring",
  "why": "a missing verified extensions checkout must stop the GenAI build"
 },
 {
  "id": "lib.android-ort-verified-fetch",
  "target": "linux/scripts/03-media/build/onnxruntime/android/build-android.sh",
  "find": "ort_source_fetch onnxruntime \"${ORT_VERSION}\" \"https://github.com/microsoft/onnxruntime.git\" /opt/onnxruntime-android",
  "replace": "android_clone_shallow \"https://github.com/microsoft/onnxruntime.git\" \"${ORT_VERSION}\" onnxruntime-android",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k wiring",
  "why": "the Android ORT build must use the same pinned, verified source"
 },
 {
  "id": "lib.android-ort-source-copy",
  "target": "linux/Dockerfile.android",
  "find": "COPY --chmod=644 linux/scripts/03-media/build/onnxruntime/build/lib/source-pins.txt /opt/scripts/03-media/onnxruntime/source-pins.txt\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-source-fetch.sh -k wiring",
  "why": "the Android helper needs its pins beside it in the image"
 },
 {
  "id": "handoff.media-source-upstream-inputs-refused",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "    assert not differing, ",
  "replace": "    assert True, ",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_mounted_file",
  "why": "a Media source that changes a mounted compiler, SDK or GPU input must not reuse the old GPU parent"
 },
 {
  "id": "handoff.media-source-closure-compared",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "    assert _closures(producer) == _closures(source), ",
  "replace": "    assert True, ",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_closure_member",
  "why": "the SDK and GPU selected-script contexts are image inputs too"
 },
 {
  "id": "handoff.media-source-expanded-prefix",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "    return head if head == path else head.rsplit('/', 1)[0]",
  "replace": "    return path",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_change_under_an_expanded",
  "why": "an ARG-expanded mount must be compared over every expansion, not as a literal that never exists"
 },
 {
  "id": "handoff.media-source-copy-sources",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "        paths |= {_literal_prefix(word) for word in words[:-1] if not word.startswith('--')}",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_copied_directory",
  "why": "COPY sources are image inputs as much as bind mounts"
 },
 {
  "id": "handoff.media-source-dockerfiles-fixed",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "    inputs = {*FIXED_INPUTS, *dockerfiles}",
  "replace": "    inputs = set(FIXED_INPUTS)",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_upstream_dockerfile",
  "why": "an upstream Dockerfile edit re-keys its stage even when no mounted script changes"
 },
 {
  "id": "handoff.media-source-ancestry",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "    checked_run(['git', '-C', str(source), 'merge-base', '--is-ancestor', parent, head])",
  "replace": "    None",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_parent_source_must",
  "why": "a Media source with unrelated history has no reviewed delta from its GPU parent"
 },
 {
  "id": "handoff.media-source-other-revision",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "    assert head != parent, ",
  "replace": "    assert True, ",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_parent_source_must",
  "why": "the unchanged source already has the normal inheritance path"
 },
 {
  "id": "handoff.media-source-rocm-gpu-only",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "    assert gpu['variant'] == 'rocm' and gpu['stage'] == 'gpu', ",
  "replace": "    assert True, ",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_only_reviewed",
  "why": "the reviewed input list covers the ROCm GPU chain only"
 },
 {
  "id": "handoff.media-source-distinct",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "    assert source != producer, 'Alternate source must be distinct'",
  "replace": "    assert True, 'Alternate source must be distinct'",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_only_reviewed",
  "why": "the GPU source itself is no alternate"
 },
 {
  "id": "handoff.media-source-full-proof",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "    full = full_source(source, proof_path, head)",
  "replace": "    full = {'actual_full_registry_mutations': 17}",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_media_only_change",
  "why": "the alternate source needs its own complete preflight proof"
 },
 {
  "id": "handoff.media-source-handoff-review",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "        assert actual == review and str(source)",
  "replace": "        assert str(source)",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_handoff_rechecks",
  "why": "the Media export must recompute the review rather than trust the recorded copy"
 },
 {
  "id": "handoff.media-source-handoff-proof",
  "target": "linux/scripts/local-proof/stage_handoff_profile.py",
  "find": "        assert sha(proof) == invocation['source_full_preflight_sha256'], ",
  "replace": "        assert True, ",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_handoff_rechecks",
  "why": "a changed proof file after launch must refuse the export"
 },
 {
  "id": "handoff.media-source-launcher-paired",
  "target": "linux/scripts/local-proof/launch-normal-media.py",
  "find": "    if (args.media_source is None) != (args.media_source_proof is None):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_launcher_requires",
  "why": "a source without its proof, or a proof without its source, must refuse before any work"
 },
 {
  "id": "handoff.media-source-launcher-rocm",
  "target": "linux/scripts/local-proof/launch-normal-media.py",
  "find": "        if args.media_source is not None:\n            parser.error('an alternate Media source is reviewed for ROCm only')",
  "replace": "        if False:\n            parser.error('an alternate Media source is reviewed for ROCm only')",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_launcher_requires",
  "why": "the NVIDIA lane has no reviewed alternate-source profile"
 },
 {
  "id": "handoff.media-source-launcher-record",
  "target": "linux/scripts/local-proof/launch-normal-media.py",
  "find": "source_full_preflight_sha256=sha(proof), Media_source_review=review)",
  "replace": "source_full_preflight_sha256=sha(proof))",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_launcher_binds",
  "why": "the recorded review is what the Media export rechecks"
 },
 {
  "id": "workflow-lint.run-filter-plus-repeats",
  "target": "linux/scripts/verify_workflow_conventions.py",
  "find": "            out[-1] = f\"(?:{out[-1]}){ch}\"\n",
  "replace": "            out.append(re.escape(ch))\n",
  "test": "bash linux/scripts/tests/test-workflow-run-filters.sh",
  "why": "GitHub reads '+' as a repeat, so a lint that took it literally passed filters that never trigger"
 },
 {
  "id": "workflow-lint.run-filter-class-grammar",
  "target": "linux/scripts/verify_workflow_conventions.py",
  "find": "_FILTER_CLASS = re.compile(r\"\\[([A-Za-z0-9-]+)\\]\")",
  "replace": "_FILTER_CLASS = re.compile(r\"\\[([^\\]]+)\\]\")",
  "test": "bash linux/scripts/tests/test-workflow-run-filters.sh",
  "why": "a '[ci <lane>]' filter is invalid on GitHub and starts a phantom run on every completed workflow"
 },
 {
  "id": "workflow-lint.run-filter-must-match",
  "target": "linux/scripts/verify_workflow_conventions.py",
  "find": "        if not any(regex.fullmatch(name) for name in WORKFLOW_NAMES):",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-workflow-run-filters.sh",
  "why": "a filter that matches no workflow name never triggers, and the retry it guards silently never ran"
 },
 {
  "id": "lib.iwyu-skips-module-units",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "(module|import)[[:space:]]+[[:alnum:]_<\"]' \"${file}\" ||",
  "replace": "(module)[[:space:]]+[[:alnum:]_<\"]' \"${file}\" ||",
  "test": "bash linux/scripts/tests/test-code-quality-iwyu.sh",
  "why": "a unit that imports a module would reach IWYU, whose older clang cannot load the build's module files"
 },
 {
  "id": "lib.iwyu-suggestions-stay-a-report",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  if [[ \"${errors}\" -gt 0 ]]; then",
  "replace": "  if [[ \"${errors}\" -gt 0 || \"${changed}\" -gt 0 ]]; then",
  "test": "bash linux/scripts/tests/test-code-quality-iwyu.sh",
  "why": "the owner chose a report first: include suggestions must not turn the static lane red"
 },
 {
  "id": "lib.iwyu-unread-unit-is-red",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  if [[ \"${errors}\" -gt 0 ]]; then",
  "replace": "  if [[ \"${errors}\" -gt 99 ]]; then",
  "test": "bash linux/scripts/tests/test-code-quality-iwyu.sh",
  "why": "a unit IWYU could not parse was graded by nothing, and a green report over it would claim a check that never ran"
 },
 {
  "id": "lib.quality-report-drift-needs-docs",
  "target": "linux/scripts/quality_report_text.py",
  "find": "if not isinstance(docs, dict) or not docs.get(\"build_list\") or not docs.get(\"source\"):",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_agents_drift_without_a_docs_table_is_not_collected",
  "why": "a consumer without a docs table would fail the report as incomplete over a check outside its scope"
 },
 {
  "id": "lib.think-split-final-cut",
  "target": "shared/contracts/think-split.json",
  "find": "\"expect\": {\"shown\": \"X\", \"answer\": \"X\", \"final\": \"X\", \"thinking\": 24",
  "replace": "\"expect\": {\"shown\": \"X\", \"answer\": \"X\", \"final\": \"X<think>b\", \"thinking\": 24",
  "test": "bash linux/scripts/tests/test-think-split.sh",
  "why": "final stops at a block that never closes (owner, 2026-11-23); graded with it, its intermediate values read as answers"
 },
 {
  "id": "lib.think-split-late-close-hidden",
  "target": "shared/contracts/think-split.json",
  "find": "\"expect\": {\"shown\": \"def\", \"answer\": \"def\", \"final\": \"def\", \"thinking\": 11",
  "replace": "\"expect\": {\"shown\": \"abcdef\", \"answer\": \"def\", \"final\": \"def\", \"thinking\": 11",
  "test": "bash linux/scripts/tests/test-think-split.sh",
  "why": "owner D5: text before a late close in its own piece is never shown, so no binding may flash thinking as answer"
 },
 {
  "id": "lib.usable-cpus-floor",
  "target": "shared/contracts/usable-cpus.json",
  "find": "\"affinity\": 4, \"cpu_max\": [\"150000 100000\"],\n   \"expect\": {\"usable\": 1}",
  "replace": "\"affinity\": 4, \"cpu_max\": [\"150000 100000\"],\n   \"expect\": {\"usable\": 2}",
  "test": "bash linux/scripts/tests/test-usable-cpus.sh",
  "why": "a quota of 1.5 CPUs gives one usable CPU, so no binding rounds up and oversubscribes the quota"
 },
 {
  "id": "lib.usable-cpus-parent-counts",
  "target": "shared/contracts/usable-cpus.json",
  "find": "\"affinity\": 8, \"cpu_max\": [\"max 100000\", \"200000 100000\", null],\n   \"expect\": {\"usable\": 2}",
  "replace": "\"affinity\": 8, \"cpu_max\": [\"max 100000\", \"200000 100000\", null],\n   \"expect\": {\"usable\": 8}",
  "test": "bash linux/scripts/tests/test-usable-cpus.sh",
  "why": "the owner counts every cpu.max up to the root, since the kernel enforces a parent's quota on its children"
 },
 {
  "id": "lib.usable-cpus-at-least-one",
  "target": "shared/contracts/usable-cpus.json",
  "find": "\"affinity\": 4, \"cpu_max\": [\"50000 100000\"],\n   \"expect\": {\"usable\": 1}",
  "replace": "\"affinity\": 4, \"cpu_max\": [\"50000 100000\"],\n   \"expect\": {\"usable\": 0}",
  "test": "bash linux/scripts/tests/test-usable-cpus.sh",
  "why": "a quota under one CPU still leaves one, or a binding asks ORT for zero threads, which is ORT's own default"
 },
 {
  "id": "quality-report.perf-genai-threads-own-cgroup-only",
  "target": "linux/scripts/lib/genai-model-threads.py",
  "find": "    for text in cpu_max:\n",
  "replace": "    for text in cpu_max[:1]:\n",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_usable",
  "why": "a parent's cpu.max limits the process too, so reading only the own cgroup oversubscribes a limited slice"
 },
 {
  "id": "quality-report.perf-genai-threads-fixed-period",
  "target": "linux/scripts/lib/genai-model-threads.py",
  "find": "Fraction(int(quota), int(period))",
  "replace": "Fraction(int(quota), 100000)",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_usable",
  "why": "the period is each cgroup's own; a fixed 100 ms one misreads every other quota"
 },
 {
  "id": "quality-report.perf-genai-threads-zero-cpus",
  "target": "linux/scripts/lib/genai-model-threads.py",
  "find": "    return max(1, math.floor(limit))\n",
  "replace": "    return math.floor(limit)\n",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_usable",
  "why": "a quota under one CPU still leaves one usable CPU"
 },
 {
  "id": "quality-report.perf-genai-threads-walk-stops",
  "target": "linux/scripts/lib/genai-model-threads.py",
  "find": "    for depth in range(len(parts), -1, -1):\n",
  "replace": "    for depth in range(len(parts), len(parts) - 1, -1):\n",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_cgroup",
  "why": "the reader must return every cpu.max up to the root, or the parent's quota never reaches the rule"
 },
 {
  "id": "quality-report.perf-genai-threads-outside-namespace",
  "target": "linux/scripts/lib/genai-model-threads.py",
  "find": "        parts = []\n",
  "replace": "        pass\n",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_cgroup",
  "why": "a cgroup outside the namespace shows as ../..; followed, it reads files beside the cgroup root"
 },
 {
  "id": "quality-report.perf-genai-threads-auto-ignores-quota",
  "target": "linux/scripts/lib/genai-model-threads.py",
  "find": "        usable = usable_cpus(affinity_count(), cgroup_cpu_max())\n",
  "replace": "        usable = affinity_count()\n",
  "test": "bash linux/scripts/tests/test-quality-report-perf.sh -k test_auto_honours",
  "why": "auto must honour the cgroup quota, or a perf copy in a limited container oversubscribes it"
 },
 {
  "id": "lib.openai-chat-answers-shape",
  "target": "shared/contracts/openai-chat-answers.json",
  "find": "\"expect\": {\"text\": \"Paris\", \"thinking\": \"\", \"finish\": \"stop\", \"usage\": [7, 2]}",
  "replace": "\"expect\": {\"text\": \"Paris\", \"finish\": \"stop\", \"usage\": [7, 2]}",
  "test": "bash linux/scripts/tests/test-openai-stream-lines.sh",
  "why": "a binding compares the whole outcome; a case without thinking passes a partial check in one language and fails another"
 },
 {
  "id": "cmake-arch.linux-pie-on-the-target",
  "target": "cmake/Hardening.cmake",
  "find": "        set_property(TARGET ${target} PROPERTY POSITION_INDEPENDENT_CODE ON)\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cmake-hardening-linux.sh",
  "why": "hardened from a function, a real target got no PIE: the variable never left that function"
 },
 {
  "id": "cmake-arch.linux-lost-pie-warns",
  "target": "cmake/Hardening.cmake",
  "find": "      elseif(CMAKE_CURRENT_FUNCTION)\n",
  "replace": "      elseif(FALSE)\n",
  "test": "bash linux/scripts/tests/test-cmake-hardening-linux.sh",
  "why": "an INTERFACE target hardened from a function loses its PIE, and nothing said so"
 },
 {
  "why": "a missing or failed driver, or a unit absent from the compile DB, was graded by nothing and must not report green",
  "test": "bash linux/scripts/tests/test-code-quality-iwyu.sh",
  "id": "lib.iwyu-every-unit-is-read",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "  if [[ \"${units_read}\" -lt $# ]]; then",
  "replace": "  if [[ \"${units_read}\" -lt 0 ]]; then"
 },
 {
  "why": "one reported unit must not stand in for another one IWYU never read",
  "test": "bash linux/scripts/tests/test-code-quality-iwyu.sh",
  "id": "lib.iwyu-units-match-by-path",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "if [[ \"${path}\" == \"${unit}\" || \"${path}\" == */\"${unit}\" ]]; then",
  "replace": "if [[ -n \"${path}\" ]]; then"
 },
 {
  "why": "a strict caller aborts on the driver status, which counts suggestions in some releases",
  "test": "bash linux/scripts/tests/test-code-quality-iwyu.sh",
  "id": "lib.iwyu-driver-status-is-captured",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": ">\"${log}\" 2>&1 || status=$?",
  "replace": ">\"${log}\" 2>&1"
 },
 {
  "id": "lib.iwyu-fatal-error-is-red",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "grep -cE ': (fatal )?error:'",
  "replace": "grep -cE ': error:'",
  "test": "bash linux/scripts/tests/test-code-quality-iwyu.sh",
  "why": "IWYU writes 'fatal error:' for a missing header, and a planted one stayed green in BeschleunigerBallett"
 },
 {
  "why": "grep -c exits 1 on a log without errors, which aborts a strict caller on the healthy path",
  "test": "bash linux/scripts/tests/test-code-quality-iwyu.sh",
  "id": "lib.iwyu-clean-log-is-not-an-abort",
  "target": "linux/scripts/lib/code-quality.sh",
  "find": "errors=\"$(grep -cE ': (fatal )?error:' \"${log}\" || true)\"",
  "replace": "errors=\"$(grep -cE ': (fatal )?error:' \"${log}\")\""
 },
 {
  "id": "handoff.runtime-wheels-stage-context",
  "target": "linux/scripts/01-core/runtime-build-fns.sh",
  "find": "    _awia_out+=(--build-arg WHEELS_IMAGE=runtime_wheels --build-context \"runtime_wheels=${_wheels_ctx}\")",
  "replace": "    _awia_out+=(--build-arg \"WHEELS_IMAGE=${_wheels_image}\" --build-context \"${_wheels_image}=${_wheels_ctx}\")",
  "test": "bash linux/scripts/tests/test-runtime-wheels-context.sh",
  "why": "a digest-pinned reference as the context key reaches the registry resolver and the no-push wrapper cannot find its android image"
 },
 {
  "id": "handoff.runtime-source-host-only",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "    assert touched <= HOST_ONLY_FILES, ",
  "replace": "    assert True, ",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_runtime_change_to_any",
  "why": "a runtime source may differ from its Android parent only in host-only runtime files"
 },
 {
  "id": "handoff.runtime-source-android-dockerfiles",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "ANDROID_DOCKERFILES = (*UPSTREAM_DOCKERFILES, 'linux/Dockerfile.media', 'linux/Dockerfile.android')",
  "replace": "ANDROID_DOCKERFILES = UPSTREAM_DOCKERFILES",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_runtime_change_to_any",
  "why": "Media and Android inputs belong to the already built parent as much as compiler, SDK and GPU inputs"
 },
 {
  "id": "handoff.runtime-source-unnamed-host-file",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "        assert not any(Path(path).name in text for path in HOST_ONLY_FILES), ",
  "replace": "        assert True, ",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_runtime_stage_naming",
  "why": "a host-only file must stay unnamed by every image stage"
 },
 {
  "id": "handoff.runtime-source-closure",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "    assert _closures(producer) == _closures(source), 'Runtime source",
  "replace": "    assert True, 'Runtime source",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_runtime_change_to_any",
  "why": "the SDK and GPU selected-script contexts are parent inputs too"
 },
 {
  "id": "handoff.runtime-source-dispatch",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "    if invocation['source_revision'] != ANDROID_REVISION:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_runtime_host_only_change",
  "why": "a new Android parent uses the host-only review, not the historical pinned repair"
 },
 {
  "id": "handoff.runtime-source-selected-checkout",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "    return source, review",
  "replace": "    return producer, review",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_runtime_host_only_change",
  "why": "the reviewed runtime checkout, not the Android parent's, must drive the runtime build"
 },
 {
  "id": "lib.torch-app-hub-submodule",
  "target": "linux/scripts/03-media/runtime/assemble-torch-app.sh",
  "find": "  git -C \"${APP_DIR}\" submodule update --init --depth 1 third_party/ANTfrastructure\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-app-ref.sh",
  "why": "OrchestrANT's setup.py copies hub modules from its submodule, so a tree without it fails the torch stage's uv sync"
 },
 {
  "id": "packaging.install-tree-cmake-packages",
  "target": "linux/scripts/06-packaging/check-install-tree.sh",
  "find": "BUILD_TIME='^(usr/)?(include|lib[^/]*(/[^/]+)?/(cmake|pkgconfig)|share/pkgconfig)/|\\.(lib|a)$'",
  "replace": "BUILD_TIME='^(usr/)?(include)/|\\.(lib|a)$'",
  "test": "bash linux/scripts/tests/test-check-install-tree.sh",
  "why": "a bundle shipped gtest's CMake package, which only a build can use"
 },
 {
  "id": "packaging.install-tree-static-libraries",
  "target": "linux/scripts/06-packaging/check-install-tree.sh",
  "find": "|share/pkgconfig)/|\\.(lib|a)$'",
  "replace": "|share/pkgconfig)/'",
  "test": "bash linux/scripts/tests/test-check-install-tree.sh",
  "why": "a static or import library in a shipped tree is a build input, 52 of which a bundle carried"
 },
 {
  "id": "packaging.install-tree-allow",
  "target": "linux/scripts/06-packaging/check-install-tree.sh",
  "find": "[[ \"${kept}\" == 1 ]] || found+=(\"${rel}\")",
  "replace": "found+=(\"${rel}\")",
  "test": "bash linux/scripts/tests/test-check-install-tree.sh",
  "why": "without --allow an SDK that ships its headers on purpose could not use the check at all"
 },
 {
  "id": "lib.warning-census-tidy-is-not-a-warning",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "if match and (tag is None or COMPILER_FLAG.match(tag)) else None",
  "replace": "if match else None",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "a clang lane also runs clang-tidy, whose findings would fill the compiler's census with 352 non-warnings"
 },
 {
  "id": "lib.warning-census-foreign-code",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "    if FOREIGN.search(path) or ABSOLUTE.match(path):",
  "replace": "    if ABSOLUTE.match(path):",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "a vendored library's header warnings would count as the repository's own and bury its real count"
 },
 {
  "id": "lib.warning-census-workspace-relative",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "    path = WORKSPACE.sub(\"\", path)",
  "replace": "    path = path",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "a container build logs /workspace paths; without the strip every own warning reads as foreign and the count is 0"
 },
 {
  "id": "lib.warning-census-growth-fails",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "        if now > was:",
  "replace": "        if now > was + 99:",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "a new warning that does not fail the lane is the warning-as-error step the owner put after the ratchet, skipped"
 },
 {
  "id": "lib.warning-census-drop-fails",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "        elif now < was:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "a fixed warning left in the census lets a later one take its place unseen"
 },
 {
  "id": "lib.warning-census-empty-build",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "        if not compiled:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "an incremental build that compiled nothing would pass as zero warnings and lower nothing"
 },
 {
  "id": "lib.warning-census-clang-cl-lines",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "match = WARNING.search(line) or WARNING_CL.search(line) or WARNING_MSVC.search(line)",
  "replace": "match = WARNING.search(line) or WARNING_MSVC.search(line)",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "clang-cl prints path(line,col):, so every Windows lane would read zero warnings and hold nothing"
 },
 {
  "id": "lib.warning-census-clang-cl-compile-line",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "    r\"|[\\s\\\\/](?:clang-)?cl(?:\\.exe)? .*\\s[-/]c(?:\\s|$)\"",
  "replace": "    r\"\"",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "a verbose Windows build logs each clang-cl command, not ninja's Building line, so its log would compile nothing"
 },
 {
  "id": "lib.warning-census-normalises-paths",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "    path = posixpath.normpath(path)",
  "replace": "    path = path",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "one header reached through ../ and directly would count twice, and a fixed one would leave its twin's row"
 },
 {
  "id": "lib.warning-census-strips-colour",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "            line = ANSI.sub(\"\", raw)",
  "replace": "            line = raw",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "a clang run on a terminal splits each warning with escape codes, and the census would read none of them"
 },
 {
  "id": "lib.warning-census-drive-letter-is-foreign",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "ABSOLUTE = re.compile(r\"^(?:/|[A-Za-z]:/)\")",
  "replace": "ABSOLUTE = re.compile(r\"^/\")",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "an MSVC STL or Windows SDK header under C:/Program Files would count as the repository's own"
 },
 {
  "id": "lib.warning-census-windows-workspace",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "|[A-Za-z]:/ws(?:-mnt)?|",
  "replace": "|",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "the family's Windows containers build in C:/ws, so without the strip every own warning there reads as foreign"
 },
 {
  "id": "lib.warning-census-msvc-cl-lines",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "match = WARNING.search(line) or WARNING_CL.search(line) or WARNING_MSVC.search(line)",
  "replace": "match = WARNING.search(line) or WARNING_CL.search(line)",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "MSVC cl prints warning C4244: and no -W flag, so a cl lane would read zero warnings and hold nothing"
 },
 {
  "id": "lib.warning-census-msvc-analyze-is-not-a-warning",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "COMPILER_FLAG = re.compile(r\"-W|C[45]\\d{3}$\")",
  "replace": "COMPILER_FLAG = re.compile(r\"-W|C\\d+$\")",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "/analyze's C6xxx and C26xxx are checks like clang-tidy's; counted, they would fill the compiler's census"
 },
 {
  "id": "lib.warning-census-msvc-error-is-not-a-warning",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "WARNING_MSVC = re.compile(_PAREN + r\" warning (?P<tag>C\\d{4,5}):\")",
  "replace": "WARNING_MSVC = re.compile(_PAREN + r\" \\w+ (?P<tag>C\\d{4,5}):\")",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "/sdl and /we turn a C4xxx warning into an error; counted, a failed build's errors would sit in the census"
 },
 {
  "id": "lib.warning-census-msvc-compile-line",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "    r\"|[\\s\\\\/](?:clang-)?cl(?:\\.exe)? .*\\s[-/]c(?:\\s|$)\"",
  "replace": "    r\"|[\\s\\\\/]clang-cl(?:\\.exe)? .*\\s[-/]c(?:\\s|$)\"",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "a verbose cl build logs each cl.exe command, not ninja's Building line, so its log would compile nothing"
 },
 {
  "id": "lib.warning-census-sdk-path-is-foreign",
  "target": "linux/scripts/verify_warning_census.py",
  "find": "(?:[^:(]|\\((?!\\d))*?",
  "replace": "[^:(]*?",
  "test": "bash linux/scripts/tests/test-warning-census.sh",
  "why": "the Windows SDK sits under C:/Program Files (x86); cut at (x86), its headers' warnings would count as own"
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-required",
  "target": "windows/scripts/build/Build-MigraphxFromSource.ps1",
  "find": "    Invoke-RequiredSourcePatch -PatchFile $PadPoolingPatchFile -SourceDir $sourceRoot",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.MigraphxPadPooling.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-pooling.json",
  "why": "A missing required source patch call must fail the source-order and exact-call assertions."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-unconditional",
  "target": "windows/scripts/build/Build-MigraphxFromSource.ps1",
  "find": "    Invoke-RequiredSourcePatch -PatchFile $PadPoolingPatchFile -SourceDir $sourceRoot",
  "replace": "    if ($false) { Invoke-RequiredSourcePatch -PatchFile $PadPoolingPatchFile -SourceDir $sourceRoot }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.MigraphxPadPooling.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-pooling.json",
  "why": "A disabled required call must fail the AST unconditional-call assertion."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-primary-source",
  "target": "windows/scripts/build/Build-MigraphxFromSource.ps1",
  "find": "    Invoke-RequiredSourcePatch -PatchFile $PadPoolingPatchFile -SourceDir $sourceRoot",
  "replace": "    Invoke-RequiredSourcePatch -PatchFile $PadPoolingPatchFile -SourceDir $WorkDir",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.MigraphxPadPooling.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-pooling.json",
  "why": "The patch must target the downloaded primary tree rather than the scratch parent."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-repository-default",
  "target": "windows/scripts/build/Build-MigraphxFromSource.ps1",
  "find": "..\\..\\..\\shared\\upstream\\migraphx\\patches\\0001-preserve-zero-pad-maxpool.patch",
  "replace": "..\\..\\..\\shared\\upstream\\migraphx\\patches\\absent.patch",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.MigraphxPadPooling.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-pooling.json",
  "why": "Direct repository invocations must resolve the actual shared patch."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-mount",
  "target": "windows/Dockerfile.rocm-migraphx",
  "find": "source=shared/upstream/migraphx/patches/0001-preserve-zero-pad-maxpool.patch,target=C:\\bkmnt\\migraphx-pad-pool.patch,readonly",
  "replace": "source=shared/upstream/migraphx/patches/0001-preserve-zero-pad-maxpool.patch,target=C:\\bkmnt\\wrong.patch,readonly",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.MigraphxPadPooling.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-pooling.json",
  "why": "A changed mount target must fail the exact narrow mount check."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-forwarded-path",
  "target": "windows/Dockerfile.rocm-migraphx",
  "find": "-PadPoolingPatchFile 'C:\\bkmnt\\migraphx-pad-pool.patch'",
  "replace": "-PadPoolingPatchFile 'C:\\bkmnt\\wrong.patch'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.MigraphxPadPooling.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-pooling.json",
  "why": "The mounted path must reach the builder argument."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-max-guard",
  "target": "shared/upstream/migraphx/patches/0001-preserve-zero-pad-maxpool.patch",
  "find": "+    if(op.mode == op::pooling_mode::average or op.mode == op::pooling_mode::max)",
  "replace": "+    if(op.mode == op::pooling_mode::average)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.MigraphxPadPooling.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-pooling.json",
  "why": "Reverting max preservation must change the real patched source and fail its independent expected hash."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-lpnorm-control",
  "target": "shared/upstream/migraphx/patches/0001-preserve-zero-pad-maxpool.patch",
  "find": "+    if(op.mode == op::pooling_mode::average or op.mode == op::pooling_mode::max)",
  "replace": "+    if(true)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.MigraphxPadPooling.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-pooling.json",
  "why": "An overbroad pooling refusal must fail the expected corrected-source check; the real C++ LP control separately rejects it."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-upstream-regression",
  "target": "shared/upstream/migraphx/patches/0001-preserve-zero-pad-maxpool.patch",
  "find": "+    EXPECT(l2->inputs().front()->name() == \"pad\");",
  "replace": "+    EXPECT(true);",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.MigraphxPadPooling.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-pooling.json",
  "why": "Weakening the upstream regression must fail the independent expected patched-test hash."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-default-assertion",
  "target": "windows/scripts/tests/WindowsHarness.CallAssertions.psm1",
  "find": "Assert-Equal $Text $parameter[0].DefaultValue.Extent.Text",
  "replace": "Assert-Equal $Text $Text",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.CallAssertions.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-default-assertion.json",
  "why": "The shared default assertion must refuse a wrong declared default."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-run-uniqueness",
  "target": "windows/scripts/tests/WindowsHarness.DockerFixtures.psm1",
  "find": "    Assert-Equal 1 $selected.Count \"one build RUN containing $ScriptLeaf\"",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.DockerFixtures.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-run-uniqueness.json",
  "why": "Zero or multiple selected build RUNs must refuse rather than choose the first."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-required-mount-assertion",
  "target": "windows/scripts/tests/WindowsHarness.DockerFixtures.psm1",
  "find": "Assert-True $build.Command.Contains($item.Text)",
  "replace": "Assert-True $build.Command.Contains($build.Command)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.DockerFixtures.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-required-mount-assertion.json",
  "why": "The shared mount assertion must reject a missing exact mount."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-exclusive-mount-assertion",
  "target": "windows/scripts/tests/WindowsHarness.DockerFixtures.psm1",
  "find": "$_.Contains($item.Exclusive)",
  "replace": "$_.Contains($item.Text)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.DockerFixtures.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-exclusive-mount-assertion.json",
  "why": "A caller can require broader filename exclusivity than the full mount literal."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-required-argument-assertion",
  "target": "windows/scripts/tests/WindowsHarness.DockerFixtures.psm1",
  "find": "Assert-True $build.Command.Contains($item) \"required build argument $item\"",
  "replace": "Assert-True $true \"required build argument $item\"",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.DockerFixtures.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-required-argument-assertion.json",
  "why": "A missing explicit builder argument must fail the shared contract."
 },
 {
  "id": "rocm-stack.windows-migraphx-pad-run-stage-selection",
  "target": "windows/scripts/tests/WindowsHarness.DockerFixtures.psm1",
  "find": "$docker.ByName[$Stage].Lines",
  "replace": "$docker.ByName['built'].Lines",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.DockerFixtures.Tests.ps1 -ResultFile logs/code-quality/migraphx-pad-run-stage-selection.json",
  "why": "RUN selection must preserve the requested parsed stage."
 },
 {
  "id": "windows-lane.qnn-scratch-remove",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "            Remove-Item -LiteralPath $qnnExtract -Recurse -Force -ErrorAction Stop",
  "replace": "            Write-Verbose 'mutant: no SDK cleanup'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Scratch.Tests.ps1 -ResultFile logs/code-quality/qnn-sdk-scratch-mutation.json",
  "why": "unused cross-platform SDK files must be removed before exporting the layer"
 },
 {
  "id": "windows-lane.qnn-scratch-cache-root",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "        $qnnExtract = Join-Path $env:TEMP_DIR 'qnn-sdk-extract'",
  "replace": "        $qnnExtract = Join-Path $env:TEMP_DIR 'qnn-sdk-cache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Scratch.Tests.ps1 -ResultFile logs/code-quality/qnn-sdk-scratch-mutation.json",
  "why": "the pinned download cache must never be selected as the extraction tree"
 },
 {
  "id": "windows-lane.qnn-scratch-broad-root",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "        $qnnExtract = Join-Path $env:TEMP_DIR 'qnn-sdk-extract'",
  "replace": "        $qnnExtract = $env:TEMP_DIR",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Scratch.Tests.ps1 -ResultFile logs/code-quality/qnn-sdk-scratch-mutation.json",
  "why": "cleanup must preserve the source-built interpreter and all sibling caches"
 },
 {
  "id": "windows-lane.qnn-scratch-unset-root",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "    if (-not [string]::IsNullOrWhiteSpace($env:TEMP_DIR)) {",
  "replace": "    if ($true) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Scratch.Tests.ps1 -ResultFile logs/code-quality/qnn-sdk-scratch-mutation.json",
  "why": "an unknown temporary root must not create a relative cleanup target"
 },
 {
  "id": "windows-lane.qnn-scratch-absolute-root",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "        if (-not [IO.Path]::IsPathFullyQualified($env:TEMP_DIR)) { throw 'TEMP_DIR must be absolute before scrubbing QNN SDK extraction.' }",
  "replace": "        if ($false) { throw 'TEMP_DIR must be absolute before scrubbing QNN SDK extraction.' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Scratch.Tests.ps1 -ResultFile logs/code-quality/qnn-sdk-scratch-mutation.json",
  "why": "relative roots must refuse before any filesystem cleanup"
 },
 {
  "id": "windows-lane.qnn-scratch-reparse",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "                if ((Get-Item -LiteralPath $scratchPath -Force -ErrorAction Stop).Attributes -band [IO.FileAttributes]::ReparsePoint) {",
  "replace": "                if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Scratch.Tests.ps1 -ResultFile logs/code-quality/qnn-sdk-scratch-mutation.json",
  "why": "reparse metadata on the extraction root or its parent must refuse cleanup"
 },
 {
  "id": "windows-lane.qnn-scratch-failure-status",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "            Remove-Item -LiteralPath $qnnExtract -Recurse -Force -ErrorAction Stop",
  "replace": "            Remove-Item -LiteralPath $qnnExtract -Recurse -Force -ErrorAction SilentlyContinue",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Scratch.Tests.ps1 -ResultFile logs/code-quality/qnn-sdk-scratch-mutation.json",
  "why": "a real SDK cleanup error must remain fatal with its original diagnostic"
 },
 {
  "id": "windows-lane.qnn-scratch-postcondition",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "            if (Test-Path -LiteralPath $qnnExtract) { throw \"QNN SDK extraction remains after cleanup: $qnnExtract\" }",
  "replace": "            Write-Verbose 'mutant: SDK removal unchecked'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Scratch.Tests.ps1 -ResultFile logs/code-quality/qnn-sdk-scratch-mutation.json",
  "why": "a no-op removal must not report a successful scrub"
 },
 {
  "id": "wheels-source.tvm-ffi-specific-scm",
  "target": "windows/scripts/modules/WindowsTvm.Common.psm1",
  "find": "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_APACHE_TVM_FFI = $ffiVersion",
  "replace": "SETUPTOOLS_SCM_PRETEND_VERSION = $ffiVersion",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "The release override must target FFI without changing the TVM/global override."
 },
 {
  "id": "wheels-source.tvm-ffi-selected-scm",
  "target": "windows/scripts/modules/WindowsTvm.Common.psm1",
  "find": "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_APACHE_TVM_FFI = $ffiVersion",
  "replace": "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_APACHE_TVM_FFI = '0.1.dev1'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "Both callbacks must inherit the selected release version."
 },
 {
  "id": "wheels-source.tvm-ffi-metadata-version",
  "target": "windows/scripts/modules/WindowsTvm.Common.psm1",
  "find": "if version != expected:",
  "replace": "if False:",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "Installed and archived development versions must be refused."
 },
 {
  "id": "wheels-source.tvm-ffi-metadata-cardinality",
  "target": "windows/scripts/modules/WindowsTvm.Common.psm1",
  "find": "if len(distributions) != 1 or re.sub(r\"[-_.]+\", \"-\", distributions[0].metadata[\"Name\"]).lower() != \"apache-tvm-ffi\":",
  "replace": "if False:",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "Foreign or multiple distributions cannot satisfy the FFI metadata gate."
 },
 {
  "id": "wheels-source.tvm-ffi-validate-installed",
  "target": "windows/scripts/modules/WindowsTvm.Common.psm1",
  "find": "if (-not $Wheel -or $buildResult) {",
  "replace": "if ($Wheel -and $buildResult) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "The GIL in-place install requires actual metadata validation."
 },
 {
  "id": "wheels-source.tvm-ffi-validate-twin",
  "target": "windows/scripts/modules/WindowsTvm.Common.psm1",
  "find": "if (-not $Wheel -or $buildResult) {",
  "replace": "if (-not $Wheel) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "An actually built twin needs saved archive metadata validation."
 },
 {
  "id": "wheels-source.tvm-ffi-failed-describe",
  "target": "windows/scripts/modules/WindowsTvm.Common.psm1",
  "find": "$describe = if ($tag.ExitCode -eq 0) { $tag.Text } else { '' }",
  "replace": "$describe = if ($true) { $tag.Text } else { '' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "A failed git probe must not provide a plausible but invalid release tag."
 },
 {
  "id": "wheels-source.tvm-ffi-required-bound",
  "target": "windows/scripts/modules/WindowsTvm.Common.psm1",
  "find": "Get-VendoredTvmFfiVersion -DescribeOutput $describe -TvmPyprojectText $pyproject",
  "replace": "Get-VendoredTvmFfiVersion -DescribeOutput $describe -TvmPyprojectText ''",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "A tagless checkout must use TVM source dependency metadata."
 },
 {
  "id": "wheels-source.tvm-ffi-required-check",
  "target": "windows/scripts/modules/WindowsTvm.Common.psm1",
  "find": "Assert-TvmFfiPackageVersion -Python $Python -ExpectedVersion $ffiVersion -WheelPath $wheelPath",
  "replace": "Write-Host 'unchecked metadata'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "Successful callbacks must still pass the required metadata gate."
 },
 {
  "id": "wheels-source.tvm-ffi-cross-selector",
  "target": "windows/scripts/build/Build-TvmFromSource.ps1",
  "find": "$ffiVersion = Get-TvmFfiSourceVersion -SourceDir $SourceDir",
  "replace": "$ffiVersion = '0.1.dev1'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "Cross and native version selection must stay shared."
 },
 {
  "id": "wheels-source.tvm-ffi-twin-scope",
  "target": "windows/scripts/build/Build-TvmFromSource.ps1",
  "find": "Invoke-TvmFfiPythonBuild -Python $py -SourceDir $SourceDir -Wheel -Build {",
  "replace": "Invoke-TvmFfiPythonBuild -Python $py -SourceDir $SourceDir -Build {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.TvmFfiVersion.Tests.ps1 -ResultFile logs/test-results/tvm-ffi-version-mutation.json",
  "why": "The twin requires archive validation rather than rechecking the installed GIL distribution."
 },
 {
  "id": "sccache.opencv-plugin-stats",
  "target": "windows/scripts/build/Build-OpencvGstreamerPlugin.ps1",
  "find": "Write-SccacheStats -Label 'opencv-gstreamer-plugin'",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OpencvPluginCache.Tests.ps1 -ResultFile logs/test-results/opencv-plugin-cache-mutation.json",
  "why": "Missing component counters must fail the structural lifecycle suite."
 },
 {
  "id": "sccache.opencv-plugin-stop",
  "target": "windows/scripts/build/Build-OpencvGstreamerPlugin.ps1",
  "find": "Complete-SccacheServerSession",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OpencvPluginCache.Tests.ps1 -ResultFile logs/test-results/opencv-plugin-cache-mutation.json",
  "why": "Missing server completion must fail before scratch removal."
 },
 {
  "id": "sccache.opencv-plugin-stop-before-cleanup",
  "target": "windows/scripts/build/Build-OpencvGstreamerPlugin.ps1",
  "find": "Complete-SccacheServerSession\n\n# Scrub the clone: ~500 MB of source that must not fatten the layer.\nRemove-Item -Path $SourceDir -Recurse -Force -ErrorAction SilentlyContinue",
  "replace": "# Scrub the clone: ~500 MB of source that must not fatten the layer.\nRemove-Item -Path $SourceDir -Recurse -Force -ErrorAction SilentlyContinue\nComplete-SccacheServerSession",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OpencvPluginCache.Tests.ps1 -ResultFile logs/test-results/opencv-plugin-cache-mutation.json",
  "why": "Completion after deleting the source must fail the ordering check."
 },
 {
  "id": "sccache.opencv-plugin-unconditional-stats",
  "target": "windows/scripts/build/Build-OpencvGstreamerPlugin.ps1",
  "find": "Write-SccacheStats -Label 'opencv-gstreamer-plugin'",
  "replace": "if ($false) { Write-SccacheStats -Label 'opencv-gstreamer-plugin' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OpencvPluginCache.Tests.ps1 -ResultFile logs/test-results/opencv-plugin-cache-mutation.json",
  "why": "Dead conditional stats must not satisfy the required unconditional call."
 },
 {
  "id": "sccache.opencv-plugin-label",
  "target": "windows/scripts/build/Build-OpencvGstreamerPlugin.ps1",
  "find": "Write-SccacheStats -Label 'opencv-gstreamer-plugin'",
  "replace": "Write-SccacheStats -Label 'build'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OpencvPluginCache.Tests.ps1 -ResultFile logs/test-results/opencv-plugin-cache-mutation.json",
  "why": "Counters must retain the component label for producer attribution."
 },
 {
  "id": "sccache.opencv-plugin-no-truncating-start",
  "target": "windows/scripts/build/Build-OpencvGstreamerPlugin.ps1",
  "find": "Write-SccacheStats -Label 'opencv-gstreamer-plugin'",
  "replace": "Start-SccacheServerSession\nWrite-SccacheStats -Label 'opencv-gstreamer-plugin'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.OpencvPluginCache.Tests.ps1 -ResultFile logs/test-results/opencv-plugin-cache-mutation.json",
  "why": "A fresh explicit session would truncate the preceding GStreamer log."
 },
 {
  "id": "lib.qnn-community-fixture-path-argv",
  "target": "linux/scripts/tests/test-qnn-community-zip.sh",
  "find": "env -i PATH=\"${PATH}\"",
  "replace": "env -i PATH=${PATH}",
  "test": "bash linux/scripts/tests/test-qnn-community-zip.sh",
  "why": "The SDK fixture must exercise complete environment values with spaces and glob characters on every host."
 },
 {
  "id": "lib.qnn-community-fixture-cache-argv",
  "target": "linux/scripts/tests/test-qnn-community-zip.sh",
  "find": "QNN_SDK_CACHE_DIR=\"${QNN_SDK_CACHE_DIR:?}\"",
  "replace": "QNN_SDK_CACHE_DIR=${QNN_SDK_CACHE_DIR:?}",
  "test": "bash linux/scripts/tests/test-qnn-community-zip.sh",
  "why": "The SDK fixture must exercise complete environment values with spaces and glob characters on every host."
 },
 {
  "id": "lib.qnn-community-fixture-extract-argv",
  "target": "linux/scripts/tests/test-qnn-community-zip.sh",
  "find": "QNN_SDK_EXTRACT_DIR=\"${QNN_SDK_EXTRACT_DIR:-}\"",
  "replace": "QNN_SDK_EXTRACT_DIR=${QNN_SDK_EXTRACT_DIR:-}",
  "test": "bash linux/scripts/tests/test-qnn-community-zip.sh",
  "why": "The SDK fixture must exercise complete environment values with spaces and glob characters on every host."
 },
 {
  "id": "dispatch-lanes.failed-promotion-stops-dispatch",
  "target": "linux/scripts/build-runtime-manifest.sh",
  "find": "  python3 \"${REPO_ROOT}/linux/scripts/image-acceptance.py\" promote --receipt \"${receipt}\" --target \"${IMAGE_NAME}\" || return 1\n",
  "replace": "  python3 \"${REPO_ROOT}/linux/scripts/image-acceptance.py\" promote --receipt \"${receipt}\" --target \"${IMAGE_NAME}\"\n",
  "test": "bash linux/scripts/tests/test-manifest-acceptance.sh",
  "why": "A failed promotion must stop before consumer dispatch, including when a conditional caller disables errexit."
 },
 {
  "id": "renovate.entrypoint-invalid-wrapper-executed",
  "target": "linux/scripts/verify_renovate_entrypoint.py",
  "find": "    if not errors:\n        errors.extend(help_errors(root, wrapper))",
  "replace": "    if not syntax.returncode:\n        errors.extend(help_errors(root, wrapper))",
  "test": "bash linux/scripts/tests/test-renovate-entrypoint.sh",
  "why": "A wrapper already rejected for missing delegation arguments must never execute; dropping help could start a live dependency lookup."
 },
 {
  "id": "probe.fixture-host-path-isolation",
  "target": "linux/scripts/tests/runtime-consumer-cases.sh",
  "find": "  local fixture_bin=\"$1\" probe_path=\"/usr/bin:/bin\"",
  "replace": "  local fixture_bin=\"$1\" probe_path=\"${_CC_HOST_TOOL_BIN}:/usr/bin:/bin\"",
  "test": "bash linux/scripts/tests/test-runtime-image-gates.sh",
  "why": "Synthetic consumer probes must not execute a host tool found outside their explicit fixture paths; injecting a controlled host SDK directory must fail."
 },
 {
  "id": "lib.hailort-cache-prologue",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Start-SccacheServerSession\n\nInvoke-CmakeConfigure -SourceDir $sourceRoot -BuildDir $BuildDir -InstallPrefix $InstallDir `\n    -BuildType $BuildType -ExtraArgs $cmakeExtra -TargetArch $targetArch",
  "replace": "Invoke-CmakeConfigure -SourceDir $sourceRoot -BuildDir $BuildDir -InstallPrefix $InstallDir `\n    -BuildType $BuildType -ExtraArgs $cmakeExtra -TargetArch $targetArch",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.HailortCache.Tests.ps1",
  "why": "The direct Hailo stage must own a fresh cache session before configure can compile nested protobuf."
 },
 {
  "id": "lib.hailort-cache-stats",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Write-SccacheStatsToStderr -Advanced -RequireRemote",
  "replace": "Write-Host 'Hailo cache statistics omitted'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.HailortCache.Tests.ps1",
  "why": "The direct Hailo stage needs a real stderr statistics call instead of an unmeasured successful compile."
 },
 {
  "id": "lib.hailort-cache-epilogue",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Complete-SccacheServerSession\n\n# Verify",
  "replace": "# Verify",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.HailortCache.Tests.ps1",
  "why": "The direct Hailo stage must use the shared upload drain and stop before success cleanup closes the layer."
 },
 {
  "id": "lib.hailort-cache-advanced",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Write-SccacheStatsToStderr -Advanced -RequireRemote",
  "replace": "Write-SccacheStatsToStderr -RequireRemote",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.HailortCache.Tests.ps1",
  "why": "Hailo statistics retain the selected advanced counter view."
 },
 {
  "id": "lib.hailort-cache-remote",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Write-SccacheStatsToStderr -Advanced -RequireRemote",
  "replace": "Write-SccacheStatsToStderr -Advanced",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.HailortCache.Tests.ps1",
  "why": "Statistics must not start a local cache server when the remote backend is deliberately disabled."
 },
 {
  "id": "lib.hailort-cache-conditional-stats",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Write-SccacheStatsToStderr -Advanced -RequireRemote",
  "replace": "if ($false) { Write-SccacheStatsToStderr -Advanced -RequireRemote }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.HailortCache.Tests.ps1",
  "why": "An unreachable statistics call cannot supply stage evidence."
 },
 {
  "id": "lib.hailort-cache-start-order",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Start-SccacheServerSession\n\nInvoke-CmakeConfigure -SourceDir $sourceRoot -BuildDir $BuildDir -InstallPrefix $InstallDir `\n    -BuildType $BuildType -ExtraArgs $cmakeExtra -TargetArch $targetArch",
  "replace": "Invoke-CmakeConfigure -SourceDir $sourceRoot -BuildDir $BuildDir -InstallPrefix $InstallDir `\n    -BuildType $BuildType -ExtraArgs $cmakeExtra -TargetArch $targetArch\nStart-SccacheServerSession",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.HailortCache.Tests.ps1",
  "why": "Resetting the session after configure loses nested protobuf compile counters."
 },
 {
  "id": "lib.hailort-cache-stop-order",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Write-SccacheStatsToStderr -Advanced -RequireRemote\nComplete-SccacheServerSession",
  "replace": "Complete-SccacheServerSession\nWrite-SccacheStatsToStderr -Advanced -RequireRemote",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.HailortCache.Tests.ps1",
  "why": "Stopping before reading counters would query a fresh server and lose the actual compile measurement."
 },
 {
  "id": "lib.hailort-cache-stats-order",
  "target": "windows/scripts/build/Build-HailortFromSource.ps1",
  "find": "Invoke-NinjaBuildWithRetry -BuildDir $BuildDir -Install -InstallConfig $BuildType\nWrite-SccacheStatsToStderr -Advanced -RequireRemote",
  "replace": "Write-SccacheStatsToStderr -Advanced -RequireRemote\nInvoke-NinjaBuildWithRetry -BuildDir $BuildDir -Install -InstallConfig $BuildType",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.HailortCache.Tests.ps1",
  "why": "The statistics snapshot must follow the real Hailo Ninja build."
 },
 {
  "id": "windows-lane.cleanup-decimal-mb",
  "target": "windows/scripts/host/Clear-DiskSpace.ps1",
  "find": "return [long][math]::Ceiling(([decimal]$GiB * 1GB) / 1000000)",
  "replace": "return [long]($GiB * 1024)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.StorageUnits.Tests.ps1",
  "why": "GiB admission must not become the smaller binary-MB target"
 },
 {
  "id": "windows-lane.cleanup-round-up",
  "target": "windows/scripts/host/Clear-DiskSpace.ps1",
  "find": "[math]::Ceiling(([decimal]$GiB * 1GB) / 1000000)",
  "replace": "[math]::Floor(([decimal]$GiB * 1GB) / 1000000)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.StorageUnits.Tests.ps1",
  "why": "integer MB must round up rather than understate the requested bytes"
 },
 {
  "id": "windows-lane.cleanup-regular-arguments",
  "target": "windows/scripts/host/Clear-DiskSpace.ps1",
  "find": "--free-storage (Get-BuildkitFreeTargetMB -GiB $TargetGB)",
  "replace": "--free-storage ($TargetGB * 1024)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.StorageUnits.Tests.ps1",
  "why": "the actual regular-only daemon command must receive corrected units"
 },
 {
  "id": "windows-lane.cleanup-general-arguments",
  "target": "windows/scripts/host/Clear-DiskSpace.ps1",
  "find": "$freeTargetMB = Get-BuildkitFreeTargetMB -GiB $KeepGB",
  "replace": "$freeTargetMB = $KeepGB * 1024",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.StorageUnits.Tests.ps1",
  "why": "general pruning must use the same unit boundary"
 },
 {
  "id": "windows-lane.cleanup-advice-arguments",
  "target": "windows/scripts/host/Clear-DiskSpace.ps1",
  "find": "-f (Get-BuildkitFreeTargetMB -GiB $KeepGB))",
  "replace": "-f ($KeepGB * 1024))",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.StorageUnits.Tests.ps1",
  "why": "printed advice must not reintroduce the wrong unit conversion"
 },
 {
  "id": "disk-guard.lifecycle-fixture-buildkit-prune-disabled",
  "target": "linux/scripts/tests/test-chain-lifecycle.sh",
  "find": "export CROSS_BUILDKIT_PRUNE=0 CROSS_IMAGE_PRUNE=0",
  "replace": "export CROSS_BUILDKIT_PRUNE=1 CROSS_IMAGE_PRUNE=0",
  "test": "bash linux/scripts/tests/test-chain-lifecycle-engine-isolation.sh",
  "why": "a low-disk lifecycle fixture must not inherit permission to prune the host BuildKit store before its recovery doubles are installed"
 },
 {
  "id": "disk-guard.lifecycle-fixture-image-prune-disabled",
  "target": "linux/scripts/tests/test-chain-lifecycle.sh",
  "find": "export CROSS_BUILDKIT_PRUNE=0 CROSS_IMAGE_PRUNE=0",
  "replace": "export CROSS_BUILDKIT_PRUNE=0 CROSS_IMAGE_PRUNE=1",
  "test": "bash linux/scripts/tests/test-chain-lifecycle-engine-isolation.sh",
  "why": "disabling only BuildKit still leaves the lifecycle fixture able to prune or retire real images through the image-store fallback"
 },
 {
  "id": "lib.torchvision-cache-host-launcher",
  "target": "windows/scripts/patches/pytorch/001-torchvision-host-sccache.patch",
  "find": "+        cxx = [os.environ['TORCHVISION_CXX_COMPILER_LAUNCHER'], compiler]",
  "replace": "+        cxx = [compiler]",
  "test": "bash linux/scripts/tests/test-torchvision-cache-patch.sh",
  "why": "the actual patch must place the launcher before the real host compiler as separate arguments"
 },
 {
  "id": "lib.torchvision-cache-windows-scope",
  "target": "windows/scripts/patches/pytorch/001-torchvision-host-sccache.patch",
  "find": "+    if IS_WINDOWS and IS_HIP_EXTENSION and os.environ.get(",
  "replace": "+    if IS_HIP_EXTENSION and os.environ.get(",
  "test": "bash linux/scripts/tests/test-torchvision-cache-patch.sh",
  "why": "a Windows host compiler launcher must not change the Linux HIP route"
 },
 {
  "id": "lib.torchvision-cache-hip-scope",
  "target": "windows/scripts/patches/pytorch/001-torchvision-host-sccache.patch",
  "find": "+    if IS_WINDOWS and IS_HIP_EXTENSION and os.environ.get(",
  "replace": "+    if IS_WINDOWS and os.environ.get(",
  "test": "bash linux/scripts/tests/test-torchvision-cache-patch.sh",
  "why": "the ROCm builder patch must not change the Windows non-HIP route"
 },
 {
  "id": "lib.torchvision-cache-patch-required",
  "target": "windows/scripts/build/Build-TorchvisionRocmFromSource.ps1",
  "find": "    Invoke-RequiredSourcePatch -PatchFile (Join-Path $PatchRoot 'pytorch\\001-torchvision-host-sccache.patch')",
  "replace": "    & { param($PatchFile, $SourceDir) } -PatchFile (Join-Path $PatchRoot 'pytorch\\001-torchvision-host-sccache.patch')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Torchvision.RocmCache.Tests.ps1",
  "why": "the build venv must actually receive its required reviewed patch before a launcher is accepted"
 },
 {
  "id": "lib.torchvision-cache-missing-tool",
  "target": "windows/scripts/build/Build-TorchvisionRocmFromSource.ps1",
  "find": "    if (-not $SccachePath) { return }",
  "replace": "    if ($false) { return }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Torchvision.RocmCache.Tests.ps1",
  "why": "missing sccache must preserve the existing unpatched optional-cache path"
 },
 {
  "id": "lib.torchvision-cache-launcher-value",
  "target": "windows/scripts/build/Build-TorchvisionRocmFromSource.ps1",
  "find": "    $BuildEnv['TORCHVISION_CXX_COMPILER_LAUNCHER'] = $SccachePath",
  "replace": "    $BuildEnv['TORCHVISION_CXX_COMPILER_LAUNCHER'] = 'sccache ' + $SccachePath",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Torchvision.RocmCache.Tests.ps1",
  "why": "the launcher must remain one real executable path, without a shell-style compiler prefix"
 },
 {
  "id": "lib.torchvision-cache-builder-call",
  "target": "windows/scripts/build/Build-TorchvisionRocmFromSource.ps1",
  "find": "Enable-TorchvisionRocmCompilerCache -WorkDir $WorkDir -BuildEnv $visionEnv -SccachePath $sccachePath -PatchRoot (Join-Path $scriptAssetRoot 'patches')",
  "replace": "Write-Verbose 'compiler cache unwired'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Torchvision.RocmCache.Tests.ps1",
  "why": "the unconditional cache setup must happen before publishing environment and building the wheel"
 },
 {
  "id": "lib.torchvision-cache-patch-mount",
  "target": "windows/Dockerfile.torch",
  "find": "source=windows/scripts/patches/pytorch/001-torchvision-host-sccache.patch,target=C:\\bkmnt\\patches\\pytorch\\001-torchvision-host-sccache.patch",
  "replace": "source=windows/scripts/patches/pytorch/not-installed.patch,target=C:\\bkmnt\\patches\\pytorch\\001-torchvision-host-sccache.patch",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Torch.Rocm.Dockerfile.Tests.ps1 -Jobs 1 -ResultFile logs/mutation-results/torchvision-cache-mount.json",
  "why": "the torchvision RUN must carry the exact patch without re-keying the torch RUN"
 },
 {
  "id": "msvc-notice.portable-bundle-output",
  "target": "windows/scripts/modules/WindowsCrossBundle.Common.psm1",
  "find": "{ & $PackageCheck $installer.FullName $redist | Out-Host }",
  "replace": "{ & $PackageCheck $installer.FullName $redist }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only CrossBundle.PackageCheck.Tests.ps1",
  "why": "successful package-check proof lines must remain visible without contaminating the single bundle result"
 },
 {
  "id": "msvc-notice.portable-bundle-failure",
  "target": "windows/scripts/modules/WindowsCrossBundle.Common.psm1",
  "find": "{ & $PackageCheck $installer.FullName $redist | Out-Host }",
  "replace": "{ try { & $PackageCheck $installer.FullName $redist | Out-Host } catch { } }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only CrossBundle.PackageCheck.Tests.ps1",
  "why": "a rejected installer must fail the bundle before any package is copied"
 },
 {
  "id": "windows-lane.patch-drift-pytorch-mapping",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "        'pytorch'        = @{ Url = 'https://github.com/pytorch/pytorch.git';        Ref = $Refs.PYTORCH }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Patches.ApplyClean.Tests.ps1 -ResultFile logs/code-quality/patch-drift-mutation.json",
  "why": "every current static patch needs an upstream mapping before clone or apply checks can grade it"
 },
 {
  "id": "windows-lane.patch-drift-pytorch-source-pin",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "@{ Ref = 'PYTORCH';     Key = 'PYTORCH_VERSION' }",
  "replace": "@{ Ref = 'PYTORCH';     Key = 'UNUSED_PYTORCH_VERSION' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Patches.ApplyClean.Tests.ps1 -ResultFile logs/code-quality/patch-drift-mutation.json",
  "why": "the torchvision host adapter patches PyTorch and must follow its existing source pin instead of a fallback"
 },
 {
  "id": "windows-lane.patch-drift-pytorch-owner",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "https://github.com/pytorch/pytorch.git",
  "replace": "https://github.com/pytorch/vision.git",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Patches.ApplyClean.Tests.ps1 -ResultFile logs/code-quality/patch-drift-mutation.json",
  "why": "torch/utils/cpp_extension.py belongs to PyTorch even though torchvision consumes this host compiler adapter"
 },
 {
  "id": "lib.windows-module-view-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "     C:\\bkmods\\\n# The view keeps copied module files readable through Windows bind mounts.\nRUN cmd /c exit 0",
  "replace": "     C:\\bkmods\\\n# The view keeps copied module files readable through Windows bind mounts.",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "A copied shared module closure must keep its own readable source view before a long compile can import it."
 },
 {
  "id": "lib.windows-module-view-tvm",
  "target": "windows/Dockerfile.media-builder",
  "find": "COPY windows\\scripts\\modules\\WindowsTvm.Common.psm1 C:\\bkmods\\\n# The private COPY needs its own readable view after the shared closure.\nRUN cmd /c exit 0",
  "replace": "COPY windows\\scripts\\modules\\WindowsTvm.Common.psm1 C:\\bkmods\\\n# The private COPY needs its own readable view after the shared closure.",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "A copied tvm module closure must keep its own readable source view before a long compile can import it."
 },
 {
  "id": "lib.windows-module-view-merge",
  "target": "windows/Dockerfile.media-merge-builder",
  "find": "     C:\\bkmods\\\n# The view keeps copied module files readable through Windows bind mounts.\nRUN cmd /c exit 0",
  "replace": "     C:\\bkmods\\\n# The view keeps copied module files readable through Windows bind mounts.",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "A copied merge module closure must keep its own readable source view before a long compile can import it."
 },
 {
  "id": "lib.windows-module-view-migraphx",
  "target": "windows/Dockerfile.rocm-migraphx",
  "find": "     C:\\bkmods\\\n# The view keeps copied module files readable through Windows bind mounts.\nRUN cmd /c exit 0",
  "replace": "     C:\\bkmods\\\n# The view keeps copied module files readable through Windows bind mounts.",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "A copied migraphx module closure must keep its own readable source view before a long compile can import it."
 },
 {
  "id": "lib.windows-module-view-llama",
  "target": "windows/Dockerfile.rocm-llama",
  "find": "     C:\\bkmods\\\n# The view keeps copied module files readable through Windows bind mounts.\nRUN cmd /c exit 0",
  "replace": "     C:\\bkmods\\\n# The view keeps copied module files readable through Windows bind mounts.",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "A copied llama module closure must keep its own readable source view before a long compile can import it."
 },
 {
  "id": "lib.windows-module-view-copy-order",
  "target": "windows/Dockerfile.media-builder",
  "find": "COPY windows\\scripts\\modules\\WindowsTvm.Common.psm1 C:\\bkmods\\\n# The private COPY needs its own readable view after the shared closure.\nRUN cmd /c exit 0",
  "replace": "RUN cmd /c exit 0\nCOPY windows\\scripts\\modules\\WindowsTvm.Common.psm1 C:\\bkmods\\\n# The private COPY needs its own readable view after the shared closure.",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "A view before the private COPY leaves a new unmaterialized top layer and must fail the order guard."
 },
 {
  "id": "lib.windows-module-view-scan-coverage",
  "target": "windows/scripts/tests/BuildKit.MountStub.Tests.ps1",
  "find": "'Dockerfile.rocm-migraphx', 'Dockerfile.rocm-llama'",
  "replace": "'Dockerfile.rocm-migraphx'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Dropping a copied ROCm closure from the scan must fail the complete five-stage accounting."
 },
 {
  "id": "lib.windows-module-view-arch-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "FROM ${BASE_IMAGE} AS buildmods\nARG WINDOWS_TARGET_ARCH=amd64\nCOPY ",
  "replace": "FROM ${BASE_IMAGE} AS buildmods\nCOPY ",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "An external shared module view now RUNs and must keep the target architecture argument in its own scope."
 },
 {
  "id": "lib.windows-module-view-arch-merge",
  "target": "windows/Dockerfile.media-merge-builder",
  "find": "FROM ${BASE_IMAGE} AS buildmods\nARG WINDOWS_TARGET_ARCH=amd64\nCOPY ",
  "replace": "FROM ${BASE_IMAGE} AS buildmods\nCOPY ",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "An external merge module view now RUNs and must keep the target architecture argument in its own scope."
 },
 {
  "id": "lib.windows-module-view-arch-migraphx",
  "target": "windows/Dockerfile.rocm-migraphx",
  "find": "FROM ${BASE_IMAGE} AS migraphxmods\nARG WINDOWS_TARGET_ARCH=amd64\nCOPY ",
  "replace": "FROM ${BASE_IMAGE} AS migraphxmods\nCOPY ",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "An external migraphx module view now RUNs and must keep the target architecture argument in its own scope."
 },
 {
  "id": "lib.windows-module-view-arch-llama",
  "target": "windows/Dockerfile.rocm-llama",
  "find": "FROM ${BASE_IMAGE} AS llamamods\nARG WINDOWS_TARGET_ARCH=amd64\nCOPY ",
  "replace": "FROM ${BASE_IMAGE} AS llamamods\nCOPY ",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "An external llama module view now RUNs and must keep the target architecture argument in its own scope."
 },
 {
  "id": "lib.rocm-structure-pin-stage",
  "target": "windows/scripts/tests/WindowsHarness.DockerFixtures.psm1",
  "find": "Get-TestDockerfileStageLines -Path $Path -Stage $Stage |",
  "replace": "Get-TestDockerfileStageLines -Path $Path -Stage migraphxmods |",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.Structure.Tests.ps1 -ResultFile logs/code-quality/rocm-structure-mutation.json",
  "why": "A source view does not supply the compiling stage pin defaults."
 },
 {
  "id": "lib.rocm-structure-pin-whole-file",
  "target": "windows/scripts/tests/WindowsHarness.DockerFixtures.psm1",
  "find": "Get-TestDockerfileStageLines -Path $Path -Stage $Stage |",
  "replace": "(Get-TestDockerfileStagesFromPath -Path $Path -JoinContinuations -IgnoreComments -TrimLines -StrictFromHeader).Stages.Lines |",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.Structure.Tests.ps1 -ResultFile logs/code-quality/rocm-structure-mutation.json",
  "why": "Scanning every stage mixes view configuration with compiling-stage pins and can hide a missing pin."
 },
 {
  "id": "lib.rocm-structure-llama-required-module",
  "target": "windows/Dockerfile.rocm-llama",
  "find": "     windows\\scripts\\modules\\WindowsTargetArch.Common.psm1 `\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.Structure.Tests.ps1 -ResultFile logs/code-quality/rocm-structure-mutation.json",
  "why": "The parsed closure must still reject a genuinely missing required module after an ARG precedes COPY."
 },
 {
  "id": "lib.rocm-structure-llama-stage",
  "target": "windows/Dockerfile.rocm-llama",
  "find": "FROM ${BASE_IMAGE} AS llamamods",
  "replace": "FROM ${BASE_IMAGE} AS missing-llamamods",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Rocm.Structure.Tests.ps1 -ResultFile logs/code-quality/rocm-structure-mutation.json",
  "why": "A missing named source stage must fail before inspecting its module declarations."
 },
 {
  "id": "windows-lane.ort-source-commit-shape",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "$ExpectedCommit -cnotmatch '^[0-9a-f]{40}$'",
  "replace": "$false",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "Malformed or abbreviated source pins must fail before the destination changes."
 },
 {
  "id": "windows-lane.ort-source-version-shape",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "$Version -notmatch '^\\d+\\.\\d+\\.\\d+$'",
  "replace": "$false",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "Malformed release names must fail before the destination changes."
 },
 {
  "id": "windows-lane.ort-source-commit-identity",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "$actual[0] -cne $ExpectedCommit",
  "replace": "$false",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "A primary tag resolving to another commit must refuse without a fallback override."
 },
 {
  "id": "windows-lane.ort-source-version-identity",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "$actualVersion -cne $Version",
  "replace": "$false",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "The pinned root must contain the requested release version."
 },
 {
  "id": "windows-lane.ort-source-fallback-status",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "$fallback.ExitCode -ne 0",
  "replace": "$false",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "A failed recursive source transport cannot become a successful clone."
 },
 {
  "id": "windows-lane.ort-source-native-status",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "ExitCode = $code; Output = $output.ToArray()",
  "replace": "ExitCode = 0; Output = $output.ToArray()",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "Preserve failed fetch and submodule exit codes."
 },
 {
  "id": "windows-lane.ort-source-shallow-fetch",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "'fetch', '--depth=1', '--no-tags', 'origin', $Commit",
  "replace": "'fetch', '--no-tags', 'origin', $Commit",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "The exact-commit fallback must not download full history."
 },
 {
  "id": "windows-lane.ort-source-recursive-fetch",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "if ($Recursive) { $steps +=",
  "replace": "if ($false) { $steps +=",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "A root checkout alone is incomplete when pinned submodules are required."
 },
 {
  "id": "windows-lane.ort-source-caller-order",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "Invoke-OrtSourceClone -SourceDir $SourceDir -Version $OnnxVersion -ExpectedCommit $env:ONNXRUNTIME_WINDOWS_SOURCE_COMMIT | Out-Null",
  "replace": "if ($false) { Invoke-OrtSourceClone -SourceDir $SourceDir -Version $OnnxVersion -ExpectedCommit $env:ONNXRUNTIME_WINDOWS_SOURCE_COMMIT | Out-Null }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "The source identity check must be unconditional before source patches."
 },
 {
  "id": "windows-lane.ort-source-release-pin",
  "target": "linux/scripts/01-core/versions.env",
  "find": "ONNXRUNTIME_WINDOWS_SOURCE_COMMIT=6af1a932e2286d5c58166085d24c68783033edee",
  "replace": "ONNXRUNTIME_WINDOWS_SOURCE_COMMIT=0000000000000000000000000000000000000000",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "The release configuration must retain the independently recorded full original commit."
 },
 {
  "id": "windows-lane.ort-source-driver-pin",
  "target": "windows/scripts/modules/WindowsBuildDriver.Common.psm1",
  "find": "'ONNXRUNTIME_VERSION', 'ONNXRUNTIME_WINDOWS_SOURCE_COMMIT', 'ONNXRUNTIME_GENAI_VERSION'",
  "replace": "'ONNXRUNTIME_VERSION', 'ONNXRUNTIME_GENAI_VERSION'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The driver must forward the core source pin."
 },
 {
  "id": "windows-lane.ort-source-merge-scope",
  "target": "windows/scripts/modules/WindowsBuildDriver.Common.psm1",
  "find": "'NV_CODEC_HEADERS_REF', 'CUDA_ARCHITECTURES', 'ONNXRUNTIME_WINDOWS_SOURCE_COMMIT'",
  "replace": "'NV_CODEC_HEADERS_REF', 'CUDA_ARCHITECTURES'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "A core compile-only source pin must not pollute the merge cache key."
 },
 {
  "id": "windows-lane.ort-source-stage-arg",
  "target": "windows/Dockerfile.media-builder",
  "find": "ARG ONNXRUNTIME_WINDOWS_SOURCE_COMMIT\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The ONNX stage must declare its forwarded source commit."
 },
 {
  "id": "windows-lane.ort-source-stage-env",
  "target": "windows/Dockerfile.media-builder",
  "find": "    ONNXRUNTIME_WINDOWS_SOURCE_COMMIT=\"${ONNXRUNTIME_WINDOWS_SOURCE_COMMIT}\" `\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The declared source commit must reach the builder process."
 },
 {
  "id": "windows-lane.ort-source-primary-retries",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "[int]$MaxAttempts = 3, [int]$InitialDelaySeconds = 10",
  "replace": "[int]$MaxAttempts = 2, [int]$InitialDelaySeconds = 10",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "The source recovery retains all three canonical primary attempts before fallback."
 },
 {
  "id": "windows-lane.ort-command-map-text-selection",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "if ($TextContains.ContainsKey($commandName))",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.Ast.Tests.ps1",
  "why": "Shared source-command selection retains the caller-specific text filter before checking uniqueness."
 },
 {
  "id": "windows-lane.ort-command-map-unconditional",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "foreach ($commandName in $UnconditionalText.Keys)",
  "replace": "foreach ($commandName in @())",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.Ast.Tests.ps1",
  "why": "Shared required command maps retain caller-selected unconditional execution assertions."
 },
 {
  "id": "windows-lane.qnn-source-release-pin",
  "target": "linux/scripts/01-core/versions.env",
  "find": "ORT_QNN_EP_CORE_COMMIT=2e2543fbe9fae542f921d47a72d21d5a4ef0b710",
  "replace": "ORT_QNN_EP_CORE_COMMIT=0000000000000000000000000000000000000000",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The separate header release retains its independently recorded full original commit."
 },
 {
  "id": "windows-lane.qnn-source-committed-archive",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "\"--output=$archive\" $Commit | Out-Host",
  "replace": "\"--output=$archive\" HEAD | Out-Host",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The archive uses the checked commit even when the repository HEAD has moved."
 },
 {
  "id": "windows-lane.qnn-source-archive-line-endings",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "-c core.autocrlf=false -c core.eol=lf ",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "Host autocrlf must not change canonical header bytes or break the upstream patches."
 },
 {
  "id": "windows-lane.qnn-source-archive-status",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "    if ($LASTEXITCODE -ne 0) { throw \"QNN ort_core archive failed (exit $LASTEXITCODE).\" }",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "A failed native archive command remains fatal."
 },
 {
  "id": "windows-lane.qnn-source-archive-hash",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "$Archive -Algorithm SHA256 -ErrorAction Stop",
  "replace": "$Archive -Algorithm SHA384 -ErrorAction Stop",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The local archive hash and CMake algorithm must agree exactly."
 },
 {
  "id": "windows-lane.qnn-source-dependency-cardinality",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "$entries.Count -ne 1 -or $entries[0].Value -cnotmatch $change.Expected",
  "replace": "$entries.Count -eq 0 -or $entries[0].Value -cnotmatch $change.Expected",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "Duplicate dependency declarations must refuse before substitution."
 },
 {
  "id": "windows-lane.qnn-source-dependency-release",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "[regex]::Escape($Version)",
  "replace": "'1.31.1'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The dependency release comes from the unchanged QNN fork, separately from the newer chain core."
 },
 {
  "id": "windows-lane.qnn-source-original-digest-shape",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "'\\.zip;[0-9a-f]{40}$'",
  "replace": "'\\.zip;[0-9a-f]+$'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "An unverified original dependency declaration is not silently replaced."
 },
 {
  "id": "windows-lane.qnn-source-persisted-substitution",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "return $entries.Count -eq 1 -and $entries[0].Value -ceq $change.Replacement",
  "replace": "return $true",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "A helper that writes nothing must fail the persisted archive metadata check."
 },
 {
  "id": "windows-lane.qnn-source-cmake-sha256",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "Replacement = 'URL_HASH SHA256=${DEP_SHA1_ort_core}'",
  "replace": "Replacement = 'URL_HASH SHA1=${DEP_SHA1_ort_core}'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "CMake verifies the new local archive with SHA256 without dropping its patch population."
 },
 {
  "id": "windows-lane.qnn-source-fork-core-version",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "$coreVersion = Get-OrtQnnEpCoreVersion -ForkRoot $forkRoot",
  "replace": "$coreVersion = '1.31.1'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The executable source path must read the fork-declared header release before cloning."
 },
 {
  "id": "windows-lane.qnn-source-clone-unconditional",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "$null = Invoke-OrtSourceClone -SourceDir $coreSource -Version $coreVersion -ExpectedCommit $env:ORT_QNN_EP_CORE_COMMIT",
  "replace": "if ($false) { $null = Invoke-OrtSourceClone -SourceDir $coreSource -Version $coreVersion -ExpectedCommit $env:ORT_QNN_EP_CORE_COMMIT }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The exact-commit source identity check must execute before archiving and configuring."
 },
 {
  "id": "windows-lane.qnn-source-substitution-unconditional",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "Set-OrtQnnEpCoreArchive -ForkRoot $forkRoot -Archive $coreArchive -Version $coreVersion",
  "replace": "if ($false) { Set-OrtQnnEpCoreArchive -ForkRoot $forkRoot -Archive $coreArchive -Version $coreVersion }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The original unavailable download cannot remain selected at configure time."
 },
 {
  "id": "windows-lane.qnn-source-archive-pin",
  "target": "windows/scripts/build/Build-OrtQnnEpFromSource.ps1",
  "find": "$coreArchive = Save-OrtQnnEpCoreArchive -SourceDir $coreSource -Root $SourceDir -Version $coreVersion -Commit $env:ORT_QNN_EP_CORE_COMMIT",
  "replace": "$coreArchive = Save-OrtQnnEpCoreArchive -SourceDir $coreSource -Root $SourceDir -Version $coreVersion -Commit $env:ONNXRUNTIME_WINDOWS_SOURCE_COMMIT",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The archive and clone must use the same separate header commit."
 },
 {
  "id": "windows-lane.qnn-source-driver-pin",
  "target": "windows/scripts/modules/WindowsBuildDriver.Common.psm1",
  "find": "'ORT_QNN_EP_VERSION', 'ORT_QNN_EP_SOURCE_SHA256', 'ORT_QNN_EP_CORE_COMMIT', 'ORT_TENSORRT_EP_COMMIT'",
  "replace": "'ORT_QNN_EP_VERSION', 'ORT_QNN_EP_SOURCE_SHA256', 'ORT_TENSORRT_EP_COMMIT'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The media-core driver forwards the separate header commit."
 },
 {
  "id": "windows-lane.qnn-source-merge-scope",
  "target": "windows/scripts/modules/WindowsBuildDriver.Common.psm1",
  "find": "'ORT_QNN_EP_VERSION', 'ORT_QNN_EP_SOURCE_SHA256', 'ORT_QNN_EP_CORE_COMMIT', # media-core: the QNN plugin EP fork",
  "replace": "'ORT_QNN_EP_VERSION', 'ORT_QNN_EP_SOURCE_SHA256', # media-core: the QNN plugin EP fork",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The compile-only QNN header pin must not pollute the media merge key."
 },
 {
  "id": "windows-lane.qnn-source-stage-arg",
  "target": "windows/Dockerfile.media-builder",
  "find": "ARG ORT_QNN_EP_CORE_COMMIT\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The ONNX compile stage declares the forwarded QNN header commit."
 },
 {
  "id": "windows-lane.qnn-source-stage-env",
  "target": "windows/Dockerfile.media-builder",
  "find": "    ORT_QNN_EP_CORE_COMMIT=\"${ORT_QNN_EP_CORE_COMMIT}\" `\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The stage passes the header commit to the QNN builder process."
 },
 {
  "id": "windows-lane.qnn-fixture-callback-arguments",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "        & $Body $d @FixtureArgumentList\n",
  "replace": "        & $Body $d\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.Fixtures.Tests.ps1 -ResultFile logs/test-results/qnn-source-mutations/fixtures.json",
  "why": "Shared directory fixture callbacks retain argument identity, boundaries and nested collections."
 },
 {
  "id": "windows-lane.qnn-fixture-committed-identity",
  "target": "windows/scripts/tests/WindowsHarness.GitFixtures.psm1",
  "find": "    if ($PassThru) { Invoke-TestGitCommand -Path $Path -ArgumentList @('rev-parse', 'HEAD') }",
  "replace": "    if ($false) { }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Harness.GitFixtures.Tests.ps1",
  "why": "Optional Git fixture commit results preserve the full actual identity while the default stays silent."
 },
 {
  "id": "windows-lane.qnn-fixture-caller-bindings",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "function Invoke-InTestDir {\n    param([Parameter(Mandatory)][scriptblock]$Body, [Collections.IDictionary]$Files, [Alias('Prefix')][string]$DirectoryPrefix = 'wbt-', [object[]]$FixtureArgumentList = @())\n    $global:LASTEXITCODE = 0\n    $d = New-TestDir -Prefix $DirectoryPrefix -Files $Files\n    try {\n        & $Body $d @FixtureArgumentList\n    }\n    finally { Remove-TestDir -Path $d }\n}\n",
  "replace": "function Invoke-InTestDir {\n    param([Parameter(Mandatory)][scriptblock]$Body, [Collections.IDictionary]$Files, [Alias('Prefix')][string]$DirectoryPrefix = 'wbt-', [Alias('FixtureArgumentList')][object[]]$BodyArgumentList = @())\n    $global:LASTEXITCODE = 0\n    $d = New-TestDir -Prefix $DirectoryPrefix -Files $Files\n    try {\n        & $Body $d @BodyArgumentList\n    }\n    finally { Remove-TestDir -Path $d }\n}\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Harness.Fixtures.Tests.ps1 -ResultFile logs/test-results/qnn-source-mutations/fixtures.json",
  "why": "Directory fixture argument transport must not hide the enclosing function-module callback bindings."
 },
 {
  "id": "windows-lane.source-pin-context-branch",
  "target": "windows/scripts/tests/TestHarness.psm1",
  "find": "Get-MediaBranchVersionArg -Branch $Branch -VersionTable $versions",
  "replace": "Get-MediaBranchVersionArg -Branch 'media-core' -VersionTable $versions",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "Shared pin fixtures retain the selected branch and keep compile-only source pins out of unrelated branches."
 },
 {
  "id": "windows-lane.ort-patch-source-pin-selector",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "@{ Ref = 'ONNXRUNTIME_SOURCE_COMMIT'; Key = 'ONNXRUNTIME_WINDOWS_SOURCE_COMMIT' }",
  "replace": "@{ Ref = 'ONNXRUNTIME_SOURCE_COMMIT'; Key = 'UNUSED_ONNXRUNTIME_SOURCE_COMMIT' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "Patch drift must use the reviewed full original commit rather than an absent or unrelated pin."
 },
 {
  "id": "windows-lane.ort-patch-source-pin-map",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "ExpectedCommit = $Refs.ONNXRUNTIME_SOURCE_COMMIT",
  "replace": "ExpectedCommit = ('f' * 40)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "The checked configured commit must reach the ONNX patch repository specification."
 },
 {
  "id": "windows-lane.ort-patch-mirror-owner",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "https://github.com/ROCm/onnxruntime.git",
  "replace": "https://github.com/microsoft/onnxruntime.git",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "A fallback to the unavailable primary repository cannot recover the original pinned source."
 },
 {
  "id": "windows-lane.ort-patch-shared-import",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "Import-Module (Join-Path (Split-Path $PSScriptRoot -Parent) 'modules\\WindowsSourceBuild.Common.psm1') -ErrorAction Stop\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "The real entry point must import its shared identity validators before any patch checkout."
 },
 {
  "id": "windows-lane.ort-patch-pin-before-checkout",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "        Assert-OrtSourcePin -Version $version -ExpectedCommit $Spec.ExpectedCommit\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "Malformed commit pins must fail before creating a patch source checkout."
 },
 {
  "id": "windows-lane.ort-patch-identity-before-cache",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "        Assert-OrtSourceIdentity -SourceDir $Clone -Version $version -ExpectedCommit $Spec.ExpectedCommit\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "A wrong commit or release cannot enter the patch clone cache after a successful transport."
 },
 {
  "id": "windows-lane.ort-patch-tagless-commit",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "$fallback = @{ Url = $Spec.FallbackUrl; Ref = $Spec.ExpectedCommit }",
  "replace": "$fallback = @{ Url = $Spec.FallbackUrl; Ref = $Spec.Ref }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "The mirror is keyed by the original full commit and need not carry the upstream release tag."
 },
 {
  "id": "windows-lane.ort-patch-sparse-input",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "--filter=blob:none --sparse $Spec.Url $Clone",
  "replace": "--filter=blob:none $Spec.Url $Clone",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "Patch checking retains sparse source selection instead of materializing a full long-path source tree."
 },
 {
  "id": "windows-lane.ort-patch-lf-input",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "clone --config core.autocrlf=false --depth 1",
  "replace": "clone --depth 1",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "Inherited user autocrlf settings must not rewrite patch inputs during sparse checkout."
 },
 {
  "id": "windows-lane.ort-patch-failed-cache",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "    if ($result.Error) { return $result }\n    $Clones[$cacheKey] = $clone",
  "replace": "    $Clones[$cacheKey] = $clone",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "Failed original or fallback clones must never enter the shared clone cache."
 },
 {
  "id": "windows-lane.ort-patch-primary-first",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "        if ($result.Error) {\n",
  "replace": "        if ($true) {\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "A healthy checked primary release must not depend on an unnecessary fallback."
 },
 {
  "id": "windows-lane.ort-patch-identity-export",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "    'Assert-OrtSourceIdentity',\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "The patch gate calls the shared identity API from a cold entry scope, so its export is required."
 },
 {
  "id": "windows-lane.ort-patch-fixture-payload-path",
  "target": "windows/scripts/tests/WindowsOrt.SourceFixture.psm1",
  "find": "-PayloadPath $fixturePayloadPath -VersionFile $fixtureVersionFile -Version $fixtureRelease\n",
  "replace": "-PayloadPath 'payload.txt' -VersionFile $fixtureVersionFile -Version $fixtureRelease\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Patches.ApplyClean.Tests.ps1",
  "why": "The shared release fixture retains the requested nested payload path so sparse and patch checks exercise the real target."
 },
 {
  "id": "windows-lane.genai-source-version-file-forwarded",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "Assert-OrtSourceIdentity -SourceDir $SourceDir -Version $Version -ExpectedCommit $ExpectedCommit -VersionFile $VersionFile",
  "replace": "Assert-OrtSourceIdentity -SourceDir $SourceDir -Version $Version -ExpectedCommit $ExpectedCommit",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "GenAI must pass its selected VERSION_INFO through the common identity check."
 },
 {
  "id": "windows-lane.genai-source-version-file-read",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "(Join-Path $SourceDir $VersionFile)",
  "replace": "(Join-Path $SourceDir 'VERSION_NUMBER')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "A GenAI checkout has VERSION_INFO rather than the core VERSION_NUMBER."
 },
 {
  "id": "windows-lane.genai-source-selector-before-write",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "[ValidateSet('VERSION_NUMBER', 'VERSION_INFO')][string]$VersionFile = 'VERSION_NUMBER',",
  "replace": "[string]$VersionFile = 'VERSION_NUMBER',",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "An invalid clone selector must refuse before any destination reset."
 },
 {
  "id": "windows-lane.genai-source-direct-selector",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "[ValidateSet('VERSION_NUMBER', 'VERSION_INFO')][string]$VersionFile = 'VERSION_NUMBER')",
  "replace": "[string]$VersionFile = 'VERSION_NUMBER')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "The direct source identity API must not accept an arbitrary matching payload as a release version file."
 },
 {
  "id": "windows-lane.genai-source-unconditional",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "Invoke-OrtSourceClone -SourceDir $SourceDir -Version $OnnxGenAiVersion -ExpectedCommit $env:ONNXRUNTIME_GENAI_WINDOWS_SOURCE_COMMIT `\n    -RepoUrl 'https://github.com/microsoft/onnxruntime-genai.git' -FallbackRepoUrl 'https://github.com/CodeLinaro/onnxruntime-genai.git' -VersionFile 'VERSION_INFO' | Out-Null",
  "replace": "if ($false) {\nInvoke-OrtSourceClone -SourceDir $SourceDir -Version $OnnxGenAiVersion -ExpectedCommit $env:ONNXRUNTIME_GENAI_WINDOWS_SOURCE_COMMIT `\n    -RepoUrl 'https://github.com/microsoft/onnxruntime-genai.git' -FallbackRepoUrl 'https://github.com/CodeLinaro/onnxruntime-genai.git' -VersionFile 'VERSION_INFO' | Out-Null\n}",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "The pinned clone must execute unconditionally before patches and configure."
 },
 {
  "id": "windows-lane.genai-source-mirror-owner",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "https://github.com/CodeLinaro/onnxruntime-genai.git",
  "replace": "https://github.com/microsoft/onnxruntime-genai.git",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "Recovery must use the reviewed reachable fork rather than repeat the unavailable primary transport."
 },
 {
  "id": "windows-lane.genai-source-version-info",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "-VersionFile 'VERSION_INFO'",
  "replace": "-VersionFile 'VERSION_NUMBER'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "The GenAI builder must select its own version file explicitly."
 },
 {
  "id": "windows-lane.genai-source-stage-arg",
  "target": "windows/Dockerfile.media-builder",
  "find": "ARG ONNXRUNTIME_GENAI_WINDOWS_SOURCE_COMMIT\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The compiling GenAI stage must declare the exact forwarded source commit."
 },
 {
  "id": "windows-lane.genai-source-stage-env",
  "target": "windows/Dockerfile.media-builder",
  "find": " `\n    ONNXRUNTIME_GENAI_WINDOWS_SOURCE_COMMIT=\"${ONNXRUNTIME_GENAI_WINDOWS_SOURCE_COMMIT}\"",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The exact declared commit must reach the GenAI builder process."
 },
 {
  "id": "windows-lane.genai-source-branch-forwarding",
  "target": "windows/scripts/modules/WindowsBuildDriver.Common.psm1",
  "find": "'ONNXRUNTIME_GENAI_VERSION', 'ONNXRUNTIME_GENAI_WINDOWS_SOURCE_COMMIT', 'OPENCV_VERSION'",
  "replace": "'ONNXRUNTIME_GENAI_VERSION', 'OPENCV_VERSION'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The compiling branch must forward the configured exact GenAI pin."
 },
 {
  "id": "windows-lane.genai-source-merge-exclusion",
  "target": "windows/scripts/modules/WindowsBuildDriver.Common.psm1",
  "find": "'ONNXRUNTIME_WINDOWS_SOURCE_COMMIT', 'ONNXRUNTIME_GENAI_WINDOWS_SOURCE_COMMIT',",
  "replace": "'ONNXRUNTIME_WINDOWS_SOURCE_COMMIT',",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtQnnEp.Source.Tests.ps1",
  "why": "The source-only pin must not pollute the merge cache key."
 },
 {
  "id": "windows-lane.genai-source-fixture-all-releases",
  "target": "windows/scripts/tests/WindowsOrt.SourceFixture.psm1",
  "find": "foreach ($release in Get-OrtSourceFixtureRelease)",
  "replace": "foreach ($release in @(Get-OrtSourceFixtureRelease | Select-Object -First 1))",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "Shared source fixtures must execute the supplied callback for both the core and GenAI release."
 },
 {
  "id": "windows-lane.genai-source-fixture-version-file",
  "target": "windows/scripts/tests/WindowsOrt.SourceFixture.psm1",
  "find": "Invoke-OrtSourceFixture -VersionFile $release.VersionFile -Version $release.Version",
  "replace": "Invoke-OrtSourceFixture -Version $release.Version",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "A shared release fixture must retain the selected GenAI VERSION_INFO rather than silently create a core-shaped checkout."
 },
 {
  "id": "windows-lane.patch-drift-404-diagnostic",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "if (Test-UpstreamGone -Url $Spec.Url)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Patches.ApplyClean.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/integration-mutation.json",
  "why": "Unavailable upstreams retain an explicit unchecked status distinct from reachable clone failures."
 },
 {
  "id": "windows-lane.patch-drift-unchecked-refusal",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "if ($byKind -and $byKind.ContainsKey('NOT'))",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Patches.ApplyClean.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/integration-mutation.json",
  "why": "Required patch acceptance cannot pass when any mapped patch remains unchecked."
 },
 {
  "id": "windows-lane.patch-drift-failed-refusal",
  "target": "windows/scripts/tests/Test-PatchesApplyClean.ps1",
  "find": "if ($byKind -and $byKind.ContainsKey('FAIL'))",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Patches.ApplyClean.Tests.ps1 -Jobs 1 -ResultFile logs/test-results/integration-mutation.json",
  "why": "A reachable source or patch failure independently makes the required gate fail."
 },
 {
  "id": "windows-lane.cpack-log-message-delegation",
  "target": "windows/scripts/modules/WindowsCMake.Common.psm1",
  "find": "  Write-BuildLogMessages -Context $Context -Messages @(Get-CPackGeneratorLogMessages -BuildPath $BuildPath -TailLines $TailLines)",
  "replace": "  Write-Verbose 'CPack diagnostic messages omitted'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only CMake.CPackDiagnostics.Tests.ps1",
  "why": "Generator paths, missing-directory diagnostics and file tails must reach the existing batch logger."
 },
 {
  "id": "windows-lane.cpack-log-tail",
  "target": "windows/scripts/modules/WindowsCMake.Common.psm1",
  "find": "Get-Content -LiteralPath $log.FullName -Tail $TailLines",
  "replace": "Get-Content -LiteralPath $log.FullName -Tail 1",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only CMake.CPackDiagnostics.Tests.ps1",
  "why": "Each generator log retains the caller-selected number of tail lines."
 },
 {
  "id": "windows-lane.cpack-log-order",
  "target": "windows/scripts/modules/WindowsCMake.Common.psm1",
  "find": "-File -Filter '*.log' | Sort-Object FullName",
  "replace": "-File -Filter '*.log' | Sort-Object FullName -Descending",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only CMake.CPackDiagnostics.Tests.ps1",
  "why": "Multiple generator logs retain deterministic ascending path order and separate tails."
 },
 {
  "id": "windows-lane.cpack-log-file-selection",
  "target": "windows/scripts/modules/WindowsCMake.Common.psm1",
  "find": "-File -Filter '*.log' |",
  "replace": "-File |",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only CMake.CPackDiagnostics.Tests.ps1",
  "why": "Unrelated files are not reported as CPack generator logs."
 },
 {
  "id": "windows-lane.cpack-log-export",
  "target": "windows/scripts/modules/WindowsCMake.Common.psm1",
  "find": "Get-CmakeBuildArgs, Write-CPackGeneratorLog, Invoke-CmakeConfigureAndBuild",
  "replace": "Get-CmakeBuildArgs, Invoke-CmakeConfigureAndBuild",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only CMake.CPackDiagnostics.Tests.ps1",
  "why": "The real module must export its diagnostic entry; lifted function behavior alone does not prove consumer visibility."
 },
 {
  "id": "windows-lane.cpython-isa-late-target",
  "target": "windows/scripts/build/cpython-Directory.Build.props",
  "find": "BeforeTargets=\"ClCompile\"",
  "replace": "AfterTargets=\"ClCompile\"",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','SourceBuild.CpythonIsa.Tests.ps1','-ResultFile','logs/code-quality/cpython-isa.json'],check=True); d=json.load(open('logs/code-quality/cpython-isa.json',encoding='utf-8-sig')); assert d['Total']==5 and d['Passed']==5 and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "the floor must precede the compiler"
 },
 {
  "id": "windows-lane.cpython-isa-x64-only",
  "target": "windows/scripts/build/cpython-Directory.Build.props",
  "find": "'$(Platform)' == 'x64'",
  "replace": "'$(Platform)' != 'x64'",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','SourceBuild.CpythonIsa.Tests.ps1','-ResultFile','logs/code-quality/cpython-isa.json'],check=True); d=json.load(open('logs/code-quality/cpython-isa.json',encoding='utf-8-sig')); assert d['Total']==5 and d['Passed']==5 and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "ARM64 must not inherit an x64 floor"
 },
 {
  "id": "windows-lane.cpython-isa-clang-only",
  "target": "windows/scripts/build/cpython-Directory.Build.props",
  "find": "'$(PlatformToolset)' == 'ClangCL'",
  "replace": "'$(PlatformToolset)' != 'ClangCL'",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','SourceBuild.CpythonIsa.Tests.ps1','-ResultFile','logs/code-quality/cpython-isa.json'],check=True); d=json.load(open('logs/code-quality/cpython-isa.json',encoding='utf-8-sig')); assert d['Total']==5 and d['Passed']==5 and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "other toolsets must not inherit Clang switches"
 },
 {
  "id": "windows-lane.cpython-isa-baseline-v3",
  "target": "windows/scripts/build/cpython-Directory.Build.props",
  "find": "/clang:-march=x86-64-v3",
  "replace": "/clang:-march=x86-64-v4",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','SourceBuild.CpythonIsa.Tests.ps1','-ResultFile','logs/code-quality/cpython-isa.json'],check=True); d=json.load(open('logs/code-quality/cpython-isa.json',encoding='utf-8-sig')); assert d['Total']==5 and d['Passed']==5 and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "ordinary files must not acquire AVX512"
 },
 {
  "id": "windows-lane.cpython-isa-dispatched-v4",
  "target": "windows/scripts/build/cpython-Directory.Build.props",
  "find": "/clang:-march=x86-64-v4",
  "replace": "/clang:-march=x86-64-v3",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','SourceBuild.CpythonIsa.Tests.ps1','-ResultFile','logs/code-quality/cpython-isa.json'],check=True); d=json.load(open('logs/code-quality/cpython-isa.json',encoding='utf-8-sig')); assert d['Total']==5 and d['Passed']==5 and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "existing AVX512 items must retain their ISA"
 },
 {
  "id": "windows-lane.cpython-isa-upstream-options",
  "target": "windows/scripts/build/cpython-Directory.Build.props",
  "find": "/clang:-march=x86-64-v4 %(ClCompile.AdditionalOptions)",
  "replace": "/clang:-march=x86-64-v4",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','SourceBuild.CpythonIsa.Tests.ps1','-ResultFile','logs/code-quality/cpython-isa.json'],check=True); d=json.load(open('logs/code-quality/cpython-isa.json',encoding='utf-8-sig')); assert d['Total']==5 and d['Passed']==5 and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "VNNI and VPCLMUL options must survive"
 },
 {
  "id": "windows-lane.cpython-isa-metadata-selector",
  "target": "windows/scripts/build/cpython-Directory.Build.props",
  "find": "'%(ClCompile.EnableEnhancedInstructionSet)' == 'AdvancedVectorExtensions512'",
  "replace": "'%(ClCompile.EnableEnhancedInstructionSet)' != 'AdvancedVectorExtensions512'",
  "test": "python3 -c \"import json,subprocess; subprocess.run(['pwsh','-NoProfile','-File','windows/scripts/tests/Invoke-Tests.ps1','-Only','SourceBuild.CpythonIsa.Tests.ps1','-ResultFile','logs/code-quality/cpython-isa.json'],check=True); d=json.load(open('logs/code-quality/cpython-isa.json',encoding='utf-8-sig')); assert d['Total']==5 and d['Passed']==5 and not d['Failed'] and not d['PesterFailures'] and not d['Skipped']\"",
  "why": "higher ISA must follow upstream per-file metadata"
 },
 {
  "id": "windows-lane.genai-extensions-row-cardinality",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "if ($rows.Count -ne 1) { throw \"GenAI $Label",
  "replace": "if ($false) { throw \"GenAI $Label",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiExtensions.Tests.ps1",
  "why": "Duplicate dependency rows must refuse rather than choose the first."
 },
 {
  "id": "windows-lane.genai-extensions-row-identity",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "$rows[0] -cnotmatch \"^$([regex]::Escape(\"$Name;$RepoUrl;\"))",
  "replace": "$rows[0] -notmatch \"^$([regex]::Escape(\"$Name;$RepoUrl;\"))",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiExtensions.Tests.ps1",
  "why": "Uppercase pins must not bypass the reviewed lowercase source identity."
 },
 {
  "id": "windows-lane.genai-extensions-upstream-commit",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "return $Matches['Commit']",
  "replace": "return ('0' * 40)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiExtensions.Tests.ps1",
  "why": "The dependency commit must come from the upstream row without substitution."
 },
 {
  "id": "windows-lane.genai-extensions-clone-identity",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "-Ref $commit -ExpectedCommit $commit -MaxAttempts 3 -InitialDelaySeconds 10",
  "replace": "-Ref $commit -ExpectedCommit ('0' * 40) -MaxAttempts 3 -InitialDelaySeconds 10",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiExtensions.Tests.ps1",
  "why": "The real checkout must be checked against the dependency commit before its CMake path is returned."
 },
 {
  "id": "windows-lane.genai-extensions-cmake-source-name",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "return \"-DFETCHCONTENT_SOURCE_DIR_ONNXRUNTIME_EXTENSIONS:PATH=",
  "replace": "return \"-DFETCHCONTENT_SOURCE_DIR_WRONG_EXTENSIONS:PATH=",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiExtensions.Tests.ps1",
  "why": "CMake must use the checked source instead of fetching the unavailable default repository."
 },
 {
  "id": "windows-lane.genai-extensions-append-arguments",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "$cmakeExtraGenAi += Get-GenaiExtensionsCmakeArgs -SourceDir $SourceDir",
  "replace": "$cmakeExtraGenAi = Get-GenaiExtensionsCmakeArgs -SourceDir $SourceDir",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiExtensions.Tests.ps1",
  "why": "Adding the source must retain all existing ORT, target and feature arguments."
 },
 {
  "id": "windows-lane.genai-extensions-unconditional-source",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "$cmakeExtraGenAi += Get-GenaiExtensionsCmakeArgs -SourceDir $SourceDir",
  "replace": "if ($false) { $cmakeExtraGenAi += Get-GenaiExtensionsCmakeArgs -SourceDir $SourceDir }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiExtensions.Tests.ps1",
  "why": "Every GenAI lane must prepare its required extensions before configuration."
 },
 {
  "id": "windows-lane.genai-extensions-pin-before-write",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "$InitialDelaySeconds)\n    Assert-GitCommitPin -ExpectedCommit $ExpectedCommit\n",
  "replace": "$InitialDelaySeconds)\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "The shared generic clone must validate malformed pins before replacing an existing destination."
 },
 {
  "id": "windows-lane.genai-extensions-generic-identity",
  "target": "windows/scripts/modules/WindowsSourceBuild.Common.psm1",
  "find": "    Assert-GitSourceCommit -SourceDir $SourceDir -ExpectedCommit $ExpectedCommit\n    return $true\n",
  "replace": "    return $true\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtSourceClone.Tests.ps1",
  "why": "A successful primary checkout at a different commit must refuse before fallback or build."
 },
 {
  "id": "lib.iree-x86-clangcl-feature-f",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "$features = @('f', 'vl', 'cd', 'bw', 'dq')",
  "replace": "$features = @('vl', 'cd', 'bw', 'dq')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.IsaFloor.Tests.ps1",
  "why": "The dispatched AVX512-base target must retain every explicit clang-cl feature under the global x86-64-v3 baseline."
 },
 {
  "id": "lib.iree-x86-clangcl-feature-vl",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "$features = @('f', 'vl', 'cd', 'bw', 'dq')",
  "replace": "$features = @('f', 'cd', 'bw', 'dq')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.IsaFloor.Tests.ps1",
  "why": "The dispatched AVX512-base target must retain every explicit clang-cl feature under the global x86-64-v3 baseline."
 },
 {
  "id": "lib.iree-x86-clangcl-feature-cd",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "$features = @('f', 'vl', 'cd', 'bw', 'dq')",
  "replace": "$features = @('f', 'vl', 'bw', 'dq')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.IsaFloor.Tests.ps1",
  "why": "The dispatched AVX512-base target must retain every explicit clang-cl feature under the global x86-64-v3 baseline."
 },
 {
  "id": "lib.iree-x86-clangcl-feature-bw",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "$features = @('f', 'vl', 'cd', 'bw', 'dq')",
  "replace": "$features = @('f', 'vl', 'cd', 'dq')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.IsaFloor.Tests.ps1",
  "why": "The dispatched AVX512-base target must retain every explicit clang-cl feature under the global x86-64-v3 baseline."
 },
 {
  "id": "lib.iree-x86-clangcl-feature-dq",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "$features = @('f', 'vl', 'cd', 'bw', 'dq')",
  "replace": "$features = @('f', 'vl', 'cd', 'bw')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.IsaFloor.Tests.ps1",
  "why": "The dispatched AVX512-base target must retain every explicit clang-cl feature under the global x86-64-v3 baseline."
 },
 {
  "id": "lib.iree-x86-clangcl-wired",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "\nSet-IreeX86KernelCmakeFlags -SourceDir $SourceDir\n",
  "replace": "\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.IsaFloor.Tests.ps1",
  "why": "The checked source patch must run before native and cross-host configuration."
 },
 {
  "id": "lib.iree-x86-clangcl-layout-fatal",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "throw 'IREE AVX512 base options layout changed; explicit clang-cl kernel flags were not applied.'",
  "replace": "Write-Warning 'IREE AVX512 base options layout changed; explicit clang-cl kernel flags were not applied.'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.IsaFloor.Tests.ps1",
  "why": "A missing or partially patched source block cannot silently keep incorrect flags."
 },
 {
  "id": "lib.iree-x86-clangcl-idempotent",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "-SkipIfMatch $ready -Require -Quiet",
  "replace": "-Require -Quiet",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.IsaFloor.Tests.ps1",
  "why": "Repeated source patching must preserve the complete already-correct block without failing or rewriting it."
 },
 {
  "id": "lib.iree-x86-clangcl-required-file",
  "target": "windows/scripts/build/Build-IreeFromSource.ps1",
  "find": "-SkipIfMatch $ready -Require -Quiet",
  "replace": "-SkipIfMatch $ready -Quiet",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.IsaFloor.Tests.ps1",
  "why": "A missing upstream file must retain the required-input failure and diagnostic."
 },
 {
  "id": "lib.litert-direct-chain-native-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsNative.Common.psm1 from the chain RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-chain-pythonwheel-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsPythonWheel.Common.psm1 from the chain RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-chain-scripts-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsScripts.Shared.psm1 from the chain RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-chain-sourcebuild-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsSourceBuild.Common.psm1 from the chain RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-chain-sourcebuild-cuda",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsSourceBuild.Cuda.psm1 from the chain RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-chain-sourcebuild-patches",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsSourceBuild.Patches.psm1 from the chain RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-chain-targetarch-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsTargetArch.Common.psm1 from the chain RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-chain-reject-cached-view",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertAll.ps1,target=C:\\bkmnt\\Build-LitertAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertFromSource.ps1,target=C:\\bkmnt\\Build-LitertFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmBazel.ps1,target=C:\\bkmnt\\Build-LitertLmBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertLmFromSource.ps1,target=C:\\bkmnt\\Build-LitertLmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Export-LitertLmBridge.ps1,target=C:\\bkmnt\\Export-LitertLmBridge.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Debug-LitertlmLink.ps1,target=C:\\bkmnt\\Debug-LitertlmLink.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,from=buildmods,source=/bkmods,target=C:\\bkmnt\\modules `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/shims,target=C:\\bkmnt\\shims `\n    --mount=type=bind,source=windows/scripts/patches/litert-lm,target=C:\\bkmnt\\patches\\litert-lm `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    $env:BAZEL_REPO_CACHE = 'C:\\bzl-repo-cache'; & 'C:\\bkmnt\\Build-LitertAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "A cached directory view must be refused even when all direct-file mounts are also declared."
 },
 {
  "id": "lib.litert-direct-wheel-native-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "replace": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsNative.Common.psm1 from the wheel RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-wheel-pythonwheel-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "replace": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsPythonWheel.Common.psm1 from the wheel RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-wheel-scripts-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "replace": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsScripts.Shared.psm1 from the wheel RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-wheel-sourcebuild-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "replace": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsSourceBuild.Common.psm1 from the wheel RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-wheel-sourcebuild-cuda",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "replace": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsSourceBuild.Cuda.psm1 from the wheel RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-wheel-sourcebuild-patches",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "replace": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsSourceBuild.Patches.psm1 from the wheel RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-wheel-targetarch-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "replace": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "Removing WindowsTargetArch.Common.psm1 from the wheel RUN must fail the complete direct-file delivery guard."
 },
 {
  "id": "lib.litert-direct-wheel-reject-cached-view",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "replace": "RUN --mount=type=cache,target=C:\\bzl-repo-cache,id=bazel-litertlm-winamd64,sharing=locked `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT `\n    --mount=type=bind,source=windows/scripts/build/Build-LitertWheelBazel.ps1,target=C:\\bkmnt\\Build-LitertWheelBazel.ps1 `\n    --mount=type=bind,source=windows/scripts/build/litert-wheel-smoke.py,target=C:\\bkmnt\\litert-wheel-smoke.py `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,from=buildmods,source=/bkmods,target=C:\\bkmnt\\modules `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsBazel.Common.psm1,target=C:\\bkmnt\\bazelmods\\WindowsBazel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/litert,target=C:\\bkmnt\\patches\\litert `\n    $env:UV_CACHE_DIR = 'C:\\lw\\ty-uv-cache'; $env:UV_TOOL_DIR = 'C:\\lw\\ty-uv-tools'; `\n    $env:UV_PYTHON_DOWNLOADS = 'never'; & 'C:\\bkmnt\\Build-LitertWheelBazel.ps1' -ScriptDir 'C:\\bkmnt' -ToolCache 'C:\\bzl-repo-cache\\toolcache'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "A cached directory view must be refused even when all direct-file mounts are also declared."
 },
 {
  "id": "lib.litert-direct-module-scan-coverage",
  "target": "windows/scripts/tests/BuildKit.MountStub.Tests.ps1",
  "find": "$modules = @($stages['buildmods'].MountedModules)",
  "replace": "$modules = @($stages['buildmods'].MountedModules | Select-Object -Skip 1)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "An incomplete module-scan must fail the measured seven-module/two-RUN scan coverage."
 },
 {
  "id": "lib.litert-direct-run-scan-coverage",
  "target": "windows/scripts/tests/BuildKit.MountStub.Tests.ps1",
  "find": "$runs = @(Get-TestDockerfileRun -Path $path -Stage 'media-litert-built')",
  "replace": "$runs = @(Get-TestDockerfileRun -Path $path -Stage 'media-litert-built' | Select-Object -First 1)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/module-view-mutation.json",
  "why": "An incomplete run-scan must fail the measured seven-module/two-RUN scan coverage."
 },
 {
  "id": "lib.media-direct-core-onnx-missing-windowsnative-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-onnx-missing-windowspythonwheel-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-onnx-missing-windowsscripts-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-onnx-missing-windowssourcebuild-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-onnx-missing-windowssourcebuild-cuda",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-onnx-missing-windowssourcebuild-patches",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-onnx-missing-windowstargetarch-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-onnx-reject-cached-view",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,from=buildmods,source=/bkmods,target=C:\\bkmnt\\modules `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Retaining direct mounts must not hide a reintroduced cached module-directory view."
 },
 {
  "id": "lib.media-direct-core-onnx-reject-wrong-source",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsInstaller.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Equal mount counts do not prove the selected source file matches the required module."
 },
 {
  "id": "lib.media-direct-core-onnx-reject-foreign-leaf",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "A TVM-only file in ONNX silently widens its build-cache key and must be refused."
 },
 {
  "id": "lib.media-direct-core-onnx-reject-duplicate-delivery",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxFromSource.ps1,target=C:\\bkmnt\\Build-OnnxFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtQnnEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtQnnEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OrtTensorRtEpFromSource.ps1,target=C:\\bkmnt\\Build-OrtTensorRtEpFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/onnxruntime,target=C:\\bkmnt\\patches\\onnxruntime `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,from=trt-sdk,source=/tensorrt,target=C:\\tensorrt-sdk `\n    $env:TENSORRT_SDK_ROOT = 'C:\\tensorrt-sdk'; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -Until 'TensorRT plugin EP' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Duplicate delivery cannot satisfy exact per-consumer module cardinality."
 },
 {
  "id": "lib.media-direct-core-ffmpeg-missing-windowsnative-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-ffmpeg-missing-windowspythonwheel-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-ffmpeg-missing-windowsscripts-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-ffmpeg-missing-windowssourcebuild-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-ffmpeg-missing-windowssourcebuild-cuda",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-ffmpeg-missing-windowssourcebuild-patches",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-ffmpeg-missing-windowstargetarch-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-ffmpeg-reject-cached-view",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,from=buildmods,source=/bkmods,target=C:\\bkmnt\\modules `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Retaining direct mounts must not hide a reintroduced cached module-directory view."
 },
 {
  "id": "lib.media-direct-core-ffmpeg-reject-wrong-source",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegFromSource.ps1,target=C:\\bkmnt\\Build-FfmpegFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Build-FfmpegCodecs.ps1,target=C:\\bkmnt\\Build-FfmpegCodecs.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNativeProvenance.Common.psm1,target=C:\\bkmnt\\ortmods\\WindowsNativeProvenance.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceOffer.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsSourceOffer.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsInstaller.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/ffmpeg,target=C:\\bkmnt\\patches\\ffmpeg `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'FFmpeg' -Until 'FFmpeg' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Equal mount counts do not prove the selected source file matches the required module."
 },
 {
  "id": "lib.media-direct-core-opencv-missing-windowsnative-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-opencv-missing-windowspythonwheel-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-opencv-missing-windowsscripts-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-opencv-missing-windowssourcebuild-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-opencv-missing-windowssourcebuild-cuda",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-opencv-missing-windowssourcebuild-patches",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-opencv-missing-windowstargetarch-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-opencv-reject-cached-view",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,from=buildmods,source=/bkmods,target=C:\\bkmnt\\modules `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Retaining direct mounts must not hide a reintroduced cached module-directory view."
 },
 {
  "id": "lib.media-direct-core-opencv-reject-wrong-source",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OpencvFromSource.ps1,target=C:\\bkmnt\\Build-OpencvFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsInstaller.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/opencv,target=C:\\bkmnt\\patches\\opencv `\n    --mount=type=bind,source=windows/scripts/patches/opencv_contrib,target=C:\\bkmnt\\patches\\opencv_contrib `\n    $env:SCCACHE_CUDA_LAUNCHER = $env:OPENCV_CUDA_LAUNCHER; `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'OpenCV' -Until 'OpenCV' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Equal mount counts do not prove the selected source file matches the required module."
 },
 {
  "id": "lib.media-direct-core-hailo-missing-windowsnative-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-hailo-missing-windowspythonwheel-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-hailo-missing-windowsscripts-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-hailo-missing-windowssourcebuild-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-hailo-missing-windowssourcebuild-cuda",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-hailo-missing-windowssourcebuild-patches",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-hailo-missing-windowstargetarch-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-hailo-reject-cached-view",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,from=buildmods,source=/bkmods,target=C:\\bkmnt\\modules `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Retaining direct mounts must not hide a reintroduced cached module-directory view."
 },
 {
  "id": "lib.media-direct-core-hailo-reject-wrong-source",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-HailortFromSource.ps1,target=C:\\bkmnt\\Build-HailortFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsInstaller.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/patches/hailo,target=C:\\bkmnt\\patches\\hailo `\n    & 'C:\\bkmnt\\Build-HailortFromSource.ps1' -SourceDir 'C:\\temp\\hailort-src' -BuildDir 'C:\\temp\\hailort-build' -InstallDir 'C:\\runtime\\hailo'\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Equal mount counts do not prove the selected source file matches the required module."
 },
 {
  "id": "lib.media-direct-core-missing-windowsnative-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-missing-windowspythonwheel-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-missing-windowsscripts-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-missing-windowssourcebuild-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-missing-windowssourcebuild-cuda",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-missing-windowssourcebuild-patches",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-missing-windowstargetarch-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-core-reject-cached-view",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,from=buildmods,source=/bkmods,target=C:\\bkmnt\\modules `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Retaining direct mounts must not hide a reintroduced cached module-directory view."
 },
 {
  "id": "lib.media-direct-core-reject-wrong-source",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaCoreAll.ps1,target=C:\\bkmnt\\Build-MediaCoreAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-OnnxGenaiFromSource.ps1,target=C:\\bkmnt\\Build-OnnxGenaiFromSource.ps1 `\n    --mount=type=bind,source=shared/upstream/llguidance,target=C:\\bkmnt\\llguidance,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/stage-cargo-licenses.py,target=C:\\bkmnt\\cargo-licenses\\stage-cargo-licenses.py,readonly `\n    --mount=type=bind,source=linux/scripts/06-packaging/cargo_license_tree.py,target=C:\\bkmnt\\cargo-licenses\\cargo_license_tree.py,readonly `\n    --mount=type=bind,source=windows/scripts/modules/WindowsOrtProvenance.Build.psm1,target=C:\\bkmnt\\ortmods\\WindowsOrtProvenance.Build.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsRustToolchain.Common.psm1,target=C:\\bkmnt\\rustmods\\WindowsRustToolchain.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\rustmods\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsInstaller.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    & 'C:\\bkmnt\\Build-MediaCoreAll.ps1' -ResumeFrom 'ONNX GenAI' -Until 'ONNX GenAI' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Equal mount counts do not prove the selected source file matches the required module."
 },
 {
  "id": "lib.media-direct-tvm-missing-windowsnative-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-tvm-missing-windowspythonwheel-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-tvm-missing-windowsscripts-shared",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-tvm-missing-windowssourcebuild-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-tvm-missing-windowssourcebuild-cuda",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-tvm-missing-windowssourcebuild-patches",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-tvm-missing-windowstargetarch-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-tvm-missing-windowstvm-common",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The actual selected media RUN must carry every original module; a missing file must fail the portable structural gate."
 },
 {
  "id": "lib.media-direct-tvm-reject-cached-view",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,from=tvmmods,source=/bkmods,target=C:\\bkmnt\\modules `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Retaining direct mounts must not hide a reintroduced cached module-directory view."
 },
 {
  "id": "lib.media-direct-tvm-reject-wrong-source",
  "target": "windows/Dockerfile.media-builder",
  "find": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsNative.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "replace": "RUN --mount=type=cache,target=C:\\sccache,id=sccache-winamd64-2,sharing=shared `\n    --mount=type=secret,id=sccache_s3_key_id,env=AWS_ACCESS_KEY_ID --mount=type=secret,id=sccache_s3_secret,env=AWS_SECRET_ACCESS_KEY `\n    --mount=type=secret,id=sccache_webdav_endpoint,env=SCCACHE_WEBDAV_ENDPOINT --mount=type=secret,id=sccache_multilevel_chain,env=SCCACHE_MULTILEVEL_CHAIN `\n    --mount=type=secret,id=sccache_endpoint,env=SCCACHE_ENDPOINT --mount=type=secret,id=sccache_bucket,env=SCCACHE_BUCKET `\n    --mount=type=secret,id=sccache_region,env=SCCACHE_REGION --mount=type=secret,id=sccache_s3_use_ssl,env=SCCACHE_S3_USE_SSL `\n    --mount=type=cache,target=C:\\sccache-logs,id=sccache-logs-winamd64,sharing=shared `\n    --mount=type=cache,target=C:\\iree-build,id=iree-build-winamd64,sharing=locked `\n    --mount=type=bind,source=windows/scripts/build/Build-MediaTvmAll.ps1,target=C:\\bkmnt\\Build-MediaTvmAll.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-TargetCpython.ps1,target=C:\\bkmnt\\Build-TargetCpython.ps1 `\n    --mount=type=bind,source=windows/scripts/build/cpython-Directory.Build.props,target=C:\\bkmnt\\cpython-Directory.Build.props `\n    --mount=type=bind,source=windows/scripts/build/Build-TvmFromSource.ps1,target=C:\\bkmnt\\Build-TvmFromSource.ps1 `\n    --mount=type=bind,source=windows/scripts/build/Build-IreeFromSource.ps1,target=C:\\bkmnt\\Build-IreeFromSource.ps1 `\n    --mount=type=bind,source=linux/scripts/02-toolchain/python/free-threaded-wheel.py,target=C:\\bkmnt\\free-threaded-wheel.py `\n    --mount=type=bind,source=linux/scripts/03-media/free-threaded-twins.txt,target=C:\\bkmnt\\free-threaded-twins.txt `\n    --mount=type=bind,source=windows/scripts/build/Import-Versions.ps1,target=C:\\bkmnt\\Import-Versions.ps1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsInstaller.Common.psm1,target=C:\\bkmnt\\modules\\WindowsNative.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsPythonWheel.Common.psm1,target=C:\\bkmnt\\modules\\WindowsPythonWheel.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsScripts.Shared.psm1,target=C:\\bkmnt\\modules\\WindowsScripts.Shared.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Common.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Cuda.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Cuda.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsSourceBuild.Patches.psm1,target=C:\\bkmnt\\modules\\WindowsSourceBuild.Patches.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTargetArch.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTargetArch.Common.psm1 `\n    --mount=type=bind,source=windows/scripts/modules/WindowsTvm.Common.psm1,target=C:\\bkmnt\\modules\\WindowsTvm.Common.psm1 `\n    --mount=type=bind,source=windows/qnn-sdk,target=C:\\temp\\qnn-sdk --mount=type=cache,target=C:\\qnn-sdk-cache,id=qnn-sdk-winamd64,sharing=shared `\n    --mount=type=bind,source=windows/scripts/patches/iree,target=C:\\bkmnt\\patches\\iree `\n    & 'C:\\bkmnt\\Build-MediaTvmAll.ps1' -ScriptDir 'C:\\bkmnt' -ScrubAfter\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Equal mount counts do not prove the selected source file matches the required module."
 },
 {
  "id": "lib.media-direct-core-stage-scan-coverage",
  "target": "windows/scripts/tests/BuildKit.MountStub.Tests.ps1",
  "find": "        $coreStages = @('media-core-built-onnx', 'media-core-built-ffmpeg', 'media-core-built-opencv', 'media-core-built-hailo', 'media-core-built')",
  "replace": "        $coreStages = @('media-core-built-ffmpeg', 'media-core-built-opencv', 'media-core-built-hailo', 'media-core-built')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Dropping one selected core stage must fail the explicit five-stage census."
 },
 {
  "id": "lib.media-direct-tvm-module-scan-coverage",
  "target": "windows/scripts/tests/BuildKit.MountStub.Tests.ps1",
  "find": "$tvmModules = @($modules) + @($stages['tvmmods'].MountedModules)",
  "replace": "$tvmModules = @($modules | Select-Object -Skip 1) + @($stages['tvmmods'].MountedModules)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "The private TVM consumer must grade all seven shared modules and its private leaf."
 },
 {
  "id": "lib.media-direct-tvm-run-scan-coverage",
  "target": "windows/scripts/tests/BuildKit.MountStub.Tests.ps1",
  "find": "$tvmRuns = @(Get-TestDockerfileRun -Path $path -Stage 'media-tvm-built')",
  "replace": "$tvmRuns = @(Get-TestDockerfileRun -Path $path -Stage 'media-tvm-built' | Select-Object -First 0)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "An empty TVM consumer scan must fail the required one-RUN census."
 },
 {
  "id": "lib.media-direct-reject-duplicate-module-scan",
  "target": "windows/scripts/tests/BuildKit.MountStub.Tests.ps1",
  "find": "$modules = @($stages['buildmods'].MountedModules)",
  "replace": "$modules = @($stages['buildmods'].MountedModules)\n        $modules[0] = $modules[1]",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildKit.MountStub.Tests.ps1 -ResultFile logs/code-quality/media-direct-module-mutation.json",
  "why": "Seven module entries with a duplicate cannot stand in for seven unique required modules."
 },
 {
  "id": "windows-lane.delegation-selector",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Policy.psm1",
  "find": "if ($image.Tag -cnotmatch $pattern) { continue }",
  "replace": "if ($image.Tag -cnotmatch $pattern) { $Matches = @{ lane = '-nvidia'; arch = '' } }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "Final SDK and unrelated tags must remain protected"
 },
 {
  "id": "windows-lane.delegation-merge",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Policy.psm1",
  "find": "if (-not @($Snapshot.Images | Where-Object { ($_.Tag -creplace '^docker.io/', '') -ceq $merge }).Count) { continue }",
  "replace": "if ($false) { continue }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "A corresponding merged image is required before branch retirement"
 },
 {
  "id": "windows-lane.delegation-reference",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Policy.psm1",
  "find": "if ($image.Config -cin @($protectedContainers | ForEach-Object Image) -or $image.Manifest -cin @($protectedContainers | ForEach-Object Image)) { continue }",
  "replace": "if ($false) { continue }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "Retained containers protect their referenced image"
 },
 {
  "id": "windows-lane.delegation-marked",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Policy.psm1",
  "find": "$_.Disposable -and -not $_.Running",
  "replace": "$true -and -not $_.Running",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "Unmarked stopped containers have no deletion authorization"
 },
 {
  "id": "windows-lane.delegation-stopped",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Policy.psm1",
  "find": "-not $_.Running -and $_.Status",
  "replace": "$true -and $_.Status",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "A running container never becomes a retirement candidate"
 },
 {
  "id": "windows-lane.delegation-cache-preservation",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Policy.psm1",
  "find": "if ((@($Plan.CacheMounts | Sort-Object) -join \"`n\") -cne (@($Snapshot.CacheMounts | Sort-Object) -join \"`n\"))",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "Compiler cache identity drift must fail completion"
 },
 {
  "id": "windows-lane.delegation-marker-value",
  "target": "windows/scripts/modules/WindowsHostMaintenance.Common.psm1",
  "find": "$label.Value -ceq 'true'",
  "replace": "$label.Value -eq 'true'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "The disposable label value is exact and case-sensitive"
 },
 {
  "id": "windows-lane.delegation-marker-key",
  "target": "windows/scripts/modules/WindowsHostMaintenance.Common.psm1",
  "find": "$label.Name -ceq (Get-HostDisposableContainerLabel)",
  "replace": "$true",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "The disposable label name is exact and case-sensitive"
 },
 {
  "id": "windows-lane.delegation-running-type",
  "target": "windows/scripts/modules/WindowsHostMaintenance.Common.psm1",
  "find": "if ($Container.State.Running -isnot [bool])",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "A string false does not prove a stopped container"
 },
 {
  "id": "windows-lane.delegation-no-force",
  "target": "windows/scripts/host/Clear-DiskSpace.ps1",
  "find": "$Store.Namespace $command $Tag",
  "replace": "$Store.Namespace $command --force $Tag",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "The fixed daemon removal must not force or delete volumes"
 },
 {
  "id": "windows-lane.delegation-no-volume-removal",
  "target": "windows/scripts/host/Clear-DiskSpace.ps1",
  "find": "$Store.Namespace $command $Tag",
  "replace": "$Store.Namespace $command --volumes $Tag",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "The fixed daemon removal must not force or delete volumes"
 },
 {
  "id": "windows-lane.delegation-idle-usage",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "if ($row.inUse -isnot [bool] -or $row.inUse -or -not $row.id -or -not $row.recordType)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "Unknown or active BuildKit usage blocks all maintenance"
 },
 {
  "id": "windows-lane.delegation-known-storage",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "if ($row.shared -isnot [bool] -or ($row.size -isnot [long] -and $row.size -isnot [int]) -or $row.size -lt 0)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "Unknown or negative byte accounting is not zero"
 },
 {
  "id": "windows-lane.delegation-finished-history",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "if (-not $historyEvent.record.CompletedAt -or $historyEvent.record.CompletedAt.seconds -lt $historyEvent.record.CreatedAt.seconds)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Portable.Tests.ps1",
  "why": "A running BuildKit history cannot become idle"
 },
 {
  "id": "windows-lane.delegation-untagged",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "if ($row.Repository -ceq '<none>' -or $row.Tag -ceq '<none>')",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Inventory.Tests.ps1",
  "why": "Untagged image records require separate review"
 },
 {
  "id": "lint-gates.fixture-ceiling-isolates-parent",
  "target": "linux/scripts/tests/test-consumer-hooks.sh",
  "find": "export GIT_CEILING_DIRECTORIES",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-consumer-hooks.sh",
  "why": "empty-directory refusal cases must not inherit the fixture parent repository when TMPDIR is inside a checkout"
 },
 {
  "id": "host.proof-ft-source-pin-cleared",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "unset UV_VERSION PYTHON_VERSION",
  "replace": "unset UV_VERSION",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The isolated full preflight must retain source-pinned genuine free-threaded prerequisites and raw refusals so its real extension case cannot silently skip."
 },
 {
  "id": "host.proof-ft-install",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "UV_PYTHON_INSTALL_DIR=/opt/preflight-ft-python uv python install \"${PYTHON_VERSION:?}t\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The isolated full preflight must retain source-pinned genuine free-threaded prerequisites and raw refusals so its real extension case cannot silently skip."
 },
 {
  "id": "host.proof-ft-managed-resolution",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "uv python find --managed-python \"${PYTHON_VERSION}t\"",
  "replace": "uv python find \"${PYTHON_VERSION}t\"",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The isolated full preflight must retain source-pinned genuine free-threaded prerequisites and raw refusals so its real extension case cannot silently skip."
 },
 {
  "id": "host.proof-ft-version-check",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "\"${task_ft_python}\" -I -c 'import sys; assert sys.version.split()[0] == sys.argv[1]' \"${PYTHON_VERSION}\"",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The isolated full preflight must retain source-pinned genuine free-threaded prerequisites and raw refusals so its real extension case cannot silently skip."
 },
 {
  "id": "host.proof-ft-worker-environment",
  "target": "linux/scripts/isolated-preflight/bootstrap.sh",
  "find": "FT_PYTHON=\"${task_ft_python}\"",
  "replace": "FT_PYTHON=\"\"",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The isolated full preflight must retain source-pinned genuine free-threaded prerequisites and raw refusals so its real extension case cannot silently skip."
 },
 {
  "id": "host.proof-ft-worker-probe",
  "target": "linux/scripts/isolated-preflight/worker.sh",
  "find": "\"${FT_PYTHON:?}\" -I -c 'import pathlib, sys, sysconfig; assert sysconfig.get_config_var(\"Py_GIL_DISABLED\") == 1; assert not sys._is_gil_enabled(); assert pathlib.Path(sysconfig.get_paths()[\"include\"], \"Python.h\").is_file(); print(\"FT Python\", sys.version.split()[0])'",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The isolated full preflight must retain source-pinned genuine free-threaded prerequisites and raw refusals so its real extension case cannot silently skip."
 },
 {
  "id": "host.proof-ft-worker-config",
  "target": "linux/scripts/isolated-preflight/worker.sh",
  "find": "assert sysconfig.get_config_var(\"Py_GIL_DISABLED\") == 1; ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The isolated full preflight must retain source-pinned genuine free-threaded prerequisites and raw refusals so its real extension case cannot silently skip."
 },
 {
  "id": "host.proof-ft-worker-gil",
  "target": "linux/scripts/isolated-preflight/worker.sh",
  "find": "assert not sys._is_gil_enabled(); ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The isolated full preflight must retain source-pinned genuine free-threaded prerequisites and raw refusals so its real extension case cannot silently skip."
 },
 {
  "id": "host.proof-ft-worker-headers",
  "target": "linux/scripts/isolated-preflight/worker.sh",
  "find": "assert pathlib.Path(sysconfig.get_paths()[\"include\"], \"Python.h\").is_file(); ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The isolated full preflight must retain source-pinned genuine free-threaded prerequisites and raw refusals so its real extension case cannot silently skip."
 },
 {
  "id": "windows-lane.delegation-raw-image-name",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "Tag = $row.Name; Manifest = $row.ID",
  "replace": "Tag = ($row.Repository + ':' + $row.Tag); Manifest = $row.ID",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Inventory.Tests.ps1",
  "why": "Digest-qualified aliases retain their raw containerd names."
 },
 {
  "id": "windows-lane.delegation-manifest-selector",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "ForEach-Object Manifest | Sort-Object -Unique",
  "replace": "ForEach-Object Tag | Sort-Object -Unique",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Inventory.Tests.ps1",
  "why": "Display-name reconstruction must never select an immutable manifest query."
 },
 {
  "id": "windows-lane.delegation-unique-manifest",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "ForEach-Object Manifest | Sort-Object -Unique",
  "replace": "ForEach-Object Manifest",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Inventory.Tests.ps1",
  "why": "Aliases of one manifest need exactly one bound configuration result."
 },
 {
  "id": "windows-lane.delegation-image-diagnostic",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "[IO.File]::ReadAllText((Join-Path $LogRoot \"$Name.stderr.log\")).Trim()",
  "replace": "$false",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Inventory.Tests.ps1",
  "why": "A raw-zero command with diagnostic output cannot prove a complete inventory."
 },
 {
  "id": "windows-lane.delegation-image-single-detail",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "if ($details.Count -ne 1 -or $null -eq $details[0].PSObject.Properties['Id'])",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Inventory.Tests.ps1",
  "why": "Missing or duplicate inspection records refuse before preservation planning."
 },
 {
  "id": "windows-lane.delegation-image-config-id",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "if ($found[0].Config -isnot [string] -or $found[0].Config -cnotmatch '^sha256:[0-9a-f]{64}$')",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Inventory.Tests.ps1",
  "why": "An unknown configuration identity cannot be retained as an accepted image."
 },
 {
  "id": "windows-lane.delegation-image-unique-name",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Inventory.psm1",
  "find": "if (@($tags | ForEach-Object Tag | Sort-Object -Unique).Count -ne $tags.Count)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Inventory.Tests.ps1",
  "why": "Repeated raw names cannot conceal an incomplete image census."
 },
 {
  "id": "windows-lane.delegation-hidden-task-instance",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Task.psm1",
  "find": "GetRunningTasks(1)",
  "replace": "GetRunningTasks(0)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Instance.Tests.ps1",
  "why": "The original hidden SYSTEM instance must remain observable."
 },
 {
  "id": "windows-lane.delegation-task-unique-instance",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Task.psm1",
  "find": "if ($instances.Count -ne 1)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Instance.Tests.ps1",
  "why": "Ambiguous original instances must refuse without choosing one."
 },
 {
  "id": "windows-lane.delegation-task-exact-path",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Task.psm1",
  "find": " | Where-Object Path -CEQ $TaskPath",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Instance.Tests.ps1",
  "why": "A foreign task cannot supply the maintenance receipt identity."
 },
 {
  "id": "windows-lane.delegation-completion-ready",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Task.psm1",
  "find": "$task.State -eq 3 -and ",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Instance.Tests.ps1",
  "why": "A filtered hidden running task cannot look completed."
 },
 {
  "id": "windows-lane.delegation-active-task-state",
  "target": "windows/scripts/modules/WindowsStevedoreDelegation.Security.psm1",
  "find": "$Task.State -notin @(1, 3) -or ",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.Delegation.Instance.Tests.ps1",
  "why": "Filtered enumeration cannot override queued running or unknown scheduler state."
 },
 {
  "id": "windows-lane.task-absent-booleans",
  "target": "windows/scripts/modules/WindowsHostMaintenance.Common.psm1",
  "find": "if ($State.$name -isnot [bool] -or $State.$name)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.ContainerState.Tests.ps1",
  "why": "A task-absent container must have three typed false activity flags."
 },
 {
  "id": "windows-lane.task-absent-numbers",
  "target": "windows/scripts/modules/WindowsHostMaintenance.Common.psm1",
  "find": "if (($State.$name -isnot [int] -and $State.$name -isnot [long]) -or $State.$name -ne 0)",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.ContainerState.Tests.ps1",
  "why": "Task absence requires typed zero PID and exit status."
 },
 {
  "id": "windows-lane.task-absent-text",
  "target": "windows/scripts/modules/WindowsHostMaintenance.Common.psm1",
  "find": "if ($State.$name -isnot [string] -or $State.$name -cne '')",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.ContainerState.Tests.ps1",
  "why": "Task absence refuses error text, timestamps and missing or non-string values."
 },
 {
  "id": "windows-lane.task-absent-proof",
  "target": "windows/scripts/modules/WindowsHostMaintenance.Common.psm1",
  "find": "        Assert-HostTaskAbsentState $State",
  "replace": "        # Mutant: omit task absence proof.",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.ContainerState.Tests.ps1",
  "why": "An empty status alone cannot authorize inactive-container retirement."
 },
 {
  "id": "windows-lane.task-absent-state",
  "target": "windows/scripts/modules/WindowsHostMaintenance.Common.psm1",
  "find": "        $status = 'created'",
  "replace": "        $status = 'exited'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.ContainerState.Tests.ps1",
  "why": "The derived status must preserve the documented task-absent state."
 },
 {
  "id": "windows-lane.container-known-status",
  "target": "windows/scripts/modules/WindowsHostMaintenance.Common.psm1",
  "find": "if ($status -cnotin @('created', 'exited', 'stopped', 'dead', 'running', 'paused', 'restarting'))",
  "replace": "if ($false)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.ContainerState.Tests.ps1",
  "why": "Nonempty unknown status values must still refuse."
 },
 {
  "id": "windows-lane.container-read-diagnostics",
  "target": "windows/scripts/host/Clear-DiskSpace.ps1",
  "find": "$raw -ne 0 -or $diagnostics.Count",
  "replace": "$raw -ne 0",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.ContainerState.Tests.ps1",
  "why": "A successful partial container query with stderr cannot prove task absence."
 },
 {
  "id": "windows-lane.container-read-raw-status",
  "target": "windows/scripts/host/Clear-DiskSpace.ps1",
  "find": "$raw -ne 0 -or $diagnostics.Count",
  "replace": "$diagnostics.Count",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Stevedore.ContainerState.Tests.ps1",
  "why": "Raw native read failure remains fatal even without diagnostics."
 },
 {
  "id": "packaging.pe-hardening.dynamic-base",
  "target": "windows/scripts/modules/WindowsPeHardening.Common.psm1",
  "find": "if (-not $pe.DynamicBase) { 'DYNAMIC_BASE' }",
  "replace": "if ($false) { 'DYNAMIC_BASE' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PeHardening.Tests.ps1",
  "why": "missing ASLR must fail the PE gate"
 },
 {
  "id": "packaging.pe-hardening.nx-compat",
  "target": "windows/scripts/modules/WindowsPeHardening.Common.psm1",
  "find": "if (-not $pe.NxCompat) { 'NX_COMPAT' }",
  "replace": "if ($false) { 'NX_COMPAT' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PeHardening.Tests.ps1",
  "why": "missing DEP must fail the PE gate"
 },
 {
  "id": "packaging.pe-hardening.high-entropy",
  "target": "windows/scripts/modules/WindowsPeHardening.Common.psm1",
  "find": "if ($pe.Pe32Plus -and -not $pe.HighEntropyVa) { 'HIGH_ENTROPY_VA' }",
  "replace": "if ($false) { 'HIGH_ENTROPY_VA' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PeHardening.Tests.ps1",
  "why": "a PE32+ without high-entropy ASLR must fail"
 },
 {
  "id": "packaging.pe-hardening.guard-cf",
  "target": "windows/scripts/modules/WindowsPeHardening.Common.psm1",
  "find": "if (-not $pe.GuardCf -and (Split-Path -Leaf $file) -notin $NoCfg) { 'GUARD_CF' }",
  "replace": "if ($false) { 'GUARD_CF' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PeHardening.Tests.ps1",
  "why": "missing CFG must fail outside the existing explicit vendor selection"
 },
 {
  "id": "packaging.pe-hardening.flag-offset",
  "target": "windows/scripts/modules/WindowsPeHardening.Common.psm1",
  "find": "$flags = [BitConverter]::ToUInt16($layout.Bytes, $optional + 70)",
  "replace": "$flags = [BitConverter]::ToUInt16($layout.Bytes, $optional + 68)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PeHardening.Tests.ps1",
  "why": "flags must come from DllCharacteristics rather than a neighboring field"
 },
 {
  "id": "packaging.pe-hardening.verdict",
  "target": "windows/scripts/modules/WindowsPeHardening.Common.psm1",
  "find": "if ($misses.Count -gt 0) { throw \"PE hardening:",
  "replace": "if ($false) { throw \"PE hardening:",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PeHardening.Tests.ps1",
  "why": "reported missing hardening must cause failure"
 },
 {
  "id": "host.proof-mounted-transcript",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "shutil.copyfile(transcript, output / \"preflight.log\")",
  "replace": "shutil.copyfile(output / \"engine-attach.log\", output / \"preflight.log\")",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "An incomplete attach stream must not replace the complete mounted worker bytes."
 },
 {
  "id": "host.proof-transcript-exit",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "return status if status else int(cleaned != 0 or not captured)",
  "replace": "return status if status else int(cleaned != 0)",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Missing worker evidence must fail the outer command even after engine and cleanup zero."
 },
 {
  "id": "host.proof-transcript-verdict",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "\"passed\" if status == 0 and cleaned == 0 and captured else \"failed\"",
  "replace": "\"passed\" if status == 0 and cleaned == 0 else \"failed\"",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The run record must retain a failed capture rather than publish an inner green."
 },
 {
  "id": "host.proof-transcript-regular",
  "target": "linux/scripts/run-isolated-preflight.py",
  "find": "if transcript.is_symlink() or not transcript.is_file():",
  "replace": "if not transcript.exists():",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "A linked report cannot substitute for the worker transcript."
 },
 {
  "id": "host.proof-worker-transcript",
  "target": "linux/scripts/isolated-preflight/worker.sh",
  "find": "exec make preflight > /evidence/isolated-preflight-command.log 2>&1",
  "replace": "exec make preflight",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "The actual worker must persist its output before engine cleanup."
 },
 {
  "id": "host.proof-worker-transcript-stderr",
  "target": "linux/scripts/isolated-preflight/worker.sh",
  "find": "exec make preflight > /evidence/isolated-preflight-command.log 2>&1",
  "replace": "exec make preflight > /evidence/isolated-preflight-command.log 2>/dev/null",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "Failed-command diagnostics must reach the mounted transcript along with stdout."
 },
 {
  "id": "compiler-llvm-tools.complete-preflight-joined-property-prefix",
  "target": "linux/scripts/local-proof/complete-preflight-receipt.py",
  "find": "r\"^(?:--property=|-p)?ExecStopPost=\"",
  "replace": "r\"^ExecStopPost=\"",
  "test": "bash linux/scripts/tests/test-complete-preflight-receipt.sh",
  "why": "Synthetic CLI controls require all supported property argument forms, exactly one cleanup, the original owner and raw cleanup success. They do not execute systemd, authenticate receipts or prove image acceptance."
 },
 {
  "id": "compiler-llvm-tools.complete-preflight-separated-property-value",
  "target": "linux/scripts/local-proof/complete-preflight-receipt.py",
  "find": "r\"^(?:--property=|-p)?ExecStopPost=\"",
  "replace": "r\"^(?:--property=|-p)ExecStopPost=\"",
  "test": "bash linux/scripts/tests/test-complete-preflight-receipt.sh",
  "why": "Synthetic CLI controls require all supported property argument forms, exactly one cleanup, the original owner and raw cleanup success. They do not execute systemd, authenticate receipts or prove image acceptance."
 },
 {
  "id": "compiler-llvm-tools.complete-preflight-unique-cleanup",
  "target": "linux/scripts/local-proof/complete-preflight-receipt.py",
  "find": "assert len(cleanup_commands) == 1",
  "replace": "assert len(cleanup_commands) >= 1",
  "test": "bash linux/scripts/tests/test-complete-preflight-receipt.sh",
  "why": "Synthetic CLI controls require all supported property argument forms, exactly one cleanup, the original owner and raw cleanup success. They do not execute systemd, authenticate receipts or prove image acceptance."
 },
 {
  "id": "compiler-llvm-tools.complete-preflight-argv-owner",
  "target": "linux/scripts/local-proof/complete-preflight-receipt.py",
  "find": "assert cleanup_argv[cleanup_argv.index(\"--run-id\") + 1] == record[\"owner_run_id\"]",
  "replace": "assert True",
  "test": "bash linux/scripts/tests/test-complete-preflight-receipt.sh",
  "why": "Synthetic CLI controls require all supported property argument forms, exactly one cleanup, the original owner and raw cleanup success. They do not execute systemd, authenticate receipts or prove image acceptance."
 },
 {
  "id": "compiler-llvm-tools.complete-preflight-raw-cleanup-status",
  "target": "linux/scripts/local-proof/complete-preflight-receipt.py",
  "find": "assert cleanup[\"exit_status\"] == 0 and cleanup[\"run_id\"] == record[\"owner_run_id\"]",
  "replace": "assert cleanup[\"run_id\"] == record[\"owner_run_id\"]",
  "test": "bash linux/scripts/tests/test-complete-preflight-receipt.sh",
  "why": "Synthetic CLI controls require all supported property argument forms, exactly one cleanup, the original owner and raw cleanup success. They do not execute systemd, authenticate receipts or prove image acceptance."
 },
 {
  "id": "compiler-llvm-tools.complete-preflight-cleanup-receipt-owner",
  "target": "linux/scripts/local-proof/complete-preflight-receipt.py",
  "find": "assert cleanup[\"exit_status\"] == 0 and cleanup[\"run_id\"] == record[\"owner_run_id\"]",
  "replace": "assert cleanup[\"exit_status\"] == 0",
  "test": "bash linux/scripts/tests/test-complete-preflight-receipt.sh",
  "why": "Synthetic CLI controls require all supported property argument forms, exactly one cleanup, the original owner and raw cleanup success. They do not execute systemd, authenticate receipts or prove image acceptance."
 },
 {
  "why": "an approved notice must not ship a DRAFT line to every end user",
  "id": "packaging.msvc-notice-no-draft",
  "replace": "the DRAFT Microsoft Visual C++ runtime libraries",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msvc.RuntimeNotice.Tests.ps1 -ResultFile logs/code-quality/msvc-notice-mutation.json",
  "target": "cmake/msvc-runtime-notice.txt",
  "find": "the Microsoft Visual C++ runtime libraries"
 },
 {
  "why": "the notice must link the license terms that govern the runtime, not only the file list",
  "id": "packaging.msvc-notice-names-license-terms",
  "replace": "https://example.invalid/",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Msvc.RuntimeNotice.Tests.ps1 -ResultFile logs/code-quality/msvc-notice-mutation.json",
  "target": "cmake/msvc-runtime-notice.txt",
  "find": "https://visualstudio.microsoft.com/license-terms/"
 },
 {
  "id": "host.proof-ft-fixture-clears-selection",
  "target": "linux/scripts/tests/proof_workflow_ft_tests.py",
  "find": "            PREFLIGHT_SKIP=\"\",\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-proof-workflows.sh",
  "why": "CI runs preflight with PREFLIGHT_SKIP set; a fixture that inherits it makes the worker refuse before the FT probe"
 },
 {
  "target": "windows/scripts/build/Build-TvmFromSource.ps1",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.PipPins.Tests.ps1 -ResultFile logs/code-quality/tvm-packaging-pin-mutation.json",
  "replace": "-Name scikit-build-core, setuptools-scm, wheel, cython",
  "find": "-Name packaging, scikit-build-core, setuptools-scm, wheel, cython",
  "id": "windows-lane.tvm-build-tools-pin-packaging",
  "why": "scikit-build-core and setuptools-scm pull packaging; unpinned, the TVM branch takes the newest release and the media merge refuses the mixed install"
 },
 {
  "why": "the app's setup.py copies hub modules at build time, so a checkout without the hub submodule fails uv sync in the torch stage",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only TorchApp.Checkout.Tests.ps1 -ResultFile logs/code-quality/torch-app-hub-mutation.json",
  "id": "windows-lane.torch-app-hub-submodule",
  "target": "windows/scripts/build/Build-TorchApp.ps1",
  "replace": "status",
  "find": "submodule update --init --depth 1 third_party/ANTfrastructure"
 },
 {
  "target": "windows/scripts/build/Build-TvmFromSource.ps1",
  "find": "-Name cython, wheel, packaging",
  "why": "wheel pulls packaging; unpinned on the arm64 cross path, the TVM branch takes the newest release and the media merge refuses the mixed install",
  "replace": "-Name cython, wheel",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only Build.PipPins.Tests.ps1 -ResultFile logs/code-quality/tvm-cross-wheel-mutation.json",
  "id": "windows-lane.tvm-cross-wheel-pin-packaging"
 },
 {
  "id": "windows-lane.ffmpeg-pin-tarball-unchecked",
  "target": "windows/scripts/build/Build-FfmpegFromSource.ps1",
  "find": "        Assert-FfmpegTarballStream -Path $tarballPath -Expected $Sha256 -Tag $FfmpegVersion\n",
  "replace": "",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Artifact.Tests.ps1 -ResultFile logs/code-quality/ffmpeg-pin-mutation.json",
  "why": "the pinned tag extracted unhashed is an unverified download that still looks pinned"
 },
 {
  "id": "windows-lane.ffmpeg-pin-file-hash",
  "target": "windows/scripts/build/Build-FfmpegFromSource.ps1",
  "find": "HashData($stream)",
  "replace": "HashData($file)",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Artifact.Tests.ps1 -ResultFile logs/code-quality/ffmpeg-pin-mutation.json",
  "why": "GitHub may re-gzip the same tar, so only the stream hash is stable"
 },
 {
  "id": "windows-lane.ffmpeg-pin-shape-unchecked",
  "target": "windows/scripts/build/Build-FfmpegFromSource.ps1",
  "find": "if ($Expected -cnotmatch '^[0-9a-f]{64}$') {",
  "replace": "if ($false) {",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Artifact.Tests.ps1 -ResultFile logs/code-quality/ffmpeg-pin-mutation.json",
  "why": "an empty pin must name the missing versions.env key, not read as a corrupt archive"
 },
 {
  "id": "windows-lane.ffmpeg-pin-not-forwarded",
  "target": "windows/scripts/modules/WindowsBuildDriver.Common.psm1",
  "find": "'FFMPEG_VERSION', 'FFMPEG_SHA256', 'PYAV_VERSION',",
  "replace": "'FFMPEG_VERSION', 'PYAV_VERSION',",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only BuildDriver.MediaLane.Tests.ps1 -ResultFile logs/code-quality/ffmpeg-pin-forward-mutation.json",
  "why": "an unforwarded pin falls back to the script default, which a versions.env bump never moves"
 },
 {
  "id": "windows-lane.ffmpeg-pin-env-dropped",
  "target": "windows/Dockerfile.media-builder",
  "find": "    FFMPEG_SHA256=\"${FFMPEG_SHA256}\" `\n",
  "replace": "",
  "test": "mkdir -p logs/code-quality && pwsh -NoProfile -File windows/scripts/tests/Invoke-Tests.ps1 -Only SourceBuild.Artifact.Tests.ps1 -ResultFile logs/code-quality/ffmpeg-pin-env-mutation.json",
  "why": "an ARG the RUN cannot read as ENV leaves the script on its baked default"
 },
 {
  "id": "image-acceptance.arm64-closure-windows-prefix",
  "target": "linux/scripts/local-proof/windows-arm64-acceptance.py",
  "find": "return '*' in inputs or path.startswith('windows/') or path in HOST_INPUTS",
  "test": "python3 linux/scripts/tests/windows_arm64_acceptance_tests.py ClosureTests.test_each_windows_closure_path_blocks_reuse",
  "replace": "return '*' in inputs or path in HOST_INPUTS",
  "why": "a later commit that changes a Windows build script must not reuse an older ARM64 image for promotion"
 },
 {
  "target": "linux/scripts/local-proof/windows-arm64-acceptance.py",
  "id": "image-acceptance.arm64-receipt-masked-status",
  "test": "python3 linux/scripts/tests/windows_arm64_acceptance_tests.py EvidenceTests.test_a_receipt_binds_source_run_attempt_status_and_immutable_image",
  "find": "if receipt['Passed'] != (receipt['GateExitCode'] == 0):",
  "why": "a receipt that reports passed beside a failing gate status must not promote the tag",
  "replace": "if receipt is None:"
 },
 {
  "target": "linux/scripts/local-proof/windows-arm64-acceptance.py",
  "id": "image-acceptance.arm64-device-single-verdict",
  "test": "python3 linux/scripts/tests/windows_arm64_acceptance_tests.py EvidenceTests.test_the_device_log_needs_every_step_at_the_original_floor",
  "find": "if len(verdicts) != 1 or tuple(",
  "why": "a device log must carry exactly one full verdict at the original floor",
  "replace": "if not verdicts or tuple("
 },
 {
  "id": "doc-prose.list-item-ends-sentence",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        if LIST_ITEM.match(text):\n            self.flush()\n",
  "replace": "        if LIST_ITEM.match(text):\n            pass\n",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a list item without a full stop would run into the next one and read as one long sentence"
 },
 {
  "id": "doc-prose.fence-is-not-prose",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "            fence = opened.group(1)\n",
  "replace": "            fence = \"\"\n",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "code in a fence is not prose; counted, it skews every rate"
 },
 {
  "id": "doc-prose.table-is-not-prose",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "MD_SKIP = re.compile(r\"^(?:\\||#|",
  "replace": "MD_SKIP = re.compile(r\"^(?:#|",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a table row has no sentences; read as prose it joins the next line into one"
 },
 {
  "id": "doc-prose.inline-code-is-one-word",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "    (re.compile(r\"(`+)(?:(?!\\1).)+?\\1\"), \" X \"),",
  "replace": "    (re.compile(r\"(`+)((?:(?!\\1).)+?)\\1\"), r\" \\2 \"),",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a date or a dot inside inline code is not the page's own date or sentence end"
 },
 {
  "id": "doc-prose.link-target-dropped",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "    (re.compile(r\"\\[([^\\]]*)\\]\\([^)]*\\)\"), r\"\\1\"),",
  "replace": "    (re.compile(r\"\\[([^\\]]*)\\]\\(([^)]*)\\)\"), r\"\\1 \\2\"),",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a link target is an address, not prose; a date in a URL is not a date in the text"
 },
 {
  "id": "doc-prose.sentence-split",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "SENTENCE_END = re.compile(r\"(?:(?<=[.!?])|(?<=[.!?][\\\"')\\]*]))\\s+(?=[\\\"'(\\[*_A-Z0-9])\")",
  "replace": "SENTENCE_END = re.compile(r\"(?!)\")",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "without the split a paragraph is one sentence, and every average is a paragraph length"
 },
 {
  "id": "doc-prose.fragment-is-no-sentence",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "    return [n for n in lengths if n >= MIN_SENTENCE]",
  "replace": "    return lengths",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a label or a lone path is not a sentence; counted, it pulls the average down"
 },
 {
  "id": "doc-prose.short-page-not-graded",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "    if words < MIN_WORDS:\n        return None",
  "replace": "    if False:\n        return None",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a rate over a few words means nothing; a generated stub must not get rows"
 },
 {
  "id": "doc-prose.dates-and-ids-counted",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "DATE_OR_ID = re.compile(r\"\\b(?:20\\d\\d-[01]\\d-[0-3]\\d|D\\d{1,2}|CON\\d{1,4})\\b\")",
  "replace": "DATE_OR_ID = re.compile(r\"\\b(?:20\\d\\d-[01]\\d-[0-3]\\d)\\b\")",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a decision id in an instruction is what the metric exists to count, beside the dates"
 },
 {
  "id": "doc-prose.bold-counted",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        \"bold-per-k\": round(len(BOLD.findall(text)) * per_k, 1),",
  "replace": "        \"bold-per-k\": 0.0,",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "bold is one of the four rates; a constant zero freezes nothing"
 },
 {
  "id": "doc-prose.short-page-counts-as-1000",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "    per_k = 1000 / max(words, 1000)",
  "replace": "    per_k = 1000 / words",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a 200-word page with one date is not five dates per 1000 words; without the floor short pages fail on one date"
 },
 {
  "id": "doc-prose.directive-body-skipped",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        return -1 if directive and directive.group(1) in PROSE_DIRECTIVES else indent",
  "replace": "        return -1",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "raw HTML under a reST directive read as prose is the generated page that counted as one 1393-word sentence"
 },
 {
  "id": "doc-prose.admonition-is-prose",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "PROSE_DIRECTIVES = {\"note\", \"warning\",",
  "replace": "PROSE_DIRECTIVES = {\"warning\",",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a note body is the page's own prose and must be graded"
 },
 {
  "id": "doc-prose.literal-block-skipped",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        out.flush()\n        return indent\n    return None",
  "replace": "        out.flush()\n        return -1\n    return None",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "the indented block after :: is code, not prose"
 },
 {
  "id": "doc-prose.rst-table-skipped",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        if table or SIMPLE_TABLE.match(stripped):",
  "replace": "        if table:",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "a simple reST table is data, not sentences"
 },
 {
  "id": "doc-prose.title-is-not-prose",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        if len(self.lines) == 1:\n            self.lines = []",
  "replace": "        if False:\n            self.lines = []",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k split",
  "why": "an underlined title is a heading, not a sentence"
 },
 {
  "id": "doc-prose.records-exempt",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "EXEMPT = re.compile(r\"changelog|backlog|archive|(^|/)decisions\\.md$|(^|/)third_party/\"",
  "replace": "EXEMPT = re.compile(r\"(^|/)third_party/\"",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k records",
  "why": "CHANGELOG, BACKLOG, archives and decisions.md are where dates and ids belong"
 },
 {
  "id": "doc-prose.licence-exempt",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "r\"|(^|/)(licen[cs]e|copying|notice)[^/]*$|",
  "replace": "r\"|(^|/)(copying|notice)[^/]*$|",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k records",
  "why": "a licence text is not ours to restyle"
 },
 {
  "id": "doc-prose.generated-skipped",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        if not GENERATED.search(head):",
  "replace": "        if True:",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k records",
  "why": "a generated page changes with its generator, not by hand"
 },
 {
  "id": "doc-prose.generated-block-skipped",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "HTML_COMMENT.sub(_blank_out, GENERATED_BLOCK.sub(_blank_out, text))",
  "replace": "HTML_COMMENT.sub(_blank_out, text)",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k records",
  "why": "a generated block inside a page is rewritten by its tool; grading it fails the page on the next sync"
 },
 {
  "id": "doc-prose.grew-fails",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        elif now > was:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k ratchet",
  "why": "a value above its row is the regression the census exists to stop"
 },
 {
  "id": "doc-prose.fell-fails",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        elif now < was:",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k ratchet",
  "why": "a drop not written down lets the next change grow back into the gap"
 },
 {
  "id": "doc-prose.write-never-raises",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "    return {key: min(was, measured[key[0]][key[1]]) for key, was in census.items()",
  "replace": "    return {key: measured[key[0]][key[1]] for key, was in census.items()",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k ratchet",
  "why": "--write that raises a row turns the ratchet into a recorder"
 },
 {
  "id": "doc-prose.stale-rows-fail",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "    stale = sorted({page for page, metric in census if metric not in measured.get(page, {})})",
  "replace": "    stale: list[str] = []",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k ratchet",
  "why": "rows of a page that is gone are cover for the next page of that name"
 },
 {
  "id": "doc-prose.malformed-row-refused",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        if len(parts) != 3 or parts[1] not in spec.metrics or not re.fullmatch(r\"\\d+(\\.\\d)?\", parts[2]):",
  "replace": "        if len(parts) < 2:",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k ratchet",
  "why": "a row the gate cannot read is an error, never a skip"
 },
 {
  "id": "doc-prose.seed-refuses-existing",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        if census_path.exists():\n            raise CensusError(f\"{census_path} exists;",
  "replace": "        if False:\n            raise CensusError(f\"{census_path} exists;",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k ratchet",
  "why": "--seed over a census would raise every row at once"
 },
 {
  "id": "doc-prose.new-page-limits-bind",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "            for metric, now in values.items() if metric in caps and now > caps[metric]]",
  "replace": "            for metric, now in values.items() if False]",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k limits",
  "why": "a page without rows must meet the fixed limits, or every new page is unbounded"
 },
 {
  "id": "doc-prose.avg-limit",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "NEW_PAGE_LIMITS = {\"avg-sentence\": 22.0,",
  "replace": "NEW_PAGE_LIMITS = {\"avg-sentence\": 23.0,",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k limits",
  "why": "the new-page average is 22 words, as decided"
 },
 {
  "id": "doc-prose.long-share-limit",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "\"long-share\": 15.0,",
  "replace": "\"long-share\": 20.0,",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k limits",
  "why": "at most 15 % of a new page's sentences may run over 30 words"
 },
 {
  "id": "doc-prose.ids-limit",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "\"ids-per-k\": 2.0}",
  "replace": "\"ids-per-k\": 3.0}",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k limits",
  "why": "a new page may hold at most two dates or ids per 1000 words"
 },
 {
  "id": "doc-prose.long-is-over-30",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "sum(n > LONG_SENTENCE for n in lengths)",
  "replace": "sum(n >= LONG_SENTENCE for n in lengths)",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k limits",
  "why": "a 30-word sentence is not over 30"
 },
 {
  "id": "doc-prose.agents-consumer-target",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "AGENTS_TARGET = {True: 6000, False: 3000}",
  "replace": "AGENTS_TARGET = {True: 6000, False: 3001}",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k agents",
  "why": "a consumer AGENTS.md targets 3000 words"
 },
 {
  "id": "doc-prose.agents-hub-target",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "AGENTS_TARGET = {True: 6000, False: 3000}",
  "replace": "AGENTS_TARGET = {True: 6001, False: 3000}",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k hub",
  "why": "the hub AGENTS.md targets 6000 words"
 },
 {
  "id": "doc-prose.agents-words-counted",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "[WORDS] = float(len(agents.read_text(encoding=\"utf-8\").split()))",
  "replace": "[WORDS] = 0.0",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k agents",
  "why": "the AGENTS.md word budget needs the real count"
 },
 {
  "id": "doc-prose.consumer-off-until-seeded",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "    if not census_path.exists():\n        if hub:",
  "replace": "    if False:\n        if hub:",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k consumer",
  "why": "an unseeded consumer is reported, not failed; otherwise the next pin bump reds every consumer at once"
 },
 {
  "id": "doc-prose.hub-census-required",
  "target": "linux/scripts/verify_doc_prose.py",
  "find": "        if hub:\n            raise CensusError(f\"{census_path} is missing",
  "replace": "        if False:\n            raise CensusError(f\"{census_path} is missing",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k hub",
  "why": "the hub without its census would report instead of grade, and pass every page"
 },
 {
  "id": "doc-prose.consumer-half-grades",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  _lint_gates_hub linux/scripts/verify_doc_prose.py || return 1",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k wiring",
  "why": "the consumer half must run the gate and return its verdict"
 },
 {
  "id": "doc-prose.consumer-half-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  run_gate \"doc prose\" _lint_gates_doc_prose\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k wiring",
  "why": "a gate function nothing registers runs in no consumer"
 },
 {
  "id": "doc-prose.consumer-half-root",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  _lint_gates_hub_python --root \"${_LINT_GATES_ROOT}\"\n}\n\n# A quality-report.toml",
  "replace": "  _lint_gates_hub_python\n}\n\n# A quality-report.toml",
  "test": "bash linux/scripts/tests/test-doc-prose.sh -k wiring",
  "why": "without --root the gate grades the hub and passes every consumer"
 },
 {
  "id": "image-acceptance.arm64-closure-bind-mounts",
  "target": "linux/scripts/local-proof/windows-arm64-acceptance.py",
  "find": "if spec.get('type', 'bind') == 'bind' and 'from' not in spec:",
  "test": "python3 linux/scripts/tests/windows_arm64_acceptance_tests.py InstructionTests.test_only_context_copies_and_bind_mounts_are_inputs",
  "replace": "if spec.get('type', 'bind') == 'bind' and 'from' in spec:",
  "why": "a file a Windows RUN mounts from the build context belongs to the image closure even though it lives outside windows/"
 },
 {
  "find": "retention-days: ${{ github.event_name == 'workflow_dispatch' && 14 || 2 }}",
  "replace": "retention-days: 14",
  "test": "python3 linux/scripts/tests/artifact_retention_tests.py RetentionTests.test_the_arm64_bundle_lives_long_enough_only_for_a_manual_candidate",
  "target": ".github/workflows/windows-arm64.yml",
  "id": "windows-lane.arm64-bundle-retention-by-trigger",
  "why": "the daily device replay re-uploads a ~2 GB bundle that only its own gate job reads"
 },
 {
  "find": "          # Only the arm64 test job of this run reads the stage.\n          retention-days: 1\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/artifact_retention_tests.py RetentionTests.test_every_reusable_upload_keeps_the_ref_policy_or_is_a_same_run_handoff",
  "target": ".github/workflows/python-ci-windows.yml",
  "id": "windows-lane.handoff-retention-one-day",
  "why": "a same-run handoff must not keep its bytes for the 90-day default"
 },
 {
  "find": "        type: number\n        default: 0\n",
  "replace": "        type: number\n        default: 90\n",
  "test": "python3 linux/scripts/tests/artifact_retention_tests.py RetentionTests.test_reusable_lanes_take_an_override_that_defaults_to_the_ref_policy",
  "target": ".github/workflows/python-ci-linux.yml",
  "id": "python-ci.retention-input-default-by-ref",
  "why": "a nonzero default would bypass the by-ref policy for every consumer that calls the lane at @develop"
 },
 {
  "test": "python3 linux/scripts/tests/ghcr_cleanup_workflow_tests.py PruneTests.test_both_packages_are_pruned_with_confirm_age_and_tag_guards",
  "replace": "",
  "find": "          GHCR_PKG: kataglyphis_beschleuniger-stages\n",
  "why": "without its package name the second step prunes the public package again and the private stages keep every untagged version",
  "id": "lib.ghcr-cleanup-stages-package",
  "target": ".github/workflows/ghcr-cleanup.yml"
 },
 {
  "test": "python3 linux/scripts/tests/ghcr_cleanup_workflow_tests.py PruneTests.test_only_the_stage_package_lowers_the_empty_inventory_guard",
  "replace": "          MIN_TAGS: \"0\"\n",
  "find": "          MIN_TAGS: \"3\"\n",
  "why": "a zero guard lets an empty tag listing turn the stage prune into a registry wipe",
  "id": "lib.ghcr-cleanup-stages-guard",
  "target": ".github/workflows/ghcr-cleanup.yml"
 },
 {
  "id": "lib.ghcr-candidate-tags-only-candidates",
  "target": "linux/host-config/ghcr-candidate-tags.py",
  "why": "a candidate that was promoted carries a public tag too, and deleting its candidate tag must never be proposed as freeing it",
  "find": "if tags and all(tag.startswith(PREFIX) for tag in tags) and created < cutoff:",
  "test": "python3 linux/scripts/tests/ghcr_candidate_tags_tests.py SelectTests.test_only_old_versions_carrying_nothing_but_candidate_tags_are_listed",
  "replace": "if tags and any(tag.startswith(PREFIX) for tag in tags) and created < cutoff:"
 },
 {
  "id": "handoff.runtime-source-torch-assembly",
  "target": "linux/scripts/local-proof/runtime_source_profile.py",
  "find": "HOST_ONLY_FILES = frozenset({'linux/scripts/01-core/runtime-build-fns.sh', 'linux/scripts/03-media/runtime/assemble-torch-app.sh'})",
  "replace": "HOST_ONLY_FILES = frozenset({'linux/scripts/01-core/runtime-build-fns.sh'})",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh -k test_runtime_torch_assembly",
  "why": "the torch stage's own assembly script runs only in the runtime lane and must not force a rebuild of verified parents"
 },
 {
  "id": "smoke.cargo-qa-through-cargo",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "$(cargo \"${_t#cargo-}\" --version",
  "replace": "$(\"${_t}\" --version",
  "test": "bash linux/scripts/tests/test-runtime-probe-inputs.sh -k cargo_subcommands",
  "why": "cargo-mutants rejects --version when called directly, so the probe must ask every tool through cargo"
 },
 {
  "id": "smoke.ft-probe-library-shipped",
  "target": "linux/Dockerfile.torch",
  "find": "COPY --chmod=755 linux/scripts/03-media/free-threaded-wheels.sh /opt/scripts/03-media/free-threaded-wheels.sh\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-probe-inputs.sh -k ft_probe_inputs",
  "why": "the free-threaded store probe sources this library inside the shipped image"
 },
 {
  "id": "smoke.ft-probe-table-shipped",
  "target": "linux/Dockerfile.torch",
  "find": "COPY linux/scripts/03-media/free-threaded-twins.txt /opt/scripts/03-media/free-threaded-twins.txt\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-probe-inputs.sh -k ft_probe_inputs",
  "why": "the sourced library reads its twin table beside itself"
 },
 {
  "id": "mutations.drop-bytecode-after-apply",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        write_exact(target, mutated)\n        drop_bytecode(target)\n",
  "replace": "        write_exact(target, mutated)\n",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k basics",
  "why": "a same-size Python mutant must not run the previous mutant's cached bytecode"
 },
 {
  "id": "mutations.drop-bytecode-after-restore",
  "target": "docs/scripts/verify_mutations.py",
  "find": "        os.unlink(backup.name)\n        drop_bytecode(target)\n",
  "replace": "        os.unlink(backup.name)\n",
  "test": "bash linux/scripts/tests/test-mutation-gate.sh -k basics",
  "why": "no bytecode of a mutant may outlive its run, where a later same-size mutant would load it"
 },
 {
  "id": "disk-guard.storage-guardian-beside-runtime",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(directory == runtime_path.parent.with_name(runtime_path.parent.name + '-storage-guard'), 'Storage guardian directory must sit beside the runtime output')\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "FINAL reads the guardian only beside the runtime output, so a guardian elsewhere must refuse at launch"
 },
 {
  "id": "disk-guard.storage-guardian-runtime-checkout",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "            and runtime.get('host_tools_revision') == checked_output(['git', '-C', str(ROOT), 'rev-parse', 'HEAD']).strip(),\n",
  "replace": "            and runtime.get('host_tools_revision') is not None,\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "FINAL binds the guardian to the runtime host tools revision, so another revision must refuse at launch"
 },
 {
  "id": "disk-guard.storage-guardian-runtime-root",
  "target": "linux/scripts/runtime_storage_guard.py",
  "find": "    require(Path(runtime.get('engine_wrapper', '')).resolve(strict=True).parents[2] == ROOT\n",
  "replace": "    require(Path(runtime.get('engine_wrapper', '')).resolve(strict=True).parents[2] is not None\n",
  "test": "bash linux/scripts/tests/test-runtime-storage-guard.sh",
  "why": "FINAL binds the guardian to the runtime host tools checkout, so another checkout must refuse at launch"
 },
 {
  "id": "tvm-llvm.private-static-filter",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "    '        if(_tvm_llvm_type STREQUAL \"STATIC_LIBRARY\")' \\\n",
  "replace": "    '        if(NOT _tvm_llvm_type STREQUAL \"INTERFACE_LIBRARY\")' \\\n",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k patch",
  "why": "only static LLVM targets may reach LLVM_LIBS, or TVM links the libLLVM another LLVM can interpose"
 },
 {
  "id": "tvm-llvm.private-static-layout",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "  [ \"$(grep -c -x -F -e \"$anchor\" \"$file\" || true)\" = 1 ] \\\n",
  "replace": "  true \\\n",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k patch",
  "why": "a moved upstream anchor must refuse, not build silently against the shared LLVM"
 },
 {
  "id": "tvm-llvm.private-static-needed",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "    *'Shared library: [libLLVM'*) die \"TVM private LLVM: ${lib} needs a shared libLLVM\" ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k elf",
  "why": "a libtvm_compiler that needs a shared libLLVM must fail the build"
 },
 {
  "id": "tvm-llvm.private-static-exported",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "  [ -z \"$exported\" ] || die",
  "replace": "  [ -n \"$exported\" ] || die",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k elf",
  "why": "an exported llvm:: symbol lets another LLVM bind to TVM's copy and must fail the build"
 },
 {
  "id": "tvm-llvm.private-static-build-assert",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "  [ \"$llvm_cmake_value\" = \"OFF\" ] || assert_tvm_private_llvm \"$build_dir/lib/libtvm_compiler.so\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k smoke",
  "why": "every LLVM-enabled TVM build must prove its private static LLVM"
 },
 {
  "id": "tvm-llvm.private-static-main",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "  patch_tvm_findllvm_private_static\n  patch_tvm_compiler_llvm_symbols_local\n",
  "replace": "  patch_tvm_compiler_llvm_symbols_local\n",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k smoke",
  "why": "the FindLLVM patch must run before configure"
 },
 {
  "id": "tvm-llvm.smoke-shared-llvm-mapped",
  "target": "linux/scripts/06-packaging/smoke-torch-venv.sh",
  "find": "if \"Shared library: [libLLVM\" in dynamic:\n",
  "replace": "if \"Shared library: [libLLVM\" in dynamic and False:\n",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "the shipped smoke must fail a libtvm_compiler that needs a shared libLLVM another LLVM can interpose"
 },
 {
  "id": "tvm-llvm.private-static-available",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "    '      set(LLVM_LIBS ${LLVM_AVAILABLE_LIBS})' \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k patch",
  "why": "an installed package maps all to nothing, so the static targets must come from LLVM_AVAILABLE_LIBS"
 },
 {
  "id": "tvm-llvm.compiler-symbols-map-local",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "  printf '%s\\n' '{' '  local: _ZN4llvm*; _ZNK4llvm*;' '};' > \"${tvm_dir}/private-llvm.map\"\n",
  "replace": "  printf '%s\\n' '{' '  local: _ZN4llvm_none*;' '};' > \"${tvm_dir}/private-llvm.map\"\n",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k map",
  "why": "the map must keep the inline llvm:: members TVM instantiates local"
 },
 {
  "id": "tvm-llvm.compiler-symbols-map-linked",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "    'set_property(TARGET tvm_compiler APPEND PROPERTY LINK_OPTIONS \"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/private-llvm.map\")'\n",
  "replace": "    ''\n",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k map",
  "why": "libtvm_compiler must link with the map, or its inline llvm:: members stay exported"
 },
 {
  "id": "tvm-llvm.compiler-symbols-main",
  "target": "linux/scripts/05-frameworks/tvm.sh",
  "find": "  patch_tvm_compiler_llvm_symbols_local\n  resolve_tvm_llvm\n",
  "replace": "  resolve_tvm_llvm\n",
  "test": "bash linux/scripts/tests/test-tvm-private-llvm.sh -k smoke",
  "why": "the version-script patch must run before configure"
 },
 {
  "id": "docs-site.isolated-fileinfo-only",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "        AddOutputFilterByType DEFLATE application/wasm\n",
  "replace": "        AddOutputFilterByType DEFLATE application/wasm\n        Options -Indexes\n",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "Options needs AllowOverride Options, which nothing proves the host grants; a refused directive is a 500 on every page of the app"
 },
 {
  "id": "docs-site.isolated-guarded",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "<IfModule mod_setenvif.c>\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "an unguarded SetEnvIf on a host without mod_setenvif is an unknown directive, a 500 on every page of the app"
 },
 {
  "id": "docs-site.isolated-coop",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "\"same-origin\"",
  "replace": "\"same-origin-allow-popups\"",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "crossOriginIsolated needs COOP same-origin; without it the app gets no wasm threads"
 },
 {
  "id": "docs-site.isolated-coep",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "\"require-corp\"",
  "replace": "\"credentialless\"",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "Safari has no credentialless, so the app would not be isolated there"
 },
 {
  "id": "docs-site.isolated-camera",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "\"camera=(self)\"",
  "replace": "\"camera=()\"",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "camera=() refuses getUserMedia, and the webcam page is the app's showcase"
 },
 {
  "id": "docs-site.isolated-https",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "standing alone at a docroot, the app must still move plain http to https: no secure context, no camera and no WebGPU"
 },
 {
  "id": "docs-site.isolated-mjs-type",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "    AddType text/javascript .mjs\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "a module script under the host's default type for .mjs is refused, and ORT Web ships .mjs"
 },
 {
  "id": "docs-site.isolated-wasm-type",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "    AddType application/wasm .wasm\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "WebAssembly.instantiateStreaming rejects a wasm served under any type but application/wasm"
 },
 {
  "id": "docs-site.isolated-no-cache",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "    Header set Cache-Control \"no-cache\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "main.dart.wasm keeps its name across builds, so a cached one would run against a newer main.dart.js"
 },
 {
  "id": "docs-site.isolated-immutable-versioned-only",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": " immutable\" env=VERSIONED_PATH\n",
  "replace": " immutable\"\n",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "immutable on every file pins a returning visitor to an old build for a year"
 },
 {
  "id": "docs-site.isolated-ort-path-hashed",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "/ort/[^/]+-[0-9a-f]{8,64}/",
  "replace": "/ort/[^/]+/",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "an ORT path without its build hash can change under the same name, and a cached .mjs would meet a new .wasm"
 },
 {
  "id": "docs-site.isolated-model-path-hashed",
  "target": "linux/webserver/templates/flutter-web-isolated.htaccess",
  "find": "/models/[0-9a-f]{64}/",
  "replace": "/models/[^/]+/",
  "test": "bash linux/scripts/tests/test-flutter-web-isolated-htaccess.sh",
  "why": "a model path without its SHA-256 can change under the same name"
 },
 {
  "id": "docs-site.ort-web-build-order",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "DEFAULT_BUILDS = (\"jspi\", \"asyncify\", \"cpu\")",
  "replace": "DEFAULT_BUILDS = (\"asyncify\", \"jspi\", \"cpu\")",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "the app tries JSPI, then Asyncify, then CPU, and the manifest lists them in that order"
 },
 {
  "id": "docs-site.ort-web-jsep-on-request",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "builds = [*DEFAULT_BUILDS, *((\"jsep\",) if args.jsep else ())]",
  "replace": "builds = [*DEFAULT_BUILDS, \"jsep\"]",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "JSEP is staged only when --jsep asks for it"
 },
 {
  "id": "docs-site.ort-web-missing-build-refused",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "for build in builds]",
  "replace": "for build in builds if (source / f\"{BUILDS[build][1]}.wasm\").exists()]",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "a missing requested build is refused instead of staging fewer builds"
 },
 {
  "id": "docs-site.ort-web-receipt-hash",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "    if entry.get(\"sha256\") != actual:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "bytes that differ from the image's receipt are refused"
 },
 {
  "id": "docs-site.ort-web-receipt-required",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "        if build in RECEIPT_REQUIRED:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "a WebGPU build without a receipt flavor is refused, not staged as receipt-less"
 },
 {
  "id": "docs-site.ort-web-runtime-probe",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": " or ran.get(\"returncode\") != 0:",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "a runtime receipt of a failed factory probe is refused"
 },
 {
  "id": "docs-site.ort-web-wheel-version",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "        if wheel != version:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "the wheel's license texts are taken only from the receipt's ORT version"
 },
 {
  "id": "docs-site.ort-web-wheel-record",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "            if rows[f\"onnxruntime/{name}\"] != f\"sha256={digest}\":",
  "replace": "            if False:",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "a wheel license text that differs from its RECORD is refused"
 },
 {
  "id": "docs-site.ort-web-bundle-exact",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "if pattern.fullmatch(p.name)",
  "replace": "if pattern.match(p.name)",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "only a build's own ort.*.mjs bundles ship, never a *.bak or a source map beside them"
 },
 {
  "id": "docs-site.ort-web-build-hash-bytes",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "\"\".join(f\"{e['sha256']}  {e['file']}\\n\" for e in files)",
  "replace": "\"\".join(f\"{e['file']}\\n\" for e in files)",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "new bytes get a new build path, so an immutable cached wasm never meets a new loader"
 },
 {
  "id": "docs-site.ort-web-licenses-per-build",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "    roles.update({name: (\"license\", path) for name, path in licenses.items()})\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "every build directory carries ORT's LICENSE and ThirdPartyNotices"
 },
 {
  "id": "docs-site.ort-web-bundles-required",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "    if js and not js_files:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "a build without its JS bundle is refused unless --no-js-bundles says so"
 },
 {
  "id": "docs-site.ort-web-existing-refused",
  "target": "linux/scripts/lib/stage-ort-web.py",
  "find": "    if target.exists():",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-stage-ort-web.sh",
  "why": "an existing ort/ is refused rather than mixed with a new staging"
 },
 {
  "id": "docs-site.ort-web-parity-missing-build",
  "target": "shared/python/ort_web_parity.py",
  "find": "raise ParityError(f\"build {name} is not staged in {path}: refusing to report fewer builds\")",
  "replace": "continue",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "a build the app would ship must not drop out of the report because it was never staged"
 },
 {
  "id": "docs-site.ort-web-parity-file-hash",
  "target": "shared/python/ort_web_parity.py",
  "find": "if actual != item[\"sha256\"]:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "the report is about the staged bytes; a file changed after staging proves nothing about them"
 },
 {
  "id": "docs-site.ort-web-parity-model-hash",
  "target": "shared/python/ort_web_parity.py",
  "find": "if sha256(path) != expected:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "the cat rule and the tolerances were taken from DEIM v2 on the two-cats photo, not from any model"
 },
 {
  "id": "docs-site.ort-web-parity-native-compare",
  "target": "shared/python/ort_web_parity.py",
  "find": "        parity.compare(cpu, runs[0])\n",
  "replace": "        pass\n",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "a build whose detections differ from the native CPU run beyond the tolerances must not ship"
 },
 {
  "id": "docs-site.ort-web-parity-repeat",
  "target": "shared/python/ort_web_parity.py",
  "find": "parity.compare(runs[0], again, pairwise=True)",
  "replace": "pass",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "a second run that differs from the first is a nondeterministic build"
 },
 {
  "id": "docs-site.ort-web-parity-cats-rule",
  "target": "shared/python/ort_web_parity.py",
  "find": "\"passed\": min(counted) >= CATS_MINIMUM}",
  "replace": "\"passed\": True}",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "parity within 0.05 can still leave one cat under 0.4; the old rule holds too"
 },
 {
  "id": "docs-site.ort-web-parity-cats-score",
  "target": "shared/python/ort_web_parity.py",
  "find": "item[\"score\"] >= CATS_SCORE",
  "replace": "item[\"score\"] >= parity.MIN_SCORE",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "a cat counts at 0.4 or more, not at the decoder's 0.25 floor"
 },
 {
  "id": "docs-site.ort-web-parity-required-provider",
  "target": "shared/python/ort_web_parity.py",
  "find": "elif counts[wanted] == 0:",
  "replace": "elif False:",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "ORT puts nodes it cannot run on the CPU without a word: a WebGPU build with no WebGPU node proves nothing"
 },
 {
  "id": "docs-site.ort-web-parity-unproven-provider",
  "target": "shared/python/ort_web_parity.py",
  "find": "    if not counts:\n        reasons.append(",
  "replace": "    if False:\n        reasons.append(",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "a log without placement lines leaves the provider unproven, which is its own reason"
 },
 {
  "id": "docs-site.ort-web-parity-own-bundle-decides",
  "target": "shared/python/ort_web_parity.py",
  "find": "\"decides\": js is not None and js[\"from\"] == \"manifest\",",
  "replace": "\"decides\": js is not None,",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "a run with another JS layer proves the wasm, not the bundle that ships"
 },
 {
  "id": "docs-site.ort-web-parity-decode-score",
  "target": "shared/python/ort_web_parity.py",
  "find": "if not math.isfinite(score) or score < parity.MIN_SCORE:",
  "replace": "if not math.isfinite(score):",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "the comparator reads detections at 0.25 or more, as every family detector decodes them"
 },
 {
  "id": "docs-site.ort-web-parity-decode-unstretch",
  "target": "shared/python/ort_web_parity.py",
  "find": "min(max(x1 * width / SIZE, 0.0), width)",
  "replace": "min(max(x1, 0.0), width)",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "boxes come back in model pixels and must be stretched back to the photo"
 },
 {
  "id": "docs-site.ort-web-parity-stretch-nearest",
  "target": "shared/python/ort_web_parity.py",
  "find": "columns = [(x * width // size) * 3 for x in range(size)]",
  "replace": "columns = [x * width // size for x in range(size)]",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "the tensor samples whole RGB pixels as vision_core does"
 },
 {
  "id": "docs-site.ort-web-parity-provider-per-build",
  "target": "shared/python/ort_web_parity.py",
  "find": "\"cpu\": (\"ort.wasm\", \"wasm\", \"none\", \"cpu\"),",
  "replace": "\"cpu\": (\"ort.wasm\", \"webgpu\", \"webgpu\", \"cpu\"),",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "the CPU build runs the wasm provider with the GPU off, the path a browser without WebGPU takes"
 },
 {
  "id": "docs-site.ort-web-parity-js-dir",
  "target": "shared/python/ort_web_parity.py",
  "find": "    if js_dir is None:\n        return None\n",
  "replace": "    if True:\n        return None\n",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "an arm64 image has no bundles; --js-dir is the only way its wasm runs at all"
 },
 {
  "id": "docs-site.ort-web-parity-two-runs",
  "target": "shared/python/ort_web_parity.py",
  "find": "if not reasons and len(runs) < 2:",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "parity is a run and its repeat; one run cannot show a nondeterministic build"
 },
 {
  "id": "docs-site.ort-web-parity-old-report",
  "target": "shared/python/ort_web_parity.py",
  "find": "if args.out.exists():",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "a new report must not mix with an old one's files"
 },
 {
  "id": "docs-site.ort-web-parity-output-shape",
  "target": "shared/python/ort_web_parity.py",
  "find": "if run.get(\"dims\") != [1, ROWS, STRIDE] or run.get(\"type\") != \"float32\":",
  "replace": "if False:",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "an output of another shape decodes to garbage rows"
 },
 {
  "id": "docs-site.ort-web-parity-jsep-informational",
  "target": "shared/python/ort_web_parity.py",
  "find": "    deciding = [entry for entry in reports if entry[\"build\"] in DEFAULT_BUILDS] or reports\n",
  "replace": "    deciding = reports\n",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "a requested JSEP report would turn develop red although JSEP cannot run DEIM and never ships"
 },
 {
  "id": "docs-site.ort-web-parity-jsep-alone-decides",
  "target": "shared/python/ort_web_parity.py",
  "find": " if entry[\"build\"] in DEFAULT_BUILDS] or reports\n",
  "replace": " if entry[\"build\"] in DEFAULT_BUILDS]\n",
  "test": "python3 shared/python/tests/test_ort_web_parity.py",
  "why": "a run of JSEP alone must still fail on its refusal instead of passing on an empty set"
 },
 {
  "id": "packaging.ort-profile-webgpu-name",
  "target": "shared/python/verify_ort_profile.py",
  "find": "\"webgpu\": \"WebGpuExecutionProvider\",",
  "replace": "\"webgpu\": \"CPUExecutionProvider\",",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "a WebGPU build that fell back to the CPU must not prove WebGPU ran"
 },
 {
  "id": "packaging.ort-profile-jsep-name",
  "target": "shared/python/verify_ort_profile.py",
  "find": "\"jsep\": \"JsExecutionProvider\",",
  "replace": "\"jsep\": \"WebGpuExecutionProvider\",",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "the JSEP build's provider is JsExecutionProvider; the WebGPU EP's name proves another build"
 },
 {
  "id": "packaging.ort-profile-placement-count",
  "target": "shared/python/verify_ort_profile.py",
  "find": "counts[provider] += int(nodes)",
  "replace": "counts[provider] += 1",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "a placement line names how many nodes went to the provider; one line is not one node"
 },
 {
  "id": "packaging.ort-profile-placements-mode",
  "target": "shared/python/verify_ort_profile.py",
  "find": "            counts = placement_counts(events)\n",
  "replace": "            pass\n",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "--placements reads a browser's log lines, which hold no profile events"
 },
 {
  "id": "packaging.ort-profile-shares",
  "target": "shared/python/verify_ort_profile.py",
  "find": "{provider: nodes / total for provider",
  "replace": "{provider: nodes for provider",
  "test": "python3 shared/python/tests/test_verify_ort_profile.py",
  "why": "a share is a fraction of all counted nodes"
 },
 {
  "id": "docs-site.ort-web-harness-isolation",
  "target": "linux/scripts/ort-web-detector-parity.js",
  "find": "'Cross-Origin-Embedder-Policy': 'require-corp',",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-parity.sh",
  "why": "without COEP the page is not cross-origin isolated and the threaded builds have no SharedArrayBuffer"
 },
 {
  "id": "docs-site.ort-web-harness-traversal",
  "target": "linux/scripts/ort-web-detector-parity.js",
  "find": "return file.startsWith(base + path.sep) ? file : null;",
  "replace": "return file;",
  "test": "bash linux/scripts/tests/test-ort-web-parity.sh",
  "why": "the server answers below its roots only"
 },
 {
  "id": "docs-site.ort-web-harness-js-dir-optional",
  "target": "linux/scripts/ort-web-detector-parity.js",
  "find": "if (root && pathname.startsWith(prefix)) {",
  "replace": "if (pathname.startsWith(prefix)) {",
  "test": "bash linux/scripts/tests/test-ort-web-parity.sh",
  "why": "without --js-dir no JS layer may come from the working directory"
 },
 {
  "id": "docs-site.ort-web-harness-wasm-paths",
  "target": "linux/scripts/ort-web-detector-parity.js",
  "find": "wasmPaths: at(o.wasmDir)",
  "replace": "wasmPaths: undefined",
  "test": "bash linux/scripts/tests/test-ort-web-parity.sh",
  "why": "the bundle must load the staged build's loader and wasm, never one beside the bundle"
 },
 {
  "id": "docs-site.ort-web-harness-verbose-log",
  "target": "linux/scripts/ort-web-detector-parity.js",
  "find": "logSeverityLevel: 0, logVerbosityLevel: 0",
  "replace": "logSeverityLevel: 2, logVerbosityLevel: 0",
  "test": "bash linux/scripts/tests/test-ort-web-parity.sh",
  "why": "only the verbose session log names the provider of each node"
 },
 {
  "id": "docs-site.ort-web-harness-runs",
  "target": "linux/scripts/ort-web-detector-parity.js",
  "find": "for (let i = 0; i < o.runs; i++) {",
  "replace": "for (let i = 0; i < 1; i++) {",
  "test": "bash linux/scripts/tests/test-ort-web-parity.sh",
  "why": "the repeat is the second run of the same session"
 },
 {
  "id": "docs-site.ort-web-harness-error-captured",
  "target": "linux/scripts/ort-web-detector-parity.js",
  "find": "result.error = String((error && error.stack) || error);",
  "replace": "throw error;",
  "test": "bash linux/scripts/tests/test-ort-web-parity.sh",
  "why": "a build that fails must come back as a report with its error, not as a dead page"
 },
 {
  "id": "live-site.isolated-page",
  "target": "linux/scripts/check-live-site.js",
  "find": "  const isolated = !opts.isolated || (await look('self.crossOriginIsolated === true'));\n",
  "replace": "  const isolated = true;\n",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "COOP and COEP missing leave crossOriginIsolated false without any console error; only this probe sees it"
 },
 {
  "id": "live-site.isolated-headers",
  "target": "linux/scripts/check-live-site.js",
  "find": "      .filter(([name, want]) => res.headers[name] !== want)\n",
  "replace": "      .filter(([name, want]) => !res.headers[name])\n",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "COEP credentialless isolates Chrome but not Safari; only the header's value tells it from require-corp"
 },
 {
  "id": "live-site.isolated-verdict",
  "target": "linux/scripts/check-live-site.js",
  "find": "  if (headers.length) failed++;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a header failure printed but not counted exits 0 and the deploy stays green"
 },
 {
  "id": "live-site.models-bytes",
  "target": "linux/scripts/check-live-site.js",
  "find": "else if (got.sha256 !== f.sha256 || got.size !== f.size)",
  "replace": "else if (false)",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a model answered with other bytes, a page among them, must fail the check"
 },
 {
  "id": "live-site.models-verdict",
  "target": "linux/scripts/check-live-site.js",
  "find": "    if (wrong.length) failed++;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a model with the wrong bytes printed as FAIL must also fail the run"
 },
 {
  "id": "live-site.models-manifest-shape",
  "target": "linux/scripts/check-live-site.js",
  "find": "!/^models\\/[0-9a-f]{64}\\/([^/]+\\/)?[^/]+$/.test(f?.path) || !f.path.startsWith(f.prefix) || f.path.slice(f.prefix.length).includes('/')\n    || !/^[0-9a-f]{64}$/.test(f.sha256) || ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a manifest entry outside models/<its sha256>/, or a GenAI file outside its archive's, is not what the mirror writes, and its check would prove nothing"
 },
 {
  "id": "docs-site.stage-isolated-app",
  "target": "linux/scripts/docs-site.sh",
  "find": "  cp \"${DOCS_SITE_HUB}/linux/webserver/templates/flutter-web-isolated.htaccess\" \"$1/$2/.htaccess\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "without it the app is served without COOP and COEP, and crossOriginIsolated stays false"
 },
 {
  "id": "docs-site.stage-isolated-app-needs-page",
  "target": "linux/scripts/docs-site.sh",
  "find": "  [ -f \"$1/$2/index.html\" ] || die",
  "replace": "  true || die",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "an app directory without its page is a build that wrote nothing, and would publish a site with a dead /app/"
 },
 {
  "id": "docs-site.stage-isolated-app-own-refused",
  "target": "linux/scripts/docs-site.sh",
  "find": "  [ ! -e \"$1/$2/.htaccess\" ] || die",
  "replace": "  true || die",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "overwriting an app's own .htaccess silently drops what that app needed it for"
 },
 {
  "id": "docs-site.stage-isolated-app-path-safety",
  "target": "linux/scripts/docs-site.sh",
  "find": "  _docs_site_relative \"isolated app\" \"$2\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a path that climbs out of the site would write the template outside the published tree"
 },
 {
  "id": "docs-site.workflow-isolated-apps",
  "target": ".github/workflows/build-docs.yml",
  "find": "          for app in ${apps[@]+\"${apps[@]}\"}; do args+=(--isolated-app \"${app}\"); done\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "an isolated-apps input that never reaches the stager publishes the app without its headers"
 },
 {
  "id": "site-links.base-root-absolute",
  "target": "linux/scripts/verify_site_links.py",
  "find": "                base = SITE + page.base[1:]\n",
  "replace": "                pass\n",
  "test": "bash linux/scripts/tests/test-site-links.sh",
  "why": "a Flutter app built with --base-href /app/ names the site root; read as the build host's root, every link of the app is reported dead"
 },
 {
  "id": "tvm-llvm.smoke-assert-only-codegen",
  "target": "linux/scripts/06-packaging/smoke-torch-venv.sh",
  "find": "    assert_app_venv_parity\n    assert_tvm_codegen\n",
  "replace": "    assert_app_venv_parity\n",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "the runtime-image gate runs only the assert-only smoke, so the TVM check must run there to reach the shipped venv"
 },
 {
  "id": "smoke.build-backends-assert-only",
  "target": "linux/scripts/06-packaging/smoke-torch-venv.sh",
  "find": "    assert_tvm_codegen\n    assert_build_backends\n    smoke_summary\n",
  "replace": "    assert_tvm_codegen\n    smoke_summary\n",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "the runtime-image gate runs only the assert-only smoke, so without the call there the image can lose setuptools or wheel unseen"
 },
 {
  "id": "smoke.build-backends-full",
  "target": "linux/scripts/06-packaging/smoke-torch-venv.sh",
  "find": "  done\n  assert_build_backends\n",
  "replace": "  done\n",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "a standalone run of the venv smoke must check what uv-lock-in-image.sh imports, like the runtime gate"
 },
 {
  "id": "smoke.build-backends-probe-imports-wheel",
  "target": "linux/scripts/06-packaging/smoke-torch-venv.sh",
  "find": "try_import \"setuptools, wheel\" \"setuptools and wheel\" \"setuptools.__version__, wheel.__version__\" 1 || true\n",
  "replace": "try_import \"setuptools\" \"setuptools and wheel\" \"setuptools.__version__\" 1 || true\n",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "a setuptools that stops vendoring wheel leaves uv-lock-in-image.sh to install it, which a non-root run cannot"
 },
 {
  "id": "smoke.build-backends-probe-setuptools-first",
  "target": "linux/scripts/06-packaging/smoke-torch-venv.sh",
  "find": "try_import \"setuptools, wheel\" \"setuptools and wheel\" \"setuptools.__version__, wheel.__version__\" 1 || true\n",
  "replace": "try_import \"wheel, setuptools\" \"setuptools and wheel\" \"setuptools.__version__, wheel.__version__\" 1 || true\n",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "the image's wheel is setuptools' vendored copy, importable only after setuptools, as uv-lock-in-image.sh probes it"
 },
 {
  "id": "smoke.build-backends-probe-required",
  "target": "linux/scripts/06-packaging/smoke-torch-venv.sh",
  "find": "try_import \"setuptools, wheel\" \"setuptools and wheel\" \"setuptools.__version__, wheel.__version__\" 1 || true\n",
  "replace": "try_import \"setuptools, wheel\" \"setuptools and wheel\" \"setuptools.__version__, wheel.__version__\" 0 || true\n",
  "test": "bash linux/scripts/tests/test-smoke-arch-parity.sh",
  "why": "a missing setuptools or wheel must fail the gate, not print a SKIP that holds nothing"
 },
 {
  "id": "lib.ort-plugin-rust-reuse-skips-registration",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "        {\n            return Ok(());\n        }\n        self.binding.register_library",
  "replace": "        {\n        }\n        self.binding.register_library",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "a device another library registered must be attached without registering the module again"
 },
 {
  "id": "lib.ort-plugin-rust-reuse-opt-in",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "        self.append(options, &request, false)\n",
  "replace": "        self.append(options, &request, true)\n",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "the ordinary append owns its registration; reuse of an external one is an explicit opt-in"
 },
 {
  "id": "lib.ort-plugin-rust-reuse-selected",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "        self.append(options, &request, true)\n",
  "replace": "        self.append(options, &request, false)\n",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "the reusing append must not register over a device another library already listed"
 },
 {
  "id": "lib.ort-plugin-rust-reuse-enumeration-error",
  "target": "shared/rust/ort_plugin_eps.rs",
  "find": "                .devices()?\n                .iter()",
  "replace": "                .devices()\n                .unwrap_or_default()\n                .iter()",
  "test": "bash linux/scripts/tests/test-ort-plugin-rust.sh",
  "why": "an enumeration failure must stay an error, never read as no external device"
 },
 {
  "id": "lib.ort-plugin-python-reuse-skips-registration",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "        ):\n            return path\n        register = getattr",
  "replace": "        ):\n            pass\n        register = getattr",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "a device another library registered must be attached without registering the module again"
 },
 {
  "id": "lib.ort-plugin-python-reuse-forwarded",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "            binding, plugin, environ=environ, reuse_existing=reuse_existing\n",
  "replace": "            binding, plugin, environ=environ, reuse_existing=False\n",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "device selection must forward the reuse opt-in to registration"
 },
 {
  "id": "lib.ort-plugin-python-reuse-opt-in",
  "target": "shared/python/ort_plugin_eps.py",
  "find": "    environ: Mapping[str, str] | None = None,\n    reuse_existing: bool = False,\n) -> Path | None:",
  "replace": "    environ: Mapping[str, str] | None = None,\n    reuse_existing: bool = True,\n) -> Path | None:",
  "test": "bash linux/scripts/tests/test-ort-plugin-registration.sh",
  "why": "ordinary registration owns its name; reusing another library's registration is an explicit opt-in"
 },
 {
  "id": "packaging.gcc-unwinder-host-preload",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "    host_preload=\"$(printf '\\n  export LD_PRELOAD=\"$here/%s/libgcc_s.so.1${LD_PRELOAD:+:$LD_PRELOAD}\"' \"${to_lib}\")\"\n",
  "replace": "    host_preload=\"\"\n",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "a Flutter app on the host glibc must resolve _Unwind_* from the bundled libgcc_s or ROCm's caught exceptions terminate it"
 },
 {
  "id": "packaging.gcc-unwinder-bundled-preload",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "    bundled_preload=\" --preload \\\"\\$here/${to_lib}/libgcc_s.so.1\\\"\"\n",
  "replace": "    bundled_preload=\"\"\n",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "the bundled loader must preload the unwinder too, without exporting LD_PRELOAD to host children"
 },
 {
  "id": "packaging.gcc-unwinder-policy-unchecked",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "    [ \"${GCC_UNWINDER}\" = \"${unwinder}\" ] || err \"${rel} has a different unwinder policy; restage the executable\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "a rerun must not silently keep a launcher built under the other unwinder policy"
 },
 {
  "id": "packaging.gcc-unwinder-missing-library",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "  [ -f \"${LIB_DIR}/libgcc_s.so.1\" ] && [ ! -L \"${LIB_DIR}/libgcc_s.so.1\" ] || err \"--gcc-unwinder needs a regular ${LIB_DIR}/libgcc_s.so.1\"\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "a launcher must not preload an unwinder the bundle does not carry"
 },
 {
  "id": "docs-site.live-isolated",
  "target": "linux/scripts/docs-site.sh",
  "find": " --files \"${site}/${app}\" --isolated || failed=1",
  "replace": " --files \"${site}/${app}\" || failed=1",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "without --isolated a published app whose COOP or COEP header is gone passes, and its wasm threads stop unseen"
 },
 {
  "id": "docs-site.live-published-files",
  "target": "linux/scripts/docs-site.sh",
  "find": " --files \"${site}/${app}\" --isolated",
  "replace": " --isolated",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "the file sweep is what finds a published file the server does not answer with 200"
 },
 {
  "id": "docs-site.live-every-app",
  "target": "linux/scripts/docs-site.sh",
  "find": " --isolated || failed=1",
  "replace": " --isolated || return 1",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "one red app would hide the verdicts of the apps after it"
 },
 {
  "id": "docs-site.live-https-only",
  "target": "linux/scripts/docs-site.sh",
  "find": "    https://*) ;;\n",
  "replace": "    http*) ;;\n",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "cross-origin isolation needs a secure context, so a plain-http address would check a page that can never be isolated"
 },
 {
  "id": "docs-site.live-app-path-safety",
  "target": "linux/scripts/docs-site.sh",
  "find": "    _docs_site_relative \"isolated app\" \"${app}\"\n    models=()\n",
  "replace": "    models=()\n",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "an app path climbing out of the site would check files the publish never sent"
 },
 {
  "id": "docs-site.live-after-publish",
  "target": ".github/workflows/build-docs.yml",
  "find": "    needs: publish\n",
  "replace": "    needs: site\n",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "before the upload the live check grades the previous publish, and a pull request's run would check a site it never changed"
 },
 {
  "id": "docs-site.live-only-when-asked",
  "target": ".github/workflows/build-docs.yml",
  "find": "    if: inputs.live-url != '' && inputs.isolated-apps != ''\n",
  "replace": "    if: inputs.isolated-apps != ''\n",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "without a live-url the check has no address, and the job would fail every site that has apps"
 },
 {
  "id": "docs-site.app-models-hash-path",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "\"path\": f\"models/{sha}/{name}\"",
  "replace": "\"path\": f\"models/{name}\"",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "only models/<sha256>/ is immutable to the isolated-app .htaccess; a plain name can change under a cached copy"
 },
 {
  "id": "docs-site.app-models-texts-shipped",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "    return [model, *license_texts(lock, model, Path(model).stem, rows)]\n",
  "replace": "    return [model]\n",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "the site ships each model's LICENSE and NOTICE beside it, or it distributes the model without its terms"
 },
 {
  "id": "docs-site.app-models-notice-required",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "LICENSE_SUFFIXES = (\".LICENSE\", \".NOTICE\")",
  "replace": "LICENSE_SUFFIXES = (\".LICENSE\",)",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "ModelANT's NOTICE carries the Apache-2.0 attribution, and a model must not ship without it"
 },
 {
  "id": "docs-site.app-models-existing-refused",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "    if target.exists():\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "an existing models/ is refused by name rather than mixed with or left behind a new mirror"
 },
 {
  "id": "docs-site.app-models-lock-in-repo",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "relative = lock.resolve().relative_to(root.resolve()).as_posix()",
  "replace": "relative = lock.resolve().as_posix()",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "the manifest is published, so it names the lock by its path in the repository, never the runner's"
 },
 {
  "id": "docs-site.app-models-twice-refused",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "    if len(set(names)) != len(names):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "one model named twice would stand twice in the manifest the browser reads"
 },
 {
  "id": "docs-site.app-models-release-named",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "return {\"repository\": release[1], \"tag\": release[2]} if release else None",
  "replace": "return None",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "the provenance panel shows the model's ModelANT release from the manifest"
 },
 {
  "id": "docs-site.app-models-real-size",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "\"size\": (work / sha / name).stat().st_size",
  "replace": "\"size\": 0",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "the live check and the browser compare the bytes they receive with the manifest's size"
 },
 {
  "id": "docs-site.app-models-built-app-only",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "    if not out.is_dir():\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "a mistyped app path is refused with its reason, not with a bare file error"
 },
 {
  "id": "docs-site.app-models-refusal-leaves-nothing",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "    finally:\n        shutil.rmtree(work, ignore_errors=True)\n",
  "replace": "    finally:\n        pass\n",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "a refused mirror leaves the app as the build wrote it; a stray work directory would be published"
 },
 {
  "id": "live-site.models-genai-files",
  "target": "linux/scripts/check-live-site.js",
  "find": "m?.kind === 'genai' ?",
  "replace": "false ?",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a GenAI entry names no URL of its own; its directory's files are what the browser fetches and the check must hash"
 },
 {
  "id": "live-site.models-genai-prefix",
  "target": "linux/scripts/check-live-site.js",
  "find": " || !f.path.startsWith(f.prefix)",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a GenAI file must sit below its archive's models/<sha256>/<directory>/, the immutable path the mirror writes"
 },
 {
  "id": "live-site.models-genai-empty",
  "target": "linux/scripts/check-live-site.js",
  "find": "m.files?.length ? m.files : [null]",
  "replace": "m.files || []",
  "test": "bash linux/scripts/tests/test-check-live-site.sh",
  "why": "a GenAI entry without files would pass with nothing checked"
 },
 {
  "id": "docs-site.app-models-genai-unpacked",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "    FETCHER[\"extract\"](cached, sha, target)\n",
  "replace": "    target.mkdir()\n",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "the browser fetches the GenAI directory's files one by one, so the archive must be unpacked"
 },
 {
  "id": "docs-site.app-models-genai-stamp-dropped",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "    (target / FETCHER[\"STAMP\"]).unlink()\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "the fetcher's stamp is no model file and must not be published or listed"
 },
 {
  "id": "docs-site.app-models-genai-flat",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "p.is_symlink() or not p.is_file() or ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "a subdirectory or link in the archive is refused by name, since the worker fetches plain files by their name"
 },
 {
  "id": "docs-site.app-models-genai-config-required",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "    if not any(p.name == \"genai_config.json\" for p in files):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "an archive without genai_config.json is no model the generation loop can read"
 },
 {
  "id": "docs-site.app-models-genai-texts",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "for text in license_texts(lock, archive, name, rows)]",
  "replace": "for text in []]",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "a GenAI model ships with the LICENSE and NOTICE of its release, as every model does"
 },
 {
  "id": "docs-site.app-models-genai-file-hash",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "\"sha256\": FETCHER[\"sha256_of\"](p)",
  "replace": "\"sha256\": sha",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "the worker checks each file by its own SHA-256, so the manifest must hold that and not the archive's"
 },
 {
  "id": "docs-site.app-models-option-order",
  "target": "linux/scripts/lib/mirror-app-models.py",
  "find": "dest=\"models\", metavar=(\"LOCK\", \"ARCHIVE\", \"NAME\")",
  "replace": "dest=\"genai\", metavar=(\"LOCK\", \"ARCHIVE\", \"NAME\")",
  "test": "bash linux/scripts/tests/test-mirror-app-models.sh",
  "why": "--model and --genai share one list, so the manifest holds the models in the order given"
 },
 {
  "id": "docs-site.live-models",
  "target": "linux/scripts/docs-site.sh",
  "find": "|| models=(--models \"${site}/${app}/models/manifest.json\")",
  "replace": "|| models=()",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a 200 is also what a host's catch-all page answers; only the models' bytes prove the mirror is served"
 },
 {
  "id": "handoff.groups-from-source-slugs",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "len(groups) == len(set(groups)) == len(preflight_slugs(source)), 'All preflight groups are required'",
  "replace": "len(groups) == len(set(groups)), 'All preflight groups are required'",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "A source proof that skipped a default group must not qualify a stage; the count comes from the source's own KNOWN_SLUGS."
 },
 {
  "id": "handoff.groups-unique",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "len(groups) == len(set(groups)) == len(preflight_slugs(source))",
  "replace": "len(groups) == len(preflight_slugs(source))",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "A repeated group heading must not stand in for a missing one."
 },
 {
  "id": "handoff.slugs-well-formed",
  "target": "linux/scripts/local-proof/normal_stage_launch.py",
  "find": "and len(slugs) == len(set(slugs)), 'Malformed KNOWN_SLUGS'",
  "replace": ", 'Malformed KNOWN_SLUGS'",
  "test": "bash linux/scripts/tests/test-normal-stage-launch.sh",
  "why": "A duplicated slug would inflate the required group count."
 },
 {
  "id": "handoff.gpu-profile-groups-measured",
  "target": "linux/scripts/local-proof/gpu_source_profile.py",
  "find": "'all_preflight_groups': full['actual_preflight_group_count'],",
  "replace": "'all_preflight_groups': 42,",
  "test": "bash linux/scripts/tests/test-gpu-source-profile.sh",
  "why": "The GPU review records the checked proof's group count, not a constant from an older preflight."
 },
 {
  "id": "handoff.media-profile-groups-measured",
  "target": "linux/scripts/local-proof/media_source_profile.py",
  "find": "'all_preflight_groups': full['actual_preflight_group_count'],",
  "replace": "'all_preflight_groups': 0,",
  "test": "bash linux/scripts/tests/test-media-source-profile.sh",
  "why": "The Media review records the checked proof's group count, not a constant."
 },
 {
  "id": "windows-lane.nsis-probe-compressor-line",
  "target": "windows/scripts/diagnostics/Measure-NsisSetup.ps1",
  "find": "\"SetCompressor $Compressor\"",
  "replace": "'SetCompressor lzma'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Diagnostics.NsisSetupProbe.Tests.ps1",
  "why": "Each measured setup must use the compressor it is reported under."
 },
 {
  "id": "windows-lane.nsis-probe-first-listing-fact",
  "target": "windows/scripts/diagnostics/Measure-NsisSetup.ps1",
  "find": "        if (-not $facts.Contains($group[1].Value)) { $facts[$group[1].Value] = $group[2].Value.Trim() }",
  "replace": "        $facts[$group[1].Value] = $group[2].Value.Trim()",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Diagnostics.NsisSetupProbe.Tests.ps1",
  "why": "The archive's own method must not be overwritten by a member file's row."
 },
 {
  "id": "windows-lane.nsis-probe-shim-target",
  "target": "windows/scripts/diagnostics/Measure-NsisSetup.ps1",
  "find": "    if ($null -eq $hit) { throw \"$shim names no target path\" }\n",
  "replace": "    if ($null -eq $hit) { return $Path }\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Diagnostics.NsisSetupProbe.Tests.ps1",
  "why": "A shim without a target must fail rather than measure the shim's own working set."
 },
 {
  "id": "packaging.nvidia-core-option-ignored",
  "target": "linux/scripts/06-packaging/verify-ort-appimage-payload.sh",
  "find": "  nvidia) kind=cuda; required=(\"$nvidia_core\" libonnxruntime_providers_shared.so libonnxruntime_providers_cuda.so) ;;\n",
  "replace": "  nvidia) kind=cuda; required=(libonnxruntime.so.1 libonnxruntime_providers_shared.so libonnxruntime_providers_cuda.so) ;;\n",
  "test": "bash linux/scripts/tests/test-ort-appimage-payload.sh",
  "why": "An NVIDIA bundle that stages only the bare soname ort dlopens must pass when its caller says so."
 },
 {
  "id": "packaging.nvidia-core-any-name",
  "target": "linux/scripts/06-packaging/verify-ort-appimage-payload.sh",
  "find": "  case \"${2:-}\" in libonnxruntime.so | libonnxruntime.so.1) nvidia_core=\"$2\" ;; *) echo 'Invalid --nvidia-core name' >&2; exit 2 ;; esac\n",
  "replace": "  nvidia_core=\"${2:-}\"\n",
  "test": "bash linux/scripts/tests/test-ort-appimage-payload.sh",
  "why": "Only an ORT core soname may stand in for the core; a provider name would let a bundle without its core pass."
 },
 {
  "id": "packaging.nsis-read-as-nsis",
  "target": "linux/scripts/verify_package_license.py",
  "find": "*([\"-tNsis\"] if nsis else [])",
  "replace": "*([] if nsis else [])",
  "test": "python3 linux/scripts/tests/test_package_nsis_setup.py",
  "why": "A setup is listed as NSIS, never by whatever format 7-Zip guesses."
 },
 {
  "id": "packaging.nsis-internals-excluded",
  "target": "linux/scripts/verify_package_license.py",
  "find": "if not name.startswith(\"$\")]",
  "replace": "if True]",
  "test": "python3 linux/scripts/tests/test_package_nsis_setup.py",
  "why": "An installer-internal $PLUGINSDIR entry can never satisfy a package rule."
 },
 {
  "id": "packaging.nsis-case-duplicates",
  "target": "linux/scripts/verify_package_license.py",
  "find": "if count > 1)",
  "replace": "if count > 2)",
  "test": "python3 linux/scripts/tests/test_package_nsis_setup.py",
  "why": "A setup that writes one path twice, in any case, is refused."
 },
 {
  "id": "packaging.nsis-extraction-exact",
  "target": "linux/scripts/verify_package_license.py",
  "find": "if found != {name for _, name in selected}:",
  "replace": "if not found:",
  "test": "python3 linux/scripts/tests/test_package_nsis_setup.py",
  "why": "An extraction with a missing or an extra file fails."
 },
 {
  "id": "packaging.nsis-license-branch",
  "target": "linux/scripts/verify_package_license.py",
  "find": "elif path.suffix.lower() == \".exe\":\n        yield from nsis_entries(path, rules)",
  "replace": "elif path.suffix.lower() == \".exe-off\":\n        yield from nsis_entries(path, rules)",
  "test": "python3 linux/scripts/tests/test_package_nsis_setup.py",
  "why": "The license verifier reads a -setup.exe as an NSIS setup."
 },
 {
  "id": "packaging.nsis-binary-branch",
  "target": "linux/scripts/verify_package_binary.py",
  "find": "elif args.package.suffix.lower() == \".exe\":",
  "replace": "elif args.package.suffix.lower() == \".exe-off\":",
  "test": "python3 linux/scripts/tests/test_package_nsis_setup.py",
  "why": "The binary verifier reads a -setup.exe as an NSIS setup."
 },
 {
  "id": "stage-graph.nvidia-sbsa-default-on",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "[ \"${CROSS_NVIDIA_SBSA:-1}\" = \"1\" ]",
  "replace": "[ \"${CROSS_NVIDIA_SBSA:-0}\" = \"1\" ]",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "Owner directive: an nvidia chain on amd64 cross-builds arm64 through SBSA unless CROSS_NVIDIA_SBSA=0."
 },
 {
  "id": "stage-graph.nvidia-default-arches-include-arm64",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "then printf 'amd64,arm64'; else",
  "replace": "then printf 'amd64'; else",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "Without named arches an nvidia chain must build both entries of :latest-nvidia."
 },
 {
  "id": "stage-graph.rocm-default-arches-amd64",
  "target": "linux/scripts/01-core/stage-defs.sh",
  "find": "    rocm) printf 'amd64' ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "A rocm chain without named arches would fall back to riscv64 and be refused."
 },
 {
  "id": "disk-guard.chain-uses-variant-default-arches",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "TARGET_ARCHES=\"$(resolve_arch_list \"$(cross_variant_default_arches)\")\"",
  "replace": "TARGET_ARCHES=\"$(resolve_arch_list)\"",
  "test": "bash linux/scripts/tests/test-gpu-variant.sh",
  "why": "The chain must take the variant's default arches when none are named."
 },
 {
  "id": "windows-lane.nsis-install-version-shape",
  "target": "windows/scripts/host/Install-Nsis.ps1",
  "find": "    $release = [regex]::Match($Version, '^(?<major>\\d+)\\.\\d{2}$')",
  "replace": "    $release = [regex]::Match($Version, '^(?<major>\\d+)\\.')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Install.Tests.ps1",
  "why": "Only a major.minor NSIS release may name the SourceForge folder and zip."
 },
 {
  "id": "windows-lane.nsis-install-required-files",
  "target": "windows/scripts/host/Install-Nsis.ps1",
  "find": "    foreach ($required in 'Bin\\makensis.exe', 'COPYING', 'Stubs\\zlib-x86-unicode') {",
  "replace": "    foreach ($required in 'Bin\\makensis.exe') {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Install.Tests.ps1",
  "why": "The installed tree must carry NSIS's licence and the zlib stub the setups use."
 },
 {
  "id": "windows-lane.nsis-install-pin-before-download",
  "target": "windows/scripts/host/Install-Nsis.ps1",
  "find": "        [ValidatePattern('^[0-9a-fA-F]{64}$', ErrorMessage",
  "replace": "        [ValidatePattern('^', ErrorMessage",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Install.Tests.ps1",
  "why": "A malformed SHA256 pin must stop the install before any download."
 },
 {
  "id": "windows-lane.nsis-final-path-first",
  "target": "windows/Dockerfile",
  "find": "    PATH=C:\\nsis\\Bin;$PATH",
  "replace": "    PATH=$PATH;C:\\nsis\\Bin",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Install.Tests.ps1",
  "why": "The pinned makensis must precede base's floating scoop copy on PATH."
 },
 {
  "id": "lib.bump-nsis-sha1-gate",
  "target": "docs/scripts/bump_tools.py",
  "find": "    if hashlib.sha1(data).hexdigest() != m.group(1):",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "A zip whose SHA1 differs from SourceForge's must not have its SHA256 pinned."
 },
 {
  "id": "lib.bump-nsis-tag-shape",
  "target": "docs/scripts/bump_tools.py",
  "find": "    m = re.fullmatch(r\"v(\\d)(\\d{2})\", tag)",
  "replace": "    m = re.fullmatch(r\"v(\\d)(\\d+)\", tag)",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "Four-digit maintenance tags like v3061 are not NSIS_VERSION releases."
 },
 {
  "id": "lib.bump-coverage-commit-not-hidden",
  "target": "docs/scripts/bump_coverage.py",
  "find": "    r\"|^APP_REF$)\"  # a tracked branch, resolved to a commit per run",
  "replace": "    r\"|_COMMIT$|_ASSET$|^APP_REF$)\"  # a tracked branch, resolved to a commit per run",
  "test": "bash linux/scripts/tests/test-bump-coverage.sh",
  "why": "A new commit or asset pin must need an owner instead of passing as a non-version."
 },
 {
  "id": "lib.bump-coverage-drift-needs-set-pin",
  "target": "docs/scripts/bump_coverage.py",
  "find": "        if env.get(key) and classes.get(key, (\"\",))[0] == \"hand\"",
  "replace": "        if classes.get(key, (\"\",))[0] == \"hand\"",
  "test": "bash linux/scripts/tests/test-bump-coverage.sh",
  "why": "An empty commit pin follows its tag and must not be reported as drift."
 },
 {
  "id": "lib.bump-coverage-stale-follows-row",
  "target": "docs/scripts/bump_coverage.py",
  "find": "        elif classes[key] != (\"hand\", f\"with {owner}\"):",
  "replace": "        elif False:",
  "test": "bash linux/scripts/tests/test-bump-coverage.sh",
  "why": "A FOLLOWS row another class already covers must be deleted, not kept as stale debt."
 },
 {
  "id": "lib.bump-coverage-unclassified-fails",
  "target": "docs/scripts/bump_coverage.py",
  "find": "    bad = [k for k, (c, _) in classes.items() if c == \"UNCLASSIFIED\"] + stale_rows(env, classes)",
  "replace": "    bad = stale_rows(env, classes)",
  "test": "bash linux/scripts/tests/test-bump-coverage.sh",
  "why": "The coverage audit must fail on a pin with no class."
 },
 {
  "id": "lib.renovate-apply-coverage-summary",
  "target": "linux/scripts/renovate-local.sh",
  "find": "run_apply; apply_pin_sweep; report_pin_coverage ;;",
  "replace": "run_apply; apply_pin_sweep ;;",
  "test": "bash linux/scripts/tests/test-renovate-pin-sweep.sh",
  "why": "An apply run must name the pins it did not move."
 },
 {
  "id": "lib.bump-llvm-commit-follows-release",
  "target": "docs/scripts/bump_tools.py",
  "find": "    return bv.ls_remote_tag_commit(\"llvm/llvm-project\", f\"llvmorg-{bv.read_env()['LLVM_RELEASE']}\"), {}",
  "replace": "    return cur, {}",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "LLVM_COMMIT must move with the release Renovate wrote, or the source build checks out a stale commit."
 },
 {
  "id": "lib.bump-tvm-commit-follows-ref",
  "target": "docs/scripts/bump_tools.py",
  "find": "    return bv.ls_remote_tag_commit(\"apache/tvm\", bv.read_env()[\"TVM_REF\"]), {}",
  "replace": "    return cur, {}",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "TVM_COMMIT must move with the TVM_REF tag Renovate wrote."
 },
 {
  "id": "lib.bump-coverage-held-drift-named",
  "target": "docs/scripts/bump_coverage.py",
  "find": "{', held' if key in holds else ''}",
  "replace": "",
  "test": "bash linux/scripts/tests/test-bump-coverage.sh",
  "why": "A held drift pin must say it is held, so nobody expects the call to move it."
 },
 {
  "id": "lib.bump-libvpx-once-per-gstreamer",
  "target": "docs/scripts/bump_images.py",
  "find": "    if env.get(\"LIBVPX_MESON_GSTREAMER_VERSION\") == gst:\n        return cur, {}\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "The libvpx commit must stay put while GStreamer does, or every run re-pins a moving branch head and re-keys the Windows media build."
 },
 {
  "id": "lib.bump-libvpx-sha-with-commit",
  "target": "docs/scripts/bump_images.py",
  "find": "        extras[\"LIBVPX_MESON_SHA256\"] = bv.sha256_of_url(archive)",
  "replace": "        pass",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "A new libvpx commit must carry its archive SHA256, or the Windows download gate refuses it mid-build."
 },
 {
  "id": "lib.bump-libvpx-repo-pinned",
  "target": "docs/scripts/bump_images.py",
  "find": "    if url.removesuffix(\"/\") != LIBVPX_MESON_URL:",
  "replace": "    if False:",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "A wrap that names another repository must refuse, since the Windows build fetches the fixed meson-ports URL."
 },
 {
  "id": "lib.bump-ffmpeg-stream-hash",
  "target": "docs/scripts/bump_images.py",
  "find": "extras[\"FFMPEG_SHA256\"] = bv.sha256_of_gz_stream(",
  "replace": "extras[\"FFMPEG_SHA256\"] = bv.sha256_of_url(",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "both lanes check the stream hash, so a file hash would fail the next FFmpeg build"
 },
 {
  "id": "lib.bump-ffmpeg-sha-with-commit",
  "target": "docs/scripts/bump_images.py",
  "find": "    if commit != cur and bv.WRITE_MODE:\n        extras[\"FFMPEG_SHA256\"]",
  "replace": "    if False:\n        extras[\"FFMPEG_SHA256\"]",
  "test": "bash linux/scripts/tests/test-bump-versions.sh",
  "why": "a moved FFmpeg tag must carry its archive hash, or both lanes refuse the download"
 },
 {
  "id": "docs-site.cdp-caller-bound",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "}, timeoutMs);",
  "replace": "}, 30000);",
  "test": "bash linux/scripts/tests/test-chrome-close.sh",
  "why": "a page that holds its main thread through one WebGPU frame on SwiftShader needs the bound its caller names; the fixed 30 s failed OxidANT's browser lane"
 },
 {
  "id": "docs-site.cdp-default-bound",
  "target": "linux/scripts/check-docs-sidebars.js",
  "find": "params = {}, timeoutMs = 30000)",
  "replace": "params = {}, timeoutMs = 300000)",
  "test": "bash linux/scripts/tests/test-chrome-close.sh",
  "why": "a Chrome that stops answering must still fail a caller that names no bound within 30 s"
 },
 {
  "id": "wheels.iree-twin-drops-nb-suffix",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": " \"-U\" \"NB_SUFFIX*\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-iree-wheelhouse-stages.sh",
  "why": "a cross twin keeps nanobind's cached GIL suffix and setup.py links an extension with no inputs"
 },
 {
  "id": "wheels.iree-twin-sets-skbuild-soabi",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "                  \"-DSKBUILD_SOABI=${ft_soabi}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-iree-wheelhouse-stages.sh",
  "why": "CMake 4.4.5's cross FindPython empties Python_SOABI, so nanobind configures the twin without free-threading"
 },
 {
  "id": "wheels.iree-twin-requires-ft-nanobind",
  "target": "linux/scripts/05-frameworks/torch/iree-wheelhouse.sh",
  "find": "    if ! grep -Eq -e 'nanobind-static(-[a-z0-9]+)*-ft[/.]' \"${target_build}/build.ninja\"; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-iree-wheelhouse-stages.sh",
  "why": "a GIL nanobind twin would reach packaging and fail there with no input files, or ship a module that re-enables the GIL"
 },
 {
  "id": "version-snapshot.source-pins-ored",
  "target": "docs/scripts/sync_versions.py",
  "find": "        result |= check_source_pins(REPO_ROOT, versions)",
  "replace": "        result |= 0",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "the ORT and GenAI rows of source-pins.txt repeat versions.env, and only this sub-check holds them to it"
 },
 {
  "id": "version-snapshot.source-pins-written",
  "target": "docs/scripts/sync_versions.py",
  "find": "    result |= write_source_pins(REPO_ROOT, versions)",
  "replace": "    result |= 0",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "the Renovate run's sync_versions.py --write is what moves the row when the pin moves"
 },
 {
  "id": "version-snapshot.source-pins-commit",
  "target": "docs/scripts/source_pins.py",
  "find": "        want = [fields[0], versions[tag_key], versions[commit_key], *fields[3:]]",
  "replace": "        want = [fields[0], versions[tag_key], fields[2], *fields[3:]]",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "the commit is the source's identity, so a row that checks only the tag can fetch other bytes"
 },
 {
  "id": "version-snapshot.source-pins-missing-row",
  "target": "docs/scripts/source_pins.py",
  "find": "if seen.get(n, 0) != 1]",
  "replace": "if seen.get(n, 0) > 1]",
  "test": "bash linux/scripts/tests/test-version-snapshot.sh",
  "why": "a deleted row compares nothing and must not read as a match"
 },
 {
  "id": "windows-lane.nsis-makensis-pin-only",
  "target": "windows/scripts/modules/WindowsNsis.Common.psm1",
  "find": "  if ($reported -ne \"v$ExpectedVersion\") {",
  "replace": "  if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "GitHub runners carry their own NSIS, so a setup built with any makensis but the pin is a different, unverified build"
 },
 {
  "id": "windows-lane.nsis-payload-path-limit",
  "target": "windows/scripts/modules/WindowsNsis.Common.psm1",
  "find": "  if ($longest.FullName.Length -gt $Limit) {",
  "replace": "  if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "makensis 3.13 is not long-path aware, so a payload path at MAX_PATH fails deep in the build without naming the file"
 },
 {
  "id": "windows-lane.nsis-runtime-dollar-doubled",
  "target": "windows/scripts/modules/WindowsNsis.Common.psm1",
  "find": "function ConvertTo-NsisString { param([string]$Text) return $Text.Replace('$', '$$') }",
  "replace": "function ConvertTo-NsisString { param([string]$Text) return $Text }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "an undoubled $ in an installed path is an NSIS variable, so the uninstaller would delete another file or none"
 },
 {
  "id": "windows-lane.nsis-define-name-case",
  "target": "windows/scripts/modules/WindowsNsis.Common.psm1",
  "find": "    if ($name -cnotmatch '^KG_[A-Z0-9_]+$') {",
  "replace": "    if ($name -notmatch '^KG_[A-Z0-9_]+$') {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "NSIS defines are case-sensitive, so a lower-case name passes the module and is never read by the script"
 },
 {
  "id": "windows-lane.nsis-deepest-dir-first",
  "target": "windows/scripts/modules/WindowsNsis.Common.psm1",
  "find": "  $depthFirst = $dirs | Sort-Object { ($_ -split '\\\\').Count }, { $_ } -Descending",
  "replace": "  $depthFirst = $dirs | Sort-Object { ($_ -split '\\\\').Count }, { $_ }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "RMDir removes only an empty directory, so a parent removed before its child stays behind after uninstall"
 },
 {
  "id": "windows-lane.nsis-no-recursive-uninstall",
  "target": "windows/scripts/nsis/setup.nsi",
  "find": "  !insertmacro KG_UNINSTALL_FILES",
  "replace": "  RMDir /r \"$INSTDIR\"",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "a recursive delete of a user-chosen install directory can remove files the setup never installed"
 },
 {
  "id": "windows-lane.nsis-zlib-only",
  "target": "windows/scripts/nsis/setup.nsi",
  "find": "SetCompressor /FINAL zlib",
  "replace": "SetCompressor /SOLID lzma",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "the LZMA stub ships CPL-1.0 code, which needs a source-availability notice the setups do not carry"
 },
 {
  "id": "windows-lane.nsis-refusal-nonzero",
  "target": "windows/scripts/nsis/kataglyphis-common.nsh",
  "find": "  SetErrorLevel 2\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "a silent install that refuses the wrong architecture or a present MSI must exit nonzero, or the caller reads success"
 },
 {
  "id": "windows-lane.nsis-inputs-before-makensis",
  "target": "windows/scripts/modules/WindowsMsix.Common.psm1",
  "find": "    if (-not (Test-Path -LiteralPath $Inputs[$name] -PathType Leaf)) { throw \"$Kind input not found, ${name}: $($Inputs[$name])\" }",
  "replace": "    if (-not (Test-Path -LiteralPath $Inputs[$name] -PathType Leaf)) { continue }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "a setup without its main exe still compiles and installs a shortcut that points at nothing"
 },
 {
  "id": "windows-lane.nsis-setup-unknown-key",
  "target": "windows/scripts/modules/WindowsNsis.Common.psm1",
  "find": "    if (-not ($script:NsisSetupKeys.Contains($key) -or $script:NsisSetupOptional.ContainsKey($key))) { throw \"Unknown NSIS setup key: $key\" }",
  "replace": "    if (-not ($script:NsisSetupKeys.Contains($key) -or $script:NsisSetupOptional.ContainsKey($key))) { continue }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "a misspelt optional key such as MsiUpgradecode would silently drop the MSI guard from the setup"
 },
 {
  "id": "windows-lane.nsis-setup-missing-key",
  "target": "windows/scripts/modules/WindowsNsis.Common.psm1",
  "find": "  if ($missing) { throw \"NSIS setup lacks $($missing -join ', ')\" }",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "a setup without its other-architecture name refuses on the wrong machine without telling the user which setup to run"
 },
 {
  "id": "onnx-ep-qnn.ort-core-from-verified-source",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  sed -i \"s|^ort_core;.*|ort_core;${archive};${digest}|\" \"${deps}\" && ",
  "replace": "  ",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "FetchContent would download ort_core from microsoft/onnxruntime again, which GitHub has served as 404 since 2026-11-17"
 },
 {
  "id": "onnx-ep-qnn.ort-core-identity-checked",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  if [ \"$(grep -cE \"^ort_core;https",
  "replace": "  if false && [ \"$(grep -cE \"^ort_core;https",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "a changed fork dependency row would be replaced silently instead of re-reviewed"
 },
 {
  "id": "onnx-ep-qnn.ort-core-sha256-hash",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": " && sed -i 's|URL_HASH SHA1=${DEP_SHA1_ort_core}|URL_HASH SHA256=${DEP_SHA1_ort_core}|' \"${ext}\"",
  "replace": "",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "FetchContent would check the local archive's SHA256 as a SHA1 and refuse it"
 },
 {
  "id": "onnx-ep-qnn.ort-core-before-shim",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  qnnep_ort_core_archive \"${QNNEP_SRC}\" \"${work}/ort-core-git\" \"${work}/ort-core-archive\" || err \"the QNN plugin EP's ort_core archive failed\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "the build would reach configure with the upstream ort_core URL"
 },
 {
  "id": "onnx-ep-qnn.ort-core-version-checked",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "    [ \"${got}\" = \"${ver}\" ] && return 0\n",
  "replace": "    return 0\n",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "a pinned commit whose VERSION_NUMBER is not the fork's ort_core tag would give the plugin another release's headers"
 },
 {
  "id": "onnx-ep-qnn.ort-core-uses-fallbacks",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  urls+=(\"${fallbacks[@]}\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "with upstream gone, only the ORT pin's fallback repositories still serve the release commit"
 },
 {
  "id": "onnx-ep-qnn.ort-core-full-commit",
  "target": "linux/scripts/03-media/build/onnxruntime/build/36-build-qnn-plugin-ep.sh",
  "find": "  [[ \"${commit}\" =~ ^[0-9a-f]{40}$ ]] ||",
  "replace": "  true ||",
  "test": "bash linux/scripts/tests/test-qnn-plugin-ep.sh",
  "why": "an abbreviated pin would let a fallback repository answer with a different object"
 },
 {
  "id": "lib.opencv-riscv64-names-libtiff6",
  "target": "linux/scripts/03-media/build/opencv/install-deps.sh",
  "find": "        target_packages=(libtiff6 \"${target_packages[@]}\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-opencv-riscv64-seams.sh",
  "why": "riscv64 OpenCV falls back to its bundled libtiff, which cannot find the target jconfig.h"
 },
 {
  "id": "windows-lane.authenticode-signer-thumbprint",
  "target": "windows/scripts/modules/WindowsMsix.Signing.psm1",
  "find": "  if (-not $signer -or $signer.Thumbprint -ne $expected) {",
  "replace": "  if (-not $signer) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "any signature passes a check that never compares the signer, so a setup signed by someone else would ship"
 },
 {
  "id": "windows-lane.authenticode-status-allowlist",
  "target": "windows/scripts/modules/WindowsMsix.Signing.psm1",
  "find": "  if ([string]$signature.Status -notin @('Valid', 'UnknownError', 'NotTrusted')) {",
  "replace": "  if ([string]$signature.Status -notin @('Valid', 'UnknownError', 'NotTrusted', 'HashMismatch')) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "a file changed after signing keeps its signer but breaks the hash; only an untrusted test root may pass"
 },
 {
  "id": "windows-lane.authenticode-require-refuses",
  "target": "windows/scripts/modules/WindowsMsix.Signing.psm1",
  "find": "    if ($Require) { throw \"Cannot sign ${Path}: $missing\" }",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "the !finalize signer runs with -Require, so a missing .pfx must stop makensis instead of shipping unsigned"
 },
 {
  "id": "windows-lane.nsis-signer-checked-after-build",
  "target": "windows/scripts/modules/WindowsNsis.Common.psm1",
  "find": "    Assert-AuthenticodeSigner @signerArgs",
  "replace": "    $null = $signerArgs",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "the file makensis wrote is what ships, so its signer is checked after the build, not only inside !finalize"
 },
 {
  "id": "windows-lane.nsis-sign-pfx-define",
  "target": "windows/scripts/modules/WindowsNsis.Common.psm1",
  "find": "    $defines.KG_SIGN_PFX = (Resolve-Path -LiteralPath $Setup.SignPfx).Path\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "without the define the template skips both finalize steps and the setup leaves makensis unsigned"
 },
 {
  "id": "windows-lane.nsis-finalize-fails-build",
  "target": "windows/scripts/nsis/setup.nsi",
  "find": "  !finalize '\"${KG_SIGN_PWSH}\" -NoProfile -NonInteractive -File \"${__FILEDIR__}\\Invoke-NsisSign.ps1\" -Path \"%1\" -PfxPath \"${KG_SIGN_PFX}\" -LogDir \"${KG_SIGN_LOGDIR}\"' = 0",
  "replace": "  !finalize '\"${KG_SIGN_PWSH}\" -NoProfile -NonInteractive -File \"${__FILEDIR__}\\Invoke-NsisSign.ps1\" -Path \"%1\" -PfxPath \"${KG_SIGN_PFX}\" -LogDir \"${KG_SIGN_LOGDIR}\"'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "without = 0 makensis ignores the signing script's exit code and writes an unsigned setup"
 },
 {
  "id": "windows-lane.nsis-uninstaller-signed",
  "target": "windows/scripts/nsis/setup.nsi",
  "find": "  !uninstfinalize '\"${KG_SIGN_PWSH}\" -NoProfile -NonInteractive -File \"${__FILEDIR__}\\Invoke-NsisSign.ps1\" -Path \"%1\" -PfxPath \"${KG_SIGN_PFX}\" -LogDir \"${KG_SIGN_LOGDIR}\"' = 0\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.Common.Tests.ps1",
  "why": "the uninstaller is written inside the setup, so an unsigned one is extracted and run unsigned at uninstall"
 },
 {
  "id": "windows-lane.nsis-header-aligned",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "$offset += 512",
  "replace": "$offset += 4",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.PackageGates.Tests.ps1",
  "why": "Only a 512-byte-aligned first header makes a file an NSIS setup."
 },
 {
  "id": "windows-lane.nsis-listing-internals",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "Where-Object { -not $_.StartsWith('$') })",
  "replace": "Where-Object { $true })",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.PackageGates.Tests.ps1",
  "why": "The setup listing leaves installer-internal entries out."
 },
 {
  "id": "windows-lane.nsis-listing-duplicates",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "if ($repeated) { throw",
  "replace": "if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.PackageGates.Tests.ps1",
  "why": "The setup listing refuses one path in two cases."
 },
 {
  "id": "windows-lane.nsis-listing-exit",
  "target": "windows/scripts/modules/WindowsMsiLicense.Common.psm1",
  "find": "if ($LASTEXITCODE) { throw \"7-Zip cannot read",
  "replace": "if ($false) { throw \"7-Zip cannot read",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.PackageGates.Tests.ps1",
  "why": "A failed 7-Zip listing stops the gate instead of returning an empty setup."
 },
 {
  "id": "windows-lane.nsis-msvc-branch",
  "target": "windows/scripts/modules/WindowsMsvcRuntimeNotice.Common.psm1",
  "find": "    if ([IO.Path]::GetExtension($Path) -ieq '.exe') { return @(Get-NsisSetupFileNames -Path $Path) }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.PackageGates.Tests.ps1",
  "why": "The MSVC notice gate reads an NSIS setup's files."
 },
 {
  "id": "windows-lane.nsis-ort-provider-branch",
  "target": "windows/scripts/modules/WindowsPackageBinary.Common.psm1",
  "find": "$extension -in @('.zip', '.msix', '.exe')",
  "replace": "$extension -in @('.zip', '.msix')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.PackageGates.Tests.ps1",
  "why": "ORT provider enumeration reads an NSIS setup."
 },
 {
  "id": "windows-lane.nsis-ort-family-branch",
  "target": "windows/scripts/modules/WindowsPackageBinary.Common.psm1",
  "find": "GetExtension($resolved) -in @('.zip', '.msix', '.exe')",
  "replace": "GetExtension($resolved) -in @('.zip', '.msix')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.PackageGates.Tests.ps1",
  "why": "The ORT family gate reads an NSIS setup."
 },
 {
  "id": "windows-lane.package-ort-provider-set-verdict",
  "target": "windows/scripts/modules/WindowsPackageBinary.Common.psm1",
  "find": "    if (($want -join \"`n\") -cne ($have -join \"`n\")) {",
  "replace": "    if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PackageBinary.ProviderSet.Tests.ps1",
  "why": "A finished package whose ORT providers differ from the proven set, by a missing or an extra provider, must fail."
 },
 {
  "id": "windows-lane.package-ort-provider-set-no-provider",
  "target": "windows/scripts/modules/WindowsPackageBinary.Common.psm1",
  "find": "    if ($want.Count -eq 0) { throw \"$Label proven names carry no ORT provider\" }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PackageBinary.ProviderSet.Tests.ps1",
  "why": "A proven list that names no provider must fail, or a package without providers passes against it."
 },
 {
  "id": "windows-lane.package-ort-provider-set-order",
  "target": "windows/scripts/modules/WindowsPackageBinary.Common.psm1",
  "find": "$want = @(Get-ValidatedOrtProviderNames -Names $Expected)",
  "replace": "$want = @($Expected | Where-Object { $_ -clike 'onnxruntime_providers_*.dll' })",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PackageBinary.ProviderSet.Tests.ps1",
  "why": "The proven list's order must not decide the verdict; both sides leave the same validator sorted."
 },
 {
  "id": "windows-lane.package-ort-provider-set-directory",
  "target": "windows/scripts/modules/WindowsPackageBinary.Common.psm1",
  "find": "-Path $Path -Directory $Directory -RootDirectoryId $RootDirectoryId",
  "replace": "-Path $Path -Directory '' -RootDirectoryId $RootDirectoryId",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PackageBinary.ProviderSet.Tests.ps1",
  "why": "The census reads the caller's package directory, not the package root."
 },
 {
  "id": "windows-lane.package-ort-provider-set-msi-root",
  "target": "windows/scripts/modules/WindowsPackageBinary.Common.psm1",
  "find": "-Path $Path -Directory $Directory -RootDirectoryId $RootDirectoryId -RootDirectoryName $RootDirectoryName)",
  "replace": "-Path $Path -Directory $Directory -RootDirectoryName $RootDirectoryName)",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PackageBinary.ProviderSet.Tests.ps1",
  "why": "An MSI census needs the caller's install root; a dropped root must not reach the reader as empty."
 },
 {
  "id": "windows-lane.package-ort-provider-set-names-both",
  "target": "windows/scripts/modules/WindowsPackageBinary.Common.psm1",
  "find": "expected $($want -join ', '); found $found\"",
  "replace": "expected $($want -join ', ')\"",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PackageBinary.ProviderSet.Tests.ps1",
  "why": "The refusal names the proven and the found set, so a red log says which provider moved."
 },
 {
  "id": "windows-lane.package-ort-provider-set-export",
  "target": "windows/scripts/modules/WindowsPackageBinary.Common.psm1",
  "find": "Get-PackageOrtProviderNames, Assert-PackageOrtProviderSet, Assert-PackageOrtFamily",
  "replace": "Get-PackageOrtProviderNames, Assert-PackageOrtFamily",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PackageBinary.ProviderSet.Tests.ps1",
  "why": "Consumers call the assertion by name across the module boundary, so the module must export it."
 },
 {
  "id": "windows-lane.nsis-bundle-setup",
  "target": "windows/scripts/modules/WindowsCrossBundle.Common.psm1",
  "find": " -or ($_.Extension -eq '.exe' -and (Test-NsisSetup $_.FullName))",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.PackageGates.Tests.ps1",
  "why": "New-PortableBundle checks and ships an NSIS setup of any name."
 },
 {
  "id": "windows-lane.nsis-bundle-no-double",
  "target": "windows/scripts/modules/WindowsCrossBundle.Common.psm1",
  "find": "$_ -notin $cpack.FullName -and ",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only Nsis.PackageGates.Tests.ps1",
  "why": "A setup found by its header is not listed a second time by the same-stem rule."
 },
 {
  "id": "windows-lane.source-offer-notice-required",
  "target": "windows/scripts/modules/WindowsSourceOffer.Build.psm1",
  "find": "if ($notices.Count -eq 0) { throw",
  "replace": "if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Build.Tests.ps1",
  "why": "A component without a licence text at the top of its tree cannot be offered."
 },
 {
  "id": "windows-lane.source-offer-archive-required",
  "target": "windows/scripts/modules/WindowsSourceOffer.Build.psm1",
  "find": "if (-not (Test-Path -LiteralPath $Component.Archive -PathType Leaf)) { throw",
  "replace": "if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Build.Tests.ps1",
  "why": "A component whose exact archive is gone stops the offer by name."
 },
 {
  "id": "windows-lane.source-offer-archive-name-safe",
  "target": "windows/scripts/modules/WindowsSourceOffer.Build.psm1",
  "find": "if ($Component.ArchiveName -notmatch",
  "replace": "if ($false -and $Component.ArchiveName -notmatch",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Build.Tests.ps1",
  "why": "An archive name cannot leave the offer directory."
 },
 {
  "id": "windows-lane.source-offer-owner-case",
  "target": "windows/scripts/modules/WindowsSourceOffer.Build.psm1",
  "find": "if ($Owner -cnotmatch",
  "replace": "if ($Owner -notmatch",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Build.Tests.ps1",
  "why": "The owner name is lower-case kebab, case-sensitively."
 },
 {
  "id": "windows-lane.source-offer-hash-finding",
  "target": "windows/scripts/modules/WindowsSourceOffer.Build.psm1",
  "find": ".Hash -ine $item.sha256) { 'not the archived bytes'; break }",
  "replace": ".Hash -ine $item.sha256 -and $false) { 'not the archived bytes'; break }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Build.Tests.ps1",
  "why": "An offered archive or build file that changed after the build is a finding."
 },
 {
  "id": "windows-lane.source-offer-missing-offer",
  "target": "windows/scripts/modules/WindowsSourceOffer.Build.psm1",
  "find": "return [string[]]($findings + \"no source offer at $offer\")",
  "replace": "return [string[]]$findings",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Build.Tests.ps1",
  "why": "A missing sources.json is a finding, not a pass."
 },
 {
  "id": "windows-lane.source-offer-package-predates",
  "target": "windows/scripts/modules/WindowsSourceOffer.Common.psm1",
  "find": "if (-not (Test-Path -LiteralPath $manifest -PathType Leaf)) { return $null }",
  "replace": "if (-not (Test-Path -LiteralPath $manifest -PathType Leaf)) { return [ordered]@{} }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Common.Tests.ps1",
  "why": "An image without the offer is named in a warning, not passed silently."
 },
 {
  "id": "windows-lane.source-offer-package-warning",
  "target": "windows/scripts/modules/WindowsSourceOffer.Common.psm1",
  "find": "Write-Warning \"the bundle carries",
  "replace": "Write-Verbose \"the bundle carries",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Common.Tests.ps1",
  "why": "The predates case reaches the build log as a warning."
 },
 {
  "id": "windows-lane.source-offer-package-bundle-lacks",
  "target": "windows/scripts/modules/WindowsSourceOffer.Common.psm1",
  "find": "if ($absent.Count) { throw",
  "replace": "if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Common.Tests.ps1",
  "why": "A bundle that carries FFmpeg without a copied text fails by name."
 },
 {
  "id": "windows-lane.source-offer-package-copy-proven",
  "target": "windows/scripts/modules/WindowsSourceOffer.Common.psm1",
  "find": "    Assert-NativeProvenanceManifest -Path (Join-Path $Root \"provenance\\$Owner.json\") -Root $Root\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Common.Tests.ps1",
  "why": "Image texts that no longer match their manifest are never copied into a bundle."
 },
 {
  "id": "windows-lane.source-offer-package-verified",
  "target": "windows/scripts/modules/WindowsSourceOffer.Common.psm1",
  "find": "    Assert-PackageLicenses -Path $Path -Pattern $members -LicensePath @($plan.Values) -PythonPath $PythonPath",
  "replace": "    $null = $PythonPath",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Common.Tests.ps1",
  "why": "The package's texts are compared with the image's bytes."
 },
 {
  "id": "windows-lane.source-offer-package-targets",
  "target": "windows/scripts/modules/WindowsSourceOffer.Common.psm1",
  "find": "if ($parts[0] -ieq 'licenses') { return ($parts -join '\\') }",
  "replace": "if ($false) { return ($parts -join '\\') }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Common.Tests.ps1",
  "why": "Licence texts keep their licenses\\<component> path in the bundle."
 },
 {
  "id": "windows-lane.source-offer-zip-gated",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    Assert-PackageSourceOffer -Path $zip -Offer $ffmpegOffer -ArchivePrefix $stem\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PythonApp.PackageLicense.Tests.ps1",
  "why": "The ZIP package is checked for FFmpeg's source offer."
 },
 {
  "id": "windows-lane.source-offer-msi-gated",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    Assert-PackageSourceOffer -Path $msi -Offer $ffmpegOffer -Format msi -WixPath $wxs\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PythonApp.PackageLicense.Tests.ps1",
  "why": "The MSI package is checked for FFmpeg's source offer."
 },
 {
  "id": "windows-lane.source-offer-msix-gated",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "    Assert-PackageSourceOffer -Path $msix -Offer $ffmpegOffer\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PythonApp.PackageLicense.Tests.ps1",
  "why": "The MSIX package is checked for FFmpeg's source offer."
 },
 {
  "id": "windows-lane.source-offer-bundle-copies",
  "target": "windows/scripts/python/New-PythonAppBundle.ps1",
  "find": "    $offer = @(Copy-PythonAppFfmpegOffer -Bundle $bundle)",
  "replace": "    $offer = @()",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PythonApp.PackageLicense.Tests.ps1",
  "why": "The bundle copies FFmpeg's texts and offer once cv2\\bin holds it."
 },
 {
  "id": "packaging.release-offer-identical-once",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "if cmp -s \"$1\" \"${OUT}/$2\"; then GAVE=1; return 0; fi",
  "replace": "if false; then GAVE=1; return 0; fi",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "The same source offer from two lanes ships once instead of failing the release."
 },
 {
  "id": "packaging.release-offer-dedupe-scoped",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "case \"$1\" in */source-offer/*) if cmp",
  "replace": "case \"$1\" in *) if cmp",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "Only the shared source offer may repeat; two packages of one name still fail."
 },
 {
  "id": "packaging.release-offer-index-tracked",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "case \"$1\" in */source-offer/*-sources.json) OFFER_INDEXES+=(\"$2\") ;; esac\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "A collected offer index is checked, not shipped unread."
 },
 {
  "id": "packaging.release-offer-checked",
  "target": "linux/scripts/06-packaging/collect-release-assets.sh",
  "find": "  check_source_offers\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "A release missing an offered file stops before it is published."
 },
 {
  "id": "packaging.release-offer-hash",
  "target": "linux/scripts/06-packaging/check-source-offer.py",
  "find": "elif hashlib.sha256(path.read_bytes()).hexdigest() != str(row[\"sha256\"]).lower():",
  "replace": "elif False:",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "An offered file with other bytes than its index records fails the release."
 },
 {
  "id": "packaging.release-offer-missing",
  "target": "linux/scripts/06-packaging/check-source-offer.py",
  "find": "if not path.is_file():",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "An offered file the release lacks is named as missing."
 },
 {
  "id": "packaging.release-offer-empty",
  "target": "linux/scripts/06-packaging/check-source-offer.py",
  "find": "found = [] if sources else [f\"{index} offers no source\"]",
  "replace": "found = []",
  "test": "bash linux/scripts/tests/test-collect-release-assets.sh",
  "why": "An index that offers no source is a failure, not an empty pass."
 },
 {
  "id": "windows-lane.source-offer-export-hash",
  "target": "windows/scripts/modules/WindowsSourceOffer.Common.psm1",
  "find": "-ine $row.sha256) { throw \"$leaf is not the",
  "replace": "-ine $row.sha256 -and $false) { throw \"$leaf is not the",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Common.Tests.ps1",
  "why": "Only the archive the offer records leaves the image for the release."
 },
 {
  "id": "windows-lane.source-offer-names-once",
  "target": "windows/scripts/modules/WindowsSourceOffer.Build.psm1",
  "find": "if ($repeated) { throw \"the $Owner source offer names",
  "replace": "if ($false) { throw \"the $Owner source offer names",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceOffer.Build.Tests.ps1",
  "why": "Two offered files of one name cannot overwrite each other in the image or the release."
 },
 {
  "id": "windows-lane.source-offer-release-export",
  "target": "windows/scripts/python/New-PythonAppPackage.ps1",
  "find": "$offered = @(Export-NativeSourceArchive -Offer $ffmpegOffer -Destination (Join-Path $OutDir 'source-offer'))",
  "replace": "$offered = @()",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only PythonApp.PackageLicense.Tests.ps1",
  "why": "The package step puts FFmpeg's exact sources where the release collects them."
 },
 {
  "id": "wheels.torch-ft-drops-find-abi",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "        \"-U\" \"Python_FIND_ABI\" \"-U\" \"Python3_FIND_ABI\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "scikit-build-core's free-threaded FIND_ABI reaches CMake 4.4.5's cross FindPython, which finds no Development.Module, so torch ships a twin without torch_python or _C"
 },
 {
  "id": "wheels.torch-ft-requires-build-python",
  "target": "linux/scripts/05-frameworks/torch/build-app-wheelhouse.sh",
  "find": "    if ! grep -qx -e 'BUILD_PYTHON:BOOL=ON' \"${src_dir}/build/CMakeCache.txt\" 2>/dev/null; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-free-threaded-wheels.sh",
  "why": "torch only warns when it turns BUILD_PYTHON off, so a twin without _C would be stored and fail only at the media stage's final store check"
 },
 {
  "id": "lib.ort-profile-test-isolated-import",
  "target": "shared/python/tests/test_verify_ort_profile.py",
  "find": "sys.path.insert(0, str(Path(__file__).resolve().parent))\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-verify-ort-profile.sh",
  "why": "consumers run the suite with python -I, so its sibling fixture must import without the script directory on sys.path"
 },
 {
  "id": "intel-gpu.amd64-only",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    if [ \"$(dpkg --print-architecture)\" = amd64 ]; then\n        append_available_packages _sdp_out intel-media-va-driver",
  "replace": "    if true; then\n        append_available_packages _sdp_out intel-media-va-driver",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "ports' apt-cache shows intel-media-va-driver with no installation candidate, so the arm64 and riscv64 runtime preflight refuses the plan"
 },
 {
  "id": "runtime-push.zstd-converts-to-a-second-tag",
  "target": "linux/scripts/01-core/runtime-push.sh",
  "find": "local tag=\"$1\" staged=\"$1-zstd\"",
  "replace": "local tag=\"$1\" staged=\"$1\"",
  "test": "bash linux/scripts/tests/test-runtime-push.sh",
  "why": "nerdctl 2.4's in-place convert loses the source manifest when no other image holds its content, and the wrapper's push then fails with content digest not found"
 },
 {
  "id": "runtime-push.failed-retag-stops",
  "target": "linux/scripts/01-core/runtime-push.sh",
  "find": "run \"${nerdctl}\" tag \"${staged}\" \"${tag}\" || return 1",
  "replace": "run \"${nerdctl}\" tag \"${staged}\" \"${tag}\" || true",
  "test": "bash linux/scripts/tests/test-runtime-push.sh",
  "why": "a failed retag leaves the gzip image under the wrapper tag, which would then be pushed as if converted"
 },
 {
  "id": "probe.ft-deps-build-outside-pool",
  "target": "linux/scripts/06-packaging/free-threaded-probe-deps.py",
  "find": "dist = pool.with_name(f\"{pool.name}-dist\")",
  "replace": "dist = pool",
  "test": "bash linux/scripts/tests/test-free-threaded-probe-deps.sh",
  "why": "uv leaves its sdist extraction under --out-dir, and the pool check then refuses the riscv64 pool"
 },
 {
  "id": "packaging.ort-appimage-amd-strip-fallback",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "    migraphx) printf '%s\\n' --strip strip ;;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-appimage-payload.sh",
  "why": "the AMD image strips its CPU core, so an exact check rejects every AMD AppImage"
 },
 {
  "id": "packaging.ort-appimage-nvidia-exact",
  "target": "linux/scripts/06-packaging/ort-package-proof.sh",
  "find": "    *) printf '%s\\n' --require-unstripped --strip \"${STRIP:-strip}\" ;;\n",
  "replace": "    *) printf '%s\\n' --strip \"${STRIP:-strip}\" ;;\n",
  "test": "bash linux/scripts/tests/test-ort-appimage-payload.sh",
  "why": "NVIDIA's GPU prefix ships unstripped, so a stripped or changed NVIDIA file must not pass by stripping the wheel"
 },
 {
  "id": "probe.ft-webgpu-proof-reads-stdout",
  "target": "linux/scripts/06-packaging/check-free-threaded-wheels.sh",
  "find": "--source-ref \"${WEBGPU_EXPECT_REF:?missing ORT source pin}\" 2>\"${work}/webgpu.err\")\"",
  "replace": "--source-ref \"${WEBGPU_EXPECT_REF:?missing ORT source pin}\" 2>&1)\"",
  "test": "bash linux/scripts/tests/test-webgpu-runtime-transport.sh",
  "why": "ORT's early stderr warning (Unknown CPU vendor under qemu-riscv64) heads the proof row, and the riscv64 runtime smoke then fails a proved factory"
 },
 {
  "id": "rust.package-rustup-downloads-with-curl",
  "target": "linux/scripts/06-packaging/setup-package-image.sh",
  "find": "    RUSTUP_USE_CURL=1 RUST_INSTALL_CARGO_C=0 BUILD_MODE=native bash",
  "replace": "    RUST_INSTALL_CARGO_C=0 BUILD_MODE=native bash",
  "test": "bash linux/scripts/tests/test-setup-package-image.sh",
  "why": "rustup 1.29's default TLS download aborts with SIGABRT under qemu-user, and the arm64 package then fails in rustup component add"
 },
 {
  "id": "image-acceptance.retries-a-failed-command",
  "target": "linux/scripts/image-acceptance.py",
  "find": "            run_consumer_once_more(args, plan, work, index, spec, row, expected, rootless)",
  "replace": "            run_consumer(args, plan, work, index, spec, row, expected, rootless)",
  "test": "python3 linux/scripts/tests/test-image-acceptance.py",
  "why": "a GitHub 500 during a consumer's dependency download failed the whole image acceptance without a second try"
 },
 {
  "id": "image-acceptance.retry-only-on-nonzero-exit",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        raise ConsumerFailed(f\"{spec['name']}: consumer smoke failed; see {log}\")",
  "replace": "        raise ValueError(f\"{spec['name']}: consumer smoke failed; see {log}\")",
  "test": "python3 linux/scripts/tests/test-image-acceptance.py",
  "why": "only the consumer command's own failure is retried; dirty sources and cleanup errors must still fail at once"
 },
 {
  "id": "image-acceptance.retry-records-first-attempt",
  "target": "linux/scripts/image-acceptance.py",
  "find": "        row.update(name=spec[\"name\"], command=spec[\"command\"], exit_code=None, first_attempt=attempt)",
  "replace": "        row.update(name=spec[\"name\"], command=spec[\"command\"], exit_code=None)",
  "test": "python3 linux/scripts/tests/test-image-acceptance.py",
  "why": "a retried pass must show its first failure in the receipt, or the retry hides a flaky consumer"
 },
 {
  "id": "image-acceptance.passed-checkout-removed",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    git(checkout, \"clean\", \"-ffdxq\")\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/test-image-acceptance.py",
  "why": "a passed consumer's build outputs stay behind otherwise; three runs left 133 GB and the next acceptance filled the disk"
 },
 {
  "id": "disk-guard.gpu-variant-lane-budget",
  "target": "linux/scripts/build-cross-chain.sh",
  "find": "[ -z \"${CROSS_GPU_VARIANT:-}\" ] || : \"${CROSS_RUNTIME_LANE_GB:=280}\"",
  "replace": "[ -z \"${CROSS_GPU_VARIANT:-}\" ] || : \"${CROSS_RUNTIME_LANE_GB:=180}\"",
  "test": "bash linux/scripts/tests/test-chain-lifecycle.sh",
  "why": "a rocm runtime lane with 225 GB free filled the disk; 180 GB lets it start into that failure"
 },
 {
  "id": "image-acceptance.cleanup-reaches-submodules",
  "target": "linux/scripts/image-acceptance.py",
  "find": "    git(checkout, \"submodule\", \"foreach\", \"--quiet\", \"--recursive\", \"git clean -ffdxq\")\n",
  "replace": "",
  "test": "python3 linux/scripts/tests/test-image-acceptance.py",
  "why": "submodule build trees are part of the consumer's build output and would stay"
 },
 {
  "id": "flutter.unwinder-order-any-first-definer",
  "target": "linux/scripts/05-frameworks/flutter/check-flutter-unwinder-order.sh",
  "find": "    libgcc_s.so*)\n",
  "replace": "    ?*)\n",
  "test": "bash linux/scripts/tests/test-check-flutter-unwinder-order.sh",
  "why": "any first definer of _Unwind_RaiseException would pass, Flutter 3.50's engine included"
 },
 {
  "id": "flutter.unwinder-order-unresolved-unchecked",
  "target": "linux/scripts/05-frameworks/flutter/check-flutter-unwinder-order.sh",
  "find": "  if [[ \"${listing}\" == *\"not found\"* ]]; then\n",
  "replace": "  if false; then\n",
  "test": "bash linux/scripts/tests/test-check-flutter-unwinder-order.sh",
  "why": "an unresolved library hides its symbols, so the order would be graded on a partial list"
 },
 {
  "id": "flutter.unwinder-order-readelf-failure",
  "target": "linux/scripts/05-frameworks/flutter/check-flutter-unwinder-order.sh",
  "find": "    if ! syms=\"$(readelf --dyn-syms -W \"${path}\" 2>&1)\"; then\n",
  "replace": "    syms=\"$(readelf --dyn-syms -W \"${path}\" 2>&1)\" || true\n    if false; then\n",
  "test": "bash linux/scripts/tests/test-check-flutter-unwinder-order.sh",
  "why": "a library readelf cannot read must fail the gate, not pass as one without the unwinder"
 },
 {
  "id": "flutter.unwinder-order-every-executable",
  "target": "linux/scripts/05-frameworks/flutter/check-flutter-unwinder-order.sh",
  "find": "  check_one \"${exe}\" || rc=1\n",
  "replace": "  check_one \"${exe}\" || rc=1\n  break\n",
  "test": "bash linux/scripts/tests/test-check-flutter-unwinder-order.sh",
  "why": "every executable named must be graded, not only the first"
 },
 {
  "id": "flutter.unwinder-order-launcher-follow",
  "target": "linux/scripts/05-frameworks/flutter/check-flutter-unwinder-order.sh",
  "find": "    exe=\"${exe}.bin\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-check-flutter-unwinder-order.sh",
  "why": "a bundle-loader.sh --beside launcher is a script, so the gate must grade the <name>.bin it starts"
 },
 {
  "id": "flutter.unwinder-cmake-late-call-by-name",
  "target": "cmake/KataglyphisFlutterUnwinder.cmake",
  "find": "    if(_lib STREQUAL \"flutter\" OR _lib MATCHES \"libflutter_linux_gtk\\\\.so$\")\n",
  "replace": "    if(_lib MATCHES \"libflutter_linux_gtk\\\\.so$\")\n",
  "test": "bash linux/scripts/tests/test-cmake-flutter-unwinder.sh",
  "why": "a call after the runner links the flutter target cannot put libgcc_s first and must fail the configure"
 },
 {
  "id": "flutter.unwinder-cmake-late-call-by-path",
  "target": "cmake/KataglyphisFlutterUnwinder.cmake",
  "find": "    if(_lib STREQUAL \"flutter\" OR _lib MATCHES \"libflutter_linux_gtk\\\\.so$\")\n",
  "replace": "    if(_lib STREQUAL \"flutter\")\n",
  "test": "bash linux/scripts/tests/test-cmake-flutter-unwinder.sh",
  "why": "the engine linked by its path comes first just the same, so a later call must fail too"
 },
 {
  "id": "flutter.unwinder-cmake-no-as-needed",
  "target": "cmake/KataglyphisFlutterUnwinder.cmake",
  "find": "PRIVATE \"-Wl,--push-state,--no-as-needed\" gcc_s \"-Wl,--pop-state\")",
  "replace": "PRIVATE gcc_s)",
  "test": "bash linux/scripts/tests/test-cmake-flutter-unwinder.sh",
  "why": "under --as-needed the linker drops libgcc_s from the runner, whose own code calls no _Unwind_* function"
 },
 {
  "id": "flutter.unwinder-cmake-linux-only",
  "target": "cmake/KataglyphisFlutterUnwinder.cmake",
  "find": "     \"Linux\")\n    return()\n",
  "replace": "     \"Linux\")\n",
  "test": "bash linux/scripts/tests/test-cmake-flutter-unwinder.sh",
  "why": "a Windows or macOS runner has no libgcc_s and must keep its link line"
 },
 {
  "id": "packaging.plugin-core-copy-dropped",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  cp -L \"$(ort_chain_core_file)\" \"${ort_dest}\" || return 1\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "the plugin MIGraphX EP names libonnxruntime.so.1 in DT_NEEDED; without the chain core beside it a clean host cannot load the module"
 },
 {
  "id": "packaging.plugin-core-not-identical",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  cp -L \"$(ort_chain_core_file)\" \"${ort_dest}\" || return 1\n",
  "replace": "  { cp -L \"$(ort_chain_core_file)\" \"${ort_dest}\" && printf 'x' >> \"${ort_dest}\"; } || return 1\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a core whose bytes are not the chain's is a second ORT source; staging must refuse it"
 },
 {
  "id": "packaging.plugin-core-sha-unchecked",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ \"${ort_have%% *}\" = \"${ort_want%% *}\" ]; then return 0; fi\n",
  "replace": "  return 0\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "the sha256 comparison is the only proof the bundled core is the chain's"
 },
 {
  "id": "packaging.plugin-core-never-replaces-wheel",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  _ort_refuse_existing \"${ort_dest}\" 'which the wheel ships' || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a wheel that ships its own libonnxruntime.so.1 keeps it; overwriting it would break the wheel proof"
 },
 {
  "id": "packaging.plugin-core-left-out-of-wheel-proof",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "    [ \"${ort_kind}:${ort_core##*/}\" = \"migraphx:${ORT_PLUGIN_CORE}\" ] || ort_cores+=(\"${ort_core}\")\n",
  "replace": "    ort_cores+=(\"${ort_core}\")\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "the chain prefix's stripped core is no wheel member; counted as the wheel's core it fails every AMD bundle"
 },
 {
  "id": "packaging.python-host-plugin-core-proof",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  ort_assert_plugin_core \"$1/${ORT_PLUGIN_CORE}\"\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-ort-host-runtime.sh",
  "why": "the host-runtime proof of a Python AMD bundle covers the module's core as well as the module"
 },
 {
  "id": "packaging.python-bundle-stages-plugin-core",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "  ort_stage_plugin_core \"${site_packages}/onnxruntime/capi\" || err \"could not stage the chain ORT core the plugin MIGraphX EP links\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-app-bundle-license.sh",
  "why": "OrchestrANT's AMD inventory stopped on capi/libmigraphx-ep.so -> libonnxruntime.so.1 unresolved (#276)"
 },
 {
  "id": "packaging.python-bundle-closure-library-path",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "  closure_args+=(--library-path \"${ort_library_path}\")\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-app-bundle-license.sh",
  "why": "the closure must take the launchers' library path, or the unpatched module's core reads as unresolved"
 },
 {
  "id": "packaging.python-bundle-loader-library-path",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "if [ -n \"${ort_library_path}\" ]; then loader_args+=(--library-path \"${ort_library_path}\"); fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-app-bundle-license.sh",
  "why": "the closure and G6 trust the stated path; a launcher without it leaves the module unloadable on a clean host"
 },
 {
  "id": "packaging.python-bundle-census-library-path",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "if [ -n \"${ort_library_path}\" ]; then census_args+=(--library-path \"${ort_library_path}\"); fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-app-bundle-license.sh",
  "why": "G6 must model the path the launcher hands the loader, or the module's import is UNRESOLVED"
 },
 {
  "id": "packaging.loader-library-path-bundled",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "--library-path \"\\$here/${to_lib}/glibc:\\$here/${to_lib}${library_suffix}${external_suffix}\"",
  "replace": "--library-path \"\\$here/${to_lib}/glibc:\\$here/${to_lib}${external_suffix}\"",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "the bundled loader's --library-path replaces LD_LIBRARY_PATH, so the stated directories must be in it"
 },
 {
  "id": "packaging.loader-library-path-host",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "    external_setup=\"$(printf '\\nexport LD_LIBRARY_PATH=\"%s${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}\"' \"${library_suffix#:}\")\"\n",
  "replace": "    external_setup=\"\"\n",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "the host-glibc exec takes no --library-path; without the export the stated directories never reach its loader"
 },
 {
  "id": "packaging.loader-library-path-external-host",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "export LD_LIBRARY_PATH=\"\\$here/${to_lib}${library_suffix}\\${external_library_path}\"",
  "replace": "export LD_LIBRARY_PATH=\"\\$here/${to_lib}\\${external_library_path}\"",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "a host GPU runtime launcher keeps the stated directories ahead of the host's library path"
 },
 {
  "id": "packaging.loader-library-path-rerun",
  "target": "linux/scripts/06-packaging/bundle-loader.sh",
  "find": "      *) err \"${rel} has a different library path; restage the executable\" ;;\n",
  "replace": "      *) ;;\n",
  "test": "bash linux/scripts/tests/test-linux-closure-install.sh",
  "why": "a rerun must not silently keep a launcher written for another library path"
 },
 {
  "id": "packaging.elf-closure-library-path",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "  if [[ \"${soname}\" != */* ]] && on_library_path \"${soname}\"; then return 0; fi\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "a protected module's library on the launcher's library path resolves there; ignoring the option fails the rocm Python bundle"
 },
 {
  "id": "packaging.elf-closure-library-path-in-bundle",
  "target": "linux/scripts/06-packaging/elf-closure.sh",
  "find": "    if [ -e \"${BUNDLE}${dir%/}/$1\" ] && in_bundle \"${BUNDLE}${dir%/}/$1\"; then return 0; fi\n",
  "replace": "    if [ -e \"${BUNDLE}${dir%/}/$1\" ]; then return 0; fi\n",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "a link out of the bundle on the stated path is dead on the target"
 },
 {
  "id": "packaging.bundle-library-path-validated",
  "target": "linux/scripts/06-packaging/check-ort-provenance.sh",
  "find": "  _ort_path=\"$(_ort_census_library_path \"$2\" \"$3\")\" || return 2\n",
  "replace": "  _ort_path=\"$3\"\n",
  "test": "bash linux/scripts/tests/test-elf-closure.sh",
  "why": "the walker and the launcher take a launcher path only as the census does: relative, physical, inside the bundle"
 },
 {
  "id": "packaging.python-deb-stated-library-path",
  "target": "linux/scripts/06-packaging/python-app-deb-depends.py",
  "find": "    stated = any(compatible_bundled_elf(directory / name, bundle, path) for directory in launcher_library_dirs(bundle))\n",
  "replace": "    stated = False\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "the unpatched module's core in capi is bundled, not a host package the DEB must depend on"
 },
 {
  "id": "packaging.python-deb-stated-suffix-parsed",
  "target": "linux/scripts/06-packaging/python-app-deb-depends.py",
  "find": "    suffix = library_suffix + ('${external_library_path}' if external else '')\n",
  "replace": "    suffix = '${external_library_path}' if external else ''\n",
  "test": "bash linux/scripts/tests/test-python-deb-depends.sh",
  "why": "a launcher with a stated library path must still parse, on both glibc paths"
 },
 {
  "id": "packaging.gpu-package-plugin-core-proof",
  "target": "linux/scripts/06-packaging/verify-python-gpu-package.py",
  "find": "            raise ValueError(f\"{capi / PLUGIN_CORE} is not the chain's {chain_core()}\")\n",
  "replace": "            pass\n",
  "test": "python3 -m unittest linux/scripts/tests/test-python-gpu-package.py",
  "why": "no wheel carries the plugin's core; its only proof is the chain prefix's bytes"
 },
 {
  "id": "packaging.gpu-package-plugin-core-not-a-wheel-core",
  "target": "linux/scripts/06-packaging/verify-python-gpu-package.py",
  "find": "    return sorted(p for p in capi.glob(\"libonnxruntime.so.*\") if not (plugin and p.name == PLUGIN_CORE))\n",
  "replace": "    return sorted(capi.glob(\"libonnxruntime.so.*\"))\n",
  "test": "python3 -m unittest linux/scripts/tests/test-python-gpu-package.py",
  "why": "the chain core beside the plugin is not the wheel's, which must stay exactly one"
 },
 {
  "id": "packaging.gpu-package-plugin-core-in-inventory",
  "target": "linux/scripts/06-packaging/verify-python-gpu-package.py",
  "find": "        cores.append(capi / PLUGIN_CORE)\n",
  "replace": "        pass\n",
  "test": "python3 -m unittest linux/scripts/tests/test-python-gpu-package.py",
  "why": "a finished AMD package must carry the plugin's core byte for byte, like the module"
 },
 {
  "id": "probe.opencv-cuda-cache-root-cli",
  "target": "linux/scripts/03-media/build/opencv/opencv-cuda-cache.sh",
  "find": "        \"-DCUDA_NVCC_EXECUTABLE=${BASH_SOURCE[0]}\"\n",
  "replace": "        \"-DCUDA_TOOLKIT_ROOT_DIR=${toolkit}\"\n        \"-DCUDA_NVCC_EXECUTABLE=${BASH_SOURCE[0]}\"\n",
  "test": "bash linux/scripts/tests/test-opencv-cuda-cache.sh",
  "why": "A CLI toolkit root makes FindCUDA drop the libcuda stub on the first configure, and cudacodec then fails to generate."
 },
 {
  "id": "runtime-gates.ap4-strip-needs-a-section-table",
  "target": "linux/scripts/verify-shipped-wrapper.sh",
  "find": "    if ! grep -q '\\.shstrtab' <<< \"${_sections}\"; then\n",
  "replace": "    if false; then\n",
  "test": "bash linux/scripts/tests/test-verify-shipped-wrapper.sh",
  "why": "a libavcodec cut short in extraction has no section table, so it would read as stripped; does not prove the strip of any other library"
 },
 {
  "id": "lib.repo-hygiene-git-failure-throws",
  "target": "windows/scripts/modules/WindowsRepoHygiene.Common.psm1",
  "find": "  if ($code -ne 0 -and -not $AllowFailure) {\n",
  "replace": "  if ($false) {\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only WindowsRepoHygiene.GitFailure.Tests.ps1",
  "why": "a git that exits non-zero prints nothing on stdout, which the hygiene guards would read as clean; does not cover a git that exits 0 with wrong output"
 },
 {
  "id": "lib.repo-hygiene-reachability-probe-may-fail",
  "target": "windows/scripts/modules/WindowsRepoHygiene.Common.psm1",
  "find": "Invoke-GitIn -AllowFailure -Path $SubmodulePath -Arguments @('rev-parse', 'HEAD')",
  "replace": "Invoke-GitIn -Path $SubmodulePath -Arguments @('rev-parse', 'HEAD')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only WindowsRepoHygiene.GitFailure.Tests.ps1",
  "why": "a failed reachability probe is the answer unreachable, not an error that hides which pin failed"
 },
 {
  "id": "lib.perf-baseline-not-run-refused",
  "target": "windows/scripts/modules/WindowsPerfBaseline.Common.psm1",
  "find": "        if ($reason) { $notRun += $reason; continue }\n",
  "replace": "        if ($false) { $notRun += $reason; continue }\n",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only WindowsPerfBaseline.NotRun.Tests.ps1",
  "why": "an errored benchmark's real_time 0 would compare as a 100% speed-up and pass; does not judge a run that measured badly"
 },
 {
  "id": "lib.perf-baseline-skipped-is-not-run",
  "target": "windows/scripts/modules/WindowsPerfBaseline.Common.psm1",
  "find": "[ordered]@{ error_occurred = 'error_message'; skipped = 'skip_message' }",
  "replace": "[ordered]@{ error_occurred = 'error_message' }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only WindowsPerfBaseline.NotRun.Tests.ps1",
  "why": "SkipWithMessage exits 0 and writes skipped, not error_occurred, so it is the case a run's exit code never reports"
 },
 {
  "id": "flutter.sync-back-failure-throws",
  "target": "windows/scripts/modules/WindowsFlutter.Common.psm1",
  "find": "    if ($failures.Count -gt 0) { throw ($failures -join ' ') }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only WindowsFlutter.Common.Tests.ps1",
  "why": "a sync-back robocopy could not finish leaves the host on the previous build while the step reports success; does not prove the copied bytes"
 },
 {
  "id": "flutter.sync-back-rust-failure-kept",
  "target": "windows/scripts/modules/WindowsFlutter.Common.psm1",
  "find": "        $failures += @(Sync-FlutterArtifactTree",
  "replace": "        $null = @(Sync-FlutterArtifactTree",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only WindowsFlutter.Common.Tests.ps1",
  "why": "a failed Rust artifact copy must fail the delivery too, not only the build tree's"
 },
 {
  "id": "vulkan.cpu-driver-caller-wins",
  "target": "linux/scripts/01-core/vulkan-env.sh",
  "find": "  [ -z \"${VK_LOADER_DRIVERS_SELECT:-}${VK_DRIVER_FILES:-}${VK_ICD_FILENAMES:-}\" ] || return 0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-vulkan-cpu-driver.sh",
  "why": "CON284: a driver the caller names (select, driver files or the older ICD list) is kept, never replaced by lavapipe"
 },
 {
  "id": "vulkan.cpu-driver-gpu-node-keeps-loader",
  "target": "linux/scripts/01-core/vulkan-env.sh",
  "find": "  if compgen -G \"${dev}/dri/renderD*\" >/dev/null || compgen -G \"${dev}/nvidia[0-9]*\" >/dev/null || [ -e \"${dev}/dxg\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-vulkan-cpu-driver.sh",
  "why": "CON284: a render node, an NVIDIA device or WSL's dxg means a GPU driver can work, so the GPU lanes keep their GPU"
 },
 {
  "id": "vulkan.cpu-driver-needs-lavapipe",
  "target": "linux/scripts/01-core/vulkan-env.sh",
  "find": "  [ \"${found}\" = 1 ] || return 0\n  export VK_LOADER_DRIVERS_SELECT",
  "replace": "  export VK_LOADER_DRIVERS_SELECT",
  "test": "bash linux/scripts/tests/test-vulkan-cpu-driver.sh",
  "why": "CON284: without a lavapipe ICD the filter would leave the loader no driver at all, so it is not set"
 },
 {
  "id": "lib.ctest-run-cpu-driver-default",
  "target": "linux/scripts/lib/ctest-run.sh",
  "find": "  project_env_source_vulkan\n  vulkan_env_default_cpu_driver\n",
  "replace": "  project_env_source_vulkan\n",
  "test": "bash linux/scripts/tests/test-lib-ctest-run.sh",
  "why": "CON284: every consumer's ctest in a GPU-less container takes lavapipe, so Mesa's other ICDs neither warn nor leak per test"
 },
 {
  "id": "rust.cargo-test-cpu-driver-default",
  "target": "linux/scripts/02-toolchain/rust/cargo_test.sh",
  "find": "vulkan_env_default_cpu_driver\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-cargo-test-junit.sh",
  "why": "CON284: cargo test in a GPU-less container takes lavapipe, as ctest-run.sh does"
 },
 {
  "id": "package.license-gate-names-tool-stderr",
  "target": "linux/scripts/verify_package_license.py",
  "find": "        print(failure_text(exc), file=sys.stderr)",
  "replace": "        print(f\"FAIL: {exc}\", file=sys.stderr)",
  "test": "bash linux/scripts/tests/test-package-license-verifier.sh",
  "why": "a failed flatpak, ostree or extractor names its own stderr; the bare command line left OxidANT's red Flatpak check unexplained"
 },
 {
  "id": "docs-site.ort-web-loader-jspi-needs-promising",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "jspi: typeof wasm.Suspending === 'function' && typeof wasm.promising === 'function',",
  "replace": "jspi: typeof wasm.Suspending === 'function',",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a browser with Suspending alone has no working JSPI"
 },
 {
  "id": "docs-site.ort-web-loader-insecure-asks-no-adapter",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "if (caps.secure_context && caps.webgpu) Object.assign(",
  "replace": "if (caps.webgpu) Object.assign(",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "an insecure page has no WebGPU to ask"
 },
 {
  "id": "docs-site.ort-web-loader-insecure-is-cpu",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  if (!caps.secure_context) return choice('cpu', 'no-secure-context');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "an insecure page gets the CPU build and says why"
 },
 {
  "id": "docs-site.ort-web-loader-no-webgpu-is-cpu",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  if (!caps.webgpu) return choice('cpu', 'no-webgpu');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a browser without navigator.gpu gets the CPU build and says why"
 },
 {
  "id": "docs-site.ort-web-loader-adapter-timeout",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "if (adapter === 'timeout') return { adapter: null, adapter_error: 'timeout' };",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "an adapter request that never answers must not hold the page"
 },
 {
  "id": "docs-site.ort-web-loader-adapter-timeout-reason",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  if (caps.adapter_error === 'timeout') return choice('cpu', 'adapter-timeout');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a timed-out adapter is named as such, not as a failed request"
 },
 {
  "id": "docs-site.ort-web-loader-adapter-error-is-cpu",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  if (caps.adapter_error) return choice('cpu', 'adapter-error');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a failed adapter request gets the CPU build and says why"
 },
 {
  "id": "docs-site.ort-web-loader-no-adapter-is-cpu",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  if (!caps.adapter) return choice('cpu', 'no-adapter');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "WebGPU without an adapter gets the CPU build"
 },
 {
  "id": "docs-site.ort-web-loader-jspi-before-asyncify",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "return caps.jspi ? choice('jspi', 'jspi-webgpu') : choice('asyncify', 'no-jspi');",
  "replace": "return choice('asyncify', 'no-jspi');",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "JSPI is preferred whenever the browser has it"
 },
 {
  "id": "docs-site.ort-web-loader-requested-build-known",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "if (!BUILD_ORDER.includes(build)) throw",
  "replace": "if (build === undefined) throw",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a requested build that never ships (jsep) is refused"
 },
 {
  "id": "docs-site.ort-web-loader-one-thread-unisolated",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  if (!caps.cross_origin_isolated) return { threads: 1, threads_note: 'not-isolated' };\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "threads need SharedArrayBuffer, which only an isolated page has"
 },
 {
  "id": "docs-site.ort-web-loader-build-path",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "if (!BUILD_PATH.test(entry.path || '') || !Array.isArray(entry.files)) {",
  "replace": "if (!Array.isArray(entry.files)) {",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a manifest path outside ort/<version>-<hash>/ would fetch elsewhere"
 },
 {
  "id": "docs-site.ort-web-loader-plain-file-name",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "if (!PLAIN_FILE.test(f.file || '') || !SHA256.test(f.sha256 || ''))",
  "replace": "if (!SHA256.test(f.sha256 || ''))",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a file name with a slash would leave the build's directory"
 },
 {
  "id": "docs-site.ort-web-loader-bundle-order",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "[`${prefix}.min.mjs`, `${prefix}.mjs`, `${prefix}.bundle.min.mjs`]",
  "replace": "[`${prefix}.bundle.min.mjs`, `${prefix}.min.mjs`, `${prefix}.mjs`]",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "the minified bundle that loads the build's own loader comes first, as in the parity check"
 },
 {
  "id": "docs-site.ort-web-loader-no-bundle-refused",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  if (!bundle) throw new OrtWebLoadError('no-bundle',",
  "replace": "  if (bundle === undefined) throw new OrtWebLoadError('no-bundle',",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "an arm64 manifest without bundles is refused, not loaded half"
 },
 {
  "id": "docs-site.ort-web-loader-one-wasm",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "else if (files.length !== 1) throw",
  "replace": "else if (files.length < 1) throw",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "two wasm files would leave the choice of bytes to order"
 },
 {
  "id": "docs-site.ort-web-loader-hash-checked",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "    if (actual !== item.sha256) throw",
  "replace": "    if (actual === null) throw",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a file other than the manifest's, such as index.html, must not load"
 },
 {
  "id": "docs-site.ort-web-loader-http-status",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  if (!response.ok) throw new OrtWebLoadError('fetch-failed', `${url}: HTTP ${response.status}`, provenance);\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a missing file is a refusal with its URL, not a TypeError"
 },
 {
  "id": "docs-site.ort-web-loader-unverifiable",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "if (verify && !subtle) throw",
  "replace": "if (verify && subtle === 0) throw",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "an insecure page cannot check the files and must say so"
 },
 {
  "id": "docs-site.ort-web-loader-version-guard",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "if (provenance.ort_web !== provenance.ort_version) {",
  "replace": "if (provenance.ort_web === null) {",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a cached bundle of another ORT version would mix with this build's wasm"
 },
 {
  "id": "docs-site.ort-web-loader-own-wasm-paths",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "wasmPaths: { mjs: at(entry.loader), wasm: at(entry.wasm) }",
  "replace": "wasmPaths: new URL(entry.path, root).href",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "both paths name this build's own loader and wasm, never a sibling's"
 },
 {
  "id": "docs-site.ort-web-loader-checked-bytes",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "wasmBinary: new Uint8Array(wasmBytes),",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "ORT gets the bytes that were checked, not a second download"
 },
 {
  "id": "docs-site.ort-web-loader-tap-before-import",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  if (scope.console) consoleTap(scope);\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "ORT's glue binds the console when it loads, so a later tap sees no placement line"
 },
 {
  "id": "docs-site.ort-web-loader-verbose-session",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "{ ...options, logSeverityLevel: 0, logVerbosityLevel: 0 }",
  "replace": "{ ...options }",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "only the verbose log names each node's provider"
 },
 {
  "id": "docs-site.ort-web-loader-on-provider-count",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "const onProvider = counts[PLACEMENT_NAMES[provenance.provider]] || 0;",
  "replace": "const onProvider = total;",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "the nodes ORT moved to the CPU must not count as WebGPU's"
 },
 {
  "id": "docs-site.ort-web-loader-plan-fetches-manifest",
  "target": "shared/web/javascript/ort-web-loader.mjs",
  "find": "  const staged = manifest ?? await readManifest(fetchFn, manifestUrl);\n",
  "replace": "  const staged = await readManifest(fetchFn, manifestUrl);\n",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a given manifest is not fetched again"
 },
 {
  "id": "docs-site.ort-web-loader-check-drops-isolation",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "if (!CASES[opts.case].isolated) for (const name of",
  "replace": "if (false) for (const name of",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "the not-isolated case must serve no COOP and COEP"
 },
 {
  "id": "docs-site.ort-web-loader-check-fake-hashes",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "files: list.map(([file, role, body]) => ({ file, role, sha256: sha(body), size: Buffer.byteLength(body) })) };",
  "replace": "files: list.map(([file, role, body]) => ({ file, role, sha256: sha(file), size: Buffer.byteLength(body) })) };",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "the stand-in ORT must pass the loader's hash check, or every case reads as a refusal"
 },
 {
  "id": "docs-site.ort-web-loader-check-traversal",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "    const file = within(opts.site, pathname.slice('/site/'.length));\n    return file ? { file } : null;",
  "replace": "    return { file: path.join(opts.site, pathname.slice('/site/'.length)) };",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "nothing outside the site is served"
 },
 {
  "id": "docs-site.ort-web-loader-check-worker-alone",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "if (opts.worker && (opts.model || opts.in !== 'page')) throw",
  "replace": "if (opts.worker && opts.model === null) throw",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "the app's worker runs its own protocol, without a model or the built-in worker"
 },
 {
  "id": "docs-site.ort-web-loader-check-detect-needs-worker",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "if ((opts.build || opts.image || opts.camera) && !opts.worker) throw",
  "replace": "if (false) throw",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "a build or an image goes to an app's worker, which only --worker names"
 },
 {
  "id": "docs-site.ort-web-loader-check-threshold-default",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "build: '', image: '', camera: '', threshold: 0.25, generate: '', threads: 0, chat: '' },",
  "replace": "build: '', image: '', camera: '', threshold: 0.4, generate: '', threads: 0, chat: '' },",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "the comparator keeps detections down to 0.25, so a higher default drops boxes it would match"
 },
 {
  "id": "probe.ort-run-path-empty-entry",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "  case \":$3:\" in *::*) printf '%s: %s [%s] has an empty entry\\n' \"$1\" \"$2\" \"$3\" ;; esac\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a run path with an empty entry must fail the runtime smoke"
 },
 {
  "id": "probe.ort-run-path-relative-entry",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "      *) printf '%s: %s entry %s is relative\\n' \"$1\" \"$2\" \"${entry}\" ;;",
  "replace": "      *) ;;",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a relative run path entry must fail the runtime smoke"
 },
 {
  "id": "probe.ort-run-path-origin-whole",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "      \"\" | /* | '$ORIGIN' | '$ORIGIN/'* | '${ORIGIN}' | '${ORIGIN}/'*) ;;",
  "replace": "      \"\" | /* | '$ORIGIN'* | '${ORIGIN}'*) ;;",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "$ORIGIN counts only as a whole first component, not as a prefix of another word"
 },
 {
  "id": "probe.ort-run-path-rpath-read",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "  /\\((RUNPATH|RPATH)\\).*: \\[.*\\]$/ {",
  "replace": "  /\\((RUNPATH)\\).*: \\[.*\\]$/ {",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a legacy DT_RPATH must be read as well as DT_RUNPATH"
 },
 {
  "id": "probe.ort-run-path-done-required",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "  if [ -z \"${libs}\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a probe that never printed its DONE line must fail, not pass on no rows"
 },
 {
  "id": "probe.ort-run-path-zero-libraries",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "  elif [ \"${libs}\" -eq 0 ]; then",
  "replace": "  elif false; then",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a probe that read no ORT library proves nothing and must fail"
 },
 {
  "id": "probe.ort-run-path-roots",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "_ORT_RUN_PATH_ROOTS=('/usr/local/lib/onnxruntime-*' '/opt/venv/lib/python3*/site-packages/onnxruntime*')",
  "replace": "_ORT_RUN_PATH_ROOTS=('/usr/local/lib/onnxruntime-genai')",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "the check covers every ORT prefix and the venv's ORT packages, not GenAI alone"
 },
 {
  "id": "probe.ort-run-path-wired",
  "target": "linux/scripts/06-packaging/smoke-runtime-image.sh",
  "find": "    check_ort_run_paths \"${image_tag}\" \"${target_arch}\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "the runtime smoke must run the run-path check"
 },
 {
  "id": "ort-chain.genai-run-path-slash",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "      *) entry=\"/${entry}\" ;;",
  "replace": "      *) ;;",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "the slash CMake strips off with CMAKE_SYSROOT=/ must come back"
 },
 {
  "id": "ort-chain.genai-run-path-empty",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "      \"\") continue ;;",
  "replace": "      \"\") ;;",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "CMake's padding entries must not reach the shipped run path"
 },
 {
  "id": "ort-chain.genai-run-path-origin",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "      /* | '$ORIGIN' | '$ORIGIN/'* | '${ORIGIN}' | '${ORIGIN}/'*) ;;",
  "replace": "      /*) ;;",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "an $ORIGIN entry is already anchored and must not gain a slash"
 },
 {
  "id": "ort-chain.genai-run-path-unchanged",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    [ \"${want}\" != \"${have}\" ] || continue",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a clean run path, or none, must not be rewritten"
 },
 {
  "id": "ort-chain.genai-run-path-patchelf",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "      patchelf --set-rpath \"${want}\" \"${so}\" || err \"patchelf cannot set the run path of ${so}\"",
  "replace": "      :",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "the producer must write the absolute run path into each library"
 },
 {
  "id": "ort-chain.genai-run-path-remove",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    if [ -n \"${want}\" ]; then",
  "replace": "    if true; then",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a run path of only empty entries is removed, never written back empty"
 },
 {
  "id": "ort-chain.genai-run-path-readback",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    [ \"${got}\" = \"${want}\" ] || err \"${so}: run path reads '${got}' after patchelf, not '${want}'\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "the run path is proven by reading it back, not by patchelf's exit status"
 },
 {
  "id": "ort-chain.genai-run-path-called",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "  genai_fix_run_paths \"${GENAI_OUTPUT_DIR}/lib\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "the build must fix the copied libraries' run path"
 },
 {
  "id": "ort-chain.genai-wheel-run-path-fixed",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    genai_fix_run_paths \"${pkg}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "the library a GenAI wheel embeds must be fixed too"
 },
 {
  "id": "ort-chain.genai-wheel-run-path-package",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    [ -n \"${pkg}\" ] || err \"${whl} has no onnxruntime_genai package\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a GenAI wheel without its package must stop the build"
 },
 {
  "id": "ort-chain.genai-wheel-run-path-one",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    [ \"${#packed[@]}\" -eq 1 ] && [ -f \"${packed[0]}\" ] || err \"repacking ${whl} did not make exactly one wheel\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a repack must make exactly one wheel to replace the original with"
 },
 {
  "id": "ort-chain.genai-wheel-run-path-replaced",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    mv -f \"${packed[0]}\" \"${whl}\" || err \"cannot replace ${whl}\"",
  "replace": "    :",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "the repacked wheel must replace the original"
 },
 {
  "id": "ort-chain.genai-wheel-run-path-called",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "genai_fix_wheel_run_paths \"${GENAI_OUTPUT_DIR}/wheels\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "the build must fix the collected wheels"
 },
 {
  "id": "ort-chain.genai-wheel-run-path-pack-dir",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    wheel_archive_run pack \"${pkg%/*}\" \"${tmp}\" \"${HOST_PYTHON}\" || err \"cannot repack ${whl}\"",
  "replace": "    wheel_archive_run pack \"${pkg%/*}\" \"${tmp}/packed\" \"${HOST_PYTHON}\" || err \"cannot repack ${whl}\"",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "wheel pack writes only into a directory that already exists"
 },
 {
  "id": "probe.ort-run-path-file-header",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "  /^File: / { lib = substr($0, 7); n++; next }",
  "replace": "  /^File: / { next }",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a batched readelf names each library in its File: header, and the probe must count and attribute by it"
 },
 {
  "id": "probe.ort-run-path-single-library",
  "target": "linux/scripts/06-packaging/check-ort-runtime.sh",
  "find": "  NR == 1 && total == 1 { lib = one; n = 1 }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "readelf prints no File: header for a lone library, so the probe must name and count it itself"
 },
 {
  "id": "ort-chain.genai-wheel-run-path-clean-kept",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    if [ \"${GENAI_RUN_PATHS_FIXED}\" -eq 0 ]; then",
  "replace": "    if false; then",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a GenAI wheel with clean run paths must keep its bytes instead of being repacked"
 },
 {
  "id": "ort-chain.genai-run-path-count",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    GENAI_RUN_PATHS_FIXED=$((GENAI_RUN_PATHS_FIXED + 1))\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "a patched library must mark its wheel for repacking, or the fix never reaches the wheel"
 },
 {
  "id": "ort-chain.genai-run-path-count-reset",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "  GENAI_RUN_PATHS_FIXED=0\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-run-path.sh",
  "why": "each call must count from zero, or a clean wheel inherits an earlier wheel's patches"
 },
 {
  "id": "sccache.disabled-cache-runs-the-compiler-alone",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "if [ \"${SCCACHE_DISABLE:-0}\" = 1 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "SCCACHE_DISABLE=1 must start no sccache server and retry nothing; the 2026-10-30 uid 1001 build retried a dead server twice (CON187)"
 },
 {
  "id": "sccache.disabled-cache-only-on-1",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "if [ \"${SCCACHE_DISABLE:-0}\" = 1 ]; then",
  "replace": "if [ -n \"${SCCACHE_DISABLE:-}\" ]; then",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "SCCACHE_DISABLE=0 names a cache that stays on; any non-empty value must not switch it off"
 },
 {
  "id": "sccache.disabled-cache-keeps-the-slot",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "if [ \"${SCCACHE_DISABLE:-0}\" = 1 ]; then\n  exec \"$@\"\nfi",
  "replace": "if [ \"${SCCACHE_DISABLE:-0}\" = 1 ]; then\n  exec \"$@\" 9>&-\nfi",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "a direct compile needs the same memory as a cached one, so it must keep the governor slot"
 },
 {
  "id": "sccache.unwritable-log-falls-back",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "  _log_writable \"${SCCACHE_ERROR_LOG:-}\" && return 0",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "a log the server cannot open (the image's root-owned /tmp/sccache.log at uid 1001) stops every server start and costs the cache (CON187)"
 },
 {
  "id": "sccache.writable-log-is-kept",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "  _log_writable \"${SCCACHE_ERROR_LOG:-}\" && return 0",
  "replace": "  :",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "a writable log must stay where it is: the build tooling reads the server's /tmp/sccache.log"
 },
 {
  "id": "sccache.log-check-survives-dash",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "  command : 2>/dev/null >>\"$1\"",
  "replace": "  : 2>/dev/null >>\"$1\"",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "dash ends the whole launcher on a refused redirection of a special builtin, so the compile would fail instead of falling back"
 },
 {
  "id": "sccache.fallback-log-is-per-user",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "  _log_user=\"${TMPDIR:-/tmp}/sccache-$(id -u).log\"",
  "replace": "  _log_user=\"${TMPDIR:-/tmp}/sccache.log\"",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "a shared fallback name is the same trap one uid later: the first uid to create it owns it"
 },
 {
  "id": "sccache.no-writable-log-runs-without-one",
  "target": "linux/scripts/01-core/sccache-launcher.sh",
  "find": "  unset SCCACHE_ERROR_LOG\n}",
  "replace": "}",
  "test": "bash linux/scripts/tests/test-sccache-launcher.sh",
  "why": "with no writable log anywhere sccache must start without one, not fail and lose the cache"
 },
 {
  "id": "sccache.drain-reads-the-fallback-log",
  "target": "linux/scripts/01-core/sccache-s3-level.sh",
  "find": "    log=\"${user}\"\n  fi\n  printf '%s\\n' \"${log}\"",
  "replace": "    :\n  fi\n  printf '%s\\n' \"${log}\"",
  "test": "bash linux/scripts/tests/test-sccache-s3-level.sh",
  "why": "after the launcher fell back the server writes the per-user log, and a drain blind to it re-uploads no failed S3 write (CON187)"
 },
 {
  "id": "sccache.drain-keeps-a-writable-log",
  "target": "linux/scripts/01-core/sccache-s3-level.sh",
  "find": "  if [ -z \"${log}\" ] || { ! { [ -f \"${log}\" ] && [ -w \"${log}\" ]; } && [ -f \"${user}\" ]; }; then",
  "replace": "  if [ -f \"${user}\" ]; then",
  "test": "bash linux/scripts/tests/test-sccache-s3-level.sh",
  "why": "a writable named log is where the launcher left the server, so a stray per-user file must not replace it"
 },
 {
  "id": "packaging.runtime-image-drops-sccache-log",
  "target": "linux/Dockerfile.torch",
  "find": "    rm -f /tmp/sccache.log; \\\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-compiler-cache.sh",
  "why": "a build's root-owned /tmp/sccache.log shipped in :latest-rocm, and uid 1001's sccache server could not open it (CON187)"
 },
 {
  "id": "docs-site.ort-web-loader-camera-flags",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "    browser = await launch(chrome, [...spec.flags, ...cameraFlags(opts.camera)], onEvent);\n",
  "replace": "    browser = await launch(chrome, [...spec.flags], onEvent);\n",
  "test": "bash linux/scripts/tests/test-ort-web-loader-chrome.sh",
  "why": "without the fake-camera flags Chrome has no camera, and the run proves nothing about frames"
 },
 {
  "id": "docs-site.ort-web-loader-camera-threshold",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "...(op.startsWith('detect') ? { threshold: o.threshold } : {})",
  "replace": "...(op === 'detect' ? { threshold: o.threshold } : {})",
  "test": "bash linux/scripts/tests/test-ort-web-loader-chrome.sh",
  "why": "a camera frame is detected at the asked threshold, as a still image is"
 },
 {
  "id": "docs-site.ort-web-loader-camera-not-both",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "  if (opts.image && opts.camera) throw new Error('--image or --camera, not both: one detect step per run');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "one run sends one detect step; with both, one of them would silently go unchecked"
 },
 {
  "id": "docs-site.ort-web-loader-camera-needs-worker",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "if ((opts.build || opts.image || opts.camera) && !opts.worker)",
  "replace": "if ((opts.build || opts.image) && !opts.worker)",
  "test": "bash linux/scripts/tests/test-ort-web-loader.sh",
  "why": "only the app's worker has a detectFrame step; the loader alone would ignore the camera"
 },
 {
  "id": "docs-site.ort-web-loader-camera-frame-sent",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "          worker.postMessage({ request: request(3, 'detectFrame'), frame }, [frame]);\n",
  "replace": "          worker.postMessage({ request: request(3, 'detectFrame') });\n",
  "test": "bash linux/scripts/tests/test-ort-web-loader-chrome.sh",
  "why": "the worker detects in the frame it is sent, so the frame has to reach it"
 },
 {
  "id": "packaging.plugin-notices-amdgpu-root-default",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "ort_amdgpu_ep_root() { printf '%s' \"${ORT_AMDGPU_EP_ROOT:-/usr/local/lib/onnxruntime-ep-amdgpu}\"; }",
  "replace": "ort_amdgpu_ep_root() { printf '%s' \"${ORT_AMDGPU_EP_ROOT-/usr/local/lib/onnxruntime-ep-amdgpu}\"; }",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "an empty ORT_AMDGPU_EP_ROOT, as every image but rocm sets it, still names the image's plugin prefix"
 },
 {
  "id": "packaging.plugin-notices-source-texts-dir",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ ! -d \"${ort_texts}\" ]; then printf 'no plugin licence texts directory",
  "replace": "  if false; then printf 'no plugin licence texts directory",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a plugin root without a licenses/ directory must say so, not fail on find's own error"
 },
 {
  "id": "packaging.plugin-notices-source-no-link",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  _ort_notice_none 'a plugin licence text is a link or special file' \"${ort_texts}\" ! -type f ! -type d || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a linked licence text would travel as a link into the image, not as the text"
 },
 {
  "id": "packaging.plugin-notices-refusal-names-hit",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  [ -n \"${ort_hit}\" ] || return 0\n",
  "replace": "  return 0\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "the finder refuses on a hit; returning early on one lets every link and extra entry through"
 },
 {
  "id": "packaging.plugin-notices-refusal-status",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  printf '%s: %s\\n' \"$1\" \"${ort_hit}\" >&2\n  return 1\n",
  "replace": "  printf '%s: %s\\n' \"$1\" \"${ort_hit}\" >&2\n  return 0\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a named refusal that returns 0 would print the fault and still pass"
 },
 {
  "id": "packaging.plugin-notices-refusal-find-fails",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  ort_hit=\"$(find \"$2\" \"${@:3}\" -print -quit)\" || return 1\n",
  "replace": "  ort_hit=\"$(find \"$2\" \"${@:3}\" -print -quit)\" || return 0\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a find that cannot read the tree proves nothing about it"
 },
 {
  "id": "packaging.plugin-notices-source-has-text",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ -z \"${ort_text}\" ]; then printf 'no plugin licence text in",
  "replace": "  if false; then printf 'no plugin licence text in",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "an empty licenses/ tree is no notice, and the package would ship the module without one"
 },
 {
  "id": "packaging.plugin-notices-source-provenance-empty",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ -f \"${ort_provenance}\" ] && [ -s \"${ort_provenance}\" ] && [ ! -L \"${ort_provenance}\" ]; then return 0; fi",
  "replace": "  if [ -f \"${ort_provenance}\" ] && [ ! -L \"${ort_provenance}\" ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "an empty provenance.txt names no build of the module"
 },
 {
  "id": "packaging.plugin-notices-source-provenance-link",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ -f \"${ort_provenance}\" ] && [ -s \"${ort_provenance}\" ] && [ ! -L \"${ort_provenance}\" ]; then return 0; fi",
  "replace": "  if [ -f \"${ort_provenance}\" ] && [ -s \"${ort_provenance}\" ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a linked provenance.txt is refused before the notice directory is written"
 },
 {
  "id": "packaging.plugin-notices-source-provenance-file",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ -f \"${ort_provenance}\" ] && [ -s \"${ort_provenance}\" ] && [ ! -L \"${ort_provenance}\" ]; then return 0; fi",
  "replace": "  if [ -s \"${ort_provenance}\" ] && [ ! -L \"${ort_provenance}\" ]; then return 0; fi",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a directory named provenance.txt is no provenance text"
 },
 {
  "id": "packaging.plugin-notices-stage-checks-source",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  _ort_plugin_ep_notice_sources \"${ort_root}\" || return 1\n  _ort_refuse_existing \"${ort_notices}\"",
  "replace": "  _ort_refuse_existing \"${ort_notices}\"",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a root without its texts must refuse before the stage writes anything"
 },
 {
  "id": "packaging.plugin-notices-stage-refuses-existing",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  _ort_refuse_existing \"${ort_notices}\" 'which would mix older texts into the notices' || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "an existing directory would mix older texts into the plugin's notices"
 },
 {
  "id": "packaging.plugin-refuse-existing-entry",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ -e \"$1\" ] || [ -L \"$1\" ]; then\n",
  "replace": "  if [ -L \"$1\" ]; then\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "an existing file or directory is never written over, the wheel's core and an old notice tree alike"
 },
 {
  "id": "packaging.plugin-refuse-existing-link",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ -e \"$1\" ] || [ -L \"$1\" ]; then\n",
  "replace": "  if [ -e \"$1\" ]; then\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a dangling link at the destination is refused by name, not followed by mkdir or cp"
 },
 {
  "id": "packaging.plugin-refuse-existing-status",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "    printf 'refusing to replace %s, %s\\n' \"$1\" \"$2\" >&2\n    return 1\n",
  "replace": "    printf 'refusing to replace %s, %s\\n' \"$1\" \"$2\" >&2\n    return 0\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a refusal that returns 0 prints the fault and still lets the copy run"
 },
 {
  "id": "packaging.plugin-notices-mkdir-status",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  mkdir -p -- \"${ort_notices}\" || return\n",
  "replace": "  mkdir -p -- \"${ort_notices}\"\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a failed mkdir keeps its own status under a conditional caller"
 },
 {
  "id": "packaging.plugin-notices-texts-copy-status",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  cp -a -- \"${ort_root}/licenses\" \"${ort_notices}/licenses\" || return\n",
  "replace": "  cp -a -- \"${ort_root}/licenses\" \"${ort_notices}/licenses\"\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a failed copy of the licence texts keeps its own status"
 },
 {
  "id": "packaging.plugin-notices-provenance-copy-status",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  cp -a -- \"${ort_root}/provenance.txt\" \"${ort_notices}/provenance.txt\" || return\n",
  "replace": "  cp -a -- \"${ort_root}/provenance.txt\" \"${ort_notices}/provenance.txt\"\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a failed copy of provenance.txt keeps its own status"
 },
 {
  "id": "packaging.plugin-notices-stage-proves",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  verify_plugin_ep_notices \"${ort_root}\" \"${ort_notices}\"\n}\n",
  "replace": "  :\n}\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "the stage proves what it copied, so a silent copy cannot pass"
 },
 {
  "id": "packaging.plugin-notices-verify-checks-source",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  fi\n  _ort_plugin_ep_notice_sources \"${ort_root}\" || return 1\n",
  "replace": "  fi\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a package is proved against a root that still has its texts"
 },
 {
  "id": "packaging.plugin-notices-dest-not-linked",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ ! -d \"${ort_notices}\" ] || [ -L \"${ort_notices}\" ] || [ ! -d \"${ort_notices}/licenses\" ] || [ -L \"${ort_notices}/licenses\" ]; then",
  "replace": "  if [ ! -d \"${ort_notices}\" ] || [ ! -d \"${ort_notices}/licenses\" ] || [ -L \"${ort_notices}/licenses\" ]; then",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a linked notice directory is not in the package"
 },
 {
  "id": "packaging.plugin-notices-texts-dir-not-linked",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  if [ ! -d \"${ort_notices}\" ] || [ -L \"${ort_notices}\" ] || [ ! -d \"${ort_notices}/licenses\" ] || [ -L \"${ort_notices}/licenses\" ]; then",
  "replace": "  if [ ! -d \"${ort_notices}\" ] || [ -L \"${ort_notices}\" ] || [ ! -d \"${ort_notices}/licenses\" ]; then",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a linked licenses/ is refused by name, not by diff's view of a link operand"
 },
 {
  "id": "packaging.plugin-notices-provenance-regular",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  _ort_regular_plugin_file \"${ort_notices}/provenance.txt\" 'plugin provenance' || return 1\n",
  "replace": "  :\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a packaged provenance.txt that links to the image's passes cmp but is not in the package"
 },
 {
  "id": "packaging.plugin-notices-no-extra-entry",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  _ort_notice_none 'unexpected entry beside the plugin notices' \"${ort_notices}\" -mindepth 1 -maxdepth 1 ! -name licenses ! -name provenance.txt || return 1\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "an extra entry beside the two would ship texts of something the root does not hold"
 },
 {
  "id": "packaging.plugin-notices-provenance-bytes",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  cmp -s -- \"${ort_root}/provenance.txt\" \"${ort_notices}/provenance.txt\" || {",
  "replace": "  true || {",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a changed provenance.txt names another build of the module"
 },
 {
  "id": "packaging.plugin-notices-texts-exact",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  diff --no-dereference -qr -- \"${ort_root}/licenses\" \"${ort_notices}/licenses\" >&2 && return 0\n",
  "replace": "  return 0\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a changed or missing licence text is not the module's notice"
 },
 {
  "id": "packaging.plugin-notices-texts-not-links",
  "target": "linux/scripts/06-packaging/ort-runtime-bundle.sh",
  "find": "  diff --no-dereference -qr -- \"${ort_root}/licenses\" \"${ort_notices}/licenses\" >&2 && return 0\n",
  "replace": "  diff -qr -- \"${ort_root}/licenses\" \"${ort_notices}/licenses\" >&2 && return 0\n",
  "test": "bash linux/scripts/tests/test-ort-runtime-bundle.sh",
  "why": "a packaged text that links to an identical file passes a following diff but is not in the package"
 },
 {
  "id": "packaging.python-bundle-plugin-notices",
  "target": "linux/scripts/06-packaging/python-app-bundle.sh",
  "find": "  stage_plugin_ep_notices \"$(ort_amdgpu_ep_root)\" \"${BUNDLE}/licenses/onnxruntime-ep-amdgpu\" || err \"could not stage the plugin MIGraphX EP's licence texts and provenance\"\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-python-app-bundle-license.sh",
  "why": "a ROCm Python bundle ships the plugin module, so it ships the module's licence texts and provenance"
 },
 {
  "id": "docs-site.ort-web-generate-feeds-present-back",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "    past = presentNames.map((name) => out[name]);\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "without the present cache fed back each step sees no past, which a real decoder answers wrongly"
 },
 {
  "id": "docs-site.ort-web-generate-eos-stops",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "    if (stopIds.has(next)) { finish = 'stop'; break; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "the end token ends the answer with finish stop, as GenAI does"
 },
 {
  "id": "docs-site.ort-web-generate-tie-lowest-id",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "for (let i = 1; i < row.length; i++) if (row[i] > row[best]) best = i;",
  "replace": "for (let i = 1; i < row.length; i++) if (row[i] >= row[best]) best = i;",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a tie keeps the lowest id, as GenAI's top-1 does"
 },
 {
  "id": "docs-site.ort-web-generate-mask-applied",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "sampleToken(constraint ? maskRow(row, constraint.mask()) : row, sampling, draw)",
  "replace": "sampleToken(row, sampling, draw)",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "without the mask the model's own pick wins, and the schema's one answer never comes"
 },
 {
  "id": "docs-site.ort-web-generate-mask-commits",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "    if (constraint) constraint.commit(next);\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "the grammar must see each drawn id, or its next mask is for the wrong prefix"
 },
 {
  "id": "docs-site.ort-web-generate-mask-empty-fails",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  if (!allowed) throw new TextGenerationError('generation_failed', 'the grammar allows no token of the vocabulary');\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a mask with no token would draw a -Infinity id instead of failing by name"
 },
 {
  "id": "docs-site.ort-web-generate-guide-refusal-named",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  try { return guide(schema); } catch (error) { throw new TextGenerationError('generation_failed', `the grammar compiler refused the schema: ${(error && error.message) || error}`); }",
  "replace": "  return guide(schema);",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a schema the compiler refuses is generation_failed, the contract's name, as GenAI reports it"
 },
 {
  "id": "docs-site.ort-web-generate-constraint-freed",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "    if (constraint && typeof constraint.free === 'function') constraint.free();\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a wasm constraint holds wasm memory until freed, also when the run fails"
 },
 {
  "id": "docs-site.ort-web-loader-check-chat-tool-cases",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "for (const c of chat ? [...fixture.cases, ...(fixture.tool_cases || [])] : fixture.cases)",
  "replace": "for (const c of fixture.cases)",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a chat module brings the tools, so its replay must run the tool cases too"
 },
 {
  "id": "docs-site.ort-web-fixture-verdict-arguments-as-values",
  "target": "linux/scripts/lib/ort-web-fixture-verdict.js",
  "find": "arguments: typeof t.arguments === 'string' ? JSON.parse(t.arguments) : t.arguments",
  "replace": "arguments: t.arguments",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a call's arguments compare as JSON values, so a reader's spacing is no failure"
 },
 {
  "id": "docs-site.ort-web-fixture-verdict-unguided-schema",
  "target": "linux/scripts/lib/ort-web-fixture-verdict.js",
  "find": "if (!guided && isSchemaObject(c.options.json_schema))",
  "replace": "if (isSchemaObject(c.options.json_schema))",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "with a chat module's guide the schema case must decode its answer, not count a refusal"
 },
 {
  "id": "docs-site.ort-web-generate-context-edge",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  if (promptIds.length + budget > spec.context) {",
  "replace": "  if (promptIds.length + budget >= spec.context) {",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a prompt and budget exactly at the context still run"
 },
 {
  "id": "docs-site.ort-web-generate-schema-refused",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "    if (typeof guide !== 'function') throw new TextGenerationError('json_schema_unsupported',",
  "replace": "    if (false) throw new TextGenerationError('json_schema_unsupported',",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a valid schema is refused by name, never silently ignored"
 },
 {
  "id": "docs-site.ort-web-generate-mask-covers-past",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "int64(ort, new Array(total + step.length).fill(1), [1, total + step.length])",
  "replace": "int64(ort, new Array(step.length).fill(1), [1, step.length])",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "the attention mask spans the past and the new tokens"
 },
 {
  "id": "docs-site.ort-web-generate-cancel",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "    if (signal && signal.aborted) { finish = 'cancelled'; break; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a cancel ends the loop with finish cancelled"
 },
 {
  "id": "docs-site.ort-web-generate-deadline",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "    if (now() - started >= deadline) break;\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "max_millis ends the loop with finish length"
 },
 {
  "id": "docs-site.ort-web-generate-max-millis-range",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "!(finite(maxMillis) && maxMillis >= 0)",
  "replace": "!(maxMillis >= -1)",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a negative or NaN max_millis is refused"
 },
 {
  "id": "docs-site.ort-web-generate-positions-continue",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "step.map((_, i) => total + i)",
  "replace": "step.map((_, i) => i)",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "position ids continue after the past"
 },
 {
  "id": "docs-site.ort-web-generate-nan-temperature",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  if (!finite(temperature) || temperature < 0) throw",
  "replace": "  if (temperature < 0) throw",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a NaN temperature is invalid_options, as the fixture says"
 },
 {
  "id": "docs-site.ort-web-generate-check-prompt-ids",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "promptIds: fixture.prompt_ids, options })",
  "replace": "promptIds: fixture.prompt_ids.slice(-1), options })",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "the replay sends the fixture prompt's own ids; the tiny model answers one byte as it answers three, so only the count shows it"
 },
 {
  "id": "docs-site.ort-web-generate-check-oracle-only",
  "target": "linux/scripts/ort-web-loader-check.js",
  "find": "    if (!chat && JSON.stringify(c.messages) !== oracle) {",
  "replace": "    if (!chat && JSON.stringify(c.messages) === oracle) {",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "only the oracle prompt's cases have known ids; skipping them proves nothing"
 },
 {
  "id": "docs-site.ort-web-generate-seed-used",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  const draw = random ?? seededRandom(options.seed ?? Math.floor(Math.random() * SEED_MAX));",
  "replace": "  const draw = random ?? seededRandom(Math.floor(Math.random() * SEED_MAX));",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "the same seed must give the same ids, or no sampled test can repeat"
 },
 {
  "id": "docs-site.ort-web-generate-top-k",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  if (topK > 0) ids = ids.slice(0, topK);\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "top_k keeps only the k highest candidates"
 },
 {
  "id": "docs-site.ort-web-generate-top-p",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "if (mass >= topP) { kept = i + 1; break; }",
  "replace": "if (mass >= 1) { kept = i + 1; break; }",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "top_p keeps the smallest nucleus that reaches its mass"
 },
 {
  "id": "docs-site.ort-web-generate-temperature-divides",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  const weights = ids.map((id) => Math.exp(row[id] / temperature - top));",
  "replace": "  const weights = ids.map((id) => Math.exp(row[id] - top * temperature));",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "the temperature scales every logit, so a low one sharpens the draw"
 },
 {
  "id": "docs-site.ort-web-generate-greedy-at-zero",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  if (temperature === 0) return argmax(row);\n",
  "replace": "  if (temperature === 0) temperature = 1;\n",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "temperature 0 is greedy and ignores top_p, top_k and the seed"
 },
 {
  "id": "docs-site.ort-web-generate-top-p-range",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "topP <= 0 || topP > 1)",
  "replace": "topP < 0 || topP > 1)",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a top_p of 0 keeps nothing and is invalid_options"
 },
 {
  "id": "docs-site.ort-web-generate-seed-range",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "seed >= 0 && seed <= SEED_MAX)",
  "replace": "seed >= 0)",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "GenAI reads the seed as a signed 32-bit integer, so a larger one is refused as there"
 },
 {
  "id": "docs-site.ort-web-generate-stop-ids",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  const stopIds = new Set([...spec.eos, ...(options.stop_token_ids ?? [])]);",
  "replace": "  const stopIds = new Set(spec.eos);",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a stop token id ends the answer like the end token"
 },
 {
  "id": "docs-site.ort-web-generate-stop-string-cut",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "      if (at >= 0) { text = text.slice(0, at); finish = 'stop'; break; }",
  "replace": "      if (at >= 0) { finish = 'stop'; break; }",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "the text ends before the stop string, which is never shown"
 },
 {
  "id": "docs-site.ort-web-generate-stop-needs-decode",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  if (stops.length && typeof decode !== 'function') throw",
  "replace": "  if (false) throw",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "a stop string without a decode could never match, so it is refused instead of dropped"
 },
 {
  "id": "docs-site.ort-web-generate-gpu-kv",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "  if (provider !== 'webgpu') return {};",
  "replace": "  return {};",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "on WebGPU the cache stays on the GPU instead of a copy back each token"
 },
 {
  "id": "docs-site.ort-web-generate-gpu-dispose",
  "target": "shared/web/javascript/ort-web-generate.mjs",
  "find": "    for (const old of past) if (old.location === 'gpu-buffer' && typeof old.dispose === 'function') old.dispose();\n    past = presentNames",
  "replace": "    past = presentNames",
  "test": "bash linux/scripts/tests/test-ort-web-generate.sh",
  "why": "each replaced GPU past is freed, or the GPU memory grows by a cache per token"
 },
 {
  "id": "docs-site.ort-web-llm-gate-arm64-skips",
  "target": "linux/scripts/lib/ort-web-llm-gate.sh",
  "find": "  if [ \"${arch}\" != x86_64 ]; then",
  "replace": "  if [ \"${arch}\" = none ]; then",
  "test": "bash linux/scripts/tests/test-genai-contract-fixture.sh",
  "why": "arm64 hosts and the Pi run the tiny model only"
 },
 {
  "id": "docs-site.ort-web-llm-gate-ci-fails",
  "target": "linux/scripts/lib/ort-web-llm-gate.sh",
  "find": "    if [ -n \"${ci}\" ]; then echo",
  "replace": "    if false; then echo",
  "test": "bash linux/scripts/tests/test-genai-contract-fixture.sh",
  "why": "amd64 CI that lost the model must fail, not skip"
 },
 {
  "id": "docs-site.ort-web-llm-gate-model-dir",
  "target": "linux/scripts/lib/ort-web-llm-gate.sh",
  "find": "  if [ ! -f \"${dir}/genai_config.json\" ]; then",
  "replace": "  if false; then",
  "test": "bash linux/scripts/tests/test-genai-contract-fixture.sh",
  "why": "a directory without genai_config.json is no model to decode"
 },
 {
  "id": "docs-site.genai-contract-fixture-generation-prompt",
  "target": "linux/scripts/lib/genai-contract-fixture.py",
  "find": "add_generation_prompt=True",
  "replace": "add_generation_prompt=False",
  "test": "bash linux/scripts/tests/test-genai-contract-fixture.sh",
  "why": "the contract decodes after the generation prompt"
 },
 {
  "id": "docs-site.genai-contract-fixture-must-contain",
  "target": "linux/scripts/lib/genai-contract-fixture.py",
  "find": "            word = \"contains\" if case[\"must_contain\"] in text else \"FAIL\"",
  "replace": "            word = \"contains\"",
  "test": "bash linux/scripts/tests/test-genai-contract-fixture.sh",
  "why": "other ids pass only when their text holds must_contain"
 },
 {
  "id": "docs-site.genai-contract-fixture-model-cases",
  "target": "linux/scripts/lib/genai-contract-fixture.py",
  "find": "    cases = [c for c in contract.get(\"cases\", []) if c.get(\"model\") == model_dir.name]",
  "replace": "    cases = list(contract.get(\"cases\", []))",
  "test": "bash linux/scripts/tests/test-genai-contract-fixture.sh",
  "why": "a case for another model has other ids"
 },
 {
  "id": "docs-site.await-green-cancelled-is-red",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "      skipped|neutral) green",
  "replace": "      skipped|neutral|cancelled) green",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a cancelled lane proves nothing, so its commit's site must not publish"
 },
 {
  "id": "docs-site.await-green-excludes-own-run",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "[ \"${id}\" = \"${RUN_ID}\" ]",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "the docs run waiting on itself never ends"
 },
 {
  "id": "docs-site.await-green-waits-for-running",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "if [ \"${status}\" != completed ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a lane still running has no verdict yet"
 },
 {
  "id": "docs-site.await-green-timeout",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "if [ \"$(date +%s)\" -ge \"${deadline}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a hung lane must fail the gate, not hold the job to its six-hour limit"
 },
 {
  "id": "docs-site.await-green-push-runs-only",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "&event=push",
  "replace": "",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a workflow_run follow-up of the same commit is not one of its lanes"
 },
 {
  "id": "docs-site.await-green-api-failure-cap",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "if [ \"${api_failures}\" -ge \"${max_api_failures}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "an unreadable run list must fail loudly, not wait out the timeout"
 },
 {
  "id": "docs-site.await-green-reads-tip",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "verdict; check_jobs; check_tip; exit;",
  "replace": "verdict; check_jobs; exit;",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a green commit publishes only while it is still its branch's tip"
 },
 {
  "id": "docs-site.await-green-superseded",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "if [ \"${tip}\" != \"${HEAD_SHA}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "an older commit that finishes last would put its older site back live"
 },
 {
  "id": "docs-site.await-green-tip-read-cap",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "if [ \"${failures}\" -ge \"${max_api_failures}\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "an unreadable branch tip or job list must fail loudly, not retry forever"
 },
 {
  "id": "docs-site.await-green-timeout-whole",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "! [[ \"${TIMEOUT_MINUTES}\" =~ ^[0-9]+$ ]]",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a fractional timeout breaks the arithmetic with an opaque bash error"
 },
 {
  "id": "docs-site.await-green-timeout-floor",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "[ \"${TIMEOUT_MINUTES}\" -lt 1 ]",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a zero timeout gives the lanes no time at all"
 },
 {
  "id": "docs-site.await-green-timeout-ceiling",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "[ \"${TIMEOUT_MINUTES}\" -gt 350 ]",
  "replace": "false",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "over 350 minutes the job's 360-minute limit kills the gate with no run named"
 },
 {
  "id": "docs-site.await-green-jobs-required",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "if ! grep -qxF -- \"${job}\" <<<\"${done_jobs}\"; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a lane run only on request leaves no red run when it did not run, so its absence must withhold the publish"
 },
 {
  "id": "docs-site.await-green-jobs-of-passed-runs-only",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "      skipped|neutral) green=$(( green + 1 )) ;;",
  "replace": "      skipped|neutral) green=$(( green + 1 )); passed+=(\"${id}\") ;;",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a skipped run's jobs prove nothing"
 },
 {
  "id": "docs-site.await-green-jobs-may-be-empty",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "allow_empty=1 api_read jobs",
  "replace": "api_read jobs",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "a successful run whose jobs were all skipped answers nothing, which withholds rather than fails"
 },
 {
  "id": "docs-site.await-green-checks-jobs",
  "target": "linux/scripts/await-green-runs.sh",
  "find": "verdict; check_jobs; check_tip; exit;",
  "replace": "verdict; check_tip; exit;",
  "test": "bash linux/scripts/tests/test-await-green-runs.sh",
  "why": "await-green-jobs that are never read publish a commit whose on-request lane did not run"
 },
 {
  "id": "docs-site.publish-not-withheld",
  "target": ".github/workflows/build-docs.yml",
  "find": "      && needs.await-green.outputs.withheld != 'true'\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-docs-site.sh",
  "why": "a commit whose required lane did not run must leave the live site as it was"
 },
 {
  "id": "quality-report.suppression-in-string-counted",
  "target": "linux/scripts/quality_report_text.py",
  "find": "        return lang_units.strings_masked(text, lang), lang_units.mask(text, lang).split(\"\\n\")",
  "replace": "        return lines, lines",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_only_code_and_comments_count_as_suppressions",
  "why": "a marker in a Rust, Dart or C++ string literal is data, not a suppression"
 },
 {
  "id": "quality-report.rust-attribute-in-comment-counted",
  "target": "linux/scripts/quality_report_text.py",
  "find": "enumerate(code if slug in CODE_FORM else kept, 1)",
  "replace": "enumerate(kept, 1)",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_only_code_and_comments_count_as_suppressions",
  "why": "a commented-out Rust attribute suppresses nothing"
 },
 {
  "id": "quality-report.json-string-counted",
  "target": "linux/scripts/quality_report_text.py",
  "find": "        if rel.endswith(PROSE + DATA) or rel.startswith(VENDORED):",
  "replace": "        if rel.endswith(PROSE) or rel.startswith(VENDORED):",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_only_code_and_comments_count_as_suppressions",
  "why": "a JSON string value is data, not a suppression"
 },
 {
  "id": "quality-report.python-string-counted",
  "target": "linux/scripts/quality_report_text.py",
  "find": "            kept = lang_units.strings_masked(text, \"python\")",
  "replace": "            kept = lines",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_only_code_and_comments_count_as_suppressions",
  "why": "a marker in a Python string or docstring is data, not a suppression"
 },
 {
  "id": "quality-report.shell-comment-dropped",
  "target": "linux/scripts/quality_report_text.py",
  "find": "        kept = code_lines(lines, keep_comments=True)",
  "replace": "        kept = code_lines(lines)",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_only_code_and_comments_count_as_suppressions",
  "why": "a shellcheck directive is a comment and must still count"
 },
 {
  "id": "code-size.shell-comment-not-collected",
  "target": "linux/scripts/verify_code_size.py",
  "find": "                comments.append(line[start:])",
  "replace": "                comments.append(\"\")",
  "test": "bash linux/scripts/tests/test-quality-report.sh -k test_only_code_and_comments_count_as_suppressions",
  "why": "the kept shell view must carry the comment text"
 },
 {
  "id": "scanner-extras.strings-masked-drops-comments",
  "target": "linux/scripts/lang_units.py",
  "find": "        out.append(span if keep_comments and m.lastgroup in COMMENTS else _NOT_BLANK.sub(\" \", span))",
  "replace": "        out.append(_NOT_BLANK.sub(\" \", span))",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "a NOLINT or ignore comment must survive the string mask"
 },
 {
  "id": "scanner-extras.python-strings-masked-drops-comments",
  "target": "linux/scripts/lang_units.py",
  "find": "            if not keep_comments:\n                _blank_span(lines, tok.start, tok.end, \"\")",
  "replace": "            if True:\n                _blank_span(lines, tok.start, tok.end, \"\")",
  "test": "bash linux/scripts/tests/test-lang-units.sh",
  "why": "a Python noqa comment must survive the string mask"
 },
 {
  "id": "lib.llguidance-lock-other-version",
  "target": "shared/upstream/llguidance/check-cargo-lock.py",
  "find": "for other in (v for v in locked if v != version):",
  "replace": "for other in (v for v in locked if False):",
  "test": "bash linux/scripts/tests/test-llguidance-cargo-lock.sh",
  "why": "A pinned crate at its vulnerable version must fail the lock check (CON333)."
 },
 {
  "id": "lib.llguidance-lock-missing-crate",
  "target": "shared/upstream/llguidance/check-cargo-lock.py",
  "find": "        if not locked:",
  "replace": "        if False:",
  "test": "bash linux/scripts/tests/test-llguidance-cargo-lock.sh",
  "why": "A pin that names no locked crate must fail, so a renamed crate cannot pass silently."
 },
 {
  "id": "lib.llguidance-lock-patch-bump",
  "target": "shared/upstream/llguidance/patches/0001-cargo-lock-security-bumps.patch",
  "find": "+version = \"1.0.103\"",
  "replace": "+version = \"1.0.98\"",
  "test": "bash linux/scripts/tests/test-llguidance-cargo-lock.sh",
  "why": "The patched lock must carry the fixed anyhow."
 },
 {
  "id": "lib.llguidance-lock-apply-fatal",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "|| err \"cannot apply llguidance's lock bumps to $1\"",
  "replace": "|| true",
  "test": "bash linux/scripts/tests/test-llguidance-cargo-lock.sh",
  "why": "A lock the patch does not fit must stop the Linux build."
 },
 {
  "id": "lib.llguidance-lock-windows-throw",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "    if ($LASTEXITCODE -ne 0) { throw \"GenAI llguidance: $LlguidanceDir locks a crate its security pin refuses (exit $LASTEXITCODE)\" }",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiGuidance.Tests.ps1",
  "why": "A refused lock must stop the Windows build."
 },
 {
  "id": "consumer-lanes.lint-gates-always",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "need = {\"lint-gates\": \"every repository\", \"code-quality-report\": \"every repository\"}",
  "replace": "need = {\"code-quality-report\": \"every repository\"}",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "every repository runs the lint gates; a tree with no lint-gates call must fail"
 },
 {
  "id": "consumer-lanes.code-quality-report-always",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "need = {\"lint-gates\": \"every repository\", \"code-quality-report\": \"every repository\"}",
  "replace": "need = {\"lint-gates\": \"every repository\"}",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "every repository measures its code; a tree with no code-quality-report call must fail"
 },
 {
  "id": "consumer-lanes.gitmodules-needs-pins",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "    if \".gitmodules\" in tracked:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "a submodule nobody checks can sit on a commit no fresh clone restores"
 },
 {
  "id": "consumer-lanes.lockfile-needs-audit",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "    if locks:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "a lockfile nobody audits takes a new HIGH advisory unseen"
 },
 {
  "id": "consumer-lanes.lockfiles-from-the-audit",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "names & set(lockfile_names())",
  "replace": "names & {\"uv.lock\"}",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "the condition must follow every lockfile security-audit.sh scans, not one"
 },
 {
  "id": "consumer-lanes.python-needs-static",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "    if any(rel.endswith(\".py\") for rel in tracked):\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "tracked Python without the Ruff and ty lane is a gap"
 },
 {
  "id": "consumer-lanes.powershell-needs-quality",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "    if ps:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "tracked PowerShell without PSScriptAnalyzer is a gap"
 },
 {
  "id": "consumer-lanes.psm1-counts",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "ps = [rel for rel in tracked if rel.endswith((\".ps1\", \".psm1\"))]",
  "replace": "ps = [rel for rel in tracked if rel.endswith(\".ps1\")]",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "a module-only PowerShell tree needs the lane as much as a script tree"
 },
 {
  "id": "consumer-lanes.manifest-needs-mutations",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "    if manifests:\n",
  "replace": "    if False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "recipes no lane runs prove nothing"
 },
 {
  "id": "consumer-lanes.hub-only-paths-are-hub-only",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "and not (hub and rel.startswith(HUB_ONLY_MANIFESTS))",
  "replace": "and not rel.startswith(HUB_ONLY_MANIFESTS)",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "a consumer's docs/scripts recipes still need its mutation lane"
 },
 {
  "id": "consumer-lanes.hub-manifests-run-in-preflight",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "and not (hub and rel.startswith(HUB_ONLY_MANIFESTS))",
  "replace": "and True",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k hub",
  "why": "the hub's own recipe lists run in the mutations slug, so they need no lane"
 },
 {
  "id": "consumer-lanes.manifest-in-snippet",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "return [common + [f\"manifest: {rel}\"] for rel in mutation_manifests(tracked, hub)]",
  "replace": "return [common]",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "the printed caller must name the manifest, or it fails the lane it adds"
 },
 {
  "id": "consumer-lanes.hub-checkout-only-without-submodule",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "common = [\"hub-checkout: true\"] if hub_checkout and lane != \"security-audit\" else []",
  "replace": "common = [\"hub-checkout: true\"] if lane != \"security-audit\" else []",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k call",
  "why": "a second hub checkout beside the submodule grades another hub than the pinned one"
 },
 {
  "id": "consumer-lanes.snippet-printed",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "            snippets.append(snippet(lane, tracked, hub, hub_checkout))\n",
  "replace": "            pass\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k rule",
  "why": "the rollout must not go red without the caller to add"
 },
 {
  "id": "consumer-lanes.disabled-job-is-no-call",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "(isinstance(cond, str) and cond.strip() in OFF)",
  "replace": "False",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k call",
  "why": "a job behind if: false never runs, so it calls nothing"
 },
 {
  "id": "consumer-lanes.unreadable-caller-fails",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "                problems.append(f\"{rel}: cannot read a workflow that calls a lane ({exc})\")\n",
  "replace": "                pass\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k call",
  "why": "a lane call the parser cannot read is no proof the lane runs"
 },
 {
  "id": "consumer-lanes.needs-push-and-pull-request",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "good = sorted(name for name, got in found[lane].items() if set(EVENTS) <= got)",
  "replace": "good = sorted(name for name, got in found[lane].items() if got & set(EVENTS))",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k trigger",
  "why": "a lane on push alone leaves every pull request ungated"
 },
 {
  "id": "consumer-lanes.local-calls-inherit-events",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "if kind == \"local\" and target in eff and not eff[name] <= eff[target]:",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k trigger",
  "why": "a reusable workflow of the repo's own runs on its callers' events"
 },
 {
  "id": "consumer-lanes.allow-exempts",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "        if good or lane in allow:\n",
  "replace": "        if good:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k allow",
  "why": "a lane with a reasoned row is exempt"
 },
 {
  "id": "consumer-lanes.allow-called-now-stale",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "        elif any(set(EVENTS) <= got for got in found[lane].values()):\n",
  "replace": "        elif False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k allow",
  "why": "a row whose lane is called now would hide that lane's removal later"
 },
 {
  "id": "consumer-lanes.allow-not-required-stale",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "        if lane not in need:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k allow",
  "why": "a row for a lane the tree no longer needs is dead weight that hides a future gap"
 },
 {
  "id": "consumer-lanes.allow-needs-reason",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "        elif not reason:\n",
  "replace": "        elif False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k allow",
  "why": "an exemption without a reason cannot be reviewed"
 },
 {
  "id": "consumer-lanes.allow-repeat-refused",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "        elif lane in rows:\n",
  "replace": "        elif False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k allow",
  "why": "a repeated row hides a typo in its twin"
 },
 {
  "id": "consumer-lanes.allow-unknown-lane",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "        if lane not in LANES:\n",
  "replace": "        if False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k allow",
  "why": "a misspelt lane exempts nothing and must say so"
 },
 {
  "id": "consumer-lanes.hub-own-file-calls",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "                if f\"{lane}.{ext}\" in eff:\n",
  "replace": "                if False:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k hub",
  "why": "in the hub a lane runs from its own file, on its own events or a local caller's"
 },
 {
  "id": "consumer-lanes.local-lane-file-only-in-hub",
  "target": "linux/scripts/verify_consumer_lanes.py",
  "find": "    if hub:\n        for lane in LANES:\n",
  "replace": "    if True:\n        for lane in LANES:\n",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k hub",
  "why": "a consumer file that shares a lane's name is not the hub's lane"
 },
 {
  "id": "consumer-lanes.consumer-half-grades",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  _lint_gates_hub linux/scripts/verify_consumer_lanes.py || return 1",
  "replace": "  return 0",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k wiring",
  "why": "the consumer half must run the gate and return its verdict"
 },
 {
  "id": "consumer-lanes.consumer-half-registered",
  "target": "linux/scripts/run-lint-gates.sh",
  "find": "  run_gate \"consumer lanes\" _lint_gates_consumer_lanes\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-consumer-lanes.sh -k wiring",
  "why": "a gate function nothing registers never runs in a consumer lane"
 },
 {
  "id": "ort-chain.dnnl-staged-without-its-provider",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/dnnl-runtime.sh",
  "find": "[ -e \"$3/lib/libonnxruntime_providers_dnnl.so\" ] || return 0",
  "replace": "return 0",
  "test": "bash linux/scripts/tests/test-onnx-dnnl-runtime.sh",
  "why": "an output tree with the DNNL EP must get the libdnnl.so.3 it links"
 },
 {
  "id": "ort-chain.dnnl-texts-dropped",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/dnnl-runtime.sh",
  "find": "install -m 0644 \"${texts}/LICENSE\" \"${texts}/THIRD-PARTY-PROGRAMS\" \"$3/\" || return $?",
  "replace": ":",
  "test": "bash linux/scripts/tests/test-onnx-dnnl-runtime.sh",
  "why": "libdnnl.so.3 must never ship without oneDNN's LICENSE and THIRD-PARTY-PROGRAMS"
 },
 {
  "id": "ort-chain.dnnl-link-copied",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/dnnl-runtime.sh",
  "find": "cp -L \"${lib}\" \"$2/libdnnl.so.3\"",
  "replace": "cp -P \"${lib}\" \"$2/libdnnl.so.3\"",
  "test": "bash linux/scripts/tests/test-onnx-dnnl-runtime.sh",
  "why": "the shipped libdnnl.so.3 is the library, not the build tree's link to it"
 },
 {
  "id": "ort-chain.dnnl-wheel-never-repacked",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/dnnl-runtime.sh",
  "find": "sys.exit(0 if \"onnxruntime/capi/libonnxruntime_providers_dnnl.so\" in names",
  "replace": "sys.exit(1 if \"onnxruntime/capi/libonnxruntime_providers_dnnl.so\" in names",
  "test": "bash linux/scripts/tests/test-onnx-dnnl-runtime.sh",
  "why": "a DNNL wheel without libdnnl.so.3 must be repacked with it"
 },
 {
  "id": "ort-chain.dnnl-install-tail-unwired",
  "target": "linux/scripts/03-media/build/onnxruntime/build/lib/common.sh",
  "find": "  stage_onnx_dnnl_runtime \"${build_dir}\" \"${build_config}\" \"${output_dir}\" || return $?\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-onnx-dnnl-runtime.sh",
  "why": "the native install tail must stage libdnnl.so.3 beside the provider"
 },
 {
  "id": "ort-chain.dnnl-gil-wheel-unwired",
  "target": "linux/scripts/03-media/build/onnxruntime/build/30-build-native.sh",
  "find": "add_onnx_dnnl_runtime_to_wheels \"${NATIVE_CPU_BUILD_DIR}/${NATIVE_CPU_CONFIG}/dist\"",
  "replace": "true \"${NATIVE_CPU_BUILD_DIR}/${NATIVE_CPU_CONFIG}/dist\"",
  "test": "bash linux/scripts/tests/test-onnx-dnnl-runtime.sh",
  "why": "the GIL DNNL wheel must carry libdnnl.so.3 before it is collected"
 },
 {
  "id": "lib.ort-cpu-ep-dnnl-flag",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "return @('-Donnxruntime_USE_XNNPACK=ON', '-Donnxruntime_USE_DNNL=ON')",
  "replace": "return @('-Donnxruntime_USE_XNNPACK=ON')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "winamd64 would ship ORT without the DNNL EP again"
 },
 {
  "id": "lib.ort-cpu-ep-amd64-only",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($Arch -ne 'amd64') { return @() }",
  "replace": "if ($false) { return @() }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the arm64 bundle would configure oneDNN and XNNPACK, neither proven there"
 },
 {
  "id": "lib.ort-cpu-ep-configure-line",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": ") + $gpuArgs + $kleidiArgs + $ltoArgs + $cpuEpArgs",
  "replace": ") + $gpuArgs + $kleidiArgs + $ltoArgs",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the EP args would be computed and never reach configure"
 },
 {
  "id": "lib.ort-cpu-ep-configure-gate",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($cpuEpCfg.Count -gt 0) { throw",
  "replace": "if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "ORT dropping an EP at configure would surface only in the smoke, hours later"
 },
 {
  "id": "lib.ort-cpu-ep-cache-value",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($got -ne $Want[$k]) {",
  "replace": "if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "a CMakeCache switch left OFF would pass the CPU EP and WebGPU gates"
 },
 {
  "id": "lib.ort-dnnl-stage-call",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "    if ($cpuEpArgs -contains '-Donnxruntime_USE_DNNL=ON') { Install-OrtDnnlRuntime -BuildDir $buildDir -OrtInstallDir $ortInstallDir -Pin $dnnlPin }\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "onnxruntime_providers_dnnl.dll would ship without the dnnl.dll it imports"
 },
 {
  "id": "lib.ort-dnnl-provider-required",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if (-not (Test-Path -LiteralPath $provider -PathType Leaf)) { throw \"DNNL EP:",
  "replace": "if ($false) { throw \"DNNL EP:",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "a build without the provider DLL would stage oneDNN for nothing"
 },
 {
  "id": "lib.ort-dnnl-one-dll",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($dll.Count -ne 1) { throw \"DNNL EP: expected one dnnl.dll",
  "replace": "if ($dll.Count -lt 1) { throw \"DNNL EP: expected one dnnl.dll",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "two dnnl.dll builds would ship whichever the walk met first"
 },
 {
  "id": "lib.ort-dnnl-https-origin",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($url -notmatch '^https://') {",
  "replace": "if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the provenance manifest would record an origin a reader cannot fetch"
 },
 {
  "id": "lib.ort-dnnl-wheel-hash",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "elseif ((Get-WheelEntryHash -Entry $dll) -ne (Get-FileHash -LiteralPath $DnnlDll -Algorithm SHA256).Hash) {",
  "replace": "elseif ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the wheel could pack a dnnl.dll other than the one the image ships"
 },
 {
  "id": "lib.ort-dnnl-wheel-notice",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if (-not $text.Contains((Get-OrtDnnlNoticeTitle))) {",
  "replace": "if ($false) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "a wheel copied out of the image would carry oneDNN without its licence"
 },
 {
  "id": "lib.ort-dnnl-wheel-gate-throws",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($dnnlFindings.Count -gt 0) { throw",
  "replace": "if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the wheel findings would be computed and ignored"
 },
 {
  "id": "smoke.ort-cpu-ep-both",
  "target": "windows/scripts/build/Test-Container.ps1",
  "find": "foreach ($provider in 'XnnpackExecutionProvider', 'DnnlExecutionProvider')",
  "replace": "foreach ($provider in 'XnnpackExecutionProvider')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the image smoke would stop proving the DNNL EP loads"
 },
 {
  "id": "smoke.ort-cpu-ep-session",
  "target": "windows/scripts/modules/WindowsOrtDmlCheck.Common.psm1",
  "find": "registered = int('$Provider' in session.get_providers())",
  "replace": "registered = int('$Provider' in ort.get_available_providers())",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "a listed provider whose DLL fails to load would read as registered"
 },
 {
  "id": "lib.ort-dnnl-pin-commit",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($source.Revision -cne $Pin.Commit -or $source.Version -cne $Pin.Version) {",
  "replace": "if ($source.Version -cne $Pin.Version) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "ORT would ship a oneDNN cloned at a commit versions.env never pinned"
 },
 {
  "id": "lib.ort-dnnl-pin-tag",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($source.Revision -cne $Pin.Commit -or $source.Version -cne $Pin.Version) {",
  "replace": "if ($source.Revision -cne $Pin.Commit) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the provenance would record a tag versions.env does not pin"
 },
 {
  "id": "lib.ort-dnnl-pin-commit-shape",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($commit -cnotmatch '^[0-9a-f]{40}$') { throw",
  "replace": "if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "an empty or placeholder commit would reach the hour-long build and fail only after it"
 },
 {
  "id": "lib.ort-dnnl-pin-tag-shape",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($tag -cnotmatch '^v\\d+\\.\\d+(\\.\\d+)?$') { throw",
  "replace": "if ($false) { throw",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "a stage solved without the tag would build before refusing"
 },
 {
  "id": "lib.ort-dnnl-cmake-tag",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "if ($tags.Count -ne 1 -or $tags[0] -cne $Pin.Version) {",
  "replace": "if ($tags.Count -ne 1) {",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "an ORT bump that moves DNNL_TAG would build an unpinned oneDNN first"
 },
 {
  "id": "lib.ort-dnnl-pin-plan",
  "target": "windows/scripts/build/Build-OnnxFromSource.ps1",
  "find": "    if ($cpuEpArgs -contains '-Donnxruntime_USE_DNNL=ON') {\n        $dnnlPin = Get-OrtDnnlPin",
  "replace": "    if ($false) {\n        $dnnlPin = Get-OrtDnnlPin",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the pin would never be read, so the staging check would get none"
 },
 {
  "id": "lib.ort-dnnl-pin-forward",
  "target": "windows/scripts/modules/WindowsBuildDriver.Common.psm1",
  "find": "        # The oneDNN the amd64 DNNL EP clones, checked in the ORT RUN.\n        'ORT_DNNL_WINDOWS_VERSION', 'ORT_DNNL_WINDOWS_COMMIT',\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the driver would build the ORT stage without the oneDNN pin"
 },
 {
  "id": "lib.ort-dnnl-pin-stage-env",
  "target": "windows/Dockerfile.media-builder",
  "find": "    ORT_DNNL_WINDOWS_VERSION=\"${ORT_DNNL_WINDOWS_VERSION}\" `\n",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.OrtCpuEp.Tests.ps1",
  "why": "the ORT RUN would never see the oneDNN tag the driver forwards"
 },
 {
  "id": "lib.ort-payload-dnnl-stage",
  "target": "windows/scripts/modules/WindowsOrtPayload.Common.psm1",
  "find": "if ($dnnl) { $source[$script:DnnlProvider] = $dnnl.Provider; $source['dnnl.dll'] = $dnnl.Dll }",
  "replace": "if ($false) { $source[$script:DnnlProvider] = $dnnl.Provider; $source['dnnl.dll'] = $dnnl.Dll }",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only OrtPayload.Dnnl.Tests.ps1",
  "why": "a default staging would leave the DNNL EP behind"
 },
 {
  "id": "lib.ort-payload-dnnl-dll-required",
  "target": "windows/scripts/modules/WindowsOrtPayload.Common.psm1",
  "find": "if (-not $dll) { throw \"$($Layout.Root) has $script:DnnlProvider",
  "replace": "if ($false) { throw \"$($Layout.Root) has $script:DnnlProvider",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only OrtPayload.Dnnl.Tests.ps1",
  "why": "a provider without dnnl.dll would stage and fail to load"
 },
 {
  "id": "lib.ort-payload-dnnl-notice-required",
  "target": "windows/scripts/modules/WindowsOrtPayload.Common.psm1",
  "find": "if ($absent) { throw \"$($Layout.Root) has dnnl.dll",
  "replace": "if ($false) { throw \"$($Layout.Root) has dnnl.dll",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only OrtPayload.Dnnl.Tests.ps1",
  "why": "dnnl.dll would ship without oneDNN's licence"
 },
 {
  "id": "lib.ort-payload-dnnl-notice-copy",
  "target": "windows/scripts/modules/WindowsOrtPayload.Common.psm1",
  "find": "    if ($dnnl) {\n        $licenses = Join-Path $Destination licenses onednn",
  "replace": "    if ($false) {\n        $licenses = Join-Path $Destination licenses onednn",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only OrtPayload.Dnnl.Tests.ps1",
  "why": "the staged dnnl.dll would ship without its texts"
 },
 {
  "id": "flet-build.patch-match-once",
  "target": "linux/scripts/06-packaging/flet-build-toolchain.py",
  "find": "if n != 1:",
  "replace": "if n > 1:",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "a template rule that no longer matches would ship Flet's AGP 8, which Flutter 3.50's Gradle plugin cannot load"
 },
 {
  "id": "flet-build.patch-missing-file",
  "target": "linux/scripts/06-packaging/flet-build-toolchain.py",
  "find": "return f\"the template has no {', '.join(missing)}\" if missing else \"\"",
  "replace": "return \"\"",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "a template that moved a patched file would render unpatched and fetch Gradle and an NDK at build time"
 },
 {
  "id": "flet-build.pin-ndk",
  "target": "linux/scripts/06-packaging/flet-build-toolchain.py",
  "find": "f'            android.ndkVersion = \"{ndk}\"\\n'",
  "replace": "f'            android.ndkVersion = flutter.ndkVersion\\n'",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "Flutter's default NDK is not the image's, so AGP tries to install it into the read-only SDK"
 },
 {
  "id": "flet-build.skip-seeded-downloads",
  "target": "linux/scripts/06-packaging/flet-build-toolchain.py",
  "find": "name.startsWith(\"downloadDistArchive_\") || ",
  "replace": "",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "serious_python's ETag check needs the network even when the seeded CPython tarball is there"
 },
 {
  "id": "flet-build.pyo3-needs-libpython",
  "target": "linux/scripts/06-packaging/flet-build-toolchain.py",
  "find": "if not lib.is_file():",
  "replace": "if False:",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "a PyO3 config naming a missing libpython fails only at the consumer's link step"
 },
 {
  "id": "flet-build.apk-carries-every-abi",
  "target": "linux/scripts/06-packaging/flet-build-toolchain.py",
  "find": "    if missing:\n        sys.exit(f\"[flet-build] ERROR: {args.apk} lacks",
  "replace": "    if False:\n        sys.exit(f\"[flet-build] ERROR: {args.apk} lacks",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "a warm build that dropped an ABI would still pass as proof that both build"
 },
 {
  "id": "flet-build.shim-flutter-version",
  "target": "linux/scripts/06-packaging/flet-build-shim.py",
  "find": "flet.version.flutter_version = config[\"flutter_version\"]",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "Flet then rejects Flutter 3.50 and installs its own 3.47 SDK"
 },
 {
  "id": "flet-build.shim-jdk-major",
  "target": "linux/scripts/06-packaging/flet-build-shim.py",
  "find": "jdk.JDK_MAJOR_VER = int(config[\"jdk_major\"])",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "Flet then rejects JDK 21 and downloads Temurin 17"
 },
 {
  "id": "flet-build.shim-sdk-packages",
  "target": "linux/scripts/06-packaging/flet-build-shim.py",
  "find": "f\"platforms;android-{config['compile_sdk']}\",",
  "replace": "\"platforms;android-35\",",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "Flet then runs sdkmanager for API 35 against the read-only SDK"
 },
 {
  "id": "flet-build.shim-offline-pub",
  "target": "linux/scripts/06-packaging/flet-build-shim.py",
  "find": "_run(self, [self.flutter_exe, \"pub\", \"get\", \"--offline\"], cwd, env, capture_output)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "serious_python's dart run resolves the shell's packages online even with a warm pub cache"
 },
 {
  "id": "flet-build.shim-wheelhouse",
  "target": "linux/scripts/06-packaging/flet-build-shim.py",
  "find": "os.environ.setdefault(\"PIP_FIND_LINKS\", wheels)",
  "replace": "pass",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "without the wheelhouse serious_python's pip needs PyPI for flet's own Android wheels"
 },
 {
  "id": "flet-build.arm64-off",
  "target": "linux/scripts/06-packaging/install-flet-build.sh",
  "find": "if [ \"$1\" != amd64 ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "arm64 ships no Android SDK, so it must record why there is no Flet build instead of failing"
 },
 {
  "id": "flet-build.payload-off",
  "target": "linux/scripts/06-packaging/install-flet-build.sh",
  "find": "if [ -f \"${ANDROID_PAYLOAD_DIR}/.android-payload-off\" ]; then",
  "replace": "if false; then",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "an image without the SDK must say so rather than seed caches nothing can use"
 },
 {
  "id": "flet-build.seed-armeabi",
  "target": "linux/scripts/06-packaging/install-flet-build.sh",
  "find": "for abi in \"${FB_SEED_ABIS[@]}\"; do",
  "replace": "for abi in \"${FB_ABIS[@]}\"; do",
  "test": "bash linux/scripts/tests/test-flet-build.sh",
  "why": "serious_python's Gradle unpacks every manifest ABI, so an unseeded armeabi-v7a tarball needs the network"
 },
 {
  "id": "docs-site.endpoint-generate-acts-stays-home",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "    const { acts, ...wire } = tool;\n    return wire;",
  "replace": "    return tool;",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "the family's acts flag is a consent bit, never sent to the server"
 },
 {
  "id": "docs-site.endpoint-generate-tool-answers-a-call",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "      if (!asked.has(m.tool_call_id)) throw invalid(",
  "replace": "      if (false) throw invalid(",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "a tool message that answers no earlier call is refused before any request"
 },
 {
  "id": "docs-site.endpoint-generate-deltas-join-by-index",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "        const index = Number.isInteger(part.index) ? part.index : position;",
  "replace": "        const index = position;",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "interleaved call deltas join by their index, not their place in the delta"
 },
 {
  "id": "docs-site.endpoint-generate-calls-keep-order",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "  return [...slots.keys()].sort((a, b) => a - b).map(",
  "replace": "  return [...slots.keys()].sort((a, b) => b - a).map(",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "parallel calls keep the server's order"
 },
 {
  "id": "docs-site.endpoint-generate-nameless-call-fails",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "    if (!slot.name) throw failed(",
  "replace": "    if (false) throw failed(",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "a call without a name fails the answer instead of running nothing"
 },
 {
  "id": "docs-site.endpoint-generate-nothing-after-done",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "    if (this.done) return pieces;",
  "replace": "    if (false) return pieces;",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "a line after [DONE] is not read"
 },
 {
  "id": "docs-site.endpoint-generate-error-chunk-fails",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "  if (value.error !== undefined && value.error !== null) throw failed(",
  "replace": "  if (false) throw failed(",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "any non-null error fails the answer (owner D8)"
 },
 {
  "id": "docs-site.endpoint-generate-either-thinking-name",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "  return [part.reasoning_content, part.reasoning].find(",
  "replace": "  return [part.reasoning_content].find(",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "reasoning arrives under either name, apart from the text"
 },
 {
  "id": "docs-site.endpoint-generate-finish-reason-mapped",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "  return raw === 'length' || raw === 'tool_calls' ? raw : 'stop';",
  "replace": "  return raw;",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "a raw finish beyond length and tool_calls ends as stop, the raw value kept beside it"
 },
 {
  "id": "docs-site.endpoint-generate-cancel-wins",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "  if (cut === 'cancelled') finish = 'cancelled';",
  "replace": "  if (false) finish = 'cancelled';",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "an aborted signal ends the answer with cancelled and what arrived"
 },
 {
  "id": "docs-site.endpoint-generate-budget-ends-as-length",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "  else if (cut === 'length') finish = 'length';",
  "replace": "  else if (false) finish = 'length';",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "max_millis ends an unfinished answer with length, as GenAI does"
 },
 {
  "id": "docs-site.endpoint-generate-timeout-named",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "    if (cut === 'timeout') throw new TextGenerationError('endpoint_timed_out',",
  "replace": "    if (cut === 'timeout') throw new TextGenerationError('endpoint_unreachable',",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "a server silent past the request timeout is endpoint_timed_out"
 },
 {
  "id": "docs-site.endpoint-generate-status-refused",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "    if (!response.ok) {",
  "replace": "    if (false) {",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "an HTTP error is endpoint_status with its status, not an unreadable answer"
 },
 {
  "id": "docs-site.endpoint-generate-options-checked",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "  checkRequest({ context: Infinity }, [0], options, { decode: String, guide: () => null });\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "the contract's option checks refuse before any request"
 },
 {
  "id": "docs-site.endpoint-generate-lines-span-reads",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "      if (rest) { parts.push(rest); size += rest.length; }\n",
  "replace": "",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "a line split across network reads is joined before it is read"
 },
 {
  "id": "docs-site.endpoint-generate-long-line-refused",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "    if (line.length > STREAM_LINE_LIMIT) throw",
  "replace": "    if (false) throw",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "an endless line is stream_line_too_long, not a buffer that grows"
 },
 {
  "id": "docs-site.endpoint-generate-greedy-sends-no-knobs",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "  if (body.temperature > 0) {",
  "replace": "  if (true) {",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "greedy sends no sampling knobs a strict server could refuse"
 },
 {
  "id": "docs-site.endpoint-generate-usage-or-pieces",
  "target": "shared/web/javascript/endpoint-generate.mjs",
  "find": "  const [prompt, completion] = read.usage ?? [0, pieces];",
  "replace": "  const [prompt, completion] = read.usage ?? [0, 0];",
  "test": "bash linux/scripts/tests/test-endpoint-generate.sh",
  "why": "without usage the completion count is the pieces read, as natively"
 },
 {
  "id": "gate-fixture.harness-node-case-own-line",
  "target": "linux/scripts/tests/test-harness.sh",
  "find": "    t_assert_contains $'\\n'\"${out}\"$'\\n' $'\\n'\"ok ${name}\"$'\\n'\n",
  "replace": "    t_assert_contains \"${out}\" \"ok ${name}\"\n",
  "test": "bash linux/scripts/tests/test-harness-guards.sh",
  "why": "a failed case passes when a longer case name starting with it printed ok (stream beside streamed)"
 },
 {
  "id": "lib.genai-artifact-llguidance-crate-licences",
  "target": "linux/scripts/03-media/runtime/verify-media-artifacts.sh",
  "find": "verify_file_exists \"${PREFIX}/licenses/onnxruntime-genai/llguidance-crates/manifest.json\" \"llguidance crate licence manifest\" || true",
  "replace": "true",
  "test": "bash linux/scripts/tests/test-genai-artifact-gate.sh",
  "why": "a GenAI root with a static llguidance but none of its crates' texts ships, and a consumer copies an incomplete notice set (CON327)"
 },
 {
  "id": "lib.genai-llguidance-crates-fetch",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "(cd \"$1\" && CARGO_HOME=\"${home}\" \"${GENAI_CARGO:-cargo}\" fetch --locked)",
  "replace": "(cd \"$1\" && CARGO_HOME=\"${home}\" true)",
  "test": "bash linux/scripts/tests/test-llguidance-cargo-lock.sh",
  "why": "the build downloads only what it compiles, so without the fetch cargo metadata --offline fails on the crates it skipped"
 },
 {
  "id": "lib.genai-llguidance-crates-fatal",
  "target": "linux/scripts/03-media/build/onnxruntime/build/60-build-genai.sh",
  "find": "    || failed=\"cannot stage the licence texts of llguidance's crates from $1 into ${dest}\"",
  "replace": "    || true",
  "test": "bash linux/scripts/tests/test-llguidance-cargo-lock.sh",
  "why": "a crate without a licence text or with an unreviewed AND expression must stop the GenAI stage, not ship a partial inventory"
 },
 {
  "id": "lib.genai-win-llguidance-crates-fatal",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "    if ($LASTEXITCODE -ne 0) { throw \"GenAI llguidance: cannot stage its crates' licence texts into $dest (exit $LASTEXITCODE)\" }",
  "replace": "",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiLicense.Tests.ps1",
  "why": "the Windows GenAI root would ship without its llguidance crate texts while the stage stays green"
 },
 {
  "id": "lib.genai-win-llguidance-crates-policy",
  "target": "windows/scripts/build/Build-OnnxGenaiFromSource.ps1",
  "find": "--policy (Join-Path $UpstreamDir 'crate-license-policy.json')",
  "replace": "--policy (Join-Path $UpstreamDir 'security-pins.txt')",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only SourceBuild.GenaiLicense.Tests.ps1",
  "why": "unicode-ident's AND expression is reviewed only in the upstream crate-license-policy.json"
 },
 {
  "id": "lib.sccache-buster-ignores-contents",
  "target": "linux/scripts/01-core/sccache-module-buster.sh",
  "find": "xargs -0 -r sha256sum \\",
  "replace": "xargs -0 -r sh -c 'printf \"%s  %s\\n\" 0 \"$1\"' _ \\",
  "test": "bash linux/scripts/tests/test-sccache-module-buster.sh",
  "why": "an edited module interface must change the cache key, or an importer can take an object built against the old BMI"
 },
 {
  "id": "lib.sccache-buster-counts-build-dirs",
  "target": "linux/scripts/01-core/sccache-module-buster.sh",
  "find": "-name 'build*' \\)",
  "replace": "-name 'nobuild*' \\)",
  "test": "bash linux/scripts/tests/test-sccache-module-buster.sh",
  "why": "a build tree's generated interfaces must not change the key of the source tree that builds them"
 },
 {
  "id": "lib.sccache-buster-ps-counts-build-dirs",
  "target": "windows/scripts/modules/WindowsModuleCacheKey.Common.psm1",
  "find": "$_ -like 'build*'",
  "replace": "$_ -like 'nobuild*'",
  "test": "pwsh -NoProfile -File windows/scripts/tests/Invoke-HarnessSuite.ps1 -Only ModuleCacheKey.Tests.ps1",
  "why": "the Windows key must skip build directories as the Linux key does"
 },
 {
  "id": "lib.sccache-evict-read-refreshes-age",
  "target": "linux/sccache-s3/sccache-s3-evict",
  "find": "if (r[$3] > t) { t = r[$3]; s = \"r\" }",
  "replace": "if (0) { t = r[$3]; s = \"r\" }",
  "test": "bash linux/scripts/tests/test-sccache-evict.sh",
  "why": "a hit never changes LastModified, so without the read the most used objects go first once they are old"
 },
 {
  "id": "lib.sccache-evict-journal-shows-ansi",
  "target": "linux/sccache-s3/sccache-s3-evict",
  "find": "-o short-iso -a -q",
  "replace": "-o short-iso -q",
  "test": "bash linux/scripts/tests/test-sccache-evict.sh",
  "why": "journalctl prints Garage's coloured lines as blob data, no read is ever recorded and eviction silently falls back to upload order"
 },
 {
  "id": "lib.sccache-evict-empty-reads-by-filename",
  "target": "linux/sccache-s3/sccache-s3-evict",
  "find": "FILENAME == ARGV[1] {",
  "replace": "NR == FNR {",
  "test": "bash linux/scripts/tests/test-sccache-evict.sh",
  "why": "with no reads recorded the listing is taken for the reads, nothing is aged and the bucket is never cut"
 },
 {
  "id": "lib.sccache-evict-keeps-survivor-reads",
  "target": "linux/sccache-s3/sccache-s3-evict",
  "find": "  $4 == \"r\" { print $1, $3 > kept }",
  "replace": "  0 { print $1, $3 > kept }",
  "test": "bash linux/scripts/tests/test-sccache-evict.sh",
  "why": "each eviction forgets every read, so an object read before it goes next time by its upload date"
 },
 {
  "id": "lib.sccache-evict-alert-rate-limit",
  "target": "linux/sccache-s3/sccache-s3-evict",
  "find": "-ge $(( ${ALERT_EVERY_H:-6} * 3600 ))",
  "replace": "-ge 0",
  "test": "bash linux/scripts/tests/test-sccache-evict.sh",
  "why": "a disk under MIN_FREE_GB would send an alert every 10 minutes until it is ignored"
 }
]
