Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
279 changes: 279 additions & 0 deletions data/story/bdsp-mine-pilot/CASES.md

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions data/story/bdsp-mine-pilot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# BDSP mine/Roark authored checkpoint

Start with [the 15 authored events](bdsp-mine-01.03.plan.json) and [the readable cases](CASES.md). The native story table loads the same JSON. The old hand-transcribed BDSP draft had 16 events; it is not the source of this pilot.

Source: [Arduino-Source #226](https://github.com/dayfine/Arduino-Source/pull/226), exact revision `0738cd55b562d1dd685cdea289663a015a1cbe59`, `SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryTable.cpp`, `oreburgh_mine_to_roark()`. Barry and the first heal now belong to `01.02b`. This file preserves the current inbound/outbound legs, two-tile Center/exit beliefs, `counted_wall` and `to_wall` variants, failure policy, and save-card guard.

The native companion is [Arduino #263](https://github.com/dayfine/Arduino-Source/pull/263), branch `bdsp/checkpoint-json`, based on that exact #226 head. Python implementation: [PokemonSimulation #74](https://github.com/dayfine/PokemonSimulation/pull/74). Game executors remain unchanged. Its adjacent tests load the actual table, execute `01.03` through the existing engine/fake-game simulator, and stop before healing when the exit fails through all three attempts. This is integration coverage; that fake is not a detector/timing oracle.

## Run the Python check

```sh
PYTHONPATH=src python3 -m pokesim.story.checkpoint_replay \
data/story/bdsp-mine-pilot/cases.json --case mine-all-events \
--binding data/story/bdsp-mine-pilot/binding.json --summary
PYTHONPATH=src python3 -m unittest pokesim.games.test_bdsp_story_replay
```

Nine scenarios cover all 15 events, wrong entry, unconfirmed mine arrival/exit, wild interruption before Roark, missing conversation/departure evidence, the wandering Hiker, and an unconfirmed heal. The full success, wrong-entry, missing-arrival and interrupted cases assert every ordered semantic action. Expectations do not drive execution. Shortened legs cannot be repaired by assigning `declared_after`.

## What the model proves

- Local routes and legs use the existing runtime world/movement/planner and the approved map bytes pinned at `4de7742a764d27293b4525d6ad2a6fc8a95f3e3a`. No terrain, corrections or resource pins are changed.
- BDSP `STEP` traverses its source corridor to a doorway; it is not treated as one tile. B1F arrivals can stand on a cave mat, then move away from it toward the interior.
- Complete mine destination links are absent from the published maps. Arrival is therefore a separate **scripted observation**, checked against the authored alternatives, rather than a predicted or confirmed warp. Without it the run stops.
- `to_wall` must actually reach a terrain wall within its bound; an NPC/unknown/transition is not a wall. `counted_wall` computes both native declared starts: 37 and 38 tiles north converge at city `(46,21)`. The requested count 37 must lie within those bounds. The observed/model physical pose and native fallback belief remain separate.
- Roark's conversation needs adjacency, a facing change where necessary, and a scripted dialogue observation. The scene needs a separate departure result. Healing needs a receipt; neither action becomes successful merely because it was requested.
- Wandering NPC regions remain hazards. A test may explicitly script a collision-free movement window for a named NPC; absent that window the model stops before entering its range. It does not treat the Hiker as a permanent wall or invent live waiting behavior.
- A battle during a counted leg retains the requested distance, invalidates the pose, and exposes the before/after candidate tiles with unknown facing. Recovery/rejoin is not silently assumed.

## What remains unproved

The Python path uses its pinned cost profile; it does not reproduce native robust planner costs or select identical legs. Observations, clearance windows and scene/heal results are synthetic. Controller queues, analog movement, actual NPC trajectories, banner/fade/dialogue detectors and scene timing are not simulated here. The native executor's declared-arrival fallback remains unchanged.

The authored native policy is save-at-start with `reload_and_retry` guarded by the `Oreburgh City` save card. Python uses the existing explicit one-attempt stop/no-save diagnostic binding; a Python pass is not native retry/save parity. Battle outcomes and post-heal stats are not fabricated.

## Existing run evidence behind this route

These are references preserved from #226's comments at `0738cd55b`, not new console runs performed for this PR:

- Lab-B, 2026-11-07: a counted south-three approach below Roark moved only two tiles. The current route clips the room’s south wall before moving west to talk.
- Lab-B, 2026-11-08 11:55: wild-battle recovery replanned only to open tile `(15,16)`; a later south-five leg overshot a row and the remaining taps ran under Roark’s rocks. The current source groups the inbound legs through the corner. This pilot’s interruption case stops with uncertainty; it does not claim recovery/rejoin is proved.
- Lab-B, 2026-11-08 09:46, 10:39 and 12:03: the B1F exit came out on city column 46, east of the sign at `(45,56)`, so walking north did not stop at that sign. The current route instead clips the wall beside the Center.
- Lab-B, 2026-11-08 13:50: a north tap/east wall hold matched the map only from column 46; east from `(48,57)` was blocked although the map showed `(49,57)` open. The current route avoids that street. The pilot does not change terrain to explain this unresolved discrepancy.

Entry assumes the native preceding `01.02b` Barry/heal setup. The pilot does not invent party levels, HP, item counts, or quest-flag observations to turn that assumption into a verified precondition.
197 changes: 197 additions & 0 deletions data/story/bdsp-mine-pilot/bdsp-mine-01.03.plan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
{
"format": "pokesim-authored-checkpoint/1",
"game": "bdsp",
"checkpoint": {
"id": "01.03",
"title": "Oreburgh Mine to Roark",
"start": {
"map": "OreburghCity",
"certainty": "set",
"where": {"kind": "tiles", "tiles": [[47, 21], [46, 21]], "facing": "south"}
},
"events": [
{
"id": "above_the_mine",
"kind": "route",
"target": {
"map": "OreburghCity",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[46, 58]], "facing": "south"}
},
"variant": "town",
"why": "down the door's column to above the mine's warp tiles"
},
{
"id": "into_the_mine",
"kind": "step",
"direction": "south",
"declared_after": {
"map": "OreburghMineB1F",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[12, 1]], "facing": "south"}
},
"why": "the warp tile (46, 59)"
},
{
"id": "into_the_coal_room",
"kind": "step",
"direction": "south",
"declared_after": {
"map": "OreburghMine",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[15, 2]], "facing": "south"}
},
"why": "down the entrance hall through the cave mouth"
},
{
"id": "south_to_the_rock",
"kind": "legs",
"legs": [{"direction": "south", "tiles": 8}],
"declared_after": {
"map": "OreburghMine",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[15, 9]], "facing": "south"}
},
"why": "south against the corridor rock (15, 11)",
"variant": "to_wall"
},
{
"id": "to_roarks_corner",
"kind": "legs",
"legs": [
{"direction": "east", "tiles": 1},
{"direction": "south", "tiles": 2},
{"direction": "west", "tiles": 1},
{"direction": "south", "tiles": 5},
{"direction": "east", "tiles": 14},
{"direction": "south", "tiles": 10},
{"direction": "west", "tiles": 2},
{"direction": "south", "tiles": 2},
{"direction": "west", "tiles": 7}
],
"declared_after": {
"map": "OreburghMine",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[20, 28]], "facing": "west"}
},
"why": "east around the rock, across the room, down column 29, west to Roark's rock"
},
{
"id": "beside_roarks_rock",
"kind": "legs",
"legs": [{"direction": "south", "tiles": 1}],
"declared_after": {
"map": "OreburghMine",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[20, 29]], "facing": "south"}
},
"why": "south against the room's wall",
"variant": "to_wall"
},
{
"id": "below_roark",
"kind": "legs",
"legs": [{"direction": "west", "tiles": 2}],
"declared_after": {
"map": "OreburghMine",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[18, 29]], "facing": "north"}
},
"why": "west 2 to below Roark"
},
{
"id": "roark",
"kind": "talk",
"why": "Roark, north of us between his rocks"
},
{
"id": "roark_smashes_the_rock",
"kind": "scene",
"declared_after": {
"map": "OreburghMine",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[18, 29]], "facing": "north"}
},
"why": "his lines, Rock Smash on the rock east of him, and he walks off"
},
{
"id": "below_the_coal_rooms_warp",
"kind": "legs",
"legs": [
{"direction": "east", "tiles": 9},
{"direction": "north", "tiles": 3},
{"direction": "east", "tiles": 2},
{"direction": "north", "tiles": 10},
{"direction": "west", "tiles": 14},
{"direction": "north", "tiles": 5},
{"direction": "east", "tiles": 1},
{"direction": "north", "tiles": 2},
{"direction": "west", "tiles": 1},
{"direction": "north", "tiles": 7}
],
"declared_after": {
"map": "OreburghMine",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[15, 2]], "facing": "north"}
},
"why": "east around crate, up column 29, west across row 17, and up corridor to warp doorstep"
},
{
"id": "up_to_the_hall",
"kind": "step",
"direction": "north",
"declared_after": {
"map": "OreburghMineB1F",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[12, 21]], "facing": "north"}
},
"why": "the warp tile (15, 1)"
},
{
"id": "out_of_the_mine",
"kind": "step",
"direction": "north",
"declared_after": {
"map": "OreburghCity",
"certainty": "set",
"where": {"kind": "tiles", "tiles": [[46, 59], [46, 58]], "facing": "north"}
},
"why": "up the entrance hall and out to the city"
},
{
"id": "north_to_the_centers_wall",
"kind": "legs",
"legs": [{"direction": "north", "tiles": 37}],
"declared_after": {
"map": "OreburghCity",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[46, 21]], "facing": "north"}
},
"why": "north up column 46 to the wall west of the Center's door",
"variant": "counted_wall"
},
{
"id": "east_below_the_centers_door",
"kind": "legs",
"legs": [{"direction": "east", "tiles": 1}],
"declared_after": {
"map": "OreburghCity",
"certainty": "tile",
"where": {"kind": "tiles", "tiles": [[47, 21]], "facing": "north"}
},
"why": "a tap east below the door"
},
{
"id": "heal_oreburgh",
"kind": "heal",
"declared_after": {
"map": "OreburghCity",
"certainty": "set",
"where": {"kind": "tiles", "tiles": [[47, 21], [46, 21]], "facing": "south"}
},
"why": "the nurse; out onto the doorstep, where 01.04 starts"
}
]
},
"execution": {"on_failure": "reload_and_retry", "saves_in": "Oreburgh City"}
}
39 changes: 39 additions & 0 deletions data/story/bdsp-mine-pilot/binding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"format": "pokesim-story-replay-binding/1",
"plan": {
"file": "data/story/bdsp-mine-pilot/bdsp-mine-01.03.plan.json",
"sha256": "c51c7ad19c6f0c55bdb0d112cf794c3af987fbbdec7a80ca26257b9bdf5761d4"
},
"map_revision": "4de7742a764d27293b4525d6ad2a6fc8a95f3e3a",
"maps": {
"OreburghCity": "97e3b3f03785268a3ef355f35ba2a77b811e8c010c4859d50eca58bbade707c4",
"OreburghMineB1F": "f136c91897bc100e3cfc2098f53ab1c44544a4cdd93114f1d1a08832fe21060b",
"OreburghMine": "21319ba1d8507ae7a91fe2ad2d59f99df162dfb19f5ca9bcd4c30afc27f08560"
},
"capabilities": {
"above_the_mine": {"capability": "bdsp-runtime-route/1", "parameters": {}},
"into_the_mine": {"capability": "bdsp-door-observation/1", "parameters": {}},
"into_the_coal_room": {"capability": "bdsp-door-observation/1", "parameters": {}},
"south_to_the_rock": {"capability": "bdsp-runtime-legs/1", "parameters": {}},
"to_roarks_corner": {"capability": "bdsp-runtime-legs/1", "parameters": {}},
"beside_roarks_rock": {"capability": "bdsp-runtime-legs/1", "parameters": {}},
"below_roark": {"capability": "bdsp-runtime-legs/1", "parameters": {}},
"roark": {"capability": "bdsp-dialogue-observation/1", "parameters": {"npc": "roark"}},
"roark_smashes_the_rock": {"capability": "bdsp-scene-observation/1", "parameters": {"npc": "roark"}},
"below_the_coal_rooms_warp": {"capability": "bdsp-runtime-legs/1", "parameters": {}},
"up_to_the_hall": {"capability": "bdsp-door-observation/1", "parameters": {}},
"out_of_the_mine": {"capability": "bdsp-door-observation/1", "parameters": {}},
"north_to_the_centers_wall": {"capability": "bdsp-runtime-legs/1", "parameters": {}},
"east_below_the_centers_door": {"capability": "bdsp-runtime-legs/1", "parameters": {}},
"heal_oreburgh": {"capability": "bdsp-heal-observation/1", "parameters": {}}
},
"costs": {"tile": 1, "turn": 2, "grass": 5, "warp": 1},
"max_route_moves": 256,
"policy": {
"basis": "synthetic-offline-policy",
"entry": "scripted-observation",
"attempts": 1,
"failure": "stop",
"save": "never"
}
}
Loading
Loading