refactor(simulation): split the input.rs and dialogue.rs dispatchers (T-1062)

input.rs 2,739 → 858 lines: per-domain action handlers moved to their
owning modules (inventory, movement, stance, examine, follow, interaction,
save_io, settings, bridge::debug, economy, vision_cone, bookmark,
test_world reset + new teleport.rs); input.rs keeps the queue, the thin
dispatch table, and pause/cooldown glue. All 9 type_complexity allows
dissolved via one PlayerInputQuery alias.

dialogue.rs → dialogue/ directory module: selection (631), response
(1,473), confrontation (714), mod.rs (226, shared session components +
re-exports — public paths preserved). Documented seam deviation:
process_walk_away lives with confrontation (D-064/D-063 share the same
world-response shape).

Mechanical, zero behavior change: determinism + golden_suite byte-identical
(independently re-verified); 1,504 lib tests unchanged — 23 input tests
moved with their subjects, 53 dialogue tests redistributed, zero deleted.
System scheduling registrations untouched (input_plugin.rs 0-line diff).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 17:07:36 +02:00
co-authored by Claude Fable 5
parent 3a23378a88
commit 257d979aed
23 changed files with 4819 additions and 4735 deletions
+25
View File
@@ -68,6 +68,31 @@ pub struct SaveLoadPending {
pub pending: Option<SaveLoadCommand>,
}
/// Queue a save/load command from player input (#553).
/// At most one command can be pending; a newer command overwrites it.
/// `None` means the resource was never registered (warn and drop).
pub fn queue_save_load(pending: Option<&mut SaveLoadPending>, cmd: SaveLoadCommand) {
let (label, path) = match &cmd {
SaveLoadCommand::Save { path } => ("SaveGame", path),
SaveLoadCommand::Load { path } => ("LoadGame", path),
};
let Some(sl) = pending else {
tracing::warn!(
"{} received but SaveLoadPending resource not registered",
label
);
return;
};
if sl.pending.is_some() {
tracing::warn!(
"{} overwrites already-pending save/load command (dropped)",
label
);
}
tracing::info!("{} queued: {:?}", label, path);
sl.pending = Some(cmd);
}
/// Extract world state into `SaveStateV1` and write MessagePack bytes to `path` (#553).
///
/// Queries all NPC entities, the player knowledge graph, global relationship graph,