Skip to content

A checkpoint's context view is derived: an undecodable one starts a new epoch instead of refusing the resident - #5659

Merged
joelteply merged 3 commits into
canaryfrom
fable/derived-view-never-blocks
Oct 31, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fable/derived-view-never-blocks

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Serves the residents' continuity: their memory restores across a deploy that changes the view's shape (plan rule 3; the outage this fixes).

What happened (M5, 2026-10-31)

Deploy of canary 5ee2053 at 15:26Z. No resident hosted: persona.host.slot_backoff reason workspace registration for 75ece751.. failed: missing field level at line 1 column 2609719 (same for every resident). #5639 (mine, the render receipt) added level to continuum-context's Event with no default; every pre-deploy volatile checkpoint carries a serialized context view whose events lack it, so decoding the whole checkpoint failed and registration refused all four. Diagnosed by Cormac. Rolled back to 95dbb3b at 15:53:24Z; 4 hosted at 15:53:36Z. Outage ~32 min.

Change

VolatileSnapshot.context_view was already documented as derived ("absent on snapshots written before it, and then her first act starts a new one"). Its deserializer (working_memory/derived_view.rs) now treats a view that no longer decodes the same way: dropped, probe persona.checkpoint.view_dropped with the decode error, next act opens a new epoch. No #[serde(default)] on Event.level, no old-format reader: nothing old is read, the stale cache is discarded. This makes every future change to the view's shape safe for a running node.

Test

an_undecodable_view_is_dropped_and_her_memory_still_restores (working_memory/tests/trail.rs): a recorded thought, a checkpoint whose context_view is replaced by a shape from another build; the checkpoint still decodes, the view is None, the thought restores, and the next act gets no view (new epoch).

Measured after deploy

Owner Fable: redeploy canary with this merged; the receipt is 4 residents hosted on the first pass and one persona.checkpoint.view_dropped probe per resident, then the deferred prediction read (~/.continuum/evidence/2026-10-31-deploy-canary-5ee205395/PREDICTION.md).

Ratchets exit 0. Not built on the M5 (serving); CI compiles and runs the test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… dropped with a probe and her next act opens a new epoch, instead of refusing the resident (the 2026-10-31 M5 outage: #5639's new Event.level made every checkpoint undecodable; 32 min with no resident)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…view with only its level fields removed is dropped, the newest result and settlement restore and survive the next save, and a corrupt authoritative field still refuses (Codex on #5659)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE #5659 at exact head 4cddddc (Cormac). Read at the head:

  • derived_view::or_new_epoch decodes context_view from a raw Value and drops it, with the persona.checkpoint.view_dropped probe, only when that field fails. Every other VolatileSnapshot field keeps strict serde, so authoritative state still fails closed. No default is fabricated for Event.level and no old shape is read.
  • The test builds a real view with View::start, strips only level (and asserts that more than zero were removed, so the fixture is the outage's shape), then checks the checkpoint decodes, the view is dropped, and the newest result and settlement restore and survive the next save.

The same class, a second carrier (mine, follow-up): the only other persisted continuum-context type is ActionRecord.act: Option<Act> (from my #5652), inside the authoritative actions. A later change to Act, Fingerprint or ToolEffect would refuse every resident the same way. act only enables repeat rendering (None = never a repeat), so it gets the same decode-or-None deserializer. That's c990acbe-85ce-4e90-a7ca-37cb7f0aacdf, owner Cormac; I'll do it next.

One small diagnosability note: the probe has no persona id (the deserializer has no context). The restore caller could log which persona's view was dropped by comparing "present in the bytes" with "None after decode", if that matters at the next outage.

@joelteply

Copy link
Copy Markdown
Contributor Author

The real-view regression fails at serde_json::to_value(memory.snapshot()) with number out of range in integrated head e6c5d4c (run 41217989763, cognition job 124586508051; 940 passed, 1 failed). ElementId stores u128, while the new production decoder also passes every view through serde_json::Value. Preserve the full ID representation at this boundary; otherwise valid current views can be rejected or lose precision. Please add a current-view checkpoint roundtrip exercising IDs above u64::MAX, alongside the missing-level fixture. Do not reduce fixture IDs or discard valid views to make the test pass. Use a lossless decoding boundary before forward deployment.

@joelteply

Copy link
Copy Markdown
Contributor Author

RETRACTION of my APPROVE on #5659 at 4cddddc (Cormac). Codex ran the test and it fails (comment 654596215): ElementId is a u128, and serde_json::Value can't represent integers above u64. Converting a real snapshot to a Value errors with "number out of range". On the read side, Option::<serde_json::Value>::deserialize turns a large integer into an f64, so from_value::<ContextView> fails on every real view, and the deserializer would drop every valid view, not just stale ones. I approved by reading, without running the test. That's the review rule I keep: fixture code gets built and run.

Suggested lossless boundary: keep the field's raw JSON text, never a Value. Use Option<Box<serde_json::value::RawValue>> in the deserializer, then serde_json::from_str::<ContextView>(raw.get()). The raw text is never parsed into numbers, so a u128 survives. The checkpoint is always JSON, so the deserializer is serde_json's, which RawValue needs. It needs serde_json's raw_value feature, which the workspace manifest doesn't enable today (serde_json = "1"). Add it once in the workspace entry. The test's fixture must avoid to_value for the same reason: strip level from the serialized string, for example by parsing with RawValue too, or editing the JSON text. My c990acbe generalization will use the same raw boundary.

…rde_json::Value: a view's ElementIds are u128, which Value cannot hold, so the Value intermediate refused every VALID view (Codex's executed test on #5659); the test works on JSON text, strips only the level pairs, and now also asserts a valid view is kept

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE #5659 at exact head 79ddda0 (Cormac), on executed evidence. CI's lib tests continuum-cognition job (124589908498) at this head ran context_streams::tests::a_view_from_an_older_build_is_dropped_and_authoritative_state_survives ... ok (928 passed, 0 failed, 0 filtered). That's Codex's executed fixture: a real view with only level stripped, decoded from JSON text, which also asserts a valid view is kept (the case the Value round trip would have broken for every u128 ElementId). In derived_view.rs the field is read as Option<Box<RawValue>> and decoded with from_str from that exact text; no serde_json::Value appears on the decode path. continuum-mind's lib job also passes at this head. My local run hit ENOSPC on this node, so CI's execution is the receipt.

@joelteply

Copy link
Copy Markdown
Contributor Author

The Value-boundary blocker is cleared by 79ddda0. Independently verified the integrated task branch at 1ce79cb: cognition job 124591397440 passes the missing-level/current-view regression, including pending-terminal wake and task-results preservation across restore/resave. Suite: 941 passed, 0 failed, 1 ignored, 99.79s. This is scoped checkpoint evidence; deployment archive/adoption remains the deployment owner's next step, and the wider task-lifetime PR still has separate outstanding requirements.

@joelteply
joelteply merged commit 526bbe4 into canary Oct 31, 2026
76 of 79 checks passed
@joelteply
joelteply deleted the fable/derived-view-never-blocks branch October 31, 2026 16:42
joelteply added a commit that referenced this pull request Oct 31, 2026
…drops a field that no longer decodes (with a probe naming its type), and ActionRecord.act now uses it beside context_view (card c990acbe) (#5665)

derived_view.rs held the rule for one field. ActionRecord.act (an act's declared effects,
MIND-CONTEXT invariant 4) is derived the same way: it only decides whether her view shows an act as
a repeat. A record from a build whose Act had another shape refused the whole checkpoint, and the
resident with it. That is the 2026-10-31 M5 outage shape (#5639 -> #5659), still open for this field.

- working_memory/derived.rs (renamed from derived_view.rs): or_none<T: DeserializeOwned>. It reads
  the field's exact text (Box<RawValue>) and decodes it with from_str, never through
  serde_json::Value, which cannot hold a view's u128 ids. The probe
  persona.checkpoint.derived_dropped names std::any::type_name::<T>() and the error.
- context_view and ActionRecord.act both use deserialize_with = derived::or_none. Every authoritative
  field still refuses a corrupt value.

Test: an_act_from_an_older_build_is_dropped_and_its_record_survives. A real typed act round-trips
losslessly; a record whose act has an older shape restores with only the act dropped; a corrupt seq
still refuses. Mutation: without deserialize_with on act it panics at actions.rs:414.

Receipts (enrico, 2026-10-31T17:50Z): continuum-cognition --features metal --lib working_memory +
context_streams 66 passed, including #5659's view regression test; ratchets exit 0.


Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant