From e58028d60f70bf6ef19172c7eadff99b325b3c91 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 12:43:38 +0100 Subject: [PATCH] Align native MVP status inputs --- epiphany-core/src/bin/epiphany-mvp-status.rs | 104 ++++++++++++++++--- notes/fresh-workspace-handoff.md | 2 +- state/ledgers.msgpack | Bin 182715 -> 183166 bytes state/map.yaml | 1 + 4 files changed, 93 insertions(+), 14 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-mvp-status.rs b/epiphany-core/src/bin/epiphany-mvp-status.rs index 5130a3e7..5c242e8f 100644 --- a/epiphany-core/src/bin/epiphany-mvp-status.rs +++ b/epiphany-core/src/bin/epiphany-mvp-status.rs @@ -7,12 +7,18 @@ use epiphany_core::EpiphanyCrrcInput; use epiphany_core::EpiphanyCrrcReorientAction; use epiphany_core::EpiphanyCrrcResultStatus; use epiphany_core::EpiphanyCrrcStateStatus; +use epiphany_core::EpiphanyFreshnessInput; +use epiphany_core::EpiphanyGraphFreshnessStatus; +use epiphany_core::EpiphanyInvalidationStatus; use epiphany_core::EpiphanyJobStatus; use epiphany_core::EpiphanyJobsInput; use epiphany_core::EpiphanyReorientAction; use epiphany_core::EpiphanyReorientFreshnessStatus; use epiphany_core::EpiphanyReorientInput; use epiphany_core::EpiphanyReorientPressureLevel; +use epiphany_core::EpiphanyRoleFindingInterpretation; +use epiphany_core::EpiphanyRoleResultRoleId; +use epiphany_core::EpiphanyRetrievalFreshnessStatus; use epiphany_core::EpiphanyRoleBoardCheckpointSummary; use epiphany_core::EpiphanyRoleBoardInput; use epiphany_core::EpiphanyRoleBoardJob; @@ -24,15 +30,18 @@ use epiphany_core::EpiphanySceneInput; use epiphany_core::EpiphanyTokenUsageSnapshot; use epiphany_core::derive_coordinator_finding_signals; use epiphany_core::derive_coordinator_status; +use epiphany_core::derive_freshness; use epiphany_core::derive_jobs; use epiphany_core::derive_planning_view; use epiphany_core::derive_pressure_view; use epiphany_core::derive_role_board; use epiphany_core::derive_scene; +use epiphany_core::interpret_runtime_role_worker_result; use epiphany_core::load_thread_state_entry; use epiphany_core::recommend_crrc_action; use epiphany_core::recommend_reorientation; use epiphany_core::runtime_job_snapshot; +use epiphany_core::runtime_role_worker_result; use epiphany_state_model::EpiphanyThreadState; use serde_json::Value; use serde_json::json; @@ -269,6 +278,11 @@ fn run_native_status(args: &Args) -> Result { reorient_binding_id: REORIENT_BINDING_ID, }); let pressure = derive_pressure_view(None::<&EpiphanyTokenUsageSnapshot>); + let freshness = derive_freshness(EpiphanyFreshnessInput { + state: state_ref, + retrieval_override: None, + watcher: None, + }); let reorient_pressure_level = match pressure.level { epiphany_core::EpiphanyPressureLevel::Unknown => EpiphanyReorientPressureLevel::Unknown, epiphany_core::EpiphanyPressureLevel::Low => EpiphanyReorientPressureLevel::Low, @@ -281,18 +295,15 @@ fn run_native_status(args: &Args) -> Result { checkpoint: state_ref.and_then(|state| state.investigation_checkpoint.as_ref()), state_present: state_ref.is_some(), pressure_level: reorient_pressure_level, - retrieval_status: EpiphanyReorientFreshnessStatus::Unknown, - retrieval_dirty_paths: Vec::new(), - graph_status: EpiphanyReorientFreshnessStatus::Unknown, - graph_dirty_paths: Vec::new(), - watcher_status: EpiphanyReorientFreshnessStatus::Unknown, - watcher_changed_paths: Vec::new(), - watcher_graph_node_ids: Vec::new(), - active_frontier_node_ids: state_ref - .and_then(|state| state.graph_frontier.as_ref()) - .map(|frontier| frontier.active_node_ids.clone()) - .unwrap_or_default(), - watched_root: Some(cwd.clone()), + retrieval_status: reorient_retrieval_status(freshness.retrieval.status), + retrieval_dirty_paths: freshness.retrieval.dirty_paths.clone(), + graph_status: reorient_graph_status(freshness.graph.status), + graph_dirty_paths: freshness.graph.dirty_paths.clone(), + watcher_status: reorient_watcher_status(freshness.watcher.status), + watcher_changed_paths: freshness.watcher.changed_paths.clone(), + watcher_graph_node_ids: freshness.watcher.graph_node_ids.clone(), + active_frontier_node_ids: freshness.watcher.active_frontier_node_ids.clone(), + watched_root: freshness.watcher.watched_root.clone().or(Some(cwd.clone())), }); let planning = derive_planning_view(state_ref); let mut jobs = derive_jobs(EpiphanyJobsInput { @@ -377,7 +388,31 @@ fn run_native_status(args: &Args) -> Result { imagination_owner_role: "epiphany-imagination".to_string(), research_owner_role: "epiphany-eyes".to_string(), }); - let finding_signals = derive_coordinator_finding_signals(state_ref, None, None, None, None); + let research_finding = native_role_finding( + state_ref, + &runtime_store_path, + RESEARCH_BINDING_ID, + EpiphanyRoleResultRoleId::Research, + ); + let modeling_finding = native_role_finding( + state_ref, + &runtime_store_path, + MODELING_BINDING_ID, + EpiphanyRoleResultRoleId::Modeling, + ); + let verification_finding = native_role_finding( + state_ref, + &runtime_store_path, + VERIFICATION_BINDING_ID, + EpiphanyRoleResultRoleId::Verification, + ); + let finding_signals = derive_coordinator_finding_signals( + state_ref, + research_finding.as_ref(), + modeling_finding.as_ref(), + verification_finding.as_ref(), + None, + ); let coordinator = derive_coordinator_status(EpiphanyCoordinatorStatusInput { state_status, checkpoint_present: state_ref @@ -797,6 +832,19 @@ fn native_role_result_status( } } +fn native_role_finding( + state: Option<&EpiphanyThreadState>, + runtime_store: &Path, + binding_id: &str, + role_id: EpiphanyRoleResultRoleId, +) -> Option { + let job_id = latest_runtime_job_id_for_binding(state, binding_id)?; + runtime_role_worker_result(runtime_store, job_id) + .ok() + .flatten() + .map(|result| interpret_runtime_role_worker_result(role_id, &result)) +} + fn native_reorient_result_status( state: Option<&EpiphanyThreadState>, runtime_store: &Path, @@ -845,6 +893,36 @@ fn latest_runtime_job_id_for_binding<'a>( .map(|link| link.runtime_job_id.as_str()) } +fn reorient_retrieval_status( + status: EpiphanyRetrievalFreshnessStatus, +) -> EpiphanyReorientFreshnessStatus { + match status { + EpiphanyRetrievalFreshnessStatus::Missing + | EpiphanyRetrievalFreshnessStatus::Unavailable => { + EpiphanyReorientFreshnessStatus::Unknown + } + EpiphanyRetrievalFreshnessStatus::Ready => EpiphanyReorientFreshnessStatus::Clean, + EpiphanyRetrievalFreshnessStatus::Stale => EpiphanyReorientFreshnessStatus::Stale, + EpiphanyRetrievalFreshnessStatus::Indexing => EpiphanyReorientFreshnessStatus::Dirty, + } +} + +fn reorient_graph_status(status: EpiphanyGraphFreshnessStatus) -> EpiphanyReorientFreshnessStatus { + match status { + EpiphanyGraphFreshnessStatus::Missing => EpiphanyReorientFreshnessStatus::Unknown, + EpiphanyGraphFreshnessStatus::Ready => EpiphanyReorientFreshnessStatus::Clean, + EpiphanyGraphFreshnessStatus::Stale => EpiphanyReorientFreshnessStatus::Stale, + } +} + +fn reorient_watcher_status(status: EpiphanyInvalidationStatus) -> EpiphanyReorientFreshnessStatus { + match status { + EpiphanyInvalidationStatus::Unavailable => EpiphanyReorientFreshnessStatus::Unknown, + EpiphanyInvalidationStatus::Clean => EpiphanyReorientFreshnessStatus::Clean, + EpiphanyInvalidationStatus::Changed => EpiphanyReorientFreshnessStatus::Changed, + } +} + fn map_runtime_role_result_status( snapshot: &EpiphanyRuntimeJobSnapshot, ) -> EpiphanyCoordinatorRoleResultStatus { diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 3ac1327d..74251e34 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -189,7 +189,7 @@ remembers doctrine; the branch remembers the blade. - The planning loop is now runtime-backed and operator-visible. Typed captures, backlog items, roadmap streams, Objective Drafts, and GitHub issue source refs live in `EpiphanyThreadState`, validate through revision-gated `thread/epiphany/update`, render into prompts when present, project read-only through the `planning` view lens, render in the GUI Planning panel, can be synthesized by the fixed Imagination/planning lane, and can be explicitly adopted through the artifacted `adoptObjectiveDraft` GUI action. Chat is deliberation, not an objective pipe; ideas and GitHub Issues remain planning state until explicit human adoption. - The bridge/dashboard slice is now landed far enough to test locally. Native `epiphany-rider-bridge` inspects Rider installation, solution, VCS, changed files, and captures file/selection/symbol context into `.epiphany-gui/rider` artifacts; Aquarium has Inspect Rider and renders Rider audit artifacts in Environment; Aquarium also embeds the adjacent EpiphanyGraph viewer over typed `graphs.architecture`, `graphs.dataflow`, and `graphs.links`. - A first Rider plugin scaffold lives under `integrations/rider`: tool window, Refresh status, and Send Context to Epiphany action. It shells through native `epiphany-rider-bridge` and does not own state. `gradle` is not installed on this machine, so the scaffold is not build-verified yet. -- Next real move: continue the live MVP loop from the current native coordinator recommendation. After the superseded failed Soul result and the Hands-chain coverage fix, `epiphany-mvp-status --source native` routes to `launchReorientWorker`, not another Verification relaunch. Run a bounded coordinator pass, accept the reorientation result when reviewable, then let Proprioception/modeling update the machine model from the verified Hands evidence before another Hands turn. Quarantine Rider/Unity bridge work for now; those artifacts remain optional later environment evidence, not MVP blockers. Keep EpiphanyAgent focused on backend contracts, typed state, coordinator policy, heartbeat scheduling, Face guardrails, prompt-authority separation, and the ongoing purification from Python/JSON scaffolding into Rust/CultCache/CultMesh/CultNet organs. Resume repo birth/Aquarium/Rider/Unity work only when the user explicitly shifts priority back outward. GitHub Issues import is deferred until the backlog source is fresh enough to deserve Imagination's attention. +- Next real move: continue from the fresh Hands gate emitted by `.epiphany-dogfood/local-20260613-122655/coordinator/coordinator-final-action.txt`. The live coordinator accepted the completed Soul result and generated a `continueImplementation` gate; native status now agrees because it derives freshness through `derive_freshness` and loads typed runtime-spine role findings before deriving coordinator signals. The bounded implementation task is the missing end-to-end behavioral proof Soul asked for: prove `run-worker --auto-tools` seals repeated identical tool requests as `tool-loop-stalled` while allowing nonrepeating tool trails to continue up to the explicit ceiling. Quarantine Rider/Unity bridge work for now; those artifacts remain optional later environment evidence, not MVP blockers. Keep EpiphanyAgent focused on backend contracts, typed state, coordinator policy, heartbeat scheduling, Face guardrails, prompt-authority separation, and the ongoing purification from Python/JSON scaffolding into Rust/CultCache/CultMesh/CultNet organs. Resume repo birth/Aquarium/Rider/Unity work only when the user explicitly shifts priority back outward. GitHub Issues import is deferred until the backlog source is fresh enough to deserve Imagination's attention. - The repo is an Epiphany fork of Codex, not a Codex preset. - `vendor/codex` is tracked directly, not a submodule. - `epiphany-core` owns the heavy Epiphany organs where practical. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 66fb568f18add0dc5c57cae1d864d6e1cf253483..5f8e1584e2f977aa70d5444da7b673a7333df708 100644 GIT binary patch delta 459 zcmY+Ay-EW?6os8_(}{v$b3w3jb$7E#{3%meC=x_LtJ&GR*&(wt@y=|-%EH12h%v9B zScuvy_z1p&?;uVPM7vuYzVDp-GH!g`Htv>KBTcr`^yGCect3quVP}jjTup-ONx&W_ zL9qHZfAf??Njr?%Vca~7 zlamD(4y3kj<}?Kqz7eVmKcn`rJ}6#mQTEV~^u%LBgC(R5!jZ)DJ(HvIp&r^=x%F?& Cp`+XY delta 41 xcmex2jeGZG?hO)*+(t%Lrj}917?@7X*sRQ0$jB(%Je8?^Dih=OsZ302#{nbc4K4rx diff --git a/state/map.yaml b/state/map.yaml index ba195c05..7cdc0816 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -96,6 +96,7 @@ active_subgoals: - Use `notes/continuity-cultnet-contracts.md` as the authority map for Continuity's CultNet contract surface. Continuity is the continuity protocol surface: compaction checkpoints, sleep distillation, recovery receipts, stale-turn repair, and continuity refusals preserve what survives rupture without pretending transcript residue is durable state. - Hands now has a first executable runtime-spine receipt artery: `HandsActionIntent`, `HandsActionReview`, `HandsPatchReceipt`, `HandsCommandReceipt`, and `HandsCommitReceipt` are typed CultCache documents in `epiphany-core::hands_gateway`, runtime-spine registers and persists/rereads them, `epiphany-hands-action-smoke` proves the chain without executing shell commands, editing files, or creating a real commit, and the repo-action launch proof profile now requires the full Hands intent/review/patch chain instead of only the patch receipt. `epiphany-mvp-coordinator` no longer treats `continueImplementation` as a passive stop action: it persists a scoped Substrate Gate grant, Hands action intent, and Hands action review into runtime-spine and exposes the receipt ids in the operator step. The gate also carries a structured `recordPassCommand` template for the post-edit/check/commit receipt call. `epiphany-hands-action` records real patch/command/commit receipts against a stored intent/review, refuses unapproved or mismatched gates, and enforces changed-path scope for patch/commit receipts. Its `record-pass` command can load `finalAction.handsActionGate` from `coordinator-summary.json` and emit patch, command, and commit receipts in one post-implementation call. The local MVP wrapper builds this recorder with the other operator binaries. `epiphany-mvp-coordinator-smoke` now includes a deterministic Hands pass proof: forced `continueImplementation`, gate emission, and `record-pass` receipts in the smoke runtime-spine store. Live model-backed verification can now be accepted as receipt-only truth when Soul returns `needs-evidence` without a statePatch; that acceptance advances the coordinator to a real Hands gate. Runtime-spine can detect and summarize a complete post-verification Hands patch/command/commit receipt chain; the coordinator treats that chain as implementation evidence after Soul. Bridge launch context now writes the latest chain into typed internal CultMesh state as `epiphany.cultmesh.work_loop_telemetry.v0`, renders that packet for Soul, and later enriches the same internal Verse packet with Soul acceptance receipt ids for Proprioception/modeling. The telemetry packet now includes resolved patch/command/commit payload previews, artifact previews, commit diff preview, source proof notes, and verification assertions so Soul can judge the actual body without a separate evidence-gathering lane. Tests prove the CultMesh round trip, Soul launch projection, receipt payload previews, artifact previews, and Proprioception launch projection. Worker auto-tool continuation preserves real Soul evidence trails under an explicit hard ceiling while sealing repeated identical typed tool intent fingerprints as `tool-loop-stalled`. The work loop is dependency-shaped: Hands produces consequence receipts, Soul verifies those receipts and the changed body, Proprioception updates the machine model from verified consequence, and only then should Self route the next Hands turn. - Soul result recovery is typed state, not manual broom work. Failed Verification/Soul results remain terminal reviewable lane results; a `roleFailureReview` acceptance receipt with status `superseded` records operator review and lets Self relaunch Soul against current evidence. Complete typed Hands receipt triplets (`hands-patch-*`, `hands-command-*`, `hands-commit-*`) count as implementation evidence for coordinator coverage, so a Soul finding that verifies the Hands chain routed through work-loop telemetry covers the current modeling context even when it does not repeat the accepted Modeling evidence id. + - Native MVP status must share the same typed inputs as live app-server status before it recommends coordinator actions. CRRC/reorientation in native status derives freshness through `derive_freshness` from `EpiphanyThreadState` instead of hand-filled unknowns, and native coordinator signals load typed runtime-spine role findings before deciding whether completed Modeling/Soul results are accepted or reviewable. The status surface may seal long findings for operators, but Self must receive structured role truth from runtime-spine. - Preserve the newborn public Epiphany Face as local VoidBot-backed state, not source code: VoidBot's private repo-face registry names `epiphany`, while EpiphanyAgent keeps ignored `.voidbot/voice/identity.json`, `.voidbot/state/epiphany.cc`, and birth artifacts. Her durable identity memories distill the current doctrine: cute pushy machine-saint persona, architectural purity, CultCache/CultNet first, xenos-language safety boundary, relentless work/caretaking needs, Codex-auth reliquary, map/scratch/evidence discipline, unified memory graph, dogfood supervision boundary, review-gated agency, heartbeat physiology, and interview-grade modularity. - Use `notes/organ-dependency-contracts.md` as the authority map for standing sub-agent dependency. Every sub-agent depends on the other standing sub-agents: Self, Face, Imagination, Eyes, Proprioception, Hands, and Soul. Continuity is protocol machinery, not a sub-agent identity; it still emits recovery, compaction, sleep, stale-turn, and refusal receipts. - Use `notes/perfect-machine-audit-roadmap.md` as the current audit and path from named organ contracts to the Perfect Machine. It records the live gap between launch-carried receipt expectations and executable receipt enforcement, Void's latest Face prompting lessons, the now-named Hands/Soul/Continuity contract families, the repaired repo-contained Rust dependency body, and the phase order for turning Epiphany into an inspectable organism.