{
  "article_slug": "weighted-terrain-pathfinding-in-godot",
  "artifact": "Standalone Godot weighted-terrain pathfinding correctness proof",
  "checks": [
    {
      "id": "uniform_cost_prefers_shortest_route",
      "observed": {
        "cell_count": 5,
        "cost": 4.0,
        "path": [
          "(0, 1)",
          "(1, 1)",
          "(2, 1)",
          "(3, 1)",
          "(4, 1)"
        ]
      },
      "passed": true
    },
    {
      "id": "expensive_direct_cells_choose_longer_lower_total_cost_route",
      "observed": {
        "direct_route_cost": 23.0,
        "expensive_cell": "(2, 1)",
        "path": [
          "(0, 1)",
          "(1, 1)",
          "(1, 0)",
          "(2, 0)",
          "(3, 0)",
          "(4, 0)",
          "(4, 1)"
        ],
        "returned_cost": 6.0
      },
      "passed": true
    },
    {
      "id": "destination_cell_weight_is_charged",
      "observed": {
        "actual_cost": 5.0,
        "entered_weights": [
          2.0,
          3.0
        ],
        "expected_cost": 5.0
      },
      "passed": true
    },
    {
      "id": "start_cell_weight_is_not_charged",
      "observed": {
        "actual_cost": 1.0,
        "destination_weight": 1.0,
        "start_weight": 9.0
      },
      "passed": true
    },
    {
      "id": "returned_route_cost_matches_entered_cell_sum",
      "observed": {
        "actual_cost": 9.0,
        "entered_weights": [
          2.0,
          4.0,
          3.0
        ],
        "expected_cost": 9.0
      },
      "passed": true
    },
    {
      "id": "weight_change_applies_without_update",
      "observed": {
        "after": [
          "(0, 1)",
          "(1, 1)",
          "(1, 0)",
          "(2, 0)",
          "(3, 0)",
          "(4, 0)",
          "(4, 1)"
        ],
        "before": [
          "(0, 1)",
          "(1, 1)",
          "(2, 1)",
          "(3, 1)",
          "(4, 1)"
        ],
        "dirty": false
      },
      "passed": true
    },
    {
      "id": "jumping_enabled_ignores_weight_scale",
      "observed": {
        "expensive_cell_on_skipped_segment": "(2, 1)",
        "path": [
          "(0, 1)",
          "(4, 1)"
        ],
        "weight": 20.0
      },
      "passed": true
    },
    {
      "id": "discounted_weights_can_make_default_estimate_non_optimal",
      "observed": {
        "known_cheaper_route_cost": 2.25,
        "path": [
          "(0, 0)",
          "(1, 0)",
          "(2, 0)",
          "(3, 0)",
          "(4, 0)"
        ],
        "returned_cost": 4.0
      },
      "passed": true
    },
    {
      "id": "zero_estimate_restores_discounted_route_optimality",
      "observed": {
        "cost": 2.25,
        "minimum_weight_scale": 0.0,
        "path": [
          "(0, 0)",
          "(0, 1)",
          "(1, 1)",
          "(2, 1)",
          "(3, 1)",
          "(4, 1)",
          "(4, 0)"
        ]
      },
      "passed": true
    },
    {
      "id": "minimum_weight_scaled_estimate_restores_optimality",
      "observed": {
        "cost": 2.25,
        "minimum_weight_scale": 0.25,
        "path": [
          "(0, 0)",
          "(0, 1)",
          "(1, 1)",
          "(2, 1)",
          "(3, 1)",
          "(4, 1)",
          "(4, 0)"
        ]
      },
      "passed": true
    },
    {
      "id": "gdscript_estimate_override_is_called",
      "observed": {
        "compute": 13,
        "estimate": 11
      },
      "passed": true
    },
    {
      "id": "gdscript_compute_override_is_called",
      "observed": {
        "compute": 13,
        "estimate": 11
      },
      "passed": true
    },
    {
      "id": "diagonal_always_can_cut_a_solid_corner",
      "observed": {
        "path": [
          "(0, 0)",
          "(1, 1)"
        ],
        "solid_side_cells": [
          "(1, 0)",
          "(0, 1)"
        ]
      },
      "passed": true
    },
    {
      "id": "diagonal_only_if_no_obstacles_blocks_corner_cutting",
      "observed": {
        "path": [],
        "solid_side_cells": [
          "(1, 0)",
          "(0, 1)"
        ]
      },
      "passed": true
    },
    {
      "id": "diagonal_cost_charges_only_the_destination_weight",
      "observed": {
        "actual_cost": 2.82842707633972,
        "destination_weight": 2.0,
        "expected_cost": 2.82842712474619,
        "path": [
          "(0, 0)",
          "(1, 1)"
        ],
        "side_cell_weights": [
          9.0,
          9.0
        ]
      },
      "passed": true
    },
    {
      "id": "profile_specific_weights_choose_different_routes",
      "observed": {
        "mud_averse_profile_path": [
          "(0, 1)",
          "(1, 1)",
          "(1, 0)",
          "(2, 0)",
          "(3, 0)",
          "(4, 0)",
          "(4, 1)"
        ],
        "shared_cost_profile_path": [
          "(0, 1)",
          "(1, 1)",
          "(2, 1)",
          "(3, 1)",
          "(4, 1)"
        ]
      },
      "passed": true
    },
    {
      "id": "extracted_package_reruns_cleanly",
      "passed": true,
      "observed": {
        "extracted_logic_check_count": 16,
        "check_ids_match_workspace": true,
        "scene_smoke_passed": true,
        "engine": "4.7-stable (official)"
      }
    }
  ],
  "counterexample": {
    "built_in_manhattan_returned_cost": 4.0,
    "discounted_row_weight": 0.25,
    "goal": "(4, 0)",
    "region": "5x2",
    "start": "(0, 0)",
    "zero_or_scaled_estimate_optimal_cost": 2.25
  },
  "engine": {
    "build": "official",
    "hash": "5b4e0cb0fd279832bbdd69fed5354d4e5ad26f88",
    "hex": 263936,
    "major": 4,
    "minor": 7,
    "patch": 0,
    "status": "stable",
    "string": "4.7-stable (official)",
    "timestamp": 0
  },
  "failed": [],
  "failed_count": 0,
  "measurement_scope": "Deterministic correctness verification only. No search-time, throughput, allocation, or memory claim.",
  "passed": true,
  "passed_count": 17,
  "path_contract": {
    "cost_semantics": "Each step charges compute_cost(from, destination) multiplied by the destination cell weight; the starting cell is not charged.",
    "diagonals": "Diagonal modes inspect adjacent solid cells; adjacent expensive-but-walkable cells are not charged unless entered.",
    "discounts": "Weights below 1.0 require an admissible scaled estimate or a zero estimate for Dijkstra-style search.",
    "profiles": "AStarGrid2D has one native point-weight layer per grid; stable profiles use separate prepared grids in this proof.",
    "safe_baseline": "Four-way Manhattan movement, jumping disabled, cheapest authored terrain weight 1.0, expensive terrain above 1.0."
  },
  "proof_boundary": {
    "not_verified": "TileSet authoring UX, influence-map generation, tactical AP transactions, multi-cell footprint transitions, and production performance.",
    "product_scope": "The standalone source demonstrates public Godot behavior. Private PathForge tests are supporting product evidence, not part of this package.",
    "verified_here": "Built-in AStarGrid2D weight semantics, exact route-cost reconstruction, JPS interaction, GDScript cost/estimate overrides, one discounted-road counterexample, diagonal point-agent corner policy, and stable profile-specific grids."
  },
  "scene_smoke": {
    "passed": true,
    "report": {
      "corrected_discount_route_cost": 2.25,
      "default_discount_route_cost": 4.0,
      "diagonal_always_cuts_corner": true,
      "diagonal_strict_blocks_corner": true,
      "discount_counterexample_visible": true,
      "safe_route_avoids_expensive_cell": true,
      "safe_route_cost": 6.0
    }
  },
  "verified_at": "2026-07-14T07:57:47",
  "published_files": {
    "source_zip": {
      "path": "/downloads/pathforge/weighted-terrain-pathfinding-in-godot-source.zip",
      "bytes": 9531,
      "sha256": "d7abad3952b97987a0432b2e277b78a2e8a52dfbf1368e2207ccb9e96778bf9c"
    },
    "helper_source": {
      "path_in_zip": "scripts/articles/weighted_terrain_pathfinder.gd",
      "sha256": "0feffd87aea40fc1fc449420be2f0b6985d7154aa395e0c9a1e9069a930cada2"
    },
    "demo_source": {
      "path_in_zip": "scripts/articles/weighted_terrain_pathfinding_demo.gd",
      "sha256": "624aaaba30d8bf16708c44c1f6514304aa4db1a8fd577f0f34d39a727693a11f"
    },
    "verifier_source": {
      "path_in_zip": "tools/verify_weighted_terrain_pathfinding.gd",
      "sha256": "62ae7c6fcd7697e3b87df7fcfd1537790f89f8fcb76ead11ae6c06a26c07a3d9"
    }
  },
  "extracted_package_rerun": {
    "passed": true,
    "logic_check_count": 16,
    "published_check_count": 17,
    "check_ids_match_workspace": true,
    "scene_smoke_passed": true,
    "engine": "4.7-stable (official)"
  }
}
