From df822e93f5dd1392c2112a8e065f6e026334f880 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 05:38:03 +0100 Subject: [PATCH] Mark Epiphany rollout state as legacy --- notes/fresh-workspace-handoff.md | 4 ++++ notes/native-coordinator-liberation-map.md | 6 ++++++ state/ledgers.msgpack | Bin 411434 -> 411799 bytes state/map.yaml | 2 +- .../src/protocol/thread_history.rs | 2 +- .../legacy_epiphany_rollout.rs | 6 +++--- .../codex/codex-rs/core/src/agent/control.rs | 2 +- .../src/session/rollout_reconstruction.rs | 4 ++-- .../session/rollout_reconstruction_tests.rs | 2 +- .../codex/codex-rs/core/src/session/tests.rs | 9 +++++---- .../codex/codex-rs/protocol/src/protocol.rs | 7 ++++--- vendor/codex/codex-rs/rollout/src/list.rs | 4 ++-- vendor/codex/codex-rs/rollout/src/metadata.rs | 4 ++-- vendor/codex/codex-rs/rollout/src/policy.rs | 2 +- vendor/codex/codex-rs/rollout/src/recorder.rs | 6 +++--- vendor/codex/codex-rs/state/src/extract.rs | 4 ++-- .../codex-rs/state/src/runtime/threads.rs | 4 ++-- 17 files changed, 40 insertions(+), 28 deletions(-) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index a148dc96..505315af 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1922,6 +1922,10 @@ native-state dependency in any dependency class, its giant state fixture is gone, and a minimal opaque historical-envelope test remains. Next rename the variant `LegacyEpiphanyState` while preserving serde tag `epiphany_state`, then judge whether generic unknown-rollout cargo can remove its final named trace. +The rename is complete and tested: all Rust matches say +`LegacyEpiphanyState`, serde still emits/reads `epiphany_state`, and migration +behavior is unchanged. Next audit a generic unknown historical rollout carrier, +but reject it if it weakens strict decoding of live Codex history. ## Immediate Re-entry Instruction diff --git a/notes/native-coordinator-liberation-map.md b/notes/native-coordinator-liberation-map.md index 9c39db09..b38be413 100644 --- a/notes/native-coordinator-liberation-map.md +++ b/notes/native-coordinator-liberation-map.md @@ -326,3 +326,9 @@ giant `EpiphanyThreadState` fixture and native round-trip tests are replaced by one minimal opaque-envelope preservation test. `codex-protocol` has no `epiphany-state-model` dependency in production or dev configuration; native state serialization is tested by its actual owner. + +The opaque Rust variant is now named `LegacyEpiphanyState`, with an explicit +`#[serde(rename = "epiphany_state")]` preserving the historical wire/file tag. +Every remaining Codex match therefore declares that it handles quarantine +cargo rather than live Epiphany authority. Protocol shape and app-server +migration tests prove the rename did not change old-file compatibility. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 0371023af637964e3a49c3bb09a69a6887d297a4..1ff077f20280f161f37c98e635de12e317617494 100644 GIT binary patch delta 337 zcmXYry-EW?6ouUwx3Ll|Od}U;lMvTnFpX#oqKHajWfOGivN*WXLwF@0$fv;%NQ#E9ykMtxm7C9bI+0{iGtoVbc?!+}yTFfq;{VZ;SG z&}IfP@`+*=AFoLhfKDq(TtVk+G691*hYSb8v#Cl_OzNJFjM(+Hh$N8EzDy lo}w}yAav9O5*D$17=)W^Y1;DdP0@mP^SdULhr=)m+P`ejboBrL delta 57 zcmbO}QF2wEz`&1^j GsV)HUIS}ap diff --git a/state/map.yaml b/state/map.yaml index 72446b97..1633a583 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -659,4 +659,4 @@ current_status: - Service lifecycle receipt history is now event-only: `load_epiphany_cultmesh_daemon_service_lifecycle_receipts` filters out the `epiphany-local/daemon-service-lifecycle-receipt/latest` mirror, while `load_latest_epiphany_cultmesh_daemon_service_lifecycle_receipt` remains the latest-state reader. Focused unit test `service_lifecycle_receipt_history_excludes_latest_mirror` proves two per-receipt writes return exactly two history records and latest points at the second. Fresh smoke `verse-query-lifecycle-history-filter-smoke` and live overview/triage `local-20260618-145632-497-efac6f0d` / `local-20260618-145632-321-867947af` prove compact swarm sights still expose service lifecycle attention plus the present elevated runbook artifact without daemon pokes or service mutation. Do not use a broad unscoped cargo test filter for this check on Windows; it fans out across bin harnesses and hit a broken pipe during this pass. - `epiphany-verse-query seed-compact` is the compact seed receipt for wrappers and read-only rites. The older `seed` command still prints the full local Verse context for explicit debugging, but compact wrapper modes now avoid full `seed`/final `query` readback after the combined overview proof exposed Windows debug stack overflow from full-context serialization pressure. last_completed_repo_swarm_cut: Huginn live-fire has crossed the first real repo Body from Persona pressure to branch-local Hands commit and Soul/Mind closure, and now has repeatable closure and redacted-public-proof mouths. On `E:\Projects\Huginn` branch `epiphany/huginn/first-awakening`, `tools/epiphany_local_run.ps1 -Mode repo-persona-intake` accepted item `huginn-inspection-readback-livefire`, Weksa/Persona intake remained sealed, and `epiphany-work derive-plan` lowered it to model-authored safe family `repo.status_section` for `README.md` only. `tools/epiphany_local_run.ps1 -Mode repo-swarm-run` advanced four bounded pulses: run-from-plan, adopt-from-plan, execute-from-plan, and close-from-execute. Huginn commit `e9b07c38fceabbdc89ea35c2156326c80c0393a2` updated only `README.md`; closure receipt `.epiphany\work\work-close-huginn-inspection-readback-livefire.json` records status `closed`, Soul verdict `passed`, Mind state commit `repo-work-close-huginn-inspection-readback-livefire-mind-commit`, safe family `repo.status_section`, path scope `README.md`, Bifrost publication gate, and `privateStateExposed=false`. Verification also ran Huginn's TypeScript compiler through concrete Node path: `C:\Program Files\nodejs\node.exe E:\Projects\Huginn\node_modules\typescript\bin\tsc -p tsconfig.json` passed. Native verifier `epiphany-repo-livefire-closure-smoke --workspace E:\Projects\Huginn --item huginn-inspection-readback-livefire --expected-path README.md --expected-family repo.status_section --expected-gate awaiting-publication --expected-blocker bifrost-publication-missing` checks closure receipt, Mind map entry, overview gate/blocker, authority seals, and `git show` changed paths, returning `status=ok`, `soulVerdict=passed`, `publicationGate=Bifrost`, and `privateStateExposed=false`. Wrapper `tools/epiphany_local_run.ps1 -Mode repo-livefire-closure -Workspace E:\Projects\Huginn -RepoWorkItem huginn-inspection-readback-livefire -SkipBuild` exposes the same read-only proof through the local operator mouth; artifact `local-20260621-190156-803-2f85ba15` printed commit, path, gate, blocker, Soul verdict, Mind commit receipt, and `privateStateExposed=False` without push, merge, publication, or target mutation. New wrapper `tools/epiphany_local_run.ps1 -Mode repo-work-public-proof -Workspace E:\Projects\Huginn -RepoWorkItem huginn-inspection-readback-livefire -SkipBuild` exports the redacted proof bundle and repo-local Verse index without publishing; artifact `local-20260621-190645-345-4555b1dc` wrote `.epiphany\public\proof-bundles\repo-work-public-proof-huginn-inspection-readback-livefire.json`, proof id `repo-work-public-proof-huginn-inspection-readback-livefire`, SHA-256 `857545b199f3e37eb06c2e757e5cfc201958e46667bb1f8403fd333a22620f63`, nine artifact rows, zero publication rows, and `privateStateExposed=False`. Gjallar readback `local-20260621-190701-140-b9519ec6` sees the `REPO-WORK-PUBLIC-PROOF` row and action row from Huginn's repo-local Verse with the same SHA-256 while Bifrost publication remains missing. Launcher compact modes are now named compact operator-context modes instead of read-only modes, and `bifrost-public-proof` summaries print item, target public Verse, room, proof SHA-256, review receipts, and credit receipts so publication receipts are auditable without claiming upstream sync. - next_action: Rename the opaque protocol variant to `LegacyEpiphanyState` with `#[serde(rename = "epiphany_state")]` so every remaining core match states its quarantine status while preserving old JSON exactly. Then audit whether a generic unknown-rollout compatibility carrier can delete even that named core knowledge without weakening old-file recovery. + next_action: Audit whether `RolloutItem` can carry unknown historical item kinds generically, allowing `LegacyEpiphanyState` to leave codex-protocol/core entirely while app-server migration still recognizes `type=epiphany_state`. Do not adopt a generic blob carrier unless it preserves strict decoding for live Codex items and quarantines unknown cargo without turning malformed current rollouts into silent success. diff --git a/vendor/codex/codex-rs/app-server-protocol/src/protocol/thread_history.rs b/vendor/codex/codex-rs/app-server-protocol/src/protocol/thread_history.rs index a9c87fbb..c6036d1e 100644 --- a/vendor/codex/codex-rs/app-server-protocol/src/protocol/thread_history.rs +++ b/vendor/codex/codex-rs/app-server-protocol/src/protocol/thread_history.rs @@ -233,7 +233,7 @@ impl ThreadHistoryBuilder { RolloutItem::Compacted(payload) => self.handle_compacted(payload), RolloutItem::ResponseItem(item) => self.handle_response_item(item), RolloutItem::TurnContext(_) - | RolloutItem::EpiphanyState(_) + | RolloutItem::LegacyEpiphanyState(_) | RolloutItem::SessionMeta(_) => {} } } diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/legacy_epiphany_rollout.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/legacy_epiphany_rollout.rs index 290ec11a..acedf8f4 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/legacy_epiphany_rollout.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/legacy_epiphany_rollout.rs @@ -68,7 +68,7 @@ pub(super) fn latest_legacy_epiphany_state( RolloutItem::ResponseItem(ResponseItem::Message { role, .. }) if role == "user" => { segment.get_or_insert_with(LegacySegment::default).user_turn = true; } - RolloutItem::EpiphanyState(payload) => { + RolloutItem::LegacyEpiphanyState(payload) => { let item: epiphany_state_model::EpiphanyStateItem = serde_json::from_value(payload.clone()).map_err(|error| { format!("invalid legacy Epiphany rollout payload: {error}") @@ -137,7 +137,7 @@ mod tests { local_images: Vec::new(), text_elements: Vec::new(), })), - RolloutItem::EpiphanyState( + RolloutItem::LegacyEpiphanyState( serde_json::to_value(EpiphanyStateItem { turn_id: Some(id.to_string()), state, @@ -176,7 +176,7 @@ mod tests { #[test] fn rejects_malformed_legacy_state_payload() { - let items = vec![RolloutItem::EpiphanyState(serde_json::json!({ + let items = vec![RolloutItem::LegacyEpiphanyState(serde_json::json!({ "turn_id": "not-the-legacy-shape" }))]; diff --git a/vendor/codex/codex-rs/core/src/agent/control.rs b/vendor/codex/codex-rs/core/src/agent/control.rs index 04ff07e9..b02271f1 100644 --- a/vendor/codex/codex-rs/core/src/agent/control.rs +++ b/vendor/codex/codex-rs/core/src/agent/control.rs @@ -119,7 +119,7 @@ fn keep_forked_rollout_item(item: &RolloutItem) -> bool { // A forked child gets its own runtime config, including spawned-agent // instructions, so it must establish a fresh context diff baseline. RolloutItem::TurnContext(_) => false, - RolloutItem::EpiphanyState(_) => true, + RolloutItem::LegacyEpiphanyState(_) => true, RolloutItem::Compacted(_) | RolloutItem::EventMsg(_) | RolloutItem::SessionMeta(_) => true, } } diff --git a/vendor/codex/codex-rs/core/src/session/rollout_reconstruction.rs b/vendor/codex/codex-rs/core/src/session/rollout_reconstruction.rs index b640d609..00126a3d 100644 --- a/vendor/codex/codex-rs/core/src/session/rollout_reconstruction.rs +++ b/vendor/codex/codex-rs/core/src/session/rollout_reconstruction.rs @@ -182,7 +182,7 @@ impl Session { } } } - RolloutItem::EpiphanyState(_) => {} + RolloutItem::LegacyEpiphanyState(_) => {} RolloutItem::EventMsg(EventMsg::TurnStarted(event)) => { // `TurnStarted` is the oldest boundary of the active reverse segment. if active_segment.as_ref().is_some_and(|active_segment| { @@ -275,7 +275,7 @@ impl Session { } RolloutItem::EventMsg(_) | RolloutItem::TurnContext(_) - | RolloutItem::EpiphanyState(_) + | RolloutItem::LegacyEpiphanyState(_) | RolloutItem::SessionMeta(_) => {} } } diff --git a/vendor/codex/codex-rs/core/src/session/rollout_reconstruction_tests.rs b/vendor/codex/codex-rs/core/src/session/rollout_reconstruction_tests.rs index 4eda10dc..4bb99e38 100644 --- a/vendor/codex/codex-rs/core/src/session/rollout_reconstruction_tests.rs +++ b/vendor/codex/codex-rs/core/src/session/rollout_reconstruction_tests.rs @@ -15,7 +15,7 @@ use pretty_assertions::assert_eq; use std::path::PathBuf; fn legacy_epiphany_state(item: EpiphanyStateItem) -> RolloutItem { - RolloutItem::EpiphanyState( + RolloutItem::LegacyEpiphanyState( serde_json::to_value(item).expect("serialize legacy Epiphany rollout payload"), ) } diff --git a/vendor/codex/codex-rs/core/src/session/tests.rs b/vendor/codex/codex-rs/core/src/session/tests.rs index 37af90cf..7a72f3c4 100644 --- a/vendor/codex/codex-rs/core/src/session/tests.rs +++ b/vendor/codex/codex-rs/core/src/session/tests.rs @@ -148,7 +148,7 @@ use std::time::Duration as StdDuration; mod guardian_tests; fn legacy_epiphany_state(item: EpiphanyStateItem) -> RolloutItem { - RolloutItem::EpiphanyState( + RolloutItem::LegacyEpiphanyState( serde_json::to_value(item).expect("serialize legacy Epiphany rollout payload"), ) } @@ -169,7 +169,8 @@ fn codex_session_has_no_epiphany_state_custody() { assert!(!codex_thread.contains("pub async fn epiphany_")); assert!(!core_lib.contains("epiphany_rollout")); assert!(!protocol.contains("pub use epiphany_state_model::")); - assert!(protocol.contains("EpiphanyState(serde_json::Value)")); + assert!(protocol.contains("LegacyEpiphanyState(serde_json::Value)")); + assert!(protocol.contains("#[serde(rename = \"epiphany_state\")]")); assert!(!protocol_manifest.contains("epiphany-state-model")); } @@ -5198,7 +5199,7 @@ async fn record_context_updates_does_not_persist_epiphany_state() { !resumed .history .iter() - .any(|item| matches!(item, RolloutItem::EpiphanyState(_))) + .any(|item| matches!(item, RolloutItem::LegacyEpiphanyState(_))) ); } @@ -5244,7 +5245,7 @@ async fn record_context_updates_and_set_reference_context_item_skips_epiphany_st !resumed .history .iter() - .any(|item| matches!(item, RolloutItem::EpiphanyState(_))), + .any(|item| matches!(item, RolloutItem::LegacyEpiphanyState(_))), "epiphany state should not be persisted when session state is empty" ); } diff --git a/vendor/codex/codex-rs/protocol/src/protocol.rs b/vendor/codex/codex-rs/protocol/src/protocol.rs index 93e78cb3..03951cb3 100644 --- a/vendor/codex/codex-rs/protocol/src/protocol.rs +++ b/vendor/codex/codex-rs/protocol/src/protocol.rs @@ -2943,7 +2943,8 @@ pub enum RolloutItem { ResponseItem(ResponseItem), Compacted(CompactedItem), TurnContext(TurnContextItem), - EpiphanyState(serde_json::Value), + #[serde(rename = "epiphany_state")] + LegacyEpiphanyState(serde_json::Value), EventMsg(EventMsg), } @@ -5111,13 +5112,13 @@ mod tests { "objective": "historical compatibility only" } }); - let item = RolloutItem::EpiphanyState(payload.clone()); + let item = RolloutItem::LegacyEpiphanyState(payload.clone()); let encoded = serde_json::to_value(&item)?; assert_eq!(encoded["type"], "epiphany_state"); assert_eq!(encoded["payload"], payload); let reparsed: RolloutItem = serde_json::from_value(encoded)?; - let RolloutItem::EpiphanyState(reparsed_payload) = reparsed else { + let RolloutItem::LegacyEpiphanyState(reparsed_payload) = reparsed else { panic!("expected opaque legacy Epiphany rollout payload"); }; assert_eq!(reparsed_payload, payload); diff --git a/vendor/codex/codex-rs/rollout/src/list.rs b/vendor/codex/codex-rs/rollout/src/list.rs index fa6488a7..a2f12c2a 100644 --- a/vendor/codex/codex-rs/rollout/src/list.rs +++ b/vendor/codex/codex-rs/rollout/src/list.rs @@ -1127,7 +1127,7 @@ async fn read_head_summary(path: &Path, head_limit: usize) -> io::Result { // Not included in `head`; skip. } - RolloutItem::EpiphanyState(_) => { + RolloutItem::LegacyEpiphanyState(_) => { // Not included in `head`; skip. } RolloutItem::Compacted(_) => { @@ -1186,7 +1186,7 @@ pub async fn read_head_for_summary(path: &Path) -> io::Result {} } } diff --git a/vendor/codex/codex-rs/rollout/src/metadata.rs b/vendor/codex/codex-rs/rollout/src/metadata.rs index bcb48ec9..b1a159c8 100644 --- a/vendor/codex/codex-rs/rollout/src/metadata.rs +++ b/vendor/codex/codex-rs/rollout/src/metadata.rs @@ -73,7 +73,7 @@ pub fn builder_from_items( RolloutItem::ResponseItem(_) | RolloutItem::Compacted(_) | RolloutItem::TurnContext(_) - | RolloutItem::EpiphanyState(_) + | RolloutItem::LegacyEpiphanyState(_) | RolloutItem::EventMsg(_) => None, }) && let Some(builder) = builder_from_session_meta(session_meta, rollout_path) { @@ -128,7 +128,7 @@ pub async fn extract_metadata_from_rollout( RolloutItem::ResponseItem(_) | RolloutItem::Compacted(_) | RolloutItem::TurnContext(_) - | RolloutItem::EpiphanyState(_) + | RolloutItem::LegacyEpiphanyState(_) | RolloutItem::EventMsg(_) => None, }), parse_errors, diff --git a/vendor/codex/codex-rs/rollout/src/policy.rs b/vendor/codex/codex-rs/rollout/src/policy.rs index af58beec..ad067d9e 100644 --- a/vendor/codex/codex-rs/rollout/src/policy.rs +++ b/vendor/codex/codex-rs/rollout/src/policy.rs @@ -18,7 +18,7 @@ pub fn is_persisted_response_item(item: &RolloutItem, mode: EventPersistenceMode // Persist Codex executive markers so we can analyze flows (e.g., compaction, API turns). RolloutItem::Compacted(_) | RolloutItem::TurnContext(_) - | RolloutItem::EpiphanyState(_) + | RolloutItem::LegacyEpiphanyState(_) | RolloutItem::SessionMeta(_) => true, } } diff --git a/vendor/codex/codex-rs/rollout/src/recorder.rs b/vendor/codex/codex-rs/rollout/src/recorder.rs index 0191391e..a88f8a0e 100644 --- a/vendor/codex/codex-rs/rollout/src/recorder.rs +++ b/vendor/codex/codex-rs/rollout/src/recorder.rs @@ -880,8 +880,8 @@ impl RolloutRecorder { RolloutItem::TurnContext(item) => { items.push(RolloutItem::TurnContext(item)); } - RolloutItem::EpiphanyState(item) => { - items.push(RolloutItem::EpiphanyState(item)); + RolloutItem::LegacyEpiphanyState(item) => { + items.push(RolloutItem::LegacyEpiphanyState(item)); } RolloutItem::EventMsg(_ev) => { items.push(RolloutItem::EventMsg(_ev)); @@ -1846,7 +1846,7 @@ async fn resume_candidate_matches_cwd( RolloutItem::SessionMeta(_) | RolloutItem::ResponseItem(_) | RolloutItem::Compacted(_) - | RolloutItem::EpiphanyState(_) + | RolloutItem::LegacyEpiphanyState(_) | RolloutItem::EventMsg(_) => None, }) { diff --git a/vendor/codex/codex-rs/state/src/extract.rs b/vendor/codex/codex-rs/state/src/extract.rs index eeddbfcd..87915002 100644 --- a/vendor/codex/codex-rs/state/src/extract.rs +++ b/vendor/codex/codex-rs/state/src/extract.rs @@ -22,7 +22,7 @@ pub fn apply_rollout_item( RolloutItem::TurnContext(turn_ctx) => apply_turn_context(metadata, turn_ctx), RolloutItem::EventMsg(event) => apply_event_msg(metadata, event), RolloutItem::ResponseItem(item) => apply_response_item(metadata, item), - RolloutItem::Compacted(_) | RolloutItem::EpiphanyState(_) => {} + RolloutItem::Compacted(_) | RolloutItem::LegacyEpiphanyState(_) => {} } if metadata.model_provider.is_empty() { metadata.model_provider = default_provider.to_string(); @@ -39,7 +39,7 @@ pub fn rollout_item_affects_thread_metadata(item: &RolloutItem) -> bool { RolloutItem::EventMsg(_) | RolloutItem::ResponseItem(_) | RolloutItem::Compacted(_) - | RolloutItem::EpiphanyState(_) => false, + | RolloutItem::LegacyEpiphanyState(_) => false, } } diff --git a/vendor/codex/codex-rs/state/src/runtime/threads.rs b/vendor/codex/codex-rs/state/src/runtime/threads.rs index e325ee9d..ea42a08d 100644 --- a/vendor/codex/codex-rs/state/src/runtime/threads.rs +++ b/vendor/codex/codex-rs/state/src/runtime/threads.rs @@ -973,7 +973,7 @@ pub(super) fn extract_dynamic_tools(items: &[RolloutItem]) -> Option None, }) } @@ -984,7 +984,7 @@ pub(super) fn extract_memory_mode(items: &[RolloutItem]) -> Option { RolloutItem::ResponseItem(_) | RolloutItem::Compacted(_) | RolloutItem::TurnContext(_) - | RolloutItem::EpiphanyState(_) + | RolloutItem::LegacyEpiphanyState(_) | RolloutItem::EventMsg(_) => None, }) }