From 9bf8a5a24352d8291250137350e753e65d3336df Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 9 Aug 2026 03:52:16 +0100 Subject: [PATCH] Demote stale CRRC routing after relinquishment --- Cargo.lock | 1 + Cargo.toml | 3 ++ epiphany-core/src/bin/epiphany-mvp-status.rs | 27 ++++++++++ epiphany-core/src/surfaces/coordinator.rs | 48 +++++++++++++++--- .../src/surfaces/coordinator_contract.rs | 4 ++ notes/epiphany-current-algorithmic-map.md | 39 +++++++++++--- notes/fresh-workspace-handoff.md | 26 ++++++++++ state/ledgers.msgpack | Bin 586079 -> 586431 bytes state/map.yaml | 10 ++-- 9 files changed, 140 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1da5a413..d51ff727 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2175,6 +2175,7 @@ dependencies = [ "serde_json", "sha1", "sha2 0.10.9", + "tempfile", "tokio", "toml", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 31aff1d8..7dae0bac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,6 +53,9 @@ windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_Securit [target.'cfg(unix)'.dependencies] libc = "0.2" +[dev-dependencies] +tempfile = "3" + [patch.crates-io] tokio-tungstenite = { git = "https://github.com/openai-oss-forks/tokio-tungstenite", rev = "132f5b39c862e3a970f731d709608b3e6276d5f6" } tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "9200079d3b54a1ff51072e24d81fd354f085156f" } diff --git a/epiphany-core/src/bin/epiphany-mvp-status.rs b/epiphany-core/src/bin/epiphany-mvp-status.rs index a0f9a766..5e591203 100644 --- a/epiphany-core/src/bin/epiphany-mvp-status.rs +++ b/epiphany-core/src/bin/epiphany-mvp-status.rs @@ -491,6 +491,11 @@ fn run_native_status(args: &Args, include_auxiliary_status: bool) -> Result Result, + runtime_store: &Path, + relinquishment: Option<&epiphany_core::RepoFrontierRelinquishmentReceipt>, +) -> Result { + let Some(relinquishment) = relinquishment else { + return Ok(true); + }; + let Some(job_id) = latest_runtime_job_id_for_binding(state, REORIENT_BINDING_ID) else { + return Ok(false); + }; + let Some(snapshot) = runtime_job_snapshot(runtime_store, job_id)? else { + return Ok(false); + }; + let reorient_updated_at = chrono::DateTime::parse_from_rfc3339(&snapshot.job.updated_at) + .context("reorientation job updated_at is not RFC3339")?; + let relinquished_at = chrono::DateTime::parse_from_rfc3339(&relinquishment.relinquished_at) + .context("frontier relinquishment timestamp is not RFC3339")?; + Ok(reorient_updated_at > relinquished_at) +} + fn reconcile_native_runtime_jobs( jobs: &mut [epiphany_core::EpiphanyJobView], state: Option<&EpiphanyThreadState>, diff --git a/epiphany-core/src/surfaces/coordinator.rs b/epiphany-core/src/surfaces/coordinator.rs index 642a4b6f..bd9ba6a5 100644 --- a/epiphany-core/src/surfaces/coordinator.rs +++ b/epiphany-core/src/surfaces/coordinator.rs @@ -55,17 +55,13 @@ pub fn derive_coordinator_status( .iter() .map(coordinator_role_lane_from_role_board) .collect(); + let routing_recommendation = + routing_crrc_recommendation(&input.recommendation, input.crrc_regather_current); let decision = recommend_coordinator_action(EpiphanyCoordinatorInput { state_status: input.state_status, checkpoint_present: input.checkpoint_present, should_prepare_compaction: input.pressure.should_prepare_compaction, - recommendation: EpiphanyCoordinatorCrrcRecommendation { - action: input.recommendation.action, - recommended_scene_action: input - .recommendation - .recommended_scene_action - .map(crrc_scene_action_to_coordinator_scene_action), - }, + recommendation: routing_recommendation, roles: coordinator_roles, signals: EpiphanyCoordinatorSignals { research_result_status: input.research_result_status, @@ -106,6 +102,24 @@ pub fn derive_coordinator_status( } } +fn routing_crrc_recommendation( + recommendation: &epiphany_core::EpiphanyCrrcRecommendation, + regather_current: bool, +) -> EpiphanyCoordinatorCrrcRecommendation { + if recommendation.action == EpiphanyCrrcAction::RegatherManually && !regather_current { + return EpiphanyCoordinatorCrrcRecommendation { + action: EpiphanyCrrcAction::Continue, + recommended_scene_action: None, + }; + } + EpiphanyCoordinatorCrrcRecommendation { + action: recommendation.action, + recommended_scene_action: recommendation + .recommended_scene_action + .map(crrc_scene_action_to_coordinator_scene_action), + } +} + pub fn derive_coordinator_finding_signals( state: Option<&EpiphanyThreadState>, research_finding: Option<&EpiphanyRoleFindingInterpretation>, @@ -1249,6 +1263,26 @@ mod tests { use epiphany_state_model::EpiphanyAcceptanceReceipt; use epiphany_state_model::EpiphanyEvidenceRecord; + #[test] + fn relinquishment_demotes_older_manual_regather_to_observation_only() { + let recommendation = epiphany_core::EpiphanyCrrcRecommendation { + action: EpiphanyCrrcAction::RegatherManually, + recommended_scene_action: Some(EpiphanyCrrcSceneAction::ReorientResult), + reason: "historical failed reorientation".to_string(), + }; + + let stale = routing_crrc_recommendation(&recommendation, false); + assert_eq!(stale.action, EpiphanyCrrcAction::Continue); + assert_eq!(stale.recommended_scene_action, None); + + let current = routing_crrc_recommendation(&recommendation, true); + assert_eq!(current.action, EpiphanyCrrcAction::RegatherManually); + assert_eq!( + current.recommended_scene_action, + Some(EpiphanyCoordinatorSceneAction::ReorientResult) + ); + } + fn base_roles() -> Vec { vec![ role( diff --git a/epiphany-core/src/surfaces/coordinator_contract.rs b/epiphany-core/src/surfaces/coordinator_contract.rs index 5d19112e..882258fb 100644 --- a/epiphany-core/src/surfaces/coordinator_contract.rs +++ b/epiphany-core/src/surfaces/coordinator_contract.rs @@ -184,6 +184,10 @@ pub struct EpiphanyCoordinatorStatusInput { pub checkpoint_present: bool, pub pressure: EpiphanyPressure, pub recommendation: EpiphanyCrrcRecommendation, + /// True when CRRC's manual-regather pressure is causally newer than the + /// latest typed frontier relinquishment. Raw CRRC remains observable when + /// false, but it cannot route Self from stale continuity history. + pub crrc_regather_current: bool, pub roles: Vec, pub reorient_action: EpiphanyReorientAction, pub research_result_status: EpiphanyCoordinatorRoleResultStatus, diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index e4afe2a1..4d867414 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -1868,9 +1868,36 @@ artifact scope. Mind-owned relinquishment `7b846272...` atomically retired route `817bf422...`, advanced RepoModel from revision 2 to 3, and preserved the adopted route as immutable history. -The next Self projection returns `regatherManually` solely because the legacy -CRRC still carries an old failed reorientation result. That failure predates the -now-terminal Eyes-to-Mind circuit and the relinquishment. A historical CRRC -failure is not fresh Eyes pressure. Routing precedence must compare causal -freshness or terminal consumption before allowing that projection to select the -next organ; prompt language must not compensate for the missing ownership cut. +The status owner now compares the latest bound reorientation job `updated_at` +with the latest typed relinquishment `relinquished_at`. No relinquishment keeps +the ordinary CRRC path. After relinquishment, a missing or older reorientation +job makes manual-regather pressure stale. Coordinator status preserves the raw +CRRC source projection but feeds routing `Continue` with no scene action to +Self. A newer reorientation result retains ordinary manual-regather authority. + +The focused policy regression passed 1/1. A collision-safe copy of the c005 +`eyes-tools` store derived `awaitFrontierProposal`, `canAutoRun=false`, and +target Imagination while source signals still published raw CRRC +`regatherManually`. The live c005 store was never mounted. CRRC therefore owns +continuity observation, Self owns routing, and relinquishment is the causal +boundary preventing dead continuity history from impersonating current Eyes +pressure. + +## Build runner and dependency-graph authority receipt (2026-08-09) + +The persistent target is useful only when the build process names it as +`CARGO_TARGET_DIR`; mounting a volume at `/target` alone carries no authority. +One rejected invocation silently compiled into `/workspace/target` for 17m48s +before operator intervention stopped it. A cached `CARGO_HOME` must also not +cover `/usr/local/cargo`, where the image keeps its Rust proxies. The working +contract uses a separate cache mount, explicit target directory, and explicit +Rust proxy path. It rebuilt the current coordinator in 37.55s with dependencies +warm. + +The remaining structural defect is independent dependency resolution: +`epiphany-self-policy/Cargo.lock` forced a 6m34s cold graph for one focused test, +while the state steward previously forced a 7m11s graph. One root Cargo +workspace/lock graph should own release binaries, policy tests, and typed state +stewardship. The exact release witness remains package identity authority; the +workspace and native runner own iteration reuse. Additional caches are +forbidden compensators. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 29814eab..7dd74970 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1,5 +1,31 @@ # Fresh workspace handoff +## Stale CRRC authority cut and copied c005 replay — 2026-08-09 + +Self no longer lets a failed reorientation result older than typed frontier +relinquishment `repo-frontier-relinquishment-7b846272...` route the next organ. +The status owner compares the latest bound reorientation job update with the +relinquishment timestamp. Coordinator status demotes only stale manual-regather +pressure to routing Continue; raw CRRC remains published as +`regatherManually`. The focused causal regression passed 1/1. + +A collision-safe copy of c005 `state/eyes-tools` was replayed for thread +`linux-eyes-tools-c005`. It derived `awaitFrontierProposal`, +`canAutoRun=false`, and target Imagination while source signals still reported +raw CRRC `regatherManually`. The live c005 store was not mounted. Receipts are +under the directory named by `.epiphany-run/stale-crrc-replay-current.txt`; the +valid proof is `replay-c005-eyes-output.log`. Earlier root-store/fresh-thread +replays are rejected-path receipts, not c005 evidence. + +The independent `epiphany-self-policy` lock graph paid 6m34s for this one cold +test. A misconfigured Docker invocation then omitted `CARGO_TARGET_DIR`, +compiled into `/workspace/target` for 17m48s, and was proactively stopped with +logs preserved under `.epiphany-run/stale-crrc-build/`. With the target, Cargo +home, and Rust proxy path explicitly separated, the coordinator rebuilt in +37.55s. Encode that contract in one native launcher and collapse the policy +test plus state steward into the root dependency authority. Do not add another +cache. + ## Resident Mind terminal adoption and warm package proof — 2026-08-09 Exact pushed source `bd96305e60428b8ea2af822f1e1a233405c09c43` is packaged and diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 92bf1fbed80e65f5151398cce90c584f32cc9eeb..9c11eee9aca7cc542e517257a9739d0c8e9f8767 100644 GIT binary patch delta 385 zcmXYru}%U(5QaTOrLnP~u$qMW$a!#}*hy`JR(9*&02}vq&)qpLR1_AzfP}_}z*rb7 ztt@;A6BAn#-@rLz@nwqn|8M5wv-R@TS~r8;c#s?ny8Vl{jmFRYV=K50g7jutyIs}- zrka~fo!MfxnVqL)t?~Z7clR7eaW9Mx!|3QdsywTQMSVXD;xp7^kfQKHgR=!GGXYr; zRA~e!O8B>BLK!ZzR?rmPsW64mdJe**pt)GxCWKOWFqR;*g&|Daa8f8; z)g-E%Jou?CA-7t|IcO`dz~@>Kzvc;gS*Pp>4@aE5tgN0SPxjV#g)Bs;qUXGJ>oF MWuVh