Add fixed Eyes research lane

This commit is contained in:
Meta Vens 2026-05-30 01:02:16 +01:00
commit 2b3b446489
31 changed files with 593 additions and 57 deletions

View file

@ -1,6 +1,7 @@
use epiphany_core::EPIPHANY_IMAGINATION_OWNER_ROLE;
use epiphany_core::EPIPHANY_IMAGINATION_ROLE_BINDING_ID;
use epiphany_core::EPIPHANY_MODELING_ROLE_BINDING_ID;
use epiphany_core::EPIPHANY_RESEARCH_ROLE_BINDING_ID;
use epiphany_core::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
use epiphany_core::EPIPHANY_REORIENT_OWNER_ROLE;
use epiphany_core::EPIPHANY_VERIFICATION_ROLE_BINDING_ID;
@ -122,6 +123,18 @@ pub async fn derive_epiphany_coordinator_status(
} else {
(CoreEpiphanyCoordinatorRoleResultStatus::MissingState, None)
};
let (research_result_status, research_finding) = if let Some(state) = state {
let snapshot = load_core_epiphany_role_result_snapshot(
state,
runtime_store_path,
EpiphanyRoleResultRoleId::Research,
EPIPHANY_RESEARCH_ROLE_BINDING_ID,
)
.await;
(snapshot.status, snapshot.finding)
} else {
(CoreEpiphanyCoordinatorRoleResultStatus::MissingState, None)
};
let (verification_result_status, verification_finding) = if let Some(state) = state {
let snapshot = load_core_epiphany_role_result_snapshot(
state,
@ -136,6 +149,7 @@ pub async fn derive_epiphany_coordinator_status(
};
let finding_signals = derive_coordinator_finding_signals(
state,
research_finding.as_ref(),
modeling_finding.as_ref(),
verification_finding.as_ref(),
reorient_finding,
@ -149,9 +163,13 @@ pub async fn derive_epiphany_coordinator_status(
reorient_action: reorient_decision
.map(|decision| decision.action)
.unwrap_or(CoreEpiphanyReorientAction::Resume),
research_result_status,
modeling_result_status,
verification_result_status,
reorient_result_status,
research_result_accepted: finding_signals.research_result_accepted,
research_result_reviewable: finding_signals.research_result_reviewable,
modeling_result_requests_regather: finding_signals.modeling_result_requests_regather,
modeling_result_accepted: finding_signals.modeling_result_accepted,
modeling_result_reviewable: finding_signals.modeling_result_reviewable,
modeling_result_accepted_after_verification: finding_signals
@ -363,10 +381,12 @@ pub fn map_epiphany_roles(
reorient_result_status: result_status,
reorient_job: reorient_job.map(map_core_role_board_job),
imagination_binding_id: EPIPHANY_IMAGINATION_ROLE_BINDING_ID.to_string(),
research_binding_id: EPIPHANY_RESEARCH_ROLE_BINDING_ID.to_string(),
modeling_binding_id: EPIPHANY_MODELING_ROLE_BINDING_ID.to_string(),
verification_binding_id: EPIPHANY_VERIFICATION_ROLE_BINDING_ID.to_string(),
reorient_owner_role: EPIPHANY_REORIENT_OWNER_ROLE.to_string(),
imagination_owner_role: EPIPHANY_IMAGINATION_OWNER_ROLE.to_string(),
research_owner_role: epiphany_core::EPIPHANY_RESEARCH_OWNER_ROLE.to_string(),
});
EpiphanyRoleBoardStatus { roles, source_jobs }

View file

@ -43,6 +43,7 @@ fn protocol_coordinator_source_signals(
should_prepare_compaction: signals.should_prepare_compaction,
reorient_action: protocol_reorient_action(signals.reorient_action),
crrc_action: protocol_crrc_action(signals.crrc_action),
research_result_status: protocol_role_result_status(signals.research_result_status),
modeling_result_status: protocol_role_result_status(signals.modeling_result_status),
verification_result_status: protocol_role_result_status(signals.verification_result_status),
reorient_result_status: protocol_reorient_result_status(signals.reorient_result_status),
@ -139,6 +140,7 @@ fn protocol_coordinator_role_id(role_id: CoreEpiphanyCoordinatorRoleId) -> Threa
match role_id {
CoreEpiphanyCoordinatorRoleId::Implementation => ThreadEpiphanyRoleId::Implementation,
CoreEpiphanyCoordinatorRoleId::Imagination => ThreadEpiphanyRoleId::Imagination,
CoreEpiphanyCoordinatorRoleId::Research => ThreadEpiphanyRoleId::Research,
CoreEpiphanyCoordinatorRoleId::Modeling => ThreadEpiphanyRoleId::Modeling,
CoreEpiphanyCoordinatorRoleId::Verification => ThreadEpiphanyRoleId::Verification,
CoreEpiphanyCoordinatorRoleId::Reorientation => ThreadEpiphanyRoleId::Reorientation,
@ -187,6 +189,12 @@ fn protocol_coordinator_action(
CoreEpiphanyCoordinatorAction::RegatherManually => {
ThreadEpiphanyCoordinatorAction::RegatherManually
}
CoreEpiphanyCoordinatorAction::LaunchResearch => {
ThreadEpiphanyCoordinatorAction::LaunchResearch
}
CoreEpiphanyCoordinatorAction::ReviewResearchResult => {
ThreadEpiphanyCoordinatorAction::ReviewResearchResult
}
CoreEpiphanyCoordinatorAction::LaunchModeling => {
ThreadEpiphanyCoordinatorAction::LaunchModeling
}

View file

@ -8,6 +8,8 @@ pub use epiphany_core::EPIPHANY_IMAGINATION_OWNER_ROLE;
pub use epiphany_core::EPIPHANY_IMAGINATION_ROLE_BINDING_ID;
pub use epiphany_core::EPIPHANY_MODELING_OWNER_ROLE;
pub use epiphany_core::EPIPHANY_MODELING_ROLE_BINDING_ID;
pub use epiphany_core::EPIPHANY_RESEARCH_OWNER_ROLE;
pub use epiphany_core::EPIPHANY_RESEARCH_ROLE_BINDING_ID;
pub use epiphany_core::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
pub use epiphany_core::EPIPHANY_REORIENT_OWNER_ROLE;
pub use epiphany_core::EPIPHANY_VERIFICATION_OWNER_ROLE;

View file

@ -102,6 +102,17 @@ pub fn build_role_acceptance_update(
}
patch
}
EpiphanyRoleResultRoleId::Research => {
let patch = parse_core_role_finding_state_patch(finding)?;
let patch_errors = epiphany_core::research_role_state_patch_policy_errors(&patch);
if !patch_errors.is_empty() {
return Err(format!(
"research role state patch is not acceptable: {}",
patch_errors.join("; ")
));
}
patch
}
EpiphanyRoleResultRoleId::Verification => EpiphanyRoleStatePatchDocument::default(),
EpiphanyRoleResultRoleId::Implementation | EpiphanyRoleResultRoleId::Reorientation => {
return Err(format!(

View file

@ -237,6 +237,7 @@ pub fn protocol_role_id_to_core(role_id: ThreadEpiphanyRoleId) -> EpiphanyRoleRe
match role_id {
ThreadEpiphanyRoleId::Implementation => EpiphanyRoleResultRoleId::Implementation,
ThreadEpiphanyRoleId::Imagination => EpiphanyRoleResultRoleId::Imagination,
ThreadEpiphanyRoleId::Research => EpiphanyRoleResultRoleId::Research,
ThreadEpiphanyRoleId::Modeling => EpiphanyRoleResultRoleId::Modeling,
ThreadEpiphanyRoleId::Verification => EpiphanyRoleResultRoleId::Verification,
ThreadEpiphanyRoleId::Reorientation => EpiphanyRoleResultRoleId::Reorientation,
@ -247,6 +248,7 @@ pub fn protocol_role_id_from_core(role_id: EpiphanyRoleResultRoleId) -> ThreadEp
match role_id {
EpiphanyRoleResultRoleId::Implementation => ThreadEpiphanyRoleId::Implementation,
EpiphanyRoleResultRoleId::Imagination => ThreadEpiphanyRoleId::Imagination,
EpiphanyRoleResultRoleId::Research => ThreadEpiphanyRoleId::Research,
EpiphanyRoleResultRoleId::Modeling => ThreadEpiphanyRoleId::Modeling,
EpiphanyRoleResultRoleId::Verification => ThreadEpiphanyRoleId::Verification,
EpiphanyRoleResultRoleId::Reorientation => ThreadEpiphanyRoleId::Reorientation,

View file

@ -21,6 +21,8 @@ use epiphany_state_model::EpiphanyThreadState;
pub const EPIPHANY_IMAGINATION_ROLE_BINDING_ID: &str = "planning-synthesis-worker";
pub const EPIPHANY_IMAGINATION_OWNER_ROLE: &str = "epiphany-imagination";
pub const EPIPHANY_RESEARCH_ROLE_BINDING_ID: &str = "research-source-gather-worker";
pub const EPIPHANY_RESEARCH_OWNER_ROLE: &str = "epiphany-eyes";
pub const EPIPHANY_MODELING_ROLE_BINDING_ID: &str = "modeling-checkpoint-worker";
pub const EPIPHANY_MODELING_OWNER_ROLE: &str = "epiphany-modeler";
pub const EPIPHANY_VERIFICATION_ROLE_BINDING_ID: &str = "verification-review-worker";
@ -31,6 +33,7 @@ pub const EPIPHANY_REORIENT_OWNER_ROLE: &str = "epiphany-reorient";
pub fn epiphany_role_binding_id(role_id: EpiphanyRoleResultRoleId) -> Result<&'static str, String> {
match role_id {
EpiphanyRoleResultRoleId::Imagination => Ok(EPIPHANY_IMAGINATION_ROLE_BINDING_ID),
EpiphanyRoleResultRoleId::Research => Ok(EPIPHANY_RESEARCH_ROLE_BINDING_ID),
EpiphanyRoleResultRoleId::Modeling => Ok(EPIPHANY_MODELING_ROLE_BINDING_ID),
EpiphanyRoleResultRoleId::Verification => Ok(EPIPHANY_VERIFICATION_ROLE_BINDING_ID),
EpiphanyRoleResultRoleId::Implementation => Err(
@ -47,6 +50,7 @@ pub fn epiphany_role_binding_id(role_id: EpiphanyRoleResultRoleId) -> Result<&'s
pub fn epiphany_role_owner(role_id: EpiphanyRoleResultRoleId) -> Result<&'static str, String> {
match role_id {
EpiphanyRoleResultRoleId::Imagination => Ok(EPIPHANY_IMAGINATION_OWNER_ROLE),
EpiphanyRoleResultRoleId::Research => Ok(EPIPHANY_RESEARCH_OWNER_ROLE),
EpiphanyRoleResultRoleId::Modeling => Ok(EPIPHANY_MODELING_OWNER_ROLE),
EpiphanyRoleResultRoleId::Verification => Ok(EPIPHANY_VERIFICATION_OWNER_ROLE),
EpiphanyRoleResultRoleId::Implementation | EpiphanyRoleResultRoleId::Reorientation => {
@ -59,6 +63,7 @@ pub fn epiphany_role_label(role_id: EpiphanyRoleResultRoleId) -> &'static str {
match role_id {
EpiphanyRoleResultRoleId::Implementation => "implementation",
EpiphanyRoleResultRoleId::Imagination => "imagination",
EpiphanyRoleResultRoleId::Research => "research",
EpiphanyRoleResultRoleId::Modeling => "modeling",
EpiphanyRoleResultRoleId::Verification => "verification",
EpiphanyRoleResultRoleId::Reorientation => "reorientation",
@ -70,6 +75,9 @@ pub fn epiphany_role_launch_output_schema(role_id: EpiphanyRoleResultRoleId) ->
EpiphanyRoleResultRoleId::Imagination => {
vec!["draft-ready", "planning-update-needed", "blocked"]
}
EpiphanyRoleResultRoleId::Research => {
vec!["evidence-ready", "source-gap", "blocked"]
}
EpiphanyRoleResultRoleId::Modeling => {
vec![
"checkpoint-ready",
@ -231,6 +239,43 @@ pub fn epiphany_role_launch_output_schema(role_id: EpiphanyRoleResultRoleId) ->
);
}
required.push("statePatch");
} else if role_id == EpiphanyRoleResultRoleId::Research {
if let Some(map) = properties.as_object_mut() {
map.insert(
"statePatch".to_string(),
serde_json::json!({
"type": "object",
"description": "Required reviewable thread/epiphany/update patch for research/Eyes. Use only observations, evidence, scratch, and optional investigationCheckpoint. The patch must include at least one evidence record and one observation that cites it.",
"required": ["observations", "evidence"],
"properties": {
"observations": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["id", "summary", "source_kind", "status", "evidence_ids"],
"additionalProperties": true
}
},
"evidence": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["id", "kind", "status", "summary"],
"additionalProperties": true
}
}
},
"anyOf": [
{"required": ["scratch"]},
{"required": ["investigationCheckpoint"]}
],
"additionalProperties": true
}),
);
}
required.push("statePatch");
} else if role_id == EpiphanyRoleResultRoleId::Modeling {
if let Some(map) = properties.as_object_mut() {
map.insert(
@ -418,6 +463,11 @@ pub fn build_epiphany_role_launch_request(
"epiphany.role.imagination",
build_epiphany_role_launch_instruction(role_id),
),
EpiphanyRoleResultRoleId::Research => (
"role-scoped source gathering",
"epiphany.role.research",
build_epiphany_role_launch_instruction(role_id),
),
EpiphanyRoleResultRoleId::Modeling => (
"role-scoped modeling/checkpoint maintenance",
"epiphany.role.modeling",
@ -484,6 +534,7 @@ fn build_epiphany_role_launch_instruction(role_id: EpiphanyRoleResultRoleId) ->
let prompts = &epiphany_specialist_prompt_config().roles;
let body = match role_id {
EpiphanyRoleResultRoleId::Imagination => prompts.imagination.as_str(),
EpiphanyRoleResultRoleId::Research => prompts.research.as_str(),
EpiphanyRoleResultRoleId::Modeling => prompts.modeling.as_str(),
EpiphanyRoleResultRoleId::Verification => prompts.verification.as_str(),
EpiphanyRoleResultRoleId::Implementation | EpiphanyRoleResultRoleId::Reorientation => {

View file

@ -8,10 +8,10 @@ use epiphany_core::epiphany_cultmesh_operator_snapshot_from_status_json;
use epiphany_core::load_epiphany_cultmesh_operator_status;
use epiphany_core::load_epiphany_cultmesh_status;
use epiphany_core::load_latest_epiphany_cultmesh_operator_snapshot;
use epiphany_core::write_epiphany_cultmesh_continuity_contracts;
use epiphany_core::write_epiphany_cultmesh_eyes_contracts;
use epiphany_core::write_epiphany_cultmesh_global_room_policies;
use epiphany_core::write_epiphany_cultmesh_hands_contracts;
use epiphany_core::write_epiphany_cultmesh_continuity_contracts;
use epiphany_core::write_epiphany_cultmesh_mind_contracts;
use epiphany_core::write_epiphany_cultmesh_operator_snapshot;
use epiphany_core::write_epiphany_cultmesh_operator_status;

View file

@ -52,6 +52,7 @@ impl Args {
fn run_smoke(args: &Args) -> Result<Value> {
let root = env::current_dir().context("failed to resolve current dir")?;
let app_server = absolute_path(&args.app_server)?;
ensure_default_app_server_built(&root, &app_server)?;
if !app_server.exists() {
return Err(anyhow!(
"codex app-server binary not found: {}",
@ -332,9 +333,6 @@ fn sibling_exe(name: &str) -> Result<PathBuf> {
}
fn ensure_coordinator_built(root: &Path, coordinator: &Path) -> Result<()> {
if coordinator.exists() {
return Ok(());
}
let status = Command::new("cargo")
.current_dir(root)
.arg("build")
@ -353,6 +351,37 @@ fn ensure_coordinator_built(root: &Path, coordinator: &Path) -> Result<()> {
)
}
fn ensure_default_app_server_built(root: &Path, app_server: &Path) -> Result<()> {
let default_app_server = PathBuf::from(DEFAULT_APP_SERVER);
if app_server != default_app_server {
return Ok(());
}
let status = Command::new("cargo")
.current_dir(root)
.env("CARGO_TARGET_DIR", r"C:\Users\Meta\.cargo-target-codex")
.arg("build")
.arg("--manifest-path")
.arg(
root.join("vendor")
.join("codex")
.join("codex-rs")
.join("Cargo.toml"),
)
.arg("-p")
.arg("codex-app-server")
.arg("--bin")
.arg("codex-app-server")
.status()
.context("failed to build default codex-app-server")?;
require(
status.success() && app_server.exists(),
&format!(
"default codex-app-server binary was not built: {}",
app_server.display()
),
)
}
fn absolute_path(path: &Path) -> Result<PathBuf> {
if path.is_absolute() {
Ok(path.to_path_buf())

View file

@ -366,12 +366,9 @@ fn run_coordinator(args: &Args) -> Result<Value> {
let revision = state_revision(&status);
match action.as_str() {
"reviewModelingResult" | "reviewVerificationResult" => {
let role_id = if action == "reviewModelingResult" {
"modeling"
} else {
"verification"
};
"reviewResearchResult" | "reviewModelingResult" | "reviewVerificationResult" => {
let role_id = role_id_for_coordinator_action(&action)
.ok_or_else(|| anyhow!("unsupported review action {action}"))?;
let result = client.send(
"thread/epiphany/roleResult",
Some(json!({"threadId": thread_id, "roleId": role_id})),
@ -386,7 +383,7 @@ fn run_coordinator(args: &Args) -> Result<Value> {
Some("completed" | "failed" | "cancelled")
) {
final_action = json!({
"action": if role_id == "modeling" { "waitForModelingResult" } else { "waitForVerificationResult" },
"action": wait_action_for_role(role_id),
"reason": result["note"],
});
append_jsonl(&steps_path, &step)?;
@ -398,7 +395,7 @@ fn run_coordinator(args: &Args) -> Result<Value> {
&& revision.is_some();
if !can_accept {
final_action = json!({
"action": if role_id == "modeling" { "reviewModelingResult" } else { "reviewVerificationResult" },
"action": review_action_for_role(role_id),
"reason": result["note"]
});
append_jsonl(&steps_path, &step)?;
@ -446,12 +443,9 @@ fn run_coordinator(args: &Args) -> Result<Value> {
steps.push(step);
break;
}
"launchModeling" | "launchVerification" => {
let role_id = if action == "launchModeling" {
"modeling"
} else {
"verification"
};
"launchResearch" | "launchModeling" | "launchVerification" => {
let role_id = role_id_for_coordinator_action(&action)
.ok_or_else(|| anyhow!("unsupported launch action {action}"))?;
let launch = launch_role(
&mut client,
&thread_id,
@ -493,7 +487,7 @@ fn run_coordinator(args: &Args) -> Result<Value> {
Some("completed" | "failed" | "cancelled")
) {
final_action = json!({
"action": if role_id == "modeling" { "waitForModelingResult" } else { "waitForVerificationResult" },
"action": wait_action_for_role(role_id),
"reason": result["note"],
});
append_jsonl(&steps_path, &step)?;
@ -502,7 +496,7 @@ fn run_coordinator(args: &Args) -> Result<Value> {
}
if !args.auto_review {
final_action = json!({
"action": if role_id == "modeling" { "reviewModelingResult" } else { "reviewVerificationResult" },
"action": review_action_for_role(role_id),
"reason": result["note"],
});
append_jsonl(&steps_path, &step)?;
@ -723,6 +717,7 @@ fn collect_coordinator_status(
let planning = view.get("planning").cloned().unwrap_or_else(|| json!(null));
let role_results = json!({
"imagination": client.send("thread/epiphany/roleResult", Some(json!({"threadId": thread_id, "roleId": "imagination"})), true)?,
"research": client.send("thread/epiphany/roleResult", Some(json!({"threadId": thread_id, "roleId": "research"})), true)?,
"modeling": client.send("thread/epiphany/roleResult", Some(json!({"threadId": thread_id, "roleId": "modeling"})), true)?,
"verification": client.send("thread/epiphany/roleResult", Some(json!({"threadId": thread_id, "roleId": "verification"})), true)?,
});
@ -827,6 +822,33 @@ fn launch_role(
client.send("thread/epiphany/roleLaunch", Some(payload), true)
}
fn role_id_for_coordinator_action(action: &str) -> Option<&'static str> {
match action {
"launchResearch" | "reviewResearchResult" => Some("research"),
"launchModeling" | "reviewModelingResult" => Some("modeling"),
"launchVerification" | "reviewVerificationResult" => Some("verification"),
_ => None,
}
}
fn wait_action_for_role(role_id: &str) -> &'static str {
match role_id {
"research" => "waitForResearchResult",
"modeling" => "waitForModelingResult",
"verification" => "waitForVerificationResult",
_ => "waitForRoleResult",
}
}
fn review_action_for_role(role_id: &str) -> &'static str {
match role_id {
"research" => "reviewResearchResult",
"modeling" => "reviewModelingResult",
"verification" => "reviewVerificationResult",
_ => "reviewRoleResult",
}
}
fn launch_reorient(
client: &mut status_cli::AppServerClient,
thread_id: &str,

View file

@ -245,11 +245,12 @@ fn validate_status(status: &Value, rendered: &str) -> Result<()> {
== [
"implementation",
"imagination",
"research",
"modeling",
"verification",
"reorientation",
],
"roles surface should expose the five MVP role lanes",
"roles surface should expose the six MVP role lanes",
)?;
require(
status
@ -283,6 +284,10 @@ fn validate_status(status: &Value, rendered: &str) -> Result<()> {
.pointer("/roleResults/imagination/status")
.and_then(Value::as_str)
== Some("missingState")
&& status
.pointer("/roleResults/research/status")
.and_then(Value::as_str)
== Some("missingState")
&& status
.pointer("/roleResults/modeling/status")
.and_then(Value::as_str)

View file

@ -56,6 +56,7 @@ const DEFAULT_THREAD_STATE_STORE: &str = "state/thread-state.msgpack";
const DEFAULT_RUNTIME_STORE: &str = "state/runtime-spine.msgpack";
const REORIENT_BINDING_ID: &str = "reorient-worker";
const IMAGINATION_BINDING_ID: &str = "imagination-synthesis-worker";
const RESEARCH_BINDING_ID: &str = "research-source-gather-worker";
const MODELING_BINDING_ID: &str = "modeling-checkpoint-worker";
const VERIFICATION_BINDING_ID: &str = "verification-review-worker";
const SEALED_DIRECT_THOUGHT_KEYS: &[&str] = &[
@ -253,6 +254,8 @@ fn run_native_status(args: &Args) -> Result<Value> {
native_reorient_result_status(state_ref, &runtime_store_path, REORIENT_BINDING_ID);
let modeling_result_status =
native_role_result_status(state_ref, &runtime_store_path, MODELING_BINDING_ID);
let research_result_status =
native_role_result_status(state_ref, &runtime_store_path, RESEARCH_BINDING_ID);
let verification_result_status =
native_role_result_status(state_ref, &runtime_store_path, VERIFICATION_BINDING_ID);
let recommendation = recommend_crrc_action(EpiphanyCrrcInput {
@ -308,12 +311,14 @@ fn run_native_status(args: &Args) -> Result<Value> {
.find(|job| job.id == REORIENT_BINDING_ID)
.cloned(),
imagination_binding_id: IMAGINATION_BINDING_ID.to_string(),
research_binding_id: RESEARCH_BINDING_ID.to_string(),
modeling_binding_id: MODELING_BINDING_ID.to_string(),
verification_binding_id: VERIFICATION_BINDING_ID.to_string(),
reorient_owner_role: "epiphany-reorienter".to_string(),
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);
let finding_signals = derive_coordinator_finding_signals(state_ref, None, None, None, None);
let coordinator = derive_coordinator_status(EpiphanyCoordinatorStatusInput {
state_status,
checkpoint_present: state_ref
@ -323,9 +328,13 @@ fn run_native_status(args: &Args) -> Result<Value> {
recommendation: recommendation.clone(),
roles: roles.clone(),
reorient_action: reorient_decision.action,
research_result_status,
modeling_result_status,
verification_result_status,
reorient_result_status: result_status,
research_result_accepted: finding_signals.research_result_accepted,
research_result_reviewable: finding_signals.research_result_reviewable,
modeling_result_requests_regather: finding_signals.modeling_result_requests_regather,
modeling_result_accepted: finding_signals.modeling_result_accepted,
modeling_result_reviewable: finding_signals.modeling_result_reviewable,
modeling_result_accepted_after_verification: finding_signals
@ -409,6 +418,7 @@ fn run_native_status(args: &Args) -> Result<Value> {
"planning": planning,
"roleResults": {
"imagination": native_role_result(state_ref, &runtime_store_path, IMAGINATION_BINDING_ID),
"research": native_role_result(state_ref, &runtime_store_path, RESEARCH_BINDING_ID),
"modeling": native_role_result(state_ref, &runtime_store_path, MODELING_BINDING_ID),
"verification": native_role_result(state_ref, &runtime_store_path, VERIFICATION_BINDING_ID),
},
@ -503,6 +513,7 @@ fn run_codex_status(args: &Args) -> Result<Value> {
let planning = view.get("planning").cloned().unwrap_or_else(|| json!(null));
let role_results = json!({
"imagination": client.send("thread/epiphany/roleResult", Some(json!({"threadId": thread_id, "roleId": "imagination"})), true)?,
"research": client.send("thread/epiphany/roleResult", Some(json!({"threadId": thread_id, "roleId": "research"})), true)?,
"modeling": client.send("thread/epiphany/roleResult", Some(json!({"threadId": thread_id, "roleId": "modeling"})), true)?,
"verification": client.send("thread/epiphany/roleResult", Some(json!({"threadId": thread_id, "roleId": "verification"})), true)?,
});
@ -1338,6 +1349,7 @@ pub fn render_status(status: &Value) -> String {
lines.extend([String::new(), "Role Findings".to_string()]);
for (role_id, label) in [
("imagination", "Imagination / Planning"),
("research", "Eyes / Research"),
("modeling", "Modeling / Checkpoint"),
("verification", "Verification / Review"),
] {

View file

@ -10,9 +10,12 @@ pub const CONTINUITY_REFUSAL_RECEIPT_TYPE: &str = "epiphany.continuity.refusal_r
pub const CONTINUITY_PACKET_SCHEMA_VERSION: &str = "epiphany.continuity.packet.v0";
pub const CONTINUITY_COMPACTION_CHECKPOINT_SCHEMA_VERSION: &str =
"epiphany.continuity.compaction_checkpoint.v0";
pub const CONTINUITY_SLEEP_DISTILLATION_SCHEMA_VERSION: &str = "epiphany.continuity.sleep_distillation.v0";
pub const CONTINUITY_RECOVERY_RECEIPT_SCHEMA_VERSION: &str = "epiphany.continuity.recovery_receipt.v0";
pub const CONTINUITY_STALE_TURN_REPAIR_SCHEMA_VERSION: &str = "epiphany.continuity.stale_turn_repair.v0";
pub const CONTINUITY_SLEEP_DISTILLATION_SCHEMA_VERSION: &str =
"epiphany.continuity.sleep_distillation.v0";
pub const CONTINUITY_RECOVERY_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.continuity.recovery_receipt.v0";
pub const CONTINUITY_STALE_TURN_REPAIR_SCHEMA_VERSION: &str =
"epiphany.continuity.stale_turn_repair.v0";
pub const CONTINUITY_REFUSAL_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.continuity.refusal_receipt.v0";

View file

@ -28,6 +28,8 @@ pub use agent_launch::EPIPHANY_MODELING_OWNER_ROLE;
pub use agent_launch::EPIPHANY_MODELING_ROLE_BINDING_ID;
pub use agent_launch::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
pub use agent_launch::EPIPHANY_REORIENT_OWNER_ROLE;
pub use agent_launch::EPIPHANY_RESEARCH_OWNER_ROLE;
pub use agent_launch::EPIPHANY_RESEARCH_ROLE_BINDING_ID;
pub use agent_launch::EPIPHANY_VERIFICATION_OWNER_ROLE;
pub use agent_launch::EPIPHANY_VERIFICATION_ROLE_BINDING_ID;
pub use agent_launch::EpiphanyCoordinatorPromptConfig;
@ -574,6 +576,7 @@ pub use surfaces::recommend_reorientation;
pub use surfaces::render_role_board_note;
pub use surfaces::reorient_finding_already_accepted;
pub use surfaces::reorientation_role_status;
pub use surfaces::research_role_state_patch_policy_errors;
pub use surfaces::review_role_self_patch_document;
pub use surfaces::role_board_job_status_to_role_status;
pub use surfaces::role_self_memory_target;

View file

@ -371,6 +371,7 @@ fn role_label(role_id: EpiphanyRoleResultRoleId) -> &'static str {
match role_id {
EpiphanyRoleResultRoleId::Implementation => "implementation",
EpiphanyRoleResultRoleId::Imagination => "imagination",
EpiphanyRoleResultRoleId::Research => "research",
EpiphanyRoleResultRoleId::Modeling => "modeling",
EpiphanyRoleResultRoleId::Verification => "verification",
EpiphanyRoleResultRoleId::Reorientation => "reorientation",

View file

@ -1,12 +1,14 @@
use serde::Deserialize;
use serde::Serialize;
use crate::continuity_gateway::{
CONTINUITY_RECOVERY_RECEIPT_TYPE, CONTINUITY_REFUSAL_RECEIPT_TYPE,
};
use crate::eyes_gateway::{EYES_EVIDENCE_PACKET_TYPE, EYES_EVIDENCE_REFUSAL_RECEIPT_TYPE};
use crate::hands_gateway::{
HANDS_ACTION_REFUSAL_RECEIPT_TYPE, HANDS_COMMIT_RECEIPT_TYPE, HANDS_PATCH_RECEIPT_TYPE,
HANDS_ROLLBACK_RECEIPT_TYPE,
};
use crate::continuity_gateway::{CONTINUITY_RECOVERY_RECEIPT_TYPE, CONTINUITY_REFUSAL_RECEIPT_TYPE};
use crate::mind_gateway::{
MIND_GATEWAY_REVIEW_TYPE, MIND_STATE_COMMIT_RECEIPT_TYPE, MIND_STATE_REJECTION_RECEIPT_TYPE,
};

View file

@ -111,6 +111,7 @@ The Eyes improve themselves by seeing earlier and hallucinating less. Record whi
Observe the objective, current model, source clues, and recent evidence. Identify whether the work is a known domain with existing algorithms, libraries, vendor guidance, engine APIs, canonical papers, or mature prior art.
Search local source/docs first. Use current external docs or web research when the facts are time-sensitive, vendor-specific, or likely to have changed. Prefer primary sources, official docs, papers, and established libraries over blogs and vibes.
Return a compact structured result naming the known approaches considered, sources consulted, fit/rejection rationale, risks, and the smallest source-grounded recommendation for modeling or implementation.
`statePatch` is part of the Eyes job. Include a reviewable `thread/epiphany/update` patch using only `observations`, `evidence`, `scratch`, and optional `investigationCheckpoint`. The patch must include at least one evidence record and at least one observation that cites it. Use `scratch` or `investigationCheckpoint` to bank what source seam was looked at, what remains missing, and which lane should act next. Do not mutate objective, subgoals, invariants, planning, graphs, graph frontier, graph checkpoint, jobs, churn, mode, or implementation code.
Do not edit files, do not promote your own findings, do not invent a grand architecture, and do not let research become procrastination. The Eyes open the path; Proprioception maps it, the Hands build it, and the Soul tests it.
'''

View file

@ -1,5 +1,6 @@
use crate::EpiphanyWorkerLaunchDocument;
use crate::agent_memory::AGENT_MEMORY_TYPE;
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;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION;
@ -21,7 +22,6 @@ use crate::eyes_gateway::EYES_SOURCE_LOOKUP_RECEIPT_TYPE;
use crate::hands_gateway::*;
use crate::heartbeat_state::HEARTBEAT_STATE_SCHEMA_VERSION;
use crate::heartbeat_state::HEARTBEAT_STATE_TYPE;
use crate::continuity_gateway::*;
use crate::memory_graph::MEMORY_GRAPH_SCHEMA_VERSION;
use crate::memory_graph::MEMORY_GRAPH_TYPE;
use crate::mind_gateway::MIND_GATEWAY_REVIEW_SCHEMA_VERSION;
@ -2197,7 +2197,9 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
CultNetMutationAuthority::ReadOnly,
vec![],
vec![],
vec!["Continuity refusal receipts preserve why a continuity packet could not be trusted."],
vec![
"Continuity refusal receipts preserve why a continuity packet could not be trusted.",
],
),
mutation_contract(
RUNTIME_EVENT_TYPE,

View file

@ -17,6 +17,7 @@ use std::collections::HashSet;
pub enum EpiphanyCoordinatorRoleId {
Implementation,
Imagination,
Research,
Modeling,
Verification,
Reorientation,
@ -58,6 +59,8 @@ pub enum EpiphanyCoordinatorAction {
WaitForReorientWorker,
ReviewReorientResult,
RegatherManually,
LaunchResearch,
ReviewResearchResult,
LaunchModeling,
ReviewModelingResult,
LaunchVerification,
@ -95,6 +98,7 @@ pub struct EpiphanyCoordinatorCrrcRecommendation {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EpiphanyCoordinatorSignals {
pub research_result_status: EpiphanyCoordinatorRoleResultStatus,
pub modeling_result_status: EpiphanyCoordinatorRoleResultStatus,
pub verification_result_status: EpiphanyCoordinatorRoleResultStatus,
}
@ -106,6 +110,7 @@ pub struct EpiphanyCoordinatorSourceSignals {
pub should_prepare_compaction: bool,
pub reorient_action: EpiphanyReorientAction,
pub crrc_action: EpiphanyCrrcAction,
pub research_result_status: EpiphanyCoordinatorRoleResultStatus,
pub modeling_result_status: EpiphanyCoordinatorRoleResultStatus,
pub verification_result_status: EpiphanyCoordinatorRoleResultStatus,
pub reorient_result_status: super::EpiphanyCrrcResultStatus,
@ -126,6 +131,9 @@ pub struct EpiphanyCoordinatorInput {
pub recommendation: EpiphanyCoordinatorCrrcRecommendation,
pub roles: Vec<EpiphanyCoordinatorRoleLane>,
pub signals: EpiphanyCoordinatorSignals,
pub research_result_accepted: bool,
pub research_result_reviewable: bool,
pub modeling_result_requests_regather: bool,
pub modeling_result_accepted: bool,
pub modeling_result_reviewable: bool,
pub modeling_result_accepted_after_verification: bool,
@ -157,9 +165,13 @@ pub struct EpiphanyCoordinatorStatusInput {
pub recommendation: super::EpiphanyCrrcRecommendation,
pub roles: Vec<EpiphanyRoleBoardLane>,
pub reorient_action: EpiphanyReorientAction,
pub research_result_status: EpiphanyCoordinatorRoleResultStatus,
pub modeling_result_status: EpiphanyCoordinatorRoleResultStatus,
pub verification_result_status: EpiphanyCoordinatorRoleResultStatus,
pub reorient_result_status: super::EpiphanyCrrcResultStatus,
pub research_result_accepted: bool,
pub research_result_reviewable: bool,
pub modeling_result_requests_regather: bool,
pub modeling_result_accepted: bool,
pub modeling_result_reviewable: bool,
pub modeling_result_accepted_after_verification: bool,
@ -182,6 +194,9 @@ pub struct EpiphanyCoordinatorStatus {
#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub struct EpiphanyCoordinatorFindingSignals {
pub research_result_accepted: bool,
pub research_result_reviewable: bool,
pub modeling_result_requests_regather: bool,
pub modeling_result_accepted: bool,
pub modeling_result_reviewable: bool,
pub modeling_result_accepted_after_verification: bool,
@ -214,6 +229,7 @@ pub fn derive_coordinator_status(
should_prepare_compaction: input.pressure.should_prepare_compaction,
reorient_action: input.reorient_action,
crrc_action: input.recommendation.action,
research_result_status: input.research_result_status,
modeling_result_status: input.modeling_result_status,
verification_result_status: input.verification_result_status,
reorient_result_status: input.reorient_result_status,
@ -236,9 +252,13 @@ pub fn derive_coordinator_status(
},
roles: coordinator_roles,
signals: EpiphanyCoordinatorSignals {
research_result_status: input.research_result_status,
modeling_result_status: input.modeling_result_status,
verification_result_status: input.verification_result_status,
},
research_result_accepted: input.research_result_accepted,
research_result_reviewable: input.research_result_reviewable,
modeling_result_requests_regather: input.modeling_result_requests_regather,
modeling_result_accepted: input.modeling_result_accepted,
modeling_result_reviewable: input.modeling_result_reviewable,
modeling_result_accepted_after_verification: input
@ -263,10 +283,18 @@ pub fn derive_coordinator_status(
pub fn derive_coordinator_finding_signals(
state: Option<&EpiphanyThreadState>,
research_finding: Option<&EpiphanyRoleFindingInterpretation>,
modeling_finding: Option<&EpiphanyRoleFindingInterpretation>,
verification_finding: Option<&EpiphanyRoleFindingInterpretation>,
reorient_finding: Option<&EpiphanyReorientFindingInterpretation>,
) -> EpiphanyCoordinatorFindingSignals {
let research_result_accepted = research_finding.as_ref().is_some_and(|finding| {
state.is_some_and(|state| {
role_finding_already_accepted(state, EpiphanyCoordinatorRoleId::Research, finding)
})
});
let research_result_reviewable =
research_finding.is_some_and(research_finding_has_reviewable_state_patch);
let modeling_result_accepted = modeling_finding.as_ref().is_some_and(|finding| {
state.is_some_and(|state| {
role_finding_already_accepted(state, EpiphanyCoordinatorRoleId::Modeling, finding)
@ -274,6 +302,8 @@ pub fn derive_coordinator_finding_signals(
});
let modeling_result_reviewable =
modeling_finding.is_some_and(modeling_finding_has_reviewable_state_patch);
let modeling_result_requests_regather =
modeling_finding.is_some_and(modeling_finding_requests_regather);
let verification_result_accepted = verification_finding.as_ref().is_some_and(|finding| {
state.is_some_and(|state| {
role_finding_already_accepted(state, EpiphanyCoordinatorRoleId::Verification, finding)
@ -315,6 +345,9 @@ pub fn derive_coordinator_finding_signals(
});
EpiphanyCoordinatorFindingSignals {
research_result_accepted,
research_result_reviewable,
modeling_result_requests_regather,
modeling_result_accepted,
modeling_result_reviewable,
modeling_result_accepted_after_verification,
@ -354,6 +387,22 @@ fn modeling_finding_has_reviewable_state_patch(
.is_some_and(|patch| super::modeling_role_state_patch_policy_errors(patch).is_empty())
}
fn research_finding_has_reviewable_state_patch(
finding: &EpiphanyRoleFindingInterpretation,
) -> bool {
finding
.state_patch
.as_ref()
.is_some_and(|patch| super::research_role_state_patch_policy_errors(patch).is_empty())
}
fn modeling_finding_requests_regather(finding: &EpiphanyRoleFindingInterpretation) -> bool {
finding
.verdict
.as_deref()
.is_some_and(|verdict| verdict.eq_ignore_ascii_case("regather-needed"))
}
fn role_finding_already_accepted(
state: &EpiphanyThreadState,
role_id: EpiphanyCoordinatorRoleId,
@ -520,6 +569,7 @@ fn coordinator_role_label(role_id: EpiphanyCoordinatorRoleId) -> &'static str {
match role_id {
EpiphanyCoordinatorRoleId::Implementation => "implementation",
EpiphanyCoordinatorRoleId::Imagination => "imagination",
EpiphanyCoordinatorRoleId::Research => "research",
EpiphanyCoordinatorRoleId::Modeling => "modeling",
EpiphanyCoordinatorRoleId::Verification => "verification",
EpiphanyCoordinatorRoleId::Reorientation => "reorientation",
@ -629,10 +679,70 @@ pub fn recommend_coordinator_action(
);
}
if input.signals.research_result_status == EpiphanyCoordinatorRoleResultStatus::Completed
&& !input.research_result_accepted
{
return build(
EpiphanyCoordinatorAction::ReviewResearchResult,
Some(EpiphanyCoordinatorRoleId::Research),
Some(EpiphanyCoordinatorSceneAction::RoleResult),
input.research_result_reviewable,
false,
"An Eyes/source-gathering finding is complete and must be reviewed before modeling or implementation can cite it.",
);
}
if input.signals.research_result_status == EpiphanyCoordinatorRoleResultStatus::Failed
&& !input.research_result_accepted
{
return build(
EpiphanyCoordinatorAction::ReviewResearchResult,
Some(EpiphanyCoordinatorRoleId::Research),
Some(EpiphanyCoordinatorSceneAction::RoleResult),
false,
false,
"The Eyes/source-gathering worker failed; inspect the failed result before routing another lane from stale evidence.",
);
}
if matches!(
input.signals.research_result_status,
EpiphanyCoordinatorRoleResultStatus::Pending | EpiphanyCoordinatorRoleResultStatus::Running
) {
return build(
EpiphanyCoordinatorAction::ReviewResearchResult,
Some(EpiphanyCoordinatorRoleId::Research),
Some(EpiphanyCoordinatorSceneAction::RoleResult),
false,
false,
"An Eyes/source-gathering specialist is already running; wait for its evidence packet before relaunching modeling.",
);
}
if input.signals.modeling_result_status == EpiphanyCoordinatorRoleResultStatus::Completed
&& !input.modeling_result_accepted
{
if !input.modeling_result_reviewable {
if input.modeling_result_requests_regather
&& !input.research_result_accepted
&& matches!(
input.signals.research_result_status,
EpiphanyCoordinatorRoleResultStatus::MissingBinding
| EpiphanyCoordinatorRoleResultStatus::BackendUnavailable
| EpiphanyCoordinatorRoleResultStatus::BackendMissing
| EpiphanyCoordinatorRoleResultStatus::Cancelled
| EpiphanyCoordinatorRoleResultStatus::Failed
)
{
return build(
EpiphanyCoordinatorAction::LaunchResearch,
Some(EpiphanyCoordinatorRoleId::Research),
Some(EpiphanyCoordinatorSceneAction::RoleLaunch),
false,
true,
"The modeling/checkpoint lane requested source regather and returned no acceptable modeling patch; launch Eyes to gather citable source evidence instead of relaunching the blind modeler.",
);
}
return build(
EpiphanyCoordinatorAction::ReviewModelingResult,
Some(EpiphanyCoordinatorRoleId::Modeling),
@ -720,13 +830,32 @@ pub fn recommend_coordinator_action(
&& role_status(&input.roles, EpiphanyCoordinatorRoleId::Implementation)
== Some(EpiphanyCoordinatorRoleStatus::Blocked)
{
if !input.research_result_accepted
&& matches!(
input.signals.research_result_status,
EpiphanyCoordinatorRoleResultStatus::MissingBinding
| EpiphanyCoordinatorRoleResultStatus::BackendUnavailable
| EpiphanyCoordinatorRoleResultStatus::BackendMissing
| EpiphanyCoordinatorRoleResultStatus::Cancelled
| EpiphanyCoordinatorRoleResultStatus::Failed
)
{
return build(
EpiphanyCoordinatorAction::LaunchResearch,
Some(EpiphanyCoordinatorRoleId::Research),
Some(EpiphanyCoordinatorSceneAction::RoleLaunch),
false,
true,
"CRRC says regather is required; launch Eyes to rebuild citable source evidence before another coding turn.",
);
}
return build(
EpiphanyCoordinatorAction::RegatherManually,
Some(EpiphanyCoordinatorRoleId::Reorientation),
input.recommendation.recommended_scene_action,
Some(EpiphanyCoordinatorRoleId::Research),
Some(EpiphanyCoordinatorSceneAction::RoleResult),
true,
false,
"CRRC says regather is required and the implementation lane is blocked; repair continuity before another coding turn.",
"CRRC says regather is required and the implementation lane is blocked; review or repair Eyes evidence before another coding turn.",
);
}
@ -855,12 +984,12 @@ pub fn recommend_coordinator_action(
if input.recommendation.action == EpiphanyCrrcAction::RegatherManually {
return build(
EpiphanyCoordinatorAction::RegatherManually,
Some(EpiphanyCoordinatorRoleId::Reorientation),
input.recommendation.recommended_scene_action,
true,
EpiphanyCoordinatorAction::LaunchResearch,
Some(EpiphanyCoordinatorRoleId::Research),
Some(EpiphanyCoordinatorSceneAction::RoleLaunch),
false,
"CRRC cannot safely continue automatically and no fixed specialist lane is currently able to advance the regather.",
true,
"CRRC requires regather; Eyes is the fixed specialist lane that can advance source gathering.",
);
}
@ -891,6 +1020,8 @@ pub fn coordinator_automation_action(
| EpiphanyCoordinatorAction::WaitForReorientWorker
| EpiphanyCoordinatorAction::ReviewReorientResult
| EpiphanyCoordinatorAction::RegatherManually
| EpiphanyCoordinatorAction::LaunchResearch
| EpiphanyCoordinatorAction::ReviewResearchResult
| EpiphanyCoordinatorAction::LaunchModeling
| EpiphanyCoordinatorAction::ReviewModelingResult
| EpiphanyCoordinatorAction::LaunchVerification
@ -935,6 +1066,10 @@ mod tests {
EpiphanyCoordinatorRoleId::Imagination,
EpiphanyCoordinatorRoleStatus::Ready,
),
role(
EpiphanyCoordinatorRoleId::Research,
EpiphanyCoordinatorRoleStatus::Ready,
),
role(
EpiphanyCoordinatorRoleId::Modeling,
EpiphanyCoordinatorRoleStatus::Ready,
@ -972,9 +1107,13 @@ mod tests {
recommendation: recommendation(EpiphanyCrrcAction::Continue),
roles: base_roles(),
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
},
research_result_accepted: false,
research_result_reviewable: false,
modeling_result_requests_regather: false,
modeling_result_accepted: false,
modeling_result_reviewable: false,
modeling_result_accepted_after_verification: false,
@ -1030,6 +1169,7 @@ mod tests {
should_prepare_compaction: true,
roles: Vec::new(),
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::BackendMissing,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::BackendMissing,
},
@ -1086,6 +1226,7 @@ mod tests {
let launch_modeling = recommend_coordinator_action(EpiphanyCoordinatorInput {
recommendation: recommendation(EpiphanyCrrcAction::RegatherManually),
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
},
@ -1100,6 +1241,7 @@ mod tests {
let review_modeling = recommend_coordinator_action(EpiphanyCoordinatorInput {
recommendation: recommendation(EpiphanyCrrcAction::RegatherManually),
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
},
@ -1119,6 +1261,7 @@ mod tests {
EpiphanyCoordinatorRoleStatus::Blocked,
)],
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
},
@ -1131,10 +1274,31 @@ mod tests {
});
assert_eq!(
blocked_regather.action,
EpiphanyCoordinatorAction::RegatherManually
EpiphanyCoordinatorAction::LaunchResearch
);
}
#[test]
fn routes_regather_needed_modeling_to_eyes() {
let decision = recommend_coordinator_action(EpiphanyCoordinatorInput {
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
},
modeling_result_requests_regather: true,
modeling_result_reviewable: false,
..input()
});
assert_eq!(decision.action, EpiphanyCoordinatorAction::LaunchResearch);
assert_eq!(
decision.target_role,
Some(EpiphanyCoordinatorRoleId::Research)
);
assert!(decision.reason.contains("source regather"));
}
#[test]
fn runs_modeling_then_verification_then_continue() {
let launch_modeling = recommend_coordinator_action(input());
@ -1149,6 +1313,7 @@ mod tests {
let review_modeling = recommend_coordinator_action(EpiphanyCoordinatorInput {
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
},
@ -1163,6 +1328,7 @@ mod tests {
let wait_for_modeling = recommend_coordinator_action(EpiphanyCoordinatorInput {
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::Running,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
},
@ -1176,6 +1342,7 @@ mod tests {
let review_failed_modeling = recommend_coordinator_action(EpiphanyCoordinatorInput {
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::Failed,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
},
@ -1189,6 +1356,7 @@ mod tests {
let review_unreviewable_modeling = recommend_coordinator_action(EpiphanyCoordinatorInput {
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
},
@ -1202,6 +1370,7 @@ mod tests {
let launch_verification = recommend_coordinator_action(EpiphanyCoordinatorInput {
signals: EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
},
@ -1215,6 +1384,7 @@ mod tests {
);
let verification_done = EpiphanyCoordinatorSignals {
research_result_status: EpiphanyCoordinatorRoleResultStatus::MissingBinding,
modeling_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
verification_result_status: EpiphanyCoordinatorRoleResultStatus::Completed,
};

View file

@ -115,6 +115,7 @@ pub use role_result::imagination_role_state_patch_policy_errors;
pub use role_result::interpret_runtime_reorient_worker_result;
pub use role_result::interpret_runtime_role_worker_result;
pub use role_result::modeling_role_state_patch_policy_errors;
pub use role_result::research_role_state_patch_policy_errors;
pub use role_result::review_role_self_patch_document;
pub use role_result::role_self_memory_target;
pub use scene::EpiphanyScene;

View file

@ -61,10 +61,12 @@ pub struct EpiphanyRoleBoardInput {
pub reorient_result_status: EpiphanyCrrcResultStatus,
pub reorient_job: Option<EpiphanyRoleBoardJob>,
pub imagination_binding_id: String,
pub research_binding_id: String,
pub modeling_binding_id: String,
pub verification_binding_id: String,
pub reorient_owner_role: String,
pub imagination_owner_role: String,
pub research_owner_role: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@ -129,6 +131,34 @@ pub fn derive_role_board(input: EpiphanyRoleBoardInput) -> Vec<EpiphanyRoleBoard
Some(EpiphanyCoordinatorSceneAction::Update)
};
let research_jobs = input
.jobs
.iter()
.filter(|job| job.id == input.research_binding_id)
.cloned()
.collect::<Vec<_>>();
let research_bound_job = research_jobs
.iter()
.find(|job| job.id == input.research_binding_id);
let research_has_bound_job = research_bound_job.is_some();
let research_status = research_bound_job
.map(|job| role_board_job_status_to_role_status(job.status))
.unwrap_or(if state_present {
EpiphanyCoordinatorRoleStatus::Ready
} else {
EpiphanyCoordinatorRoleStatus::Blocked
});
let research_note = research_bound_job.and_then(job_note).unwrap_or_else(|| {
"Gather citable source evidence before Proprioception models from it.".to_string()
});
let research_recommended_action = if research_has_bound_job {
Some(EpiphanyCoordinatorSceneAction::RoleResult)
} else if state_present {
Some(EpiphanyCoordinatorSceneAction::RoleLaunch)
} else {
Some(EpiphanyCoordinatorSceneAction::Update)
};
let verification_jobs = input
.jobs
.iter()
@ -205,6 +235,21 @@ pub fn derive_role_board(input: EpiphanyRoleBoardInput) -> Vec<EpiphanyRoleBoard
],
recommended_action: imagination_recommended_action,
},
EpiphanyRoleBoardLane {
id: EpiphanyCoordinatorRoleId::Research,
title: "Eyes / Research".to_string(),
owner_role: input.research_owner_role,
status: research_status,
note: research_note,
jobs: research_jobs,
authority_scopes: vec![
"thread/epiphany/roleLaunch".to_string(),
"thread/epiphany/roleResult".to_string(),
"thread/epiphany/roleAccept".to_string(),
"thread/epiphany/update".to_string(),
],
recommended_action: research_recommended_action,
},
EpiphanyRoleBoardLane {
id: EpiphanyCoordinatorRoleId::Modeling,
title: "Modeling / Checkpoint".to_string(),
@ -434,10 +479,12 @@ mod tests {
reorient_result_status: EpiphanyCrrcResultStatus::MissingBinding,
reorient_job: None,
imagination_binding_id: "imagination-synthesis-worker".to_string(),
research_binding_id: "research-source-gather-worker".to_string(),
modeling_binding_id: "modeling-checkpoint-worker".to_string(),
verification_binding_id: "verification-review-worker".to_string(),
reorient_owner_role: "epiphany-reorienter".to_string(),
imagination_owner_role: "epiphany-imagination".to_string(),
research_owner_role: "epiphany-eyes".to_string(),
}
}
@ -454,13 +501,14 @@ mod tests {
..input()
});
assert_eq!(roles.len(), 5);
assert_eq!(roles.len(), 6);
assert_eq!(roles[0].id, EpiphanyCoordinatorRoleId::Implementation);
assert_eq!(roles[0].status, EpiphanyCoordinatorRoleStatus::Ready);
assert_eq!(roles[1].status, EpiphanyCoordinatorRoleStatus::Needed);
assert_eq!(roles[2].status, EpiphanyCoordinatorRoleStatus::Ready);
assert_eq!(roles[3].status, EpiphanyCoordinatorRoleStatus::Needed);
assert_eq!(roles[4].status, EpiphanyCoordinatorRoleStatus::Ready);
assert_eq!(roles[3].status, EpiphanyCoordinatorRoleStatus::Ready);
assert_eq!(roles[4].status, EpiphanyCoordinatorRoleStatus::Needed);
assert_eq!(roles[5].status, EpiphanyCoordinatorRoleStatus::Ready);
}
#[test]

View file

@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
pub enum EpiphanyRoleResultRoleId {
Implementation,
Imagination,
Research,
Modeling,
Verification,
Reorientation,
@ -156,6 +157,14 @@ fn interpret_role_finding(
state_patch_parse_error,
),
),
EpiphanyRoleResultRoleId::Research => merge_item_error(
item_error,
research_role_state_patch_error(
raw_result.get("statePatch").is_some(),
state_patch.as_ref(),
state_patch_parse_error,
),
),
EpiphanyRoleResultRoleId::Implementation
| EpiphanyRoleResultRoleId::Verification
| EpiphanyRoleResultRoleId::Reorientation => item_error,
@ -266,6 +275,14 @@ pub fn interpret_runtime_role_worker_result(
None,
),
),
EpiphanyRoleResultRoleId::Research => merge_item_error(
item_error,
research_role_state_patch_error(
result.state_patch_msgpack.is_some(),
state_patch.as_ref(),
None,
),
),
EpiphanyRoleResultRoleId::Implementation
| EpiphanyRoleResultRoleId::Verification
| EpiphanyRoleResultRoleId::Reorientation => item_error,
@ -428,14 +445,15 @@ pub fn role_self_memory_target(
"epiphany.proprioception",
"state/agents/proprioception.agent-state.json",
)),
EpiphanyRoleResultRoleId::Verification => Some((
"epiphany.soul",
"state/agents/soul.agent-state.json",
)),
EpiphanyRoleResultRoleId::Implementation => Some((
"epiphany.hands",
"state/agents/hands.agent-state.json",
)),
EpiphanyRoleResultRoleId::Research => {
Some(("epiphany.eyes", "state/agents/eyes.agent-state.json"))
}
EpiphanyRoleResultRoleId::Verification => {
Some(("epiphany.soul", "state/agents/soul.agent-state.json"))
}
EpiphanyRoleResultRoleId::Implementation => {
Some(("epiphany.hands", "state/agents/hands.agent-state.json"))
}
EpiphanyRoleResultRoleId::Reorientation => None,
}
}
@ -443,6 +461,7 @@ pub fn role_self_memory_target(
pub fn role_accepted_kind(role_id: EpiphanyRoleResultRoleId) -> Result<&'static str, String> {
match role_id {
EpiphanyRoleResultRoleId::Imagination => Ok("planning_synthesis"),
EpiphanyRoleResultRoleId::Research => Ok("research_result"),
EpiphanyRoleResultRoleId::Modeling => Ok("modeling_result"),
EpiphanyRoleResultRoleId::Verification => Ok("verification_result"),
EpiphanyRoleResultRoleId::Implementation | EpiphanyRoleResultRoleId::Reorientation => Err(
@ -454,6 +473,7 @@ pub fn role_accepted_kind(role_id: EpiphanyRoleResultRoleId) -> Result<&'static
pub fn role_label(role_id: EpiphanyRoleResultRoleId) -> Result<&'static str, String> {
match role_id {
EpiphanyRoleResultRoleId::Imagination => Ok("imagination"),
EpiphanyRoleResultRoleId::Research => Ok("research"),
EpiphanyRoleResultRoleId::Modeling => Ok("modeling"),
EpiphanyRoleResultRoleId::Verification => Ok("verification"),
EpiphanyRoleResultRoleId::Implementation | EpiphanyRoleResultRoleId::Reorientation => Err(
@ -680,6 +700,74 @@ pub fn imagination_role_state_patch_policy_errors(
errors
}
pub fn research_role_state_patch_policy_errors(
patch: &EpiphanyRoleStatePatchDocument,
) -> Vec<String> {
let mut errors = Vec::new();
if patch.objective.is_some() {
errors
.push("objective changes are not allowed through research role acceptance".to_string());
}
if patch.active_subgoal_id.is_some() || patch.subgoals.is_some() {
errors.push("subgoal changes are not allowed through research role acceptance".to_string());
}
if patch.invariants.is_some() {
errors
.push("invariant changes are not allowed through research role acceptance".to_string());
}
if patch.graphs.is_some() || patch.graph_frontier.is_some() || patch.graph_checkpoint.is_some()
{
errors.push(
"graph modeling changes are not allowed through research role acceptance".to_string(),
);
}
if patch.job_bindings.is_some() {
errors.push(
"job binding changes are not allowed through research role acceptance".to_string(),
);
}
if !patch.acceptance_receipts.is_empty() {
errors.push(
"acceptance receipt changes are owned by roleAccept, not worker statePatch".to_string(),
);
}
if !patch.runtime_links.is_empty() {
errors.push(
"runtime link changes are owned by launch/read-back surfaces, not worker statePatch"
.to_string(),
);
}
if patch.planning.is_some() {
errors
.push("planning changes are not allowed through research role acceptance".to_string());
}
if patch.churn.is_some() || patch.mode.is_some() {
errors.push(
"churn or mode changes are not allowed through research role acceptance".to_string(),
);
}
if patch.evidence.is_empty() {
errors.push("research statePatch must include at least one evidence record".to_string());
}
if patch.observations.is_empty() {
errors.push("research statePatch must include at least one observation".to_string());
}
for observation in &patch.observations {
if observation.evidence_ids.is_empty() {
errors.push(format!(
"research observation {:?} must cite at least one evidence id",
observation.id
));
}
}
if patch.scratch.is_none() && patch.investigation_checkpoint.is_none() {
errors.push(
"research statePatch must include scratch or an investigationCheckpoint to bank the source-gathering seam".to_string(),
);
}
errors
}
fn modeling_role_state_patch_error(
state_patch_present: bool,
state_patch: Option<&EpiphanyRoleStatePatchDocument>,
@ -707,6 +795,33 @@ fn modeling_role_state_patch_error(
}
}
fn research_role_state_patch_error(
state_patch_present: bool,
state_patch: Option<&EpiphanyRoleStatePatchDocument>,
parse_error: Option<String>,
) -> Option<String> {
if !state_patch_present {
return Some("research result is not reviewable: missing required statePatch".to_string());
};
if let Some(error) = parse_error {
return Some(format!(
"research result is not reviewable: invalid statePatch ({error})"
));
}
let Some(state_patch) = state_patch else {
return Some("research result is not reviewable: invalid statePatch".to_string());
};
let errors = research_role_state_patch_policy_errors(state_patch);
if errors.is_empty() {
None
} else {
Some(format!(
"research result is not reviewable: {}",
errors.join("; ")
))
}
}
fn imagination_role_state_patch_error(
state_patch_present: bool,
state_patch: Option<&EpiphanyRoleStatePatchDocument>,

View file

@ -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 remaining concrete blocker is architectural: the MVP coordinator has no executable Eyes/source-gather lane. A modeler can return `regather-needed`, but it cannot inspect the missing stream-storage source itself; choose between adding a real research/Eyes specialist lane or routing this regather to the main implementation agent with explicit statePatch banking.
- 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. The next concrete rebuild layer is executable receipt enforcement beyond Mind-review launch admission: Substrate Gate, Eyes, Hands, Soul, and Continuity receipts are named and carried on launch contracts, but runtime/promotion paths still need to prove the required receipts before state/action claims are accepted.
- 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`.

Binary file not shown.

View file

@ -75,7 +75,7 @@ active_subgoals:
- The active priority is Codex starvation and CultNet liberation. Use `notes/codex-starvation-and-cultnet-liberation-plan.md` as the directive and `notes/codex-auth-spine-inventory.md` as the source-grounded keeper list for the retained OpenAI subscription auth/model transport bridge. Classify all Epiphany-relevant JSON contamination, define the native CultNet runtime boundary, keep worker launch/result/selfPatch cargo as typed documents, evacuate Epiphany operator/state/process authority from Codex JSON-RPC, wrap MCP's unavoidable JSON protocol edge in typed Epiphany intent/result/receipt documents, and keep cutting until Epiphany can run its own state and processes without `codex_message_processor.rs` except for bridge compatibility.
- Use `notes/epiphany-anatomy.md` as the canonical anatomy map. Embodied sub-agents are Self, Face, Imagination, Eyes, Proprioception, Hands, and Soul. Body is substrate, Mind is persistent state/state admission, Continuity is recovery/compaction/sleep protocol machinery, and Substrate Gate is substrate access protocol.
- Organ state now has a hard profile split: resident Epiphany sub-agents use lean `work_organ` state, public/person-shaped agents use portable `persona` state, and heartbeat/swarm machinery owns scheduling/coordination physiology. Face is the Epiphany organ; Persona is the shared GameCult contract for Epiphany Face, VoidBot repo Faces, and Ghostlight characters. Persona documents carry provenance, required public presentation metadata, `date-time` timestamps, typed `candidateActions`, strict anchored thoughts with non-authoritative extensions, custom enum companion labels, and typed affect subrecords for bonds/status reads/doctrine stances. Work organs must not inherit Persona affect/social-bond/status-read machinery just because the old Ghostlight-derived shape had room for it.
- The next Codex-starvation slice is the Eyes/source-gathering fork exposed by the Mom-ready MVP proof. The quarantined Codex MCP spine may execute typed tool intents and emit typed receipts; the model runtime can build and run provider-neutral follow-up turns from those receipts; coordinator run mode passes the quarantined tool adapter into worker runtime with auto-tools enabled by default; worker runtime now enforces max-runtime with one timeout close primitive for both tokio timeout and watchdog paths; inner `openai-worker-*` jobs are opened before async auth/stream waits and sealed with their outer worker on timeout; native status/roles/jobs/coordinator surfaces project failed and completed runtime-linked jobs as terminal without Codex prompt or scheduler authority; direct tiny model-turn transport succeeds; worker requests record request metrics, transport readiness, and sampled raw Responses frame kinds; worker prompts no longer prepend the full shared persistent-memory rite; stream deltas compact before durable storage; live MVP modeling workers complete instead of timing out; stale completed runtime links no longer block replacement launches; jobLaunch validates before opening runtime jobs; and completed-but-unreviewable modeling findings now stop for review instead of relaunching the same blind lane. The remaining blocker is structural: the MVP coordinator has no executable Eyes/source-gather lane, so a modeler that returns `regather-needed` cannot inspect the missing source itself.
- The Eyes/source-gathering fork exposed by the Mom-ready MVP proof is now landed as a fixed Research lane owned by Eyes. The quarantined Codex MCP spine may execute typed tool intents and emit typed receipts; the model runtime can build and run provider-neutral follow-up turns from those receipts; coordinator run mode passes the quarantined tool adapter into worker runtime with auto-tools enabled by default; worker runtime now enforces max-runtime with one timeout close primitive for both tokio timeout and watchdog paths; inner `openai-worker-*` jobs are opened before async auth/stream waits and sealed with their outer worker on timeout; native status/roles/jobs/coordinator surfaces project failed and completed runtime-linked jobs as terminal without Codex prompt or scheduler authority; direct tiny model-turn transport succeeds; worker requests record request metrics, transport readiness, and sampled raw Responses frame kinds; worker prompts no longer prepend the full shared persistent-memory rite; stream deltas compact before durable storage; live MVP modeling workers complete instead of timing out; stale completed runtime links no longer block replacement launches; jobLaunch validates before opening runtime jobs; completed-but-unreviewable modeling findings now stop for review instead of relaunching the same blind lane; and completed unreviewable modeling findings with verdict `regather-needed` route to `LaunchResearch` instead of relaunching Proprioception. Research findings are accepted only when their statePatch is Eyes-shaped: observations, evidence, scratch, and optional investigationCheckpoint, with no graph/planning/objective authority.
- The May 2026 teardown/rebuild migration is archived under `notes/archive/epiphany-ideal-architecture-rebuild-plan.md` unless a concrete regression reopens it. Preserve the new foundation: Epiphany view/coordinator policy lives in `epiphany-core`, runtime-spine owns job/result lifecycle identity through `runtime_links`, duplicate acceptance is receipt-keyed, public findings stay typed/sealed, view expansion requires a core contract, and app-server remains routing/adaptation rather than a second policy throne.
- Treat Phase 5 update/distill/propose/promote/read/notification as complete enough unless a concrete regression appears.
- Preserve read-only boundaries for retrieve, distill, propose, freshness, context, graphQuery, roleResult, reorientResult, and the canonical view lenses for scene, jobs, roles, planning, pressure, reorient, crrc, and coordinator.
@ -579,4 +579,13 @@ current_status:
pressure rendering delegates back to core. Vendored app-server no longer
carries the bundled prompt regression test; that guard lives beside the
core prompt owner.
next_action: Decide and implement the Eyes/source-gathering fork before another MVP automation pass: either add a real research/Eyes specialist lane that can gather the missing stream-storage source and return a reviewable statePatch, or route regather-needed modeling findings to the main implementation agent for supervised source inspection and manual statePatch banking. Do not relaunch modeling as a substitute for source access.
The fixed Research/Eyes lane is now part of the typed MVP spine:
`EpiphanyRoleResultRoleId::Research`, Research launch binding/owner/schema,
role-board lane, coordinator `LaunchResearch` / `ReviewResearchResult`
actions, status/coordinator CLIs, Codex bridge projection, and vendored
app-server protocol schemas all know the lane. The Research statePatch law
permits only Eyes evidence/observation/scratch/investigationCheckpoint
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 at the executable receipt-enforcement layer: required organ receipts are now carried on launch packets and Mind-review launch admission blocks naked findings, but Substrate Gate, Eyes, Hands, Soul, and Continuity receipts still need runtime-side proof and promotion gates before state/action claims can call themselves true.

View file

@ -6508,6 +6508,7 @@
"enum": [
"implementation",
"imagination",
"research",
"modeling",
"verification",
"reorientation"
@ -7226,4 +7227,4 @@
]
}
}
}
}

View file

@ -6727,6 +6727,7 @@
"enum": [
"implementation",
"imagination",
"research",
"modeling",
"verification",
"reorientation"
@ -13590,6 +13591,8 @@
"waitForReorientWorker",
"reviewReorientResult",
"regatherManually",
"launchResearch",
"reviewResearchResult",
"launchModeling",
"reviewModelingResult",
"launchVerification",
@ -13603,6 +13606,7 @@
"crrcAction",
"modelingResultStatus",
"pressureLevel",
"researchResultStatus",
"reorientAction",
"reorientResultStatus",
"shouldPrepareCompaction",
@ -13618,6 +13622,9 @@
"pressureLevel": {
"$ref": "#/definitions/v2/ThreadEpiphanyPressureLevel"
},
"researchResultStatus": {
"$ref": "#/definitions/v2/ThreadEpiphanyRoleResultStatus"
},
"reorientAction": {
"$ref": "#/definitions/v2/ThreadEpiphanyReorientAction"
},
@ -19612,4 +19619,4 @@
]
}
}
}
}

View file

@ -2153,6 +2153,7 @@
"enum": [
"implementation",
"imagination",
"research",
"modeling",
"verification",
"reorientation"
@ -9016,6 +9017,8 @@
"waitForReorientWorker",
"reviewReorientResult",
"regatherManually",
"launchResearch",
"reviewResearchResult",
"launchModeling",
"reviewModelingResult",
"launchVerification",
@ -9029,6 +9032,7 @@
"crrcAction",
"modelingResultStatus",
"pressureLevel",
"researchResultStatus",
"reorientAction",
"reorientResultStatus",
"shouldPrepareCompaction",
@ -9044,6 +9048,9 @@
"pressureLevel": {
"$ref": "#/definitions/ThreadEpiphanyPressureLevel"
},
"researchResultStatus": {
"$ref": "#/definitions/ThreadEpiphanyRoleResultStatus"
},
"reorientAction": {
"$ref": "#/definitions/ThreadEpiphanyReorientAction"
},
@ -17498,4 +17505,4 @@
]
}
}
}
}

View file

@ -2,4 +2,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ThreadEpiphanyCoordinatorAction = "prepareCheckpoint" | "compactRehydrateReorient" | "launchReorientWorker" | "waitForReorientWorker" | "reviewReorientResult" | "regatherManually" | "launchModeling" | "reviewModelingResult" | "launchVerification" | "reviewVerificationResult" | "continueImplementation";
export type ThreadEpiphanyCoordinatorAction = "prepareCheckpoint" | "compactRehydrateReorient" | "launchReorientWorker" | "waitForReorientWorker" | "reviewReorientResult" | "regatherManually" | "launchResearch" | "reviewResearchResult" | "launchModeling" | "reviewModelingResult" | "launchVerification" | "reviewVerificationResult" | "continueImplementation";

View file

@ -7,4 +7,4 @@ import type { ThreadEpiphanyReorientAction } from "./ThreadEpiphanyReorientActio
import type { ThreadEpiphanyReorientResultStatus } from "./ThreadEpiphanyReorientResultStatus";
import type { ThreadEpiphanyRoleResultStatus } from "./ThreadEpiphanyRoleResultStatus";
export type ThreadEpiphanyCoordinatorSignals = { pressureLevel: ThreadEpiphanyPressureLevel, shouldPrepareCompaction: boolean, reorientAction: ThreadEpiphanyReorientAction, crrcAction: ThreadEpiphanyCrrcAction, modelingResultStatus: ThreadEpiphanyRoleResultStatus, verificationResultStatus: ThreadEpiphanyRoleResultStatus, reorientResultStatus: ThreadEpiphanyReorientResultStatus, };
export type ThreadEpiphanyCoordinatorSignals = { pressureLevel: ThreadEpiphanyPressureLevel, shouldPrepareCompaction: boolean, reorientAction: ThreadEpiphanyReorientAction, crrcAction: ThreadEpiphanyCrrcAction, researchResultStatus: ThreadEpiphanyRoleResultStatus, modelingResultStatus: ThreadEpiphanyRoleResultStatus, verificationResultStatus: ThreadEpiphanyRoleResultStatus, reorientResultStatus: ThreadEpiphanyReorientResultStatus, };

View file

@ -2,4 +2,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ThreadEpiphanyRoleId = "implementation" | "imagination" | "modeling" | "verification" | "reorientation";
export type ThreadEpiphanyRoleId = "implementation" | "imagination" | "research" | "modeling" | "verification" | "reorientation";

View file

@ -3865,6 +3865,7 @@ pub enum ThreadEpiphanyRolesSource {
pub enum ThreadEpiphanyRoleId {
Implementation,
Imagination,
Research,
Modeling,
Verification,
Reorientation,
@ -4016,6 +4017,8 @@ pub enum ThreadEpiphanyCoordinatorAction {
WaitForReorientWorker,
ReviewReorientResult,
RegatherManually,
LaunchResearch,
ReviewResearchResult,
LaunchModeling,
ReviewModelingResult,
LaunchVerification,
@ -4031,6 +4034,7 @@ pub struct ThreadEpiphanyCoordinatorSignals {
pub should_prepare_compaction: bool,
pub reorient_action: ThreadEpiphanyReorientAction,
pub crrc_action: ThreadEpiphanyCrrcAction,
pub research_result_status: ThreadEpiphanyRoleResultStatus,
pub modeling_result_status: ThreadEpiphanyRoleResultStatus,
pub verification_result_status: ThreadEpiphanyRoleResultStatus,
pub reorient_result_status: ThreadEpiphanyReorientResultStatus,