Enforce Continuity recovery for reorientation
This commit is contained in:
parent
5e97e3464e
commit
3d36944fdd
8 changed files with 234 additions and 39 deletions
|
|
@ -3,14 +3,18 @@ use chrono::Utc;
|
|||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use epiphany_core::CONTINUITY_RECOVERY_RECEIPT_TYPE;
|
||||
use epiphany_core::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
|
||||
use epiphany_core::EPIPHANY_RESEARCH_ROLE_BINDING_ID;
|
||||
use epiphany_core::EYES_EVIDENCE_PACKET_TYPE;
|
||||
use epiphany_core::EpiphanyJobInterruptRequest;
|
||||
use epiphany_core::EpiphanyJobInterruptResult;
|
||||
use epiphany_core::EpiphanyJobLaunchRequest;
|
||||
use epiphany_core::EpiphanyJobLaunchResult;
|
||||
use epiphany_core::EpiphanyJobView;
|
||||
use epiphany_core::EpiphanyLaunchOrganContract;
|
||||
use epiphany_core::EpiphanyPromotionInput;
|
||||
use epiphany_core::EpiphanyReceiptEffectKind;
|
||||
use epiphany_core::EpiphanyReorientDecision;
|
||||
use epiphany_core::EpiphanyReorientFindingInterpretation;
|
||||
use epiphany_core::EpiphanyReorientStateStatus;
|
||||
|
|
@ -19,39 +23,39 @@ use epiphany_core::EpiphanyRoleResultRoleId;
|
|||
use epiphany_core::EpiphanyRoleStatePatchDocument;
|
||||
use epiphany_core::EpiphanyStateUpdate;
|
||||
use epiphany_core::EpiphanyStateUpdatedField;
|
||||
use epiphany_core::MIND_GATEWAY_REVIEW_TYPE;
|
||||
use epiphany_core::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE;
|
||||
use epiphany_core::EYES_EVIDENCE_PACKET_TYPE;
|
||||
use epiphany_core::SOUL_VERDICT_RECEIPT_TYPE;
|
||||
use epiphany_core::mind_state_commit_receipt;
|
||||
use epiphany_core::put_mind_gateway_review;
|
||||
use epiphany_core::put_mind_state_commit_receipt;
|
||||
use epiphany_core::EpiphanyLaunchOrganContract;
|
||||
use epiphany_core::EpiphanyReceiptEffectKind;
|
||||
use epiphany_core::EpiphanyTokenUsageSnapshot;
|
||||
use epiphany_core::MIND_GATEWAY_REVIEW_TYPE;
|
||||
use epiphany_core::RuntimeSpineHeartbeatJobOptions;
|
||||
use epiphany_core::RuntimeSpineHeartbeatLaunchPlanOptions;
|
||||
use epiphany_core::SOUL_VERDICT_RECEIPT_TYPE;
|
||||
use epiphany_core::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE;
|
||||
use epiphany_core::apply_epiphany_state_update;
|
||||
use epiphany_core::build_epiphany_reorient_launch_request;
|
||||
use epiphany_core::build_epiphany_role_launch_request;
|
||||
use epiphany_core::clear_epiphany_job_binding_backend;
|
||||
use epiphany_core::continuity_recovery_receipt_from_reorient_finding;
|
||||
use epiphany_core::epiphany_role_label;
|
||||
use epiphany_core::epiphany_state_update_validation_errors;
|
||||
use epiphany_core::eyes_evidence_packet_from_research_finding;
|
||||
use epiphany_core::evaluate_receipt_proof_profiles;
|
||||
use epiphany_core::evaluate_promotion;
|
||||
use epiphany_core::evaluate_receipt_proof_profiles;
|
||||
use epiphany_core::eyes_evidence_packet_from_research_finding;
|
||||
use epiphany_core::mind_state_commit_receipt;
|
||||
use epiphany_core::open_runtime_spine_heartbeat_job;
|
||||
use epiphany_core::plan_runtime_spine_heartbeat_launch;
|
||||
use epiphany_core::put_continuity_recovery_receipt;
|
||||
use epiphany_core::put_eyes_evidence_packet;
|
||||
use epiphany_core::put_mind_gateway_review;
|
||||
use epiphany_core::put_mind_state_commit_receipt;
|
||||
use epiphany_core::put_soul_verdict_receipt;
|
||||
use epiphany_core::put_substrate_gate_repo_access_grant_receipt;
|
||||
use epiphany_core::receipt_proof_evaluation_errors;
|
||||
use epiphany_core::replace_or_append_epiphany_job_binding;
|
||||
use epiphany_core::put_substrate_gate_repo_access_grant_receipt;
|
||||
use epiphany_core::put_soul_verdict_receipt;
|
||||
use epiphany_core::runtime_job_snapshot;
|
||||
use epiphany_core::runtime_continuity_recovery_receipt;
|
||||
use epiphany_core::runtime_eyes_evidence_packet;
|
||||
use epiphany_core::runtime_job_snapshot;
|
||||
use epiphany_core::runtime_mind_gateway_review;
|
||||
use epiphany_core::runtime_substrate_gate_repo_access_grant_receipt;
|
||||
use epiphany_core::runtime_soul_verdict_receipt;
|
||||
use epiphany_core::runtime_substrate_gate_repo_access_grant_receipt;
|
||||
use epiphany_core::soul_verdict_receipt_from_verification_finding;
|
||||
use epiphany_core::substrate_gate_repo_access_grant_for_launch;
|
||||
use epiphany_state_model::EpiphanyEvidenceRecord;
|
||||
|
|
@ -77,10 +81,10 @@ use crate::pressure::derive_epiphany_pressure;
|
|||
use crate::reorient::EpiphanyFreshnessWatcherSnapshot;
|
||||
use crate::reorient::derive_epiphany_freshness_view;
|
||||
use crate::reorient::derive_epiphany_reorient;
|
||||
use crate::runtime_results::latest_epiphany_runtime_link_for_binding;
|
||||
use crate::runtime_results::load_completed_core_epiphany_reorient_finding;
|
||||
use crate::runtime_results::load_completed_core_epiphany_role_finding;
|
||||
use crate::runtime_results::load_launch_organ_contract_for_runtime_job;
|
||||
use crate::runtime_results::latest_epiphany_runtime_link_for_binding;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
|
|
@ -495,12 +499,13 @@ pub async fn apply_thread_epiphany_role_accept(
|
|||
let accepted_evidence_id = acceptance_update.accepted_evidence_id.clone();
|
||||
let changed_fields = acceptance_update.changed_fields.clone();
|
||||
let applied_patch = acceptance_update.applied_patch.clone();
|
||||
put_mind_gateway_review(runtime_store_path.as_path(), &acceptance_update.mind_review)
|
||||
.map_err(|err| {
|
||||
put_mind_gateway_review(runtime_store_path.as_path(), &acceptance_update.mind_review).map_err(
|
||||
|err| {
|
||||
EpiphanyBridgeError::Fatal(format!(
|
||||
"failed to persist Mind review receipt before role state admission: {err}"
|
||||
))
|
||||
})?;
|
||||
},
|
||||
)?;
|
||||
let mut available_document_types = persisted_mind_review_receipt_types(
|
||||
runtime_store_path.as_path(),
|
||||
acceptance_update.mind_review.gateway_id.as_str(),
|
||||
|
|
@ -628,21 +633,42 @@ pub async fn apply_thread_epiphany_reorient_accept(
|
|||
let accepted_observation_id = acceptance_update.accepted_observation_id.clone();
|
||||
let accepted_evidence_id = acceptance_update.accepted_evidence_id.clone();
|
||||
let changed_fields = acceptance_update.changed_fields.clone();
|
||||
put_mind_gateway_review(runtime_store_path.as_path(), &acceptance_update.mind_review)
|
||||
.map_err(|err| {
|
||||
put_mind_gateway_review(runtime_store_path.as_path(), &acceptance_update.mind_review).map_err(
|
||||
|err| {
|
||||
EpiphanyBridgeError::Fatal(format!(
|
||||
"failed to persist Mind review receipt before reorientation state admission: {err}"
|
||||
))
|
||||
})?;
|
||||
let available_document_types = persisted_mind_review_receipt_types(
|
||||
},
|
||||
)?;
|
||||
let mut available_document_types = persisted_mind_review_receipt_types(
|
||||
runtime_store_path.as_path(),
|
||||
acceptance_update.mind_review.gateway_id.as_str(),
|
||||
)?;
|
||||
let recovery_receipt = continuity_recovery_receipt_from_reorient_finding(
|
||||
format!("continuity-recovery-{accepted_receipt_id}"),
|
||||
binding_id.to_string(),
|
||||
&finding,
|
||||
Utc::now().to_rfc3339_opts(SecondsFormat::Secs, true),
|
||||
);
|
||||
put_continuity_recovery_receipt(runtime_store_path.as_path(), &recovery_receipt).map_err(
|
||||
|err| {
|
||||
EpiphanyBridgeError::Fatal(format!(
|
||||
"failed to persist Continuity recovery receipt before reorientation state admission: {err}"
|
||||
))
|
||||
},
|
||||
)?;
|
||||
available_document_types.extend(persisted_continuity_recovery_types(
|
||||
runtime_store_path.as_path(),
|
||||
recovery_receipt.receipt_id.as_str(),
|
||||
)?);
|
||||
enforce_current_receipt_proofs(
|
||||
&organ_contract,
|
||||
&reorient_acceptance_claimed_effects(),
|
||||
&available_document_types,
|
||||
&[MIND_GATEWAY_REVIEW_TYPE.to_string()],
|
||||
&[
|
||||
MIND_GATEWAY_REVIEW_TYPE.to_string(),
|
||||
CONTINUITY_RECOVERY_RECEIPT_TYPE.to_string(),
|
||||
],
|
||||
)?;
|
||||
let mind_review = acceptance_update.mind_review.clone();
|
||||
let epiphany_state =
|
||||
|
|
@ -1021,6 +1047,23 @@ fn persisted_soul_verdict_types(
|
|||
.unwrap_or_default())
|
||||
}
|
||||
|
||||
fn persisted_continuity_recovery_types(
|
||||
runtime_store_path: &Path,
|
||||
receipt_id: &str,
|
||||
) -> BridgeResult<Vec<String>> {
|
||||
let recovery =
|
||||
runtime_continuity_recovery_receipt(runtime_store_path, receipt_id).map_err(|err| {
|
||||
EpiphanyBridgeError::Fatal(format!(
|
||||
"failed to verify persisted Continuity recovery receipt {:?}: {err}",
|
||||
receipt_id
|
||||
))
|
||||
})?;
|
||||
Ok(recovery
|
||||
.is_some()
|
||||
.then(|| vec![CONTINUITY_RECOVERY_RECEIPT_TYPE.to_string()])
|
||||
.unwrap_or_default())
|
||||
}
|
||||
|
||||
fn substrate_gate_grant_receipt_id(runtime_job_id: &str) -> String {
|
||||
format!("substrate-grant-{runtime_job_id}")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
use crate::EpiphanyReorientFindingInterpretation;
|
||||
use cultcache_rs::DatabaseEntry;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
|
||||
|
|
@ -19,6 +21,38 @@ pub const CONTINUITY_STALE_TURN_REPAIR_SCHEMA_VERSION: &str =
|
|||
pub const CONTINUITY_REFUSAL_RECEIPT_SCHEMA_VERSION: &str =
|
||||
"epiphany.continuity.refusal_receipt.v0";
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "epiphany.continuity.recovery_receipt",
|
||||
schema = "ContinuityRecoveryReceipt"
|
||||
)]
|
||||
pub struct ContinuityRecoveryReceipt {
|
||||
#[cultcache(key = 0)]
|
||||
pub schema_version: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub receipt_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub source_result_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub source_job_id: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub binding_id: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub mode: String,
|
||||
#[cultcache(key = 6)]
|
||||
pub checkpoint_still_valid: String,
|
||||
#[cultcache(key = 7)]
|
||||
pub summary: String,
|
||||
#[cultcache(key = 8)]
|
||||
pub next_safe_move: String,
|
||||
#[cultcache(key = 9)]
|
||||
pub files_inspected: Vec<String>,
|
||||
#[cultcache(key = 10)]
|
||||
pub emitted_at: String,
|
||||
#[cultcache(key = 11)]
|
||||
pub contract: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ContinuityCultNetContract {
|
||||
|
|
@ -114,6 +148,31 @@ pub fn default_continuity_cultnet_contracts() -> Vec<ContinuityCultNetContract>
|
|||
]
|
||||
}
|
||||
|
||||
pub fn continuity_recovery_receipt_from_reorient_finding(
|
||||
receipt_id: String,
|
||||
binding_id: String,
|
||||
finding: &EpiphanyReorientFindingInterpretation,
|
||||
emitted_at: String,
|
||||
) -> ContinuityRecoveryReceipt {
|
||||
ContinuityRecoveryReceipt {
|
||||
schema_version: CONTINUITY_RECOVERY_RECEIPT_SCHEMA_VERSION.to_string(),
|
||||
receipt_id,
|
||||
source_result_id: finding.runtime_result_id.clone().unwrap_or_default(),
|
||||
source_job_id: finding.runtime_job_id.clone().unwrap_or_default(),
|
||||
binding_id,
|
||||
mode: finding.mode.clone().unwrap_or_else(|| "unknown".to_string()),
|
||||
checkpoint_still_valid: finding
|
||||
.checkpoint_still_valid
|
||||
.map(|value| value.to_string())
|
||||
.unwrap_or_else(|| "unknown".to_string()),
|
||||
summary: finding.summary.clone().unwrap_or_default(),
|
||||
next_safe_move: finding.next_safe_move.clone().unwrap_or_default(),
|
||||
files_inspected: finding.files_inspected.clone(),
|
||||
emitted_at,
|
||||
contract: "Continuity recovery emitted from a reviewed reorientation finding; it proves what survived rupture before Mind admits recovery state.".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
@ -140,4 +199,33 @@ mod tests {
|
|||
.contains(&CONTINUITY_RECOVERY_RECEIPT_TYPE.to_string())
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reorient_finding_builds_continuity_recovery_receipt() {
|
||||
let finding = EpiphanyReorientFindingInterpretation {
|
||||
mode: Some("resume".to_string()),
|
||||
summary: Some("Checkpoint remains valid.".to_string()),
|
||||
next_safe_move: Some("Continue bounded implementation.".to_string()),
|
||||
checkpoint_still_valid: Some(true),
|
||||
files_inspected: vec!["state/map.yaml".to_string()],
|
||||
frontier_node_ids: Vec::new(),
|
||||
evidence_ids: Vec::new(),
|
||||
artifact_refs: Vec::new(),
|
||||
runtime_result_id: Some("result-1".to_string()),
|
||||
runtime_job_id: Some("job-1".to_string()),
|
||||
job_error: None,
|
||||
item_error: None,
|
||||
};
|
||||
let receipt = continuity_recovery_receipt_from_reorient_finding(
|
||||
"continuity-recovery-1".to_string(),
|
||||
"reorientation-worker".to_string(),
|
||||
&finding,
|
||||
"2026-05-30T00:00:00Z".to_string(),
|
||||
);
|
||||
|
||||
assert_eq!(receipt.source_result_id, "result-1");
|
||||
assert_eq!(receipt.source_job_id, "job-1");
|
||||
assert_eq!(receipt.mode, "resume");
|
||||
assert_eq!(receipt.checkpoint_still_valid, "true");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -416,6 +416,7 @@ pub use runtime_spine::ensure_runtime_session;
|
|||
pub use runtime_spine::initialize_runtime_spine;
|
||||
pub use runtime_spine::open_runtime_spine_heartbeat_job;
|
||||
pub use runtime_spine::plan_runtime_spine_heartbeat_launch;
|
||||
pub use runtime_spine::put_continuity_recovery_receipt;
|
||||
pub use runtime_spine::put_coordinator_run_receipt;
|
||||
pub use runtime_spine::put_eyes_evidence_packet;
|
||||
pub use runtime_spine::put_mind_gateway_review;
|
||||
|
|
@ -425,6 +426,7 @@ pub use runtime_spine::put_runtime_role_worker_result;
|
|||
pub use runtime_spine::put_soul_verdict_receipt;
|
||||
pub use runtime_spine::put_substrate_gate_repo_access_grant_receipt;
|
||||
pub use runtime_spine::replace_or_append_epiphany_job_binding;
|
||||
pub use runtime_spine::runtime_continuity_recovery_receipt;
|
||||
pub use runtime_spine::runtime_eyes_evidence_packet;
|
||||
pub use runtime_spine::runtime_hello_frame;
|
||||
pub use runtime_spine::runtime_job_snapshot;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use crate::EpiphanyWorkerLaunchDocument;
|
||||
use crate::agent_memory::AGENT_MEMORY_TYPE;
|
||||
use crate::continuity_gateway::ContinuityRecoveryReceipt;
|
||||
use crate::continuity_gateway::*;
|
||||
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION;
|
||||
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_TYPE;
|
||||
|
|
@ -717,6 +718,7 @@ pub fn runtime_spine_cache(store_path: impl AsRef<Path>) -> Result<CultCache> {
|
|||
cache.register_entry_type::<EyesEvidencePacket>()?;
|
||||
cache.register_entry_type::<SubstrateGateRepoAccessGrantReceipt>()?;
|
||||
cache.register_entry_type::<SoulVerdictReceipt>()?;
|
||||
cache.register_entry_type::<ContinuityRecoveryReceipt>()?;
|
||||
cache.register_entry_type::<EpiphanyOpenAiAdapterStatus>()?;
|
||||
cache.register_entry_type::<EpiphanyOpenAiModelRequest>()?;
|
||||
cache.register_entry_type::<EpiphanyOpenAiStreamEvent>()?;
|
||||
|
|
@ -1277,6 +1279,40 @@ pub fn runtime_soul_verdict_receipt(
|
|||
cache.get::<SoulVerdictReceipt>(receipt_id)
|
||||
}
|
||||
|
||||
pub fn put_continuity_recovery_receipt(
|
||||
store_path: impl AsRef<Path>,
|
||||
receipt: &ContinuityRecoveryReceipt,
|
||||
) -> Result<()> {
|
||||
validate_non_empty(&receipt.receipt_id, "Continuity recovery receipt id")?;
|
||||
validate_non_empty(
|
||||
&receipt.source_result_id,
|
||||
"Continuity recovery source result",
|
||||
)?;
|
||||
validate_non_empty(&receipt.source_job_id, "Continuity recovery source job")?;
|
||||
validate_non_empty(&receipt.binding_id, "Continuity recovery binding")?;
|
||||
validate_non_empty(&receipt.mode, "Continuity recovery mode")?;
|
||||
validate_non_empty(
|
||||
&receipt.checkpoint_still_valid,
|
||||
"Continuity recovery checkpoint validity",
|
||||
)?;
|
||||
validate_non_empty(&receipt.emitted_at, "Continuity recovery timestamp")?;
|
||||
let mut cache = runtime_spine_cache(store_path)?;
|
||||
cache.pull_all_backing_stores()?;
|
||||
require_identity(&cache)?;
|
||||
cache.put(&receipt.receipt_id, receipt)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn runtime_continuity_recovery_receipt(
|
||||
store_path: impl AsRef<Path>,
|
||||
receipt_id: &str,
|
||||
) -> Result<Option<ContinuityRecoveryReceipt>> {
|
||||
validate_non_empty(receipt_id, "Continuity recovery receipt id")?;
|
||||
let mut cache = runtime_spine_cache(store_path)?;
|
||||
cache.pull_all_backing_stores()?;
|
||||
cache.get::<ContinuityRecoveryReceipt>(receipt_id)
|
||||
}
|
||||
|
||||
pub fn put_coordinator_run_receipt(
|
||||
store_path: impl AsRef<Path>,
|
||||
receipt: &EpiphanyCoordinatorRunReceipt,
|
||||
|
|
@ -3267,6 +3303,21 @@ mod tests {
|
|||
contract: "Soul verdict persists as runtime-spine proof.".to_string(),
|
||||
};
|
||||
put_soul_verdict_receipt(&store, &soul_verdict)?;
|
||||
let continuity_recovery = ContinuityRecoveryReceipt {
|
||||
schema_version: crate::CONTINUITY_RECOVERY_RECEIPT_SCHEMA_VERSION.to_string(),
|
||||
receipt_id: "continuity-recovery-1".to_string(),
|
||||
source_result_id: "result-reorient-1".to_string(),
|
||||
source_job_id: "job-reorient-1".to_string(),
|
||||
binding_id: "reorientation-worker".to_string(),
|
||||
mode: "resume".to_string(),
|
||||
checkpoint_still_valid: "true".to_string(),
|
||||
summary: "Checkpoint survives.".to_string(),
|
||||
next_safe_move: "Continue.".to_string(),
|
||||
files_inspected: vec!["state/map.yaml".to_string()],
|
||||
emitted_at: "2026-05-06T00:08:00Z".to_string(),
|
||||
contract: "Continuity recovery persists as runtime-spine proof.".to_string(),
|
||||
};
|
||||
put_continuity_recovery_receipt(&store, &continuity_recovery)?;
|
||||
|
||||
let stored = runtime_mind_gateway_review(&store, "mind-role-modeling-job-1")?
|
||||
.expect("Mind review receipt should persist");
|
||||
|
|
@ -3284,6 +3335,9 @@ mod tests {
|
|||
let stored_verdict = runtime_soul_verdict_receipt(&store, "soul-verdict-1")?
|
||||
.expect("Soul verdict should persist");
|
||||
assert_eq!(stored_verdict, soul_verdict);
|
||||
let stored_recovery = runtime_continuity_recovery_receipt(&store, "continuity-recovery-1")?
|
||||
.expect("Continuity recovery should persist");
|
||||
assert_eq!(stored_recovery, continuity_recovery);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ remembers doctrine; the branch remembers the blade.
|
|||
- Do not copy exact branch or HEAD from this note. Run `git status --short --branch` and `git log --oneline -5`.
|
||||
- Canonical anatomy now lives in `notes/epiphany-anatomy.md`. Embodied sub-agents are Self, Face, Imagination, Eyes, Proprioception, Hands, and Soul. Body, Mind, Continuity, and Substrate Gate are substrate/state/protocol surfaces, not sub-agent identities. State is split by layer: `work_organ` for resident Epiphany sub-agents, `persona` for portable public/person-shaped state shared by Epiphany Face, VoidBot repo Faces, and Ghostlight characters, and heartbeat/swarm state for scheduling and coordination physiology. Persona state now carries provenance, required public presentation, `date-time` timestamps, typed `candidateActions`, strict anchored thoughts with non-authoritative extensions, custom enum companion labels, and typed affect records for bonds/status reads/doctrine stances.
|
||||
- The repo now has a one-command local operator path: `.\tools\epiphany_local_run.ps1`. Default mode is `smoke`; it builds the retained Codex app-server compatibility edge, builds native Epiphany operator binaries, runs the coordinator smoke, and writes launcher artifacts under `.epiphany-run/` plus coordinator artifacts under `.epiphany-dogfood/`. `-Mode status` is now Epiphany-native: it builds only Epiphany operator binaries, reads `state/thread-state.msgpack` when present, derives status through `epiphany-core`, and does not start or require `codex-app-server`. Use `-Mode plan` or `-Mode run -MaxSteps 4` for the raw bridge-equipped coordinator entrypoints; use `-Mode mvp -FaceInput "<operator request>" -MaxSteps 4` for the local product cycle that projects Face's character turn, writes a Face/Aquarium bubble, bootstraps a minimal local checkpoint for fresh threads, runs the coordinator with auto-tools, then runs heartbeat sleep/dream maintenance. Live plan/run/mvp modes use the workspace `state/runtime-spine.msgpack`, because CodexThread launch writes worker requests there; the run bundle remains artifact evidence, not runtime lifecycle authority. Add `-ThreadId <id>` and `-Workspace <path>` to inspect or continue an existing thread. `status`, `plan`, and `smoke` do not spend model calls; `run` and `mvp` build and use `epiphany-openai-runtime`. Coordinator workers now launch detached and are polled through runtime-spine instead of blocking the coordinator. MVP runs are non-ephemeral by default so `-ThreadId <id>` can resume and poll later. `-MaxRuntimeSeconds <n>` is passed into worker runtime; timeout writes a failed worker receipt and exits. Failed modeling now blocks downstream verification until the failed result is reviewed.
|
||||
- Current Mom-ready status: the normal MVP pass reaches Face -> coordinator -> detached runtime -> heartbeat sleep, and modeling workers now complete through the ChatGPT subscription transport. The first failure was a stack of violated observability/runtime invariants: worker prompts prepended the whole shared persistent-memory rite, Responses frame liveness was invisible until completion, and the runtime tried to persist hundreds of text deltas before completing the worker job. Role/reorient workers now get a compact Epiphany worker boundary instead of full persistent memory; runtime-spine records sampled raw Responses frame kinds with small previews; contiguous reasoning/text deltas compact before durable storage; and live proofs completed `2fe38dcd-d99e-4c73-9a58-afcc81f851c7`, `241e3851-e3ea-4877-a63b-0d2bbd96a7e2`, and `85149a26-6975-403f-ac93-092b717c5825` instead of timing out. The second failure was stale lifecycle authority: completed runtime jobs remained as unresolved `runtime_links`, replacement launches treated historical active links as current, and one bad validation path opened an orphan job before rejecting the state patch. Latest-link-wins is now the runtime-link invariant, terminal links project completed jobs, stale active history cannot veto replacement, launch validation happens before opening runtime jobs, and completed-but-unreviewable modeling findings stop for review instead of relaunching the same lane. The Eyes/source-gather fork is now landed: Research is a fixed Eyes lane with launch/result/accept/status/coordinator/protocol support, and `regather-needed` modeling findings route to `LaunchResearch` instead of relaunching blind Proprioception. Research statePatch admission is Eyes-shaped only: observations, evidence, scratch, and optional investigationCheckpoint; no graph, planning, objective, or checkpoint authority. Mind admission now leaves typed runtime-spine proof: role/reorient acceptance persists `epiphany.mind.gateway_review` before state admission and `epiphany.mind.state_commit_receipt` after admission with the resulting durable revision. Launch contracts now split the broad receipt catalogue from effect-specific proof profiles for state admission, evidence promotion, repo action, verification, and continuity recovery. Research evidence promotion enforces Substrate Gate read/snapshot grant, Eyes evidence packet, and Mind review before state admission; Verification acceptance enforces Soul verdict and Mind review. The next concrete rebuild layer is Continuity recovery proof for reorient acceptance or Hands action proof once action lanes become live.
|
||||
- Current Mom-ready status: the normal MVP pass reaches Face -> coordinator -> detached runtime -> heartbeat sleep, and modeling workers now complete through the ChatGPT subscription transport. The first failure was a stack of violated observability/runtime invariants: worker prompts prepended the whole shared persistent-memory rite, Responses frame liveness was invisible until completion, and the runtime tried to persist hundreds of text deltas before completing the worker job. Role/reorient workers now get a compact Epiphany worker boundary instead of full persistent memory; runtime-spine records sampled raw Responses frame kinds with small previews; contiguous reasoning/text deltas compact before durable storage; and live proofs completed `2fe38dcd-d99e-4c73-9a58-afcc81f851c7`, `241e3851-e3ea-4877-a63b-0d2bbd96a7e2`, and `85149a26-6975-403f-ac93-092b717c5825` instead of timing out. The second failure was stale lifecycle authority: completed runtime jobs remained as unresolved `runtime_links`, replacement launches treated historical active links as current, and one bad validation path opened an orphan job before rejecting the state patch. Latest-link-wins is now the runtime-link invariant, terminal links project completed jobs, stale active history cannot veto replacement, launch validation happens before opening runtime jobs, and completed-but-unreviewable modeling findings stop for review instead of relaunching the same lane. The Eyes/source-gather fork is now landed: Research is a fixed Eyes lane with launch/result/accept/status/coordinator/protocol support, and `regather-needed` modeling findings route to `LaunchResearch` instead of relaunching blind Proprioception. Research statePatch admission is Eyes-shaped only: observations, evidence, scratch, and optional investigationCheckpoint; no graph, planning, objective, or checkpoint authority. Mind admission now leaves typed runtime-spine proof: role/reorient acceptance persists `epiphany.mind.gateway_review` before state admission and `epiphany.mind.state_commit_receipt` after admission with the resulting durable revision. Launch contracts now split the broad receipt catalogue from effect-specific proof profiles for state admission, evidence promotion, repo action, verification, and continuity recovery. Research evidence promotion enforces Substrate Gate read/snapshot grant, Eyes evidence packet, and Mind review before state admission; Verification acceptance enforces Soul verdict and Mind review; Reorient acceptance enforces Continuity recovery receipt and Mind review. The next concrete rebuild layer is Hands action proof once action lanes become live, or collapsing Mind review/state mutation/commit into one state-admission primitive.
|
||||
- Local operator runs now write typed CultMesh intent/receipt documents to `.epiphany-run/cultmesh/operator-runs.ccmp` through `epiphany-operator-run`. The wrapper writes intent before acting and a completion receipt after success; this is the local consent/trace rail, not a hidden scheduler queue.
|
||||
- Status-mode local runs now also write a native CultMesh operator snapshot to `.epiphany-run/cultmesh/operator-snapshots.ccmp` through `epiphany-operator-snapshot`. That snapshot distills the operator-safe MVP status artifact into typed fields such as thread id, state status, coordinator action, CRRC action, reorient action, available actions, and artifact refs; it does not preserve the raw JSON status blob as internal state.
|
||||
- `epiphany-mvp-status --source native` is the current provider-neutral status boundary. It projects scene, pressure, jobs, roles, planning, reorient, CRRC, coordinator status, and runtime-linked worker lifecycle from native core surfaces. It reads runtime-spine job/result receipts for linked jobs so failed workers show as failed in role results, jobs, roles, and coordinator source signals, while successful semantic findings still require typed role/reorient worker result documents. Keep future pluggable model-provider work behind launch/result/runtime documents; do not let provider choice leak into status, prompt authority, scheduler policy, or durable `EpiphanyThreadState`.
|
||||
|
|
@ -1434,8 +1434,11 @@ Eyes-shaped statePatch. Research evidence promotion therefore has a live
|
|||
Substrate Gate -> Eyes -> Mind proof chain. Verification acceptance now emits a
|
||||
typed `epiphany.soul.verdict_receipt`, persists/rereads it through
|
||||
runtime-spine, and enforces Soul verdict proof before Mind admits
|
||||
verification-shaped state. Other non-Mind profile gaps remain deferred because
|
||||
those producers are not live yet.
|
||||
verification-shaped state. Reorient acceptance now emits a typed
|
||||
`epiphany.continuity.recovery_receipt`, persists/rereads it through
|
||||
runtime-spine, and enforces Continuity recovery proof before Mind admits
|
||||
recovery-shaped state. Hands profile gaps remain deferred because action-lane
|
||||
receipt producers are not live yet.
|
||||
Mind review is now a persisted receipt chain for acceptance rather than an
|
||||
in-memory blessing: the bridge writes `epiphany.mind.gateway_review` before
|
||||
role/reorient state admission and `epiphany.mind.state_commit_receipt` after
|
||||
|
|
@ -1448,9 +1451,9 @@ compares Epiphany's named organ contracts against Void's current Face prompting
|
|||
shape and maps the route from contract catalog to executable organism. Main
|
||||
finding: the boundaries are directionally right, launch packets now carry organ
|
||||
receipt expectations and effect-specific proof profiles, and acceptance now has
|
||||
persisted Mind review/commit proof plus a profile evaluator, but most non-Mind
|
||||
gates still need receipt producers before their profile gaps can become hard
|
||||
blocks. The
|
||||
persisted Mind review/commit proof plus enforced Substrate Gate, Eyes, Soul,
|
||||
and Continuity receipt chains where those producers are live. Hands still needs
|
||||
receipt producers before its profile gaps can become hard blocks. The
|
||||
first dependency-body repair is landed: the missing
|
||||
`E:\Projects\CultLib\crates\*` paths were replaced with repo-contained vendored
|
||||
CultCache/CultNet/CultMesh crates, and the `epiphany-core` library tests pass
|
||||
|
|
|
|||
|
|
@ -144,10 +144,13 @@ Substrate Gate read/snapshot access grant, and Research acceptance enforces that
|
|||
grant before admitting evidence-shaped state. Verification acceptance emits a
|
||||
typed `epiphany.soul.verdict_receipt`, persists/rereads it through
|
||||
runtime-spine, and enforces Soul verdict proof before Mind admits
|
||||
verification-shaped state. Remaining weakness: Hands and Continuity receipts are
|
||||
still mostly launch-carried expectations, not enforced proof chains before
|
||||
state/action promotion, and the current Mind state mutation plus post-commit
|
||||
receipt is not a single transaction yet.
|
||||
verification-shaped state. Reorient acceptance emits a typed
|
||||
`epiphany.continuity.recovery_receipt`, persists/rereads it through
|
||||
runtime-spine, and enforces Continuity recovery proof before Mind admits
|
||||
recovery-shaped state. Remaining weakness: Hands receipts are still mostly
|
||||
launch-carried expectations, not enforced proof chains before action promotion,
|
||||
and the current Mind state mutation plus post-commit receipt is not a single
|
||||
transaction yet.
|
||||
|
||||
### 4. Self Still Shares A Throne With Compatibility Plumbing
|
||||
|
||||
|
|
@ -344,8 +347,10 @@ comfort tunnels.
|
|||
Substrate Gate -> Eyes -> Mind.
|
||||
- Landed: Verification acceptance produces and enforces typed Soul verdict
|
||||
receipts before Mind admission.
|
||||
- Next: add Continuity recovery receipts for reorient acceptance or Hands action
|
||||
receipts when action lanes become live.
|
||||
- Landed: Reorient acceptance produces and enforces typed Continuity recovery
|
||||
receipts before Mind admission.
|
||||
- Next: add Hands action receipts when action lanes become live, or collapse
|
||||
Mind review/state mutation/commit into one storage-owner admission primitive.
|
||||
- Make Aquarium read the contract catalog and available receipts instead of
|
||||
hard-coding the route zoo.
|
||||
- Starve `codex_message_processor` down to Codex auth/model transport and
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -116,8 +116,8 @@ accepted_design:
|
|||
- Substrate Gate contract surface is now named beside Mind's state gate: `epiphany-core::substrate_gate` defines repo access requests, access reviews, grant/refusal receipts, snapshot receipts, and mutation receipts; runtime-spine advertises those contracts; CultMesh persists matching `EpiphanyCultMeshSubstrateGateContractEntry` policy documents so repo substrate access has its own typed guardian instead of hiding behind worker launch scope.
|
||||
- Eyes' evidence contract surface is named beside Substrate Gate and Mind: `epiphany-core::eyes_gateway` defines evidence requests, evidence reviews, source lookup receipts, evidence packets, and evidence refusal receipts; runtime-spine advertises those contracts; CultMesh persists matching `EpiphanyCultMeshEyesContractEntry` policy documents so retrieved snippets and source reads are not confused with inspected evidence.
|
||||
- Hands, Soul, and Continuity now have first-class contract catalogs beside Mind/Substrate Gate/Eyes. `epiphany-core::hands_gateway` defines action intents, reviews, command/patch/commit/PR/rollback/refusal receipts; `epiphany-core::soul_gateway` defines verification requests, invariant checks, verdict/regression/review/refusal receipts; `epiphany-core::continuity_gateway` defines continuity packets, compaction checkpoints, sleep distillation, recovery, stale-turn repair, and continuity refusal receipts. Runtime-spine advertises them and CultMesh persists matching Verse-scoped contract policy documents.
|
||||
- Worker launch packets now carry `EpiphanyLaunchOrganContract` beside the typed launch document. The contract derives from authority scope, document kind, and output contract id; carries the full standing sub-agent dependency matrix, a receipt document catalogue, and effect-specific receipt proof profiles for state admission, evidence promotion, repo action, verification, and continuity recovery. Runtime-spine validates and persists this contract on `EpiphanyRuntimeWorkerLaunchRequest`; bridge role/reorient/generic launch builders populate it. Role/reorient acceptance now refuses completed runtime-spine findings if their original worker launch request is missing, mismatched by document kind, or lacks a state-admission proof profile requiring Mind review. Acceptance computes claimed effects from the role/reorient state change, rereads the persisted Mind gateway review from runtime-spine, enforces that currently available Mind proof, and defers non-Mind profile gaps until their producers exist. The first executable Mind proof is landed: acceptance persists `epiphany.mind.gateway_review` before state admission and `epiphany.mind.state_commit_receipt` after admission with the resulting revision. The Research evidence-promotion proof chain is executable: Research launches persist typed Substrate Gate read/snapshot access grants, accepted Research findings emit typed Eyes evidence packets from their Eyes-shaped statePatch, runtime-spine persists/verifies both, and Research acceptance enforces Substrate Gate grant + Eyes packet + Mind review before evidence-shaped state admission. The Verification proof chain is executable too: accepted Verification findings emit typed Soul verdict receipts, runtime-spine persists/verifies them, and Verification acceptance enforces Soul verdict + Mind review before verification-shaped state admission.
|
||||
- `notes/perfect-machine-audit-roadmap.md` is the current architectural audit. The main finding is that organ contracts are now named, launch-carried, and minimally acceptance-gated against naked runtime jobs, while Mind admission has the first persisted review/commit receipt chain. The old all-receipts list is now only a catalogue; proof profiles say which receipts are required for each effect type. Substrate Gate, Eyes, Hands, Soul, and Continuity receipts are still expectations rather than mandatory receipt chains. The current Mind receipt write is not transactional across state mutation and receipt persistence; future state admission should collapse mutation plus post-commit receipt into one owner when the storage layer supports it. The Rust dependency body repair is landed: the missing `E:\Projects\CultLib\crates\*` paths were replaced with repo-contained vendored CultCache/CultNet/CultMesh crates, and `cargo test --manifest-path .\epiphany-core\Cargo.toml --lib` passes.
|
||||
- Worker launch packets now carry `EpiphanyLaunchOrganContract` beside the typed launch document. The contract derives from authority scope, document kind, and output contract id; carries the full standing sub-agent dependency matrix, a receipt document catalogue, and effect-specific receipt proof profiles for state admission, evidence promotion, repo action, verification, and continuity recovery. Runtime-spine validates and persists this contract on `EpiphanyRuntimeWorkerLaunchRequest`; bridge role/reorient/generic launch builders populate it. Role/reorient acceptance now refuses completed runtime-spine findings if their original worker launch request is missing, mismatched by document kind, or lacks a state-admission proof profile requiring Mind review. Acceptance computes claimed effects from the role/reorient state change and rereads persisted receipt documents from runtime-spine before proof admission. The first executable Mind proof is landed: acceptance persists `epiphany.mind.gateway_review` before state admission and `epiphany.mind.state_commit_receipt` after admission with the resulting revision. The Research evidence-promotion proof chain is executable: Research launches persist typed Substrate Gate read/snapshot access grants, accepted Research findings emit typed Eyes evidence packets from their Eyes-shaped statePatch, runtime-spine persists/verifies both, and Research acceptance enforces Substrate Gate grant + Eyes packet + Mind review before evidence-shaped state admission. The Verification proof chain is executable too: accepted Verification findings emit typed Soul verdict receipts, runtime-spine persists/verifies them, and Verification acceptance enforces Soul verdict + Mind review before verification-shaped state admission. The Continuity recovery proof chain is executable: accepted reorient findings emit typed Continuity recovery receipts, runtime-spine persists/verifies them, and reorient acceptance enforces Continuity recovery + Mind review before recovery-shaped state admission.
|
||||
- `notes/perfect-machine-audit-roadmap.md` is the current architectural audit. The main finding is that organ contracts are now named, launch-carried, and acceptance-gated against naked runtime jobs, while Mind admission has the first persisted review/commit receipt chain. The old all-receipts list is now only a catalogue; proof profiles say which receipts are required for each effect type. Substrate Gate, Eyes, Soul, and Continuity now have live enforced receipt chains where their producers exist; Hands receipts remain expectations until action-lane producers become live. The current Mind receipt write is not transactional across state mutation and receipt persistence; future state admission should collapse mutation plus post-commit receipt into one owner when the storage layer supports it. The Rust dependency body repair is landed: the missing `E:\Projects\CultLib\crates\*` paths were replaced with repo-contained vendored CultCache/CultNet/CultMesh crates, and `cargo test --manifest-path .\epiphany-core\Cargo.toml --lib` passes.
|
||||
- `notes/codex-starvation-and-cultnet-liberation-plan.md` is the active foundation directive. It supersedes outward product/bridge/dogfood work and supersedes the weaker goal of merely making Codex app-server a cleaner adapter. Epiphany must become a native CultCache/CultNet runtime; Codex remains only as an OpenAI subscription auth/model-transport reliquary until that too can be replaced or minimized.
|
||||
- `notes/codex-auth-spine-inventory.md` is the current source-grounded inventory of the Codex organ that may survive. Corrected compliance invariant: Codex-compatible auth identity should remain anchored in retained vendored Codex-derived auth machinery, while Epiphany owns typed request/status/event/runtime surfaces around it. Codex app-server, apps, skills, marketplace, plugin UX, MCP OAuth handlers, and collaboration-mode surfaces are not part of the keeper spine.
|
||||
- `epiphany-openai-runtime` worker result ingress now parses assistant output directly into launch-kind-specific typed documents and stores typed nested `statePatch` / `selfPatch` payloads as MessagePack inside `EpiphanyRuntimeRoleWorkerResult`; generic `serde_json::Value` no longer mediates role/reorient worker results in that crate. JSON still exists at the OpenAI text edge because the model's output is text, but the runtime boundary after parsing is typed.
|
||||
|
|
@ -588,4 +588,4 @@ current_status:
|
|||
cargo and rejects modeling/planning/graph/checkpoint authority. MVP status
|
||||
and coordinator smokes pass with six lanes, and the smoke harness now
|
||||
rebuilds stale coordinator/app-server binaries before using them.
|
||||
next_action: Continue the Perfect Machine rebuild by choosing the next chain carefully. Research evidence promotion now has Substrate Gate + Eyes + Mind proof, and Verification has Soul + Mind proof. The next likely cut is Continuity recovery proof for reorient acceptance, or Hands action proof once implementation/action lanes become live.
|
||||
next_action: Continue the Perfect Machine rebuild by choosing the next chain carefully. Research evidence promotion now has Substrate Gate + Eyes + Mind proof, Verification has Soul + Mind proof, and reorient acceptance has Continuity + Mind proof. The next likely fork is Hands action proof once implementation/action lanes become live versus collapsing Mind review/state mutation/commit into one storage-owner admission primitive.
|
||||
|
|
|
|||
Reference in a new issue