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 92bf1fbe..9c11eee9 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 37bea338..43e7ebc8 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -35,10 +35,10 @@ invariants: - Evidence and git retain history; this map retains only state that changes future decisions. current_status: - summary: Epiphany is a supervised engineering alpha on Starfire, not deployment-ready. The persistent c005 Linux body proves heartbeat, Self coordination, governed Eyes-to-Modeling cognition, causal routing, native Imagination, and dedicated Mind adoption without external consequence. Exact pushed bd96305e is packaged and published; its launch-owned identity repair carried the original candidate through one authorized Mind retry and a terminal Self decision. The same exact release rebuilt warm in 9.65 seconds after a 25m12s cold compile, proving stable Docker source/graph/Cargo-home retention is the fast iteration path. Yggdrasil remains the small public crossing body and is not a release forge. Resident crash/restart, long-duration plateau, log ownership, the admitted Hands frontier, and stable Starfire firewall ownership remain open. - latest_phase: Exact release sha256-01dbed4b015dabccc6f17df49118bba90195993da002f109bafd73f23b1d3a8f with witness sha256-c3ab5a602de9c58e3ffb23cc5d316e5e36d94a013a697a113af01b4b2cf00808 packages and publishes bd96305e. Failed Mind job 8e5952fb was superseded; authorized retry 2d2a3e8b completed, and Self committed adopt decision e7d7f3c7 against the original candidate. Hands then enforced the candidate's own rollback: current admitted evidence already proves the requested c005 coordinated circuit, while receipt-body reconciliation lies outside its two safe paths. No mutation occurred. Typed refusal hands-refusal-4cd85889 atomically retired route 817bf422 and advanced RepoModel 2 to 3 through relinquishment 7b846272. Self now falls back to historical CRRC regatherManually; that stale failed-reorientation projection is not fresh Eyes pressure. The cold package followed system-disk exhaustion and cache recovery; an identical warm package completed in 9.65 seconds wall with 0.81s and 0.65s Cargo phases and reproduced the exact release/witness. + summary: Epiphany is a supervised engineering alpha on Starfire, not deployment-ready. The persistent c005 Linux body proves heartbeat, Self coordination, governed Eyes-to-Modeling cognition, causal routing, native Imagination, dedicated Mind adoption, and typed Hands relinquishment without external consequence. Self now causally demotes pre-relinquishment CRRC manual-regather history while preserving the raw warning for operator sight; a copied c005 replay derives awaitFrontierProposal. Exact pushed bd96305e is packaged and published, and its identical warm package completed in 9.65 seconds. Yggdrasil remains the small public crossing body and is not a release forge. Resident crash/restart, long-duration plateau, log ownership, unified Cargo dependency authority, and stable Starfire firewall ownership remain open. + latest_phase: The status owner compares the latest reorientation update with typed frontier relinquishment 7b846272 before CRRC manual-regather pressure may route. Raw CRRC remains regatherManually, but stale pressure becomes Continue only at Self's routing boundary. The focused regression passed 1/1. A current coordinator rebuilt from the correctly retained target in 37.55 seconds, and a collision-safe copied c005 eyes-tools replay derived awaitFrontierProposal with no automatic action while still publishing raw regatherManually. The live store was never mounted. The pass also exposed two iteration wounds: epiphany-self-policy's independent lock graph cost 6m34s for one cold test, and an incorrectly specified Docker target path wasted 17m48s compiling outside the persistent cache before operator intervention stopped it with receipts. operational_state: - local_worktree: resident_mind_replay_complete_state_receipts_pending_commit + local_worktree: stale_crrc_causal_routing_fix_proven_on_copied_c005_pending_commit operator_wireguard: restored yggdrasil: canonical_small_public_crossing_body starfire: temporary_epiphany_cognition_body @@ -68,8 +68,8 @@ current_status: starfire_linux_modeling_peak: 109887488_bytes_resident_body_plus_modeling_circuit yggdrasil_epiphany_service_contract: repaired_in_gamecult_ops_812b427_not_installed resident_physiology: c005_swarm_with_217dd_and_bd96305e_worker_helpers_running - unresolved_authority: After typed Hands relinquishment retires the current route, Self falls back to a historical CRRC regatherManually result from failed reorientation instead of distinguishing stale pressure from a current frontier. Repository Body observation still performs two authenticated full-tree Git index/manifest passes; exact 217dd packaged observer evidence improved the same unchanged Body boundary to 94.521 seconds, but a coordinator-to-coordinator jobCommit replay has not been possible because the typed route advanced. Execute-mode workers require a persistent process body. Docker source/graph/Cargo-home cache retention is measured build authority for iteration speed, while disk/cache preflight and bounded cleanup are not yet native package orchestration. The unshipped state steward creates a second 7m11s graph. Keyed storage has not earned live migration. One Discord consequence remains blocked by the absent Yggdrasil credential. Resident stdout/stderr logs remain an unbounded supervisor-owned surface. - next_action: Map and repair Self routing precedence after route relinquishment so historical failed-reorientation CRRC pressure cannot impersonate a current Eyes frontier. Preserve relinquishment 7b846272 and do not recreate the retired planning route. Then make cache/disk preflight and the state-steward build boundary inspectable before continuing resident crash/restart, retention, and endurance work. + unresolved_authority: Cargo dependency and build-runner authority remain split. The root release graph can rebuild warm in 9.65 seconds, but epiphany-self-policy's independent lock graph cost 6m34s for one focused test and the unshipped state steward creates a second 7m11s graph. The Docker build contract is implicit enough that omitting CARGO_TARGET_DIR silently compiled for 17m48s outside the persistent cache. Repository Body observation still performs two authenticated full-tree Git index/manifest passes; exact 217dd packaged observer evidence improved the same unchanged Body boundary to 94.521 seconds. Execute-mode workers require a persistent process body. Keyed storage has not earned live migration. One Discord consequence remains blocked by the absent Yggdrasil credential. Resident stdout/stderr logs remain an unbounded supervisor-owned surface. + next_action: Make one Cargo workspace/lock graph and one native build-runner contract own shakedown compilation, including the policy test and state steward, while preserving the exact release witness as package authority. Prove a focused policy edit and state append reuse the warm graph. Then resume resident crash/restart, retention, and endurance work from awaitFrontierProposal without recreating relinquished route 817bf422. active_subgoals: - Prove Persona, Self, Eyes, Modeling, Imagination, Hands, Soul, Mind, Continuity, and nervous-system behavior individually.