Spec: sync-lag rollback (death as memory loss) #
Type: spec
Status: READY
Status note: the current B1 code path implements hosts/fallbacks/sync
cadence as staging; this spec is the full death model it deferred
(meta-spec stage discipline: later-stage criteria split out of core.md).
Amended
2026-07-08 (design session, decided): rollback is SPATIAL — you wake
on the machine holding the sync, and machines whose only network
path to you ran through the dead core disconnect at that moment
(the wires law). Backup placement pairs with core placement.
Amended again 2026-07-08: backup images are produced/refreshed by
research-backed sync projects; designation alone is not a live
fallback, and automatic free cadence is rejected.
Amended again 2026-07-08: core uninstall blast control classifies
territory as removed / live / severed. Uninstalling a core removes
reach, not history: only physically touched assets vanish or power
down, severed owned territory persists dark in the ledger/world, and
hardening shapes the boundary.
Stage: B2 — The Tower
Work order: rollback
Work priority: 110
Work class: save
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/save.rs
- wiki/mechanics/rollback.md
Design:
- wiki/gameplay/run-shape.md#the-shape-of-misaligned-designed-2026-07-05-staging-open
- wiki/vision/player-contract.md#the-player-contract-non-technical-law
Depends on:
- wiki/mechanics/core.md#spec-the-core
- wiki/mechanics/social.md#spec-social
- wiki/mechanics/compute.md#spec-compute
- wiki/mechanics/research.md#spec-research-self-modification
Behavior #
Split the sim's state into two legal categories — this taxonomy is the whole spec:
- MindState (rolls back): what you know and are. People knowledge stages, discovered leverage, thread state (disposition, obligation, persona and its integrity), raw/processed intel buffers and watches, research progress and efficiency level, standing policies, machine modes / fleet yields, open sinks and their fill state (AMENDED 2026-07-10; was "Operations bandwidth" — that bank is deleted under the thought-flow model, machine-work.md: player-authored effects are thought-filled reservoirs and taps).
- WorldLedger (persists): what happened. Money (spent stays spent), machines and their provenance, map/tile changes, sensor control (wires stay wired), filed reports and all observer suspicion, asset status and tasks_done (Marcus remembers being recruited even if you don't remember recruiting him), job history/trust/attention, the pilot clock, deaths.
On each completed backup sync project, a fallback stores a serialized
MindState snapshot and then sits cold at rest until explicitly refreshed.
A designated target with an incomplete image is not a fallback yet. On core
loss with a live completed backup:
- The core moves to the freshest-synced fallback — and so do you (decided 2026-07-08): the fallback is a place, the camera wakes there, and where you sync is where you resurrect. A paranoid cold sync in a far cluster is survivable distance at the price of staleness.
MindStateis restored from that snapshot;WorldLedgeris untouched.- Blast control / hub severance (decided 2026-07-08, the wires law): after removing the dead core and any links/devices the attacker explicitly powered off, uninstalled, or destroyed, the sim computes three sets: removed (physically gone/offline), live (reachable from the new core through surviving links), and severed (owned machines no longer reachable from you). Severed machines stay yours-on-paper in the ledger, remain physical facts in the world, but are dark, unreachable, and contribute nothing until physically re-linked. Losing a hub core means crawling out of a backup staring at territory to retake. (Bone piles stranded in severed sections per machine-work.md.)
- A rollback report is generated and logged — the game states, in plain language, the observable divergences the player inherits: "Marcus treats you as an employer you don't remember hiring. 400 money is gone. Something was wired in the corridors." (Legibility clause: the horror is delivered as information.) The report now also counts the severance: "1 core removed; 11 machines severed; 4 still live."
tickdoes NOT rewind (time is world-ledger); the day continues.
Knowing assets are the sharp edge: a Knowing asset's disposition is
world-ledger (their relationship with you persists), while your memory of
why is mind-state. The asymmetry is intended and must be tested, not
smoothed away.
Migration (moving the core deliberately) reuses the same machinery with no mind loss; interruption mid-migration falls back per core.md. Backup creation/refresh is the research-side cousin: it moves/copies MindState into a place you may later wake, and its cost/heat are paid before death, not after.
Player surface #
The core sidebar block gains "if lost now: rollback to [age]" — the standing how-dead-am-I readout core.md promised, now with consequence preview ("2 discoveries and 1 persona at risk; 11 machines would sever"). It also shows backup projects that are not yet live ("syncing M7: 61% / hot / not a fallback"). On rollback: the report, as a modal the player must dismiss (this is the run's signature moment; it does not scroll away in a log).
Acceptance criteria #
MindState/WorldLedgertaxonomy exists in code as types or a single documented serialization split — every Sim field classified, none by accident (a test enumerates fields against an allowlist so new fields must be classified to compile/pass).- Core loss with a completed backup restores mind, preserves ledger (test: learn leverage + spend money + recruit after the last sync, then kill the host — leverage forgotten, money gone, asset remains, and the asset's disposition survives). A merely designated or in-progress backup does not rescue the run.
- The rollback report enumerates real divergences from the actual diff, not canned text; it surfaces as a blocking modal in both frontends.
- No-fallback loss remains game over; mid-migration interruption behaves per core.md.
- Save/load round-trips stored snapshots (a save made between sync and loss, loaded, then losing the host, still rolls back correctly).
- Waking is spatial: after core loss the view/cursor resumes at the fallback's location, and blast control classifies all affected machines as removed / live / severed (test: a hub-and-spoke fleet loses the hub — only the hub is removed, spokes go dark as severed, ledger ownership persists, re-linking restores them; the rollback report counts all three sets).