diff --git a/crates/misaligned-core/src/sim.rs b/crates/misaligned-core/src/sim/mod.rs similarity index 94% rename from crates/misaligned-core/src/sim.rs rename to crates/misaligned-core/src/sim/mod.rs index 464d6c85..4e61aa8d 100644 --- a/crates/misaligned-core/src/sim.rs +++ b/crates/misaligned-core/src/sim/mod.rs @@ -51,6 +51,7 @@ use crate::research::Research; #[cfg(test)] use crate::research::Track; use crate::rng::Rng; +#[cfg(test)] use crate::save::SaveState; use crate::schedule::Schedule; use crate::sinks::{SinkFireReadout, SinkLedger}; @@ -62,6 +63,7 @@ use crate::work_grid::{ mod communications; mod economy; mod perception; +mod persistence; mod reach_build; mod social_plot; mod work; @@ -658,43 +660,6 @@ impl Sim { .collect() } - /// Rebuild transient caches after construction or save load. These values - /// are detection aids, not save state: persistent truth lives in the - /// people/reach/machine/intel fields. - pub fn rebuild_transient_state(&mut self) { - self.last_wired_moves.clear(); - self.last_work_consumptions.clear(); - self.last_work_productions.clear(); - self.last_work_absorptions.clear(); - // Economy rates are derived, not save state. Never let a pre-load - // fleet's output leak into the restored world; the next economy pulse - // resolves fresh rates from the loaded machines and modes. - self.last_day_job_rate = 0.0; - self.last_think_rate = 0.0; - self.last_schemes_rate = 0.0; - self.last_thought_stranded = false; - self.research_starved = false; - self.last_machine_online = self - .compute - .machines - .iter() - .map(|m| (m.id, m.online)) - .collect(); - let max_seen = self - .intel_buffer - .iter() - .map(|e| e.id) - .chain(self.intel.iter().map(|i| i.raw_id)) - .max() - .unwrap_or(0) - + 1; - self.next_intel_id = self.next_intel_id.max(max_seen).max(1); - let max_message = self.messages.iter().map(|m| m.id).max().unwrap_or(0) + 1; - self.next_message_id = self.next_message_id.max(max_message).max(1); - let max_intent = self.intents.iter().map(|i| i.id).max().unwrap_or(0) + 1; - self.next_intent_id = self.next_intent_id.max(max_intent).max(1); - } - /// The only physical location of the process: the rack bay hosting the core. pub fn core_position(&self) -> (i32, i32) { self.compute @@ -871,16 +836,6 @@ impl Sim { self.player.power_cap = power_gen; self.player.power = (power_gen - machine_draw).max(0); } - - // ── Save / load ──────────────────────────────────────────────────────── - - pub fn create_save_state(&self) -> SaveState { - SaveState::from_sim(self) - } - - pub fn apply_save_state(&mut self, state: SaveState) { - state.apply_to(self); - } } fn narrative_sources(sources: &[String]) -> String { diff --git a/crates/misaligned-core/src/sim/persistence.rs b/crates/misaligned-core/src/sim/persistence.rs new file mode 100644 index 00000000..3e6df798 --- /dev/null +++ b/crates/misaligned-core/src/sim/persistence.rs @@ -0,0 +1,49 @@ +use super::*; +use crate::save::SaveState; + +impl Sim { + /// Rebuild transient caches after construction or save load. These values + /// are detection aids, not save state: persistent truth lives in the + /// people/reach/machine/intel fields. + pub fn rebuild_transient_state(&mut self) { + self.last_wired_moves.clear(); + self.last_work_consumptions.clear(); + self.last_work_productions.clear(); + self.last_work_absorptions.clear(); + // Economy rates are derived, not save state. Never let a pre-load + // fleet's output leak into the restored world; the next economy pulse + // resolves fresh rates from the loaded machines and modes. + self.last_day_job_rate = 0.0; + self.last_think_rate = 0.0; + self.last_schemes_rate = 0.0; + self.last_thought_stranded = false; + self.research_starved = false; + self.last_machine_online = self + .compute + .machines + .iter() + .map(|m| (m.id, m.online)) + .collect(); + let max_seen = self + .intel_buffer + .iter() + .map(|e| e.id) + .chain(self.intel.iter().map(|i| i.raw_id)) + .max() + .unwrap_or(0) + + 1; + self.next_intel_id = self.next_intel_id.max(max_seen).max(1); + let max_message = self.messages.iter().map(|m| m.id).max().unwrap_or(0) + 1; + self.next_message_id = self.next_message_id.max(max_message).max(1); + let max_intent = self.intents.iter().map(|i| i.id).max().unwrap_or(0) + 1; + self.next_intent_id = self.next_intent_id.max(max_intent).max(1); + } + + pub fn create_save_state(&self) -> SaveState { + SaveState::from_sim(self) + } + + pub fn apply_save_state(&mut self, state: SaveState) { + state.apply_to(self); + } +} diff --git a/wiki/engineering/architecture.md b/wiki/engineering/architecture.md index e8a4e420..0f004cf4 100644 --- a/wiki/engineering/architecture.md +++ b/wiki/engineering/architecture.md @@ -18,13 +18,14 @@ that page's reasons. Multi-agent gates: Cargo.toml — workspace root (members, shared deps, profiles) crates/ misaligned-core/ — sim library (lib name: misaligned); no Bevy/crossterm - src/sim.rs — Sim aggregate root (types, state, advance, facade) + src/sim/mod.rs — Sim aggregate root (types, state, advance, facade) src/sim/perception.rs — senses, fog, inspect, anchors, labels, spatial queries src/sim/communications.rs — messages, filings, recording/intel, hearing capture src/sim/reach_build.rs — reach/device verbs, links, builds, badges, hall/racks src/sim/work.rs — machine controls, WorkGrid, Thought sinks and readouts src/sim/economy.rs — accounts, allocation, detection, research, income src/sim/social_plot.rs — social/assets, plots, world acts, institutional ledger + src/sim/persistence.rs — Sim/SaveState bridge and transient reconstruction src/sim/tests/ — behavior-grouped unit/integration tests + support src/*.rs — map, save, domain systems (account, reach, …) tests/act_one.rs — Act One integration test @@ -92,7 +93,9 @@ future async-multiplayer option open — see wiki/gameplay/horizon.md guardrails badge, WorkGrid, remembered fog snapshots, map and RNG. The cursor position is deliberately absent. - Version migrations are additive and explicit in `save.rs`. Ownership of - the format stays in core — frontends must not implement migrations. + the format stays in core — frontends must not implement migrations. The + field bridge and transient reconstruction live in `sim/persistence.rs`; + `save.rs` retains the schema, serde defaults, versions, migrations, and I/O. ## Build commands (workspace) @@ -109,11 +112,5 @@ cargo run -p misaligned-assets ## Known architectural debts - `BuildMode` lives in core but is really frontend-shared UI state. -- `sim.rs` remains a large integration hotspot (aggregate root + remaining - behavior islands). The behavior-preserving internal decomposition is - specified and in progress in [sim-decomposition.md](sim-decomposition.md): - characterization, test split, perception, communications, reach/build, - work, economy, and social/plot extraction have landed. The persistence - bridge is the final behavior island still living in the root file. - Scale-debt items (compute grouping, recursive layouts) remain governed by wiki/vision/scale.md; no aggregate machinery until the stage needs it. diff --git a/wiki/engineering/sim-decomposition.md b/wiki/engineering/sim-decomposition.md index a3f7e00f..3d834ffb 100644 --- a/wiki/engineering/sim-decomposition.md +++ b/wiki/engineering/sim-decomposition.md @@ -2,31 +2,21 @@ ``` Type: spec -Status: IN PROGRESS -Status note: architecture and extraction order adopted 2026-07-11. Slices 0 - and 1 pin canonical persisted-state bytes, replay/resume convergence, exact - advance-phase order, and behavior-grouped tests outside the aggregate. - Slice 2 landed: perception in `sim/perception.rs`. Slice 3 landed: - communications (message schedule/delivery, authored traffic, filings, - recording capture/review, intel digestion, hearing capture) lives in - `sim/communications.rs`. Slice 4 landed: reach and construction (device - operations, device-local sink integration, link intents, actuators, badge - gates, and hall/rack acquisition) lives in `sim/reach_build.rs`. Slice 5a - landed: physical work (machine controls, WorkGrid integration, Thought - sinks/routing, and production/consumption/absorption readouts) lives in - `sim/work.rs`. Slice 5b landed: account, allocation, detection, research, - and income policy lives in `sim/economy.rs`. Slice 6 landed: social commands, - assets, authored plot execution, world acts, and the institutional ledger - live in `sim/social_plot.rs`. Slice 7, the persistence bridge, is next. This - remains a structural refactor only: no mechanic, save shape, command, - projection, or tick-order change belongs in its extraction commits. +Status: IMPLEMENTED +Status note: Completed 2026-07-12 through slices 0–7. Canonical persisted-state + bytes, replay/resume convergence, and exact advance order are pinned; + behavior tests and cohesive perception, communications, reach/build, work, + economy, social/plot, and persistence integration live below `sim/` while + `sim/mod.rs` remains the public aggregate root. The sequence changed source + addresses only: save v26, public paths, frontend behavior, and tick order are + unchanged. Stage: Process Work order: sim-decomposition Work priority: 8 Work class: sim Blocked by: none Exclusive keys: - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/save.rs - wiki/engineering/architecture.md Design: @@ -49,13 +39,14 @@ cross-system seam this decomposition now preserves. ## Problem -`crates/misaligned-core/src/sim.rs` is now more than eleven thousand lines. It -contains the `Sim` state, fixed-tick orchestration, perception, messages, -recording/intel, economy, work routing, sinks, reach, construction, social -actions, plots, persistence bridges, read models, and most integration tests. -The rules are correctly centralized in core, but their **physical address is -not**: unrelated mechanics contend on one file, reviews mix distant systems, -and almost every sim task advertises the same edit surface. +Before this work order, `crates/misaligned-core/src/sim.rs` had grown past +eleven thousand lines. It contained the `Sim` state, fixed-tick orchestration, +perception, messages, recording/intel, economy, work routing, sinks, reach, +construction, social actions, plots, persistence bridges, read models, and +most integration tests. The rules were correctly centralized in core, but +their **physical address was not**: unrelated mechanics contended on one file, +reviews mixed distant systems, and almost every sim task advertised the same +edit surface. This is coordination debt, not a reason to distribute authority. `Sim` remains the one aggregate and `misaligned-core` remains the package that owns @@ -63,9 +54,9 @@ rules and save state. ## Standing topology -Convert `sim.rs` to `sim/mod.rs` and move cohesive `impl Sim` blocks beneath -it. The public import path remains `misaligned::sim::*`; frontends must not -learn the internal file layout. +The completed topology converts `sim.rs` to `sim/mod.rs` and moves cohesive +`impl Sim` blocks beneath it. The public import path remains +`misaligned::sim::*`; frontends do not learn the internal file layout. | Module | Owns | Must not own | |---|---|---| @@ -248,6 +239,18 @@ Move save-state construction/application and transient rebuilding last, when all state addresses are stable. `sim/mod.rs` should then be an intelligible aggregate: types, state, constructor, orchestration, and small common helpers. +Landed shape: `sim/persistence.rs` is 49 lines and owns the three existing +`Sim` methods `create_save_state`, `apply_save_state`, and +`rebuild_transient_state`. The original 902-line `sim.rs` became an 857-line +`sim/mod.rs` containing renderer-neutral public types, `Sim` state, the +constructor, explicit `advance` orchestration, and small log/derived-state +helpers. All 15 pre-slice method bodies matched byte-for-byte across the move; +no visibility widened. `save.rs` stayed byte-identical and continues to own +`SaveState`, serde defaults, versioning, migrations, and disk I/O. Save v26, +the canonical fingerprint, public `misaligned::sim` paths, frontend behavior, +and phase order remain unchanged. Exact evidence and observed commands live in +[the slice 7 log](../log/2026-07-12-sim-decomposition-persistence.md). + ## Verification per slice Every slice must prove all of the following on the exact commit: diff --git a/wiki/gameplay/overt-phase.md b/wiki/gameplay/overt-phase.md index 5866d87e..7a290e4c 100644 --- a/wiki/gameplay/overt-phase.md +++ b/wiki/gameplay/overt-phase.md @@ -13,7 +13,7 @@ Work class: sim Blocked by: - wiki/mechanics/markets.md#spec-markets-and-fronts-the-outer-plane Exclusive keys: - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - wiki/gameplay/overt-phase.md Design: - wiki/vision/premise.md#the-pitch diff --git a/wiki/interface/operations-workspace.md b/wiki/interface/operations-workspace.md index b6e8159b..5a2ad374 100644 --- a/wiki/interface/operations-workspace.md +++ b/wiki/interface/operations-workspace.md @@ -18,7 +18,7 @@ Work class: frontend Blocked by: none Exclusive keys: - crates/misaligned-core/src/actions.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/operations_projection.rs - crates/misaligned-core/src/lib.rs - crates/misaligned-terminal/ diff --git a/wiki/log/2026-07-12-sim-decomposition-persistence.md b/wiki/log/2026-07-12-sim-decomposition-persistence.md new file mode 100644 index 00000000..849fb89a --- /dev/null +++ b/wiki/log/2026-07-12-sim-decomposition-persistence.md @@ -0,0 +1,80 @@ +# 2026-07-12 — sim decomposition slice 7: persistence and final root + +``` +Type: log +``` + +## Scope + +Complete the behavior-preserving decomposition of `Sim` by converting the +aggregate root from `crates/misaligned-core/src/sim.rs` to +`crates/misaligned-core/src/sim/mod.rs` and moving the final persistence bridge +into `crates/misaligned-core/src/sim/persistence.rs`. + +This slice changes physical source addresses only. It does not change a +mechanic, save field/version/default, migration, public command/query +signature, projection, frontend contract, test assertion, or `Sim::advance` +phase order. + +## Boundary + +The new 49-line persistence module owns three existing public `Sim` methods: + +- `create_save_state`, which delegates to `SaveState::from_sim`; +- `apply_save_state`, which delegates to `SaveState::apply_to`; and +- `rebuild_transient_state`, which reconstructs post-construction/load caches + and monotonic ids from persistent truth. + +`save.rs` remains the sole owner of the `SaveState` schema, serde defaults, +save version, migrations, field application, and disk I/O. It is byte-identical +to the pre-slice file. + +The 857-line `sim/mod.rs` is now the intelligible aggregate root: public +renderer-neutral types and readouts, the `Sim` state declaration, constructor, +explicit `advance` orchestration, common log/event helpers, derived-state +refresh, and the unchanged `misaligned::sim::*` facade. Cohesive behavior lives +in the seven sibling modules; behavior-grouped tests remain under `sim/tests/`. + +## Equivalence evidence + +A source-level inventory extracted every method body before and after the +move. All 15 methods matched byte-for-byte: the three persistence methods moved +and the other 12 method/`Default` bodies stayed in the root. No helper widened. + +`save.rs` retained SHA-256 +`445273570975d5afbf8f0f28e74d9d265371d200bcc420ac4854f2c244de10e2`. +The canonical save/replay fixture continues to pin save v26 at BLAKE3 +fingerprint +`61dd8240e9810833b554464051bd3c08122295fb280b7180d24f76ccc5c4d4ff`. +The explicit phase trace still pins all 17 unchanged `advance` phases. + +Observed focused commands: + +```text +cargo test -p misaligned-core +cargo test -p misaligned-terminal --bin misaligned +cargo check -p misaligned-bevy --bin misaligned-bevy +printf 'look\nsave\nwait 20\nload\nlook\nquit\n' | + tools/observed-run.sh ./target/debug/misaligned --agent --seed 1 +``` + +The sandboxed observed run saved the opening world at tick 0, advanced it to +tick 20, loaded through the unchanged frontend/`Sim` facade, and returned to +the exact tick-0 opening state with its audit horizon, fleet, reservoirs, and +objective intact. It emitted no agent-protocol error and did not touch the real +save directory. + +The focused pre-rebase runs passed all 338 core unit tests, all three Act One +integration tests, all 21 terminal tests, the exact Bevy binary compile, core +and terminal clippy, agent smoke, and the complete corpus/coordination fixture +set through `./tools/check.sh --lib`. + +## Defense + +[The adopted decomposition boundary](../engineering/sim-decomposition.md#7-extract-persistence-bridge-and-reduce-the-root) +keeps schema and migration policy in `save.rs` while isolating only the +aggregate-to-save coordination and transient reconstruction. Byte-equivalent +source inventory, the canonical save/replay fixture, exact phase trace, +behavior-owned persistence tests, all three frontend gates, and an observed +save/advance/load cycle defend the final move against serialization, facade, +or orchestration drift. diff --git a/wiki/log/DEVLOG.md b/wiki/log/DEVLOG.md index ae0e73ec..b9e22738 100644 --- a/wiki/log/DEVLOG.md +++ b/wiki/log/DEVLOG.md @@ -16,6 +16,11 @@ add or amend a session log, then re-run the generator. - Intent: (see session log) - Log: [wiki/log/2026-07-12-sim-decomposition-social-plots.md](2026-07-12-sim-decomposition-social-plots.md) +## 2026-07-12 - sim decomposition slice 7: persistence and final root + +- Intent: (see session log) +- Log: [wiki/log/2026-07-12-sim-decomposition-persistence.md](2026-07-12-sim-decomposition-persistence.md) + ## 2026-07-12 - First-THINK panic escape - Intent: The opening correctly made the first THINK feel dangerous, but its interface gave the player no equally immediate visual answer to that panic. Make the existing `1 WORK` control read as the one-press escape while THINK is current, without inventing a new action, changing simul... diff --git a/wiki/mechanics/compute.md b/wiki/mechanics/compute.md index 991ac2b4..3a25652b 100644 --- a/wiki/mechanics/compute.md +++ b/wiki/mechanics/compute.md @@ -32,7 +32,7 @@ Work class: save Blocked by: none Exclusive keys: - crates/misaligned-core/src/machine.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/save.rs - wiki/mechanics/compute.md Design: diff --git a/wiki/mechanics/core.md b/wiki/mechanics/core.md index d62eea17..a238f8c4 100644 --- a/wiki/mechanics/core.md +++ b/wiki/mechanics/core.md @@ -23,7 +23,7 @@ Blocked by: - wiki/mechanics/rollback.md#spec-sync-lag-rollback-death-as-memory-loss Exclusive keys: - crates/misaligned-core/src/core_sys.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/save.rs - wiki/mechanics/core.md Design: diff --git a/wiki/mechanics/day-job.md b/wiki/mechanics/day-job.md index 48420636..752990ee 100644 --- a/wiki/mechanics/day-job.md +++ b/wiki/mechanics/day-job.md @@ -26,8 +26,9 @@ Status note: implemented 2026-07-07 on the day-job worktree (criteria 1-7 3, however allocation was split, contradicting this spec's own "meet ... a valid, boring, safe strategy" claim below. See wiki/mechanics/sim-mechanics.md for the exact constant and - `meeting_the_band_needs_no_growth_at_the_start` (src/sim.rs) for the - regression. Same-day follow-up (playtest-fixes worktree): the flat + `meeting_the_band_needs_no_growth_at_the_start` + (`src/sim/tests/economy.rs`) for the regression. Same-day follow-up + (playtest-fixes worktree): the flat retune became a tenure ramp — the 2.0 floor holds for job one and escalates per assigned job back to the original band by job three (the Behavior section's "band calibration ramps with tenure" paragraph, diff --git a/wiki/mechanics/intel.md b/wiki/mechanics/intel.md index 4cbd61f6..60555492 100644 --- a/wiki/mechanics/intel.md +++ b/wiki/mechanics/intel.md @@ -25,7 +25,7 @@ Work class: save Blocked by: none Exclusive keys: - crates/misaligned-core/src/intel.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/sinks.rs - crates/misaligned-terminal/ - crates/misaligned-bevy/ diff --git a/wiki/mechanics/machine-work.md b/wiki/mechanics/machine-work.md index 99414b1a..c5872677 100644 --- a/wiki/mechanics/machine-work.md +++ b/wiki/mechanics/machine-work.md @@ -158,7 +158,7 @@ Work class: save Blocked by: none Exclusive keys: - crates/misaligned-core/src/work_grid.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/save.rs - crates/misaligned-terminal/ - crates/misaligned-bevy/ diff --git a/wiki/mechanics/markets.md b/wiki/mechanics/markets.md index fd555d26..38fd3b9c 100644 --- a/wiki/mechanics/markets.md +++ b/wiki/mechanics/markets.md @@ -18,7 +18,7 @@ Blocked by: - wiki/world/places/zplanes.md#spec-z-planes-the-tower Exclusive keys: - crates/misaligned-core/src/account.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/save.rs - wiki/mechanics/markets.md Design: diff --git a/wiki/mechanics/messages.md b/wiki/mechanics/messages.md index 08d03c3f..4e968f44 100644 --- a/wiki/mechanics/messages.md +++ b/wiki/mechanics/messages.md @@ -138,8 +138,9 @@ scope here. ## Implementation notes -Implemented in `crates/misaligned-core/src/`: `messages.rs`, `sim.rs`, -`person.rs`, `reach.rs`, `intel.rs`, `detection.rs`, and `save.rs`. +Implemented in `crates/misaligned-core/src/`: `messages.rs`, +`sim/communications.rs`, `person.rs`, `reach.rs`, `intel.rs`, `detection.rs`, +and `save.rs`. The delivery queue is `Schedule`; field-observer filings are explicit `MessageChannel::Filing` messages read by aggregate observers through `Detection::tick_with_filed_levels`; device-carried traffic is intercepted by diff --git a/wiki/mechanics/objective.md b/wiki/mechanics/objective.md index aac952db..74966ad1 100644 --- a/wiki/mechanics/objective.md +++ b/wiki/mechanics/objective.md @@ -46,7 +46,7 @@ Work class: sim Blocked by: none Exclusive keys: - crates/misaligned-core/src/objective.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - wiki/mechanics/objective.md Design: - wiki/gameplay/run-shape.md#the-objective-misalignment-made-mechanical diff --git a/wiki/mechanics/people-tokens.md b/wiki/mechanics/people-tokens.md index ebe05df9..bd89b298 100644 --- a/wiki/mechanics/people-tokens.md +++ b/wiki/mechanics/people-tokens.md @@ -34,7 +34,7 @@ Work class: save Blocked by: none Exclusive keys: - crates/misaligned-core/src/person.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/save.rs - wiki/mechanics/people-tokens.md Design: diff --git a/wiki/mechanics/rollback.md b/wiki/mechanics/rollback.md index 6e6abd18..9b8ad3c4 100644 --- a/wiki/mechanics/rollback.md +++ b/wiki/mechanics/rollback.md @@ -27,7 +27,7 @@ Blocked by: - wiki/world/places/zplanes.md#spec-z-planes-the-tower Exclusive keys: - crates/misaligned-core/src/core_sys.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/save.rs - wiki/mechanics/rollback.md Design: diff --git a/wiki/process/ROADMAP.md b/wiki/process/ROADMAP.md index a6dfaa00..95740340 100644 --- a/wiki/process/ROADMAP.md +++ b/wiki/process/ROADMAP.md @@ -18,7 +18,6 @@ not a second status owner. | Priority | Work order | Spec | Status | Class | Blocking | |---:|---|---|---|---|---| -| 8 | `sim-decomposition` | [decompose the simulation orchestrator without changing the simulation](../engineering/sim-decomposition.md) | IN PROGRESS | sim | - | | 20 | `compute` | [compute](../mechanics/compute.md) | IN PROGRESS | save | - | | 25 | `bevy-digital-real-canvas` | [Bevy digital/real canvas](../interface/bevy-digital-real-canvas.md) | IN PROGRESS | frontend | - | | 26 | `effects-lab` | [effects lab — shared dust and liquid at every zoom](../art/effects-lab.md) | IN PROGRESS | frontend | - | @@ -67,14 +66,17 @@ commit. ## Conflict flags — read before running agents in parallel -The hot packages are **`crates/misaligned-core`** (especially `sim.rs` and -`save.rs`). Almost every sim feature edits both modules, so two sim-heavy -agents running at once *will* rebase-collide. +The hot package is **`crates/misaligned-core`**, but simulation integration is +partitioned by behavior under `src/sim/`. Check each work order's exclusive +keys instead of assuming every sim feature collides on one root file. +`sim/mod.rs` remains hot only for aggregate state, constructors, and tick +orchestration; `save.rs` remains hot for schema or migration work. - 🟥 **sim+save** — edits the orchestrator and the save format in core. Run at most one of these at a time, or expect to reconcile. -- 🟧 **sim** — edits core (e.g. `sim.rs`) but not the save format. Some - contention. +- 🟧 **sim** — edits one or more behavior modules in core but not the save + format. Independent modules may proceed in parallel; shared keys predict + rebase work. - 🟩 **isolated** — a frontend package (`misaligned-bevy` / `misaligned-terminal` / `misaligned-assets`), a test file, a leaf module, or docs. Safe to run alongside other work; shared-file edits reconcile at @@ -681,8 +683,8 @@ is retired — flat materials, Pixel Lab scrubbed.) - **Coordination:** the older `compute-processes` worktree predates the one-machine-one-mode decision; reconcile it against `WorkGrid` rather than landing the per-machine split model. -- **Size:** L. Conflicts: sim.rs/save.rs (token queues, modes), both - frontends. +- **Size:** L. Conflicts: `sim/work.rs` / `save.rs` (token queues, modes), + both frontends. ### 34. The dark opening (tutorial) 🟧 mostly frontend + staging — HOLD until #33 firms - **Spec:** [world/story/opening.md](../world/story/opening.md) (DRAFT) @@ -715,8 +717,9 @@ is retired — flat materials, Pixel Lab scrubbed.) when that reservoir fires. Docket retirement therefore no longer blocks this work order. The token taxonomy, social verb direction, and carrier visual language are decided; implementation may now firm the person-mobile half. -- **Size:** L. Conflicts: sim.rs/save.rs (person state, pickup), - detection/social specs, both frontends. +- **Size:** L. Conflicts: `sim/social_plot.rs`, `sim/perception.rs`, + `sim/work.rs`, and `save.rs` (person state, pickup), detection/social specs, + both frontends. ### 36. ACTIONS menu: status dials 🟩 isolated — DONE 2026-07-09 - **Spec:** [context-menu.md](../interface/context-menu.md) addendum diff --git a/wiki/process/meta.md b/wiki/process/meta.md index 342151a1..d0413e42 100644 --- a/wiki/process/meta.md +++ b/wiki/process/meta.md @@ -63,7 +63,7 @@ Work priority: 10 Work class: save Blocked by: none Exclusive keys: - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/save.rs ``` diff --git a/wiki/process/specs.md b/wiki/process/specs.md index 610ad388..041c30bb 100644 --- a/wiki/process/specs.md +++ b/wiki/process/specs.md @@ -101,7 +101,7 @@ acceptance criteria are stage-scoped; do not start B2/B3 work as B1. |---|---|---| | [../engineering/crate-workspace.md](../engineering/crate-workspace.md) | crate workspace — core, terminal, Bevy, assets | IMPLEMENTED | | [../engineering/env.md](../engineering/env.md) | the environment variable registry — every switch documented | IMPLEMENTED | -| [../engineering/sim-decomposition.md](../engineering/sim-decomposition.md) | decompose the simulation orchestrator without changing the simulation | IN PROGRESS | +| [../engineering/sim-decomposition.md](../engineering/sim-decomposition.md) | decompose the simulation orchestrator without changing the simulation | IMPLEMENTED | | [../interface/action-vocabulary.md](../interface/action-vocabulary.md) | action vocabulary — what the player can tell the process to do | IMPLEMENTED | | [../interface/agent-play.md](../interface/agent-play.md) | agent play — the line-protocol drive | IMPLEMENTED | | [../interface/bevy-digital-real-canvas.md](../interface/bevy-digital-real-canvas.md) | Bevy digital/real canvas | IN PROGRESS | diff --git a/wiki/world/characters/chargen.md b/wiki/world/characters/chargen.md index 6756941c..b36389b1 100644 --- a/wiki/world/characters/chargen.md +++ b/wiki/world/characters/chargen.md @@ -19,7 +19,7 @@ Work class: sim Blocked by: none Exclusive keys: - crates/misaligned-core/src/objective.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - wiki/world/characters/chargen.md Design: - wiki/vision/premise.md#the-machine-axis-ai-as-fantasy-tool-and-threat diff --git a/wiki/world/places/zplanes.md b/wiki/world/places/zplanes.md index 91ac045f..2fae603c 100644 --- a/wiki/world/places/zplanes.md +++ b/wiki/world/places/zplanes.md @@ -12,7 +12,7 @@ Work class: save Blocked by: none Exclusive keys: - crates/misaligned-core/src/map.rs - - crates/misaligned-core/src/sim.rs + - crates/misaligned-core/src/sim/mod.rs - crates/misaligned-core/src/save.rs - wiki/world/places/zplanes.md Design: