diff --git a/epiphany-core/src/coordinator_launch_context.rs b/epiphany-core/src/coordinator_launch_context.rs index 4a9186ef..0250f597 100644 --- a/epiphany-core/src/coordinator_launch_context.rs +++ b/epiphany-core/src/coordinator_launch_context.rs @@ -361,11 +361,16 @@ pub fn has_complete_hands_consequence_after_latest_accepted_boundary( let Some(accepted_at) = latest_accepted_modeling_or_verification_timestamp(state) else { return Ok(false); }; - runtime_latest_hands_receipt_chain_after(runtime_store_path, accepted_at) - .map(|chain| chain.is_some()) + let chain = runtime_latest_hands_receipt_chain_after(runtime_store_path, accepted_at) .map_err(|error| { format!("failed to load Hands receipt chain for coordinator routing: {error}") - }) + })?; + let Some(chain) = chain else { + return Ok(false); + }; + crate::runtime_hands_receipt_chain_matches_current_model(runtime_store_path, &chain).map_err( + |error| format!("failed to validate Hands receipt route against current model: {error}"), + ) } pub fn append_modeling_repo_model_shape_context( diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index c169dd73..82631b53 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -1060,6 +1060,7 @@ pub use runtime_spine::runtime_hands_pr_receipt; pub use runtime_spine::runtime_hands_receipt_chain_after; pub use runtime_spine::runtime_has_actionable_eyes_frontier; pub use runtime_spine::runtime_has_actionable_hands_frontier; +pub use runtime_spine::runtime_hands_receipt_chain_matches_current_model; pub use runtime_spine::runtime_has_actionable_imagination_frontier; pub use runtime_spine::runtime_hello_frame; pub use runtime_spine::runtime_job_snapshot; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 860338e2..d3a97217 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -8281,6 +8281,45 @@ pub fn runtime_latest_hands_receipt_chain_after( Ok(summaries.pop()) } +/// A complete historical receipt chain becomes notification-only when its +/// route no longer describes the current RepoModel. Self uses this predicate +/// before routing the chain to Soul. +pub fn runtime_hands_receipt_chain_matches_current_model( + store_path: impl AsRef, + chain: &RuntimeHandsReceiptChainSummary, +) -> Result { + let mut cache = runtime_spine_cache(store_path)?; + cache.pull_all_backing_stores()?; + let authorities = cache + .get_all::()? + .into_iter() + .filter(|authority| authority.hands_intent_id == chain.intent_id) + .collect::>(); + if authorities.len() != 1 { + return Err(anyhow!( + "Hands receipt chain requires exactly one persisted frontier authority" + )); + } + let authority = &authorities[0]; + let route = cache + .get::(&authority.route_id)? + .ok_or_else(|| anyhow!("Hands receipt chain lost its persisted route"))?; + let model_entry = cache + .get::(crate::MEMORY_GRAPH_KEY)? + .ok_or_else(|| anyhow!("Hands receipt chain requires current RepoModel"))?; + crate::validate_memory_graph_entry(&model_entry)?; + let model = model_entry.snapshot()?; + Ok(authority.hands_review_id == chain.review_id + && authority.substrate_grant_receipt_id == chain.substrate_gate_grant_receipt_id + && authority.route_id == route.route_id + && authority.model_revision == route.model_revision + && authority.model_hash == route.model_hash + && authority.frontier_item_id == route.frontier_item_id + && authority.frontier_item_hash == route.frontier_item_hash + && model.model_revision == route.model_revision + && crate::memory_graph_model_hash(&model)? == route.model_hash) +} + pub fn put_soul_verdict_receipt( store_path: impl AsRef, receipt: &SoulVerdictReceipt, diff --git a/epiphany-core/src/surfaces/coordinator.rs b/epiphany-core/src/surfaces/coordinator.rs index 2f8b3c82..54572008 100644 --- a/epiphany-core/src/surfaces/coordinator.rs +++ b/epiphany-core/src/surfaces/coordinator.rs @@ -972,9 +972,7 @@ pub fn recommend_coordinator_action( if input.signals.modeling_result_status == EpiphanyCoordinatorRoleResultStatus::Completed && !input.modeling_result_accepted - && !(input.modeling_result_failure_reviewed - && input.modeling_result_proposal_bound - && input.hands_frontier_ready) + && !(input.modeling_result_failure_reviewed && input.hands_frontier_ready) && !(input.modeling_result_failure_reviewed && input.research_result_accepted && input.implementation_evidence_after_verification) @@ -1166,6 +1164,16 @@ pub fn recommend_coordinator_action( "Eyes refreshed source after CRRC regather and a complete Hands consequence still awaits Soul; verify that exact consequence before Modeling evolves its active route.", ); } + if input.research_result_accepted && input.hands_frontier_ready { + return build( + EpiphanyCoordinatorAction::ContinueImplementation, + Some(EpiphanyCoordinatorRoleId::Implementation), + None, + false, + false, + "Mind has admitted a current Hands frontier after source regather; execute that exact route before launching unrelated Modeling.", + ); + } if input.research_result_accepted && !input.modeling_result_accepted_after_research { return build( EpiphanyCoordinatorAction::LaunchModeling, @@ -2014,6 +2022,15 @@ mod tests { ); assert!(launch.reason.contains("Eyes evidence is newer")); + let current_hands_route = recommend_coordinator_action(EpiphanyCoordinatorInput { + hands_frontier_ready: true, + ..base.clone() + }); + assert_eq!( + current_hands_route.action, + EpiphanyCoordinatorAction::ContinueImplementation + ); + let consumed = recommend_coordinator_action(EpiphanyCoordinatorInput { modeling_result_accepted_after_research: true, ..base @@ -2421,6 +2438,19 @@ mod tests { EpiphanyCoordinatorAction::ContinueImplementation ); + let stale_rejected_modeling = recommend_coordinator_action(EpiphanyCoordinatorInput { + signals: modeling_done, + modeling_result_accepted: false, + modeling_result_reviewable: true, + modeling_result_failure_reviewed: true, + hands_frontier_ready: true, + ..input() + }); + assert_eq!( + stale_rejected_modeling.action, + EpiphanyCoordinatorAction::ContinueImplementation + ); + let no_frontier = recommend_coordinator_action(EpiphanyCoordinatorInput { signals: modeling_done, modeling_result_accepted: true, diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 8b6c051c..7c2db92d 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -90,6 +90,21 @@ original command is the planning sentence beginning `Draft one reviewable frontier-route plan candidate...`, proving the plan-to-Hands authority defect. No amendment has yet been attempted. +The amendment has now landed as +`repo-frontier-execution-amendment-d0d1a164c03f1298681a70b332ac3ddee423f8ab3e07b91d8dc3d74833a65875`, +advancing RepoModel revision 5 to 6 and hash +`e024e2ab2580f4006533d8a8f1f38fbd3aa5189b5307ac824854247e018abefd`. +The packet and emitted receipt are preserved under +`.epiphany-dogfood/v53-execution-amend-r31`. This is a user-authorized local +supervisor admission, explicitly not a Bifrost-signed remote command. + +Post-amendment status exposed two stale-history precedence faults. A complete +Hands chain now counts for Soul routing only when its immutable authority route +matches the current RepoModel. A current Hands frontier also preempts a reviewed +stale Modeling result and the otherwise-causal Research-to-Modeling route. Focused +coordinator tests pass, and current live status now derives +`continueImplementation` with `nativeHandsConsequenceAfterBoundary=false`. + Build iteration is also an active architectural defect: a tiny `runtime_spine.rs` diagnostic edit forced 18-29 second debug rebuilds, while exact packages remain multi-minute. Map the crate/module dependency fan-out and diff --git a/state/map.yaml b/state/map.yaml index fd84c45e..acdd8c4d 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -36,7 +36,7 @@ invariants: current_status: summary: Epiphany is a supervised engineering alpha on Starfire, not deployment-ready. Live v53 completed the adopted RepoModel revision 5 Hands consequence through commit 0763fcbe94257eb9adbe92ab814b5a487f65551d. Soul correctly failed closed on a substituted plan command. The repair pass now prevents a mismatched Hands command receipt, projects the exact effective command in the gate, and adds a Mind-owned single-use execution amendment that preserves the original plan and route while atomically emitting review, admission, amendment, and Modeling-projection receipts. Live v53 migration and renewed Soul proof remain next. Persona consequence, retention, endurance, restart closure, and Linux/Yggdrasil cognition remain open. operational_state: - local_worktree: live_route_read_restored_pending_commit + local_worktree: amended_route_routing_verified_pending_commit operator_wireguard: restored yggdrasil: canonical_small_public_crossing_body starfire: temporary_epiphany_cognition_body @@ -52,8 +52,8 @@ current_status: bifrost_feedback_crossing: authenticated_transport_only yggdrasil_epiphany_services: absent resident_physiology: heartbeat_and_self_running - unresolved_authority: The active v53 route still contains the original non-executable plan command and remains fail-closed. The apparent missing-route discrepancy was an inspector/amendment defect: both registered the runtime store but omitted pull_all_backing_stores before typed reads. With the load restored, exact route fb206aaa decodes and proves the original action and command are both planning prose, not an executable consequence. No live mutation has yet occurred. Exact HEAD packaging remains required. The adopted Mind decision also carries a model-supplied 2025 timestamp; timestamp ownership remains a separate provenance audit item. - next_action: Commit and push the runtime-store load correction, then use the typed Mind repair CLI to amend live route fb206aaa with authenticated supervisor provenance and the exact successful verification command. Derive a fresh route, replay exact Hands evidence, and retry Soul. Separately map and split the monolithic epiphany-core runtime spine/build graph. + unresolved_authority: Live v53 was amended through receipt repo-frontier-execution-amendment-d0d1a164c03f1298681a70b332ac3ddee423f8ab3e07b91d8dc3d74833a65875, advancing RepoModel 5 to 6 while preserving the original plan and route. The local supervisor admission is user-authorized and packet-hash bound, not Bifrost-signed. Self initially treated stale Hands receipts and rejected Modeling history as current; the verified routing correction now requires Hands consequences to match the current RepoModel and lets a current Hands frontier preempt reviewed stale Modeling after source regather. Exact HEAD packaging remains required. The adopted Mind decision also carries a model-supplied 2025 timestamp; timestamp ownership remains a separate provenance audit item. + next_action: Commit and push the current-model Hands/Self routing correction. Run the ordinary coordinator to derive the revision-6 route and Hands gate, replay exact patch/command/commit evidence under that authority, then launch and accept Soul. Separately map and split the monolithic epiphany-core runtime spine/build graph. active_subgoals: - Prove Persona, Self, Eyes, Modeling, Imagination, Hands, Soul, Mind, Continuity, and nervous-system behavior individually.