Expose frontier repair inspection

This commit is contained in:
Meta Vens 2026-08-08 12:33:14 +01:00
commit 80c6ff8841
3 changed files with 49 additions and 6 deletions

View file

@ -1,5 +1,8 @@
use anyhow::{Result, anyhow};
use epiphany_core::{RepoFrontierExecutionAmendment, amend_repo_frontier_execution};
use epiphany_core::{
RepoFrontierExecutionAmendment, RepoFrontierRoute, amend_repo_frontier_execution,
runtime_spine_cache,
};
use sha2::{Digest, Sha256};
use std::{collections::BTreeMap, env, path::PathBuf};
@ -7,7 +10,7 @@ fn main() -> Result<()> {
let mut values = BTreeMap::new();
let mut args = env::args().skip(1);
let command = args.next().ok_or_else(|| anyhow!(usage()))?;
if command != "amend-frontier-execution" {
if command != "amend-frontier-execution" && command != "inspect-frontier-execution" {
return Err(anyhow!("unknown command {command}\n{}", usage()));
}
while let Some(flag) = args.next() {
@ -26,6 +29,37 @@ fn main() -> Result<()> {
};
let store = PathBuf::from(take("--store")?);
let route_id = take("--route-id")?;
if command == "inspect-frontier-execution" {
let routes = runtime_spine_cache(&store)?.get_all::<RepoFrontierRoute>()?;
let available = routes
.iter()
.map(|route| route.route_id.as_str())
.collect::<Vec<_>>()
.join(", ");
let route = routes
.into_iter()
.find(|route| route.route_id == route_id)
.ok_or_else(|| anyhow!("route {route_id} does not exist; available: {available}"))?;
let plan = route
.adopted_plan
.ok_or_else(|| anyhow!("route {route_id} has no adopted plan"))?;
println!(
"{}",
serde_json::to_string_pretty(&serde_json::json!({
"routeId": route.route_id,
"modelRevision": route.model_revision,
"modelHash": route.model_hash,
"frontierItemId": route.frontier_item_id,
"frontierItemHash": route.frontier_item_hash,
"originalAction": plan.action,
"originalCommand": plan.command,
"effectiveAction": plan.effective_action(),
"effectiveCommand": plan.effective_command(),
"executionAmendment": plan.execution_amendment,
}))?
);
return Ok(());
}
let source_actor_id = take("--source-actor-id")?;
let command_id = take("--command-id")?;
let admission_id = take("--admission-id")?;
@ -65,5 +99,5 @@ fn main() -> Result<()> {
}
fn usage() -> &'static str {
"usage: epiphany-mind-repair amend-frontier-execution --store PATH --route-id ID --source-actor-id ID --command-id ID --admission-id ID --packet-sha256 SHA256 --previous-action TEXT --previous-command TEXT --action TEXT --replacement-command TEXT --rationale TEXT --amended-at RFC3339"
"usage: epiphany-mind-repair inspect-frontier-execution --store PATH --route-id ID\n epiphany-mind-repair amend-frontier-execution --store PATH --route-id ID --source-actor-id ID --command-id ID --admission-id ID --packet-sha256 SHA256 --previous-action TEXT --previous-command TEXT --action TEXT --replacement-command TEXT --rationale TEXT --amended-at RFC3339"
}

View file

@ -80,6 +80,15 @@ live v53 plan with explicit supervisor command/admission provenance, derive a
fresh route, replay the exact Hands receipts against that amended route, and
retry Soul. Preserve the original route and every failed Soul launch.
The repair pass is pushed at `12c8241b`. Its read-only route inspection then
found a new live discrepancy before mutation: current source enumerates zero
persisted `RepoFrontierRoute` entries in v53, although coordinator status still
derives `launchVerification` and the accepted gate artifact cites route
`repo-frontier-route-fb206aaa609246becc17243c0ac5d98d2e70e30fd1dd3351467885ea6ca88dc2`.
No amendment was attempted. Trace the route write/schema-catalog path and restore
typed route visibility before using the repair command; do not reconstruct
authority from the old JSON artifact.
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

View file

@ -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: typed_execution_amendment_verified_pending_commit
local_worktree: live_route_persistence_diagnostic
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 typed repair mechanism is locally verified but has not yet migrated live state or produced a fresh route. 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 verified command-binding and typed execution-amendment pass. Use the narrow Mind repair CLI to migrate live v53 with authenticated supervisor provenance, derive a fresh route, replay exact Hands evidence against the amended command, then launch and accept Soul. Separately map and split the monolithic epiphany-core runtime spine/build graph; focused tests for this pass each required 64-73 seconds of compilation while execution took under one second.
unresolved_authority: The active v53 route still contains the original non-executable plan command and remains fail-closed. Commit 12c8241b provides a locally verified typed repair, but its read-only inspector sees zero persisted RepoFrontierRoute entries in the live store even though operator-safe coordinator state still derives launchVerification and historical gate artifacts cite route fb206aaa. No live mutation was attempted. Determine whether route authority was only captured in coordinator state, lost from the CultCache schema catalog, or made invisible by schema evolution before repairing v53. 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: Trace RepoFrontierRoute persistence from select_and_commit_repo_frontier_route through the runtime store and schema catalog. Restore a typed current-route read path without reconstructing authority from display artifacts. Only then use the Mind repair CLI, derive a fresh route, replay exact Hands evidence, and retry Soul. Separately map and split the monolithic epiphany-core runtime spine/build graph; focused tests for this pass each required 64-73 seconds of compilation while execution took under one second.
active_subgoals:
- Prove Persona, Self, Eyes, Modeling, Imagination, Hands, Soul, Mind, Continuity, and nervous-system behavior individually.