Sprint S12 story 6 of 7 — tracker for epic #24.
Scope
PatternObservation, PatternSignature, Label, etc. already derive Serialize/Deserialize. S12.6 wires the Chronicler itself for bincode roundtrip + adds a determinism-gated test that asserts byte-identical encodings across two runs.
API sketch
impl Chronicler {
pub fn to_bincode(&self) -> Vec<u8>;
pub fn from_bincode(bytes: &[u8]) -> Result<Self, ChroniclerLoadError>;
}
#[derive(Serialize, Deserialize)] on Chronicler itself (the few fields it owns are already derive-friendly) + a workspace-aligned bincode dep.
DoD
INVARIANTS compliance
- §6 (UI vs sim state) — only sim-side data is persisted (observations, events, label assignments, clusters). Derived UI state (
bestiary_discovered flags, ranked-confidence caches) is not serialised.
Out of scope
- Schema migrations across game versions (open a separate epic if/when v1 → v2 save migration becomes a goal).
- Compression — bincode raw is fine until the size budget bites.
Effort
2 pts.
Dependencies
- All previous S12 stories landed (12.1 events, 12.2 clusters, 12.3 cluster labels, 12.4 cluster confidence are all sub-state of the chronicler).
Sprint S12 story 6 of 7 — tracker for epic #24.
Scope
PatternObservation,PatternSignature,Label, etc. already deriveSerialize/Deserialize. S12.6 wires theChronicleritself for bincode roundtrip + adds a determinism-gated test that asserts byte-identical encodings across two runs.API sketch
#[derive(Serialize, Deserialize)]onChronicleritself (the few fields it owns are already derive-friendly) + a workspace-alignedbincodedep.DoD
ChroniclerisSerialize + Deserialize. Round-tripping via bincode produces a value that compares equal to the original (PartialEqonChronicler+ member types).ChroniclerLoadErrorcovers the three failure modes: corrupted bytes (bincode error), schema-version mismatch, signature checksum mismatch.cargo fmt+ clippy clean.no_hardcoded_label_strings.rsaudit stays green; the chronicler persists only what S10.5–S12.4 already track).INVARIANTS compliance
bestiary_discoveredflags, ranked-confidence caches) is not serialised.Out of scope
Effort
2 pts.
Dependencies