From 5a3532b996af4aecb1ed00de3747dd1ac7a1e053 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 8 Aug 2026 14:56:29 +0100 Subject: [PATCH] Bind verdict Modeling launch authority --- epiphany-core/src/agent_launch.rs | 119 +++++++++++++++++- .../src/bin/epiphany-mvp-coordinator.rs | 4 + epiphany-core/src/coordinator_launch.rs | 4 + .../src/coordinator_launch_context.rs | 36 +++++- epiphany-core/src/lib.rs | 1 + epiphany-core/src/runtime_spine.rs | 78 ++++++++++++ epiphany-core/src/substrate_gate.rs | 1 + epiphany-core/src/surfaces/worker_launch.rs | 1 + epiphany-openai-runtime/src/lib.rs | 62 ++++++++- notes/fresh-workspace-handoff.md | 19 +-- state/map.yaml | 6 +- 11 files changed, 311 insertions(+), 20 deletions(-) diff --git a/epiphany-core/src/agent_launch.rs b/epiphany-core/src/agent_launch.rs index 84c22460..515da750 100644 --- a/epiphany-core/src/agent_launch.rs +++ b/epiphany-core/src/agent_launch.rs @@ -726,19 +726,35 @@ pub fn epiphany_role_launch_output_schema(role_id: EpiphanyRoleResultRoleId) -> schema } -pub fn epiphany_frontier_verdict_modeling_output_schema(request_id: &str) -> serde_json::Value { +pub fn epiphany_frontier_verdict_modeling_output_schema( + authority: &crate::RepoFrontierVerdictModelingLaunchAuthority, +) -> serde_json::Value { + let request = &authority.request; + let item = &authority.frontier_item; + let disposition = match request.allowed_disposition { + crate::RepoFrontierVerdictDisposition::Resolved => "resolved", + crate::RepoFrontierVerdictDisposition::Blocked => "blocked", + }; + let adopted_plan = serde_json::to_value(&item.adopted_plan) + .expect("frontier adopted plan must serialize for its provider schema"); + let created_at = serde_json::to_value(&item.created_at) + .expect("frontier creation time must serialize for its provider schema"); + let retired_at = serde_json::to_value(&item.retired_at) + .expect("frontier retirement time must serialize for its provider schema"); + let superseded_by = serde_json::to_value(&item.superseded_by) + .expect("frontier supersession must serialize for its provider schema"); let mut schema = epiphany_role_launch_output_schema(EpiphanyRoleResultRoleId::Modeling); schema["properties"]["repoFrontierModelingRequestId"] = serde_json::json!({ "type": "string", - "const": request_id + "const": request.request_id }); schema["properties"]["repoModelPatch"]["properties"]["purpose"] = serde_json::json!({ "type": "object", "required": ["kind", "route_id", "soul_verdict_receipt_id"], "properties": { "kind": {"const": "incorporate_frontier_verdict"}, - "route_id": {"type": "string", "minLength": 1}, - "soul_verdict_receipt_id": {"type": "string", "minLength": 1} + "route_id": {"const": request.route_id}, + "soul_verdict_receipt_id": {"const": request.soul_verdict_receipt_id} }, "additionalProperties": false }); @@ -751,7 +767,41 @@ pub fn epiphany_frontier_verdict_modeling_output_schema(request_id: &str) -> ser "required": ["operation", "item"], "properties": { "operation": {"const": "revise_frontier"}, - "item": repo_frontier_item_output_schema() + "item": { + "type": "object", + "required": [ + "id", "migration_body", "question", "gap", "target_claim_ids", + "source_scope", "recommended_next_organ", "adopted_plan", + "dependency_item_ids", "status", "evidence_refs", "created_at", + "updated_at", "retired_at", "superseded_by" + ], + "properties": { + "id": {"const": item.id}, + "migration_body": {"const": item.migration_body}, + "question": {"const": item.question}, + "gap": {"type": "string", "minLength": 1}, + "target_claim_ids": {"const": item.target_claim_ids}, + "source_scope": {"const": item.source_scope}, + "recommended_next_organ": {"const": item.recommended_next_organ}, + "adopted_plan": {"const": adopted_plan}, + "dependency_item_ids": {"const": item.dependency_item_ids}, + "status": {"const": disposition}, + "evidence_refs": { + "type": "array", + "minItems": 2, + "items": {"type": "string", "minLength": 1}, + "allOf": [ + {"contains": {"const": request.verification_request_id}}, + {"contains": {"const": request.soul_verdict_receipt_id}} + ] + }, + "created_at": {"const": created_at}, + "updated_at": {"type": "string", "minLength": 1}, + "retired_at": {"const": retired_at}, + "superseded_by": {"const": superseded_by} + }, + "additionalProperties": false + } }, "additionalProperties": false } @@ -1158,6 +1208,7 @@ pub fn build_epiphany_frontier_plan_mind_launch_request( imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, }) } @@ -1258,6 +1309,7 @@ pub fn build_epiphany_role_launch_request_with_dynamic_context( imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, }) } @@ -1422,6 +1474,7 @@ pub fn build_epiphany_job_launch_request( imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, } } @@ -1719,7 +1772,46 @@ mod tests { #[test] fn verdict_bound_modeling_schema_exposes_only_exact_frontier_revision_authority() { - let schema = epiphany_frontier_verdict_modeling_output_schema("modeling-request-exact"); + let authority = crate::RepoFrontierVerdictModelingLaunchAuthority { + request: crate::RepoFrontierModelingRequest { + schema_version: crate::REPO_FRONTIER_MODELING_REQUEST_SCHEMA_VERSION.to_string(), + request_id: "modeling-request-exact".into(), + model_revision: 7, + model_hash: "model-hash".into(), + route_id: "route-exact".into(), + frontier_item_id: "frontier-exact".into(), + frontier_item_hash: "frontier-hash".into(), + verification_request_id: "verification-exact".into(), + soul_verdict_receipt_id: "soul-exact".into(), + verification_result_id: "verification-result".into(), + verification_job_id: "verification-job".into(), + verification_acceptance_receipt_id: "verification-acceptance".into(), + allowed_disposition: crate::RepoFrontierVerdictDisposition::Resolved, + requested_at: "2026-08-08T00:00:00Z".into(), + contract: crate::REPO_FRONTIER_MODELING_REQUEST_CONTRACT.into(), + }, + frontier_item: crate::RepoFrontierItem { + id: "frontier-exact".into(), + migration_body: "runtime".into(), + question: "Did the consequence hold?".into(), + gap: "Awaiting verdict incorporation.".into(), + target_claim_ids: vec!["claim-exact".into()], + source_scope: vec!["epiphany-core".into()], + recommended_next_organ: "Hands".into(), + adopted_plan: Some(crate::RepoFrontierAdoptedPlan { + command: "cargo test".into(), + ..Default::default() + }), + dependency_item_ids: Vec::new(), + status: crate::RepoFrontierStatus::Active, + evidence_refs: vec!["prior-evidence".into()], + created_at: Some("2026-08-07T00:00:00Z".into()), + updated_at: Some("2026-08-07T00:00:00Z".into()), + retired_at: None, + superseded_by: None, + }, + }; + let schema = epiphany_frontier_verdict_modeling_output_schema(&authority); assert_eq!( schema["properties"]["repoFrontierModelingRequestId"]["const"], "modeling-request-exact" @@ -1743,6 +1835,21 @@ mod tests { "revise_frontier" ); assert_eq!(schema["properties"]["evidenceIds"]["minItems"], 1); + let item = &schema["properties"]["repoModelPatch"]["properties"]["operations"]["items"]["properties"] + ["item"]; + assert_eq!(item["properties"]["id"]["const"], "frontier-exact"); + assert_eq!(item["properties"]["status"]["const"], "resolved"); + assert_eq!( + item["properties"]["adopted_plan"]["const"]["command"], + "cargo test" + ); + assert!( + item["required"] + .as_array() + .unwrap() + .iter() + .any(|field| field == "adopted_plan") + ); } #[test] diff --git a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs index 47f6d6dd..1f037f42 100644 --- a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs +++ b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs @@ -1410,6 +1410,7 @@ fn launch_role( let state_loaded_ms = started.elapsed().as_millis(); let role = parse_role_id(role_id)?; let mut repo_frontier_modeling_request_id = None; + let mut repo_frontier_verdict_modeling_authority = None; let expected_revision = expected_revision.and_then(|value| u64::try_from(value).ok()); let focus = epiphany_core::role_launch_context_focus(&state, epiphany_core::epiphany_role_label(role)); @@ -1448,6 +1449,8 @@ fn launch_role( context = modeling_launch_context.context; repo_frontier_modeling_request_id = modeling_launch_context.repo_frontier_modeling_request_id; + repo_frontier_verdict_modeling_authority = + modeling_launch_context.repo_frontier_verdict_modeling_authority; } let role_context_augmented_ms = started.elapsed().as_millis(); let mut request = epiphany_core::build_epiphany_role_launch_request_with_dynamic_context( @@ -1461,6 +1464,7 @@ fn launch_role( .map_err(anyhow::Error::msg)?; request.proposal_modeling_request_id = proposal_modeling_request_id.map(str::to_string); request.repo_frontier_modeling_request_id = repo_frontier_modeling_request_id; + request.repo_frontier_verdict_modeling_authority = repo_frontier_verdict_modeling_authority; let request_built_ms = started.elapsed().as_millis(); let launched = service.launch_job( thread_id, diff --git a/epiphany-core/src/coordinator_launch.rs b/epiphany-core/src/coordinator_launch.rs index 7b077b78..cc6105cf 100644 --- a/epiphany-core/src/coordinator_launch.rs +++ b/epiphany-core/src/coordinator_launch.rs @@ -341,6 +341,9 @@ fn commit_coordinator_job_launch_in_cache( .admitted_model_direction_consideration_request_id .clone(), repo_frontier_modeling_request_id: request.repo_frontier_modeling_request_id.clone(), + repo_frontier_verdict_modeling_authority: request + .repo_frontier_verdict_modeling_authority + .clone(), created_at: created_at.clone(), }, )?; @@ -2734,6 +2737,7 @@ pub(crate) mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, created_at: "2026-07-15T09:00:17Z".into(), }, )?; diff --git a/epiphany-core/src/coordinator_launch_context.rs b/epiphany-core/src/coordinator_launch_context.rs index d144ce4b..901b9d92 100644 --- a/epiphany-core/src/coordinator_launch_context.rs +++ b/epiphany-core/src/coordinator_launch_context.rs @@ -551,6 +551,8 @@ fn debug_variant_snake_case(value: impl std::fmt::Debug) -> String { pub struct ModelingWorkLoopLaunchContext { pub context: String, pub repo_frontier_modeling_request_id: Option, + pub repo_frontier_verdict_modeling_authority: + Option, } impl std::ops::Deref for ModelingWorkLoopLaunchContext { @@ -577,6 +579,7 @@ pub fn append_modeling_work_loop_telemetry_context( return Ok(ModelingWorkLoopLaunchContext { context, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, }); } if accepted_research_is_newest_unmodeled_boundary(state) { @@ -586,12 +589,14 @@ pub fn append_modeling_work_loop_telemetry_context( return Ok(ModelingWorkLoopLaunchContext { context, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, }); } let Some(accepted_verification) = latest_unique_accepted_verification(state)? else { return Ok(ModelingWorkLoopLaunchContext { context, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, }); }; let modeling_request = @@ -665,7 +670,13 @@ pub fn append_modeling_work_loop_telemetry_context( else { return Ok(ModelingWorkLoopLaunchContext { context, - repo_frontier_modeling_request_id: Some(modeling_request.request_id), + repo_frontier_modeling_request_id: Some(modeling_request.request_id.clone()), + repo_frontier_verdict_modeling_authority: Some( + crate::RepoFrontierVerdictModelingLaunchAuthority { + request: modeling_request, + frontier_item: current_item.clone(), + }, + ), }); }; let soul_receipts = latest_accepted_soul_receipts(state); @@ -715,7 +726,13 @@ pub fn append_modeling_work_loop_telemetry_context( context.push_str(""); Ok(ModelingWorkLoopLaunchContext { context, - repo_frontier_modeling_request_id: Some(modeling_request.request_id), + repo_frontier_modeling_request_id: Some(modeling_request.request_id.clone()), + repo_frontier_verdict_modeling_authority: Some( + crate::RepoFrontierVerdictModelingLaunchAuthority { + request: modeling_request, + frontier_item: current_item.clone(), + }, + ), }) } @@ -1641,6 +1658,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, created_at: "2026-06-02T00:00:00Z".to_string(), }, )?; @@ -2033,6 +2051,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, created_at: "2026-06-12T00:00:06Z".to_string(), }, )?; @@ -2130,6 +2149,19 @@ mod tests { .repo_frontier_modeling_request_id .as_deref() .expect("Soul-bound Modeling context must return typed launch authority"); + let modeling_authority = modeling_context + .repo_frontier_verdict_modeling_authority + .as_ref() + .expect("Soul-bound Modeling context must carry the exact frontier item"); + assert_eq!(modeling_authority.request.request_id, modeling_request_id); + assert_eq!( + modeling_authority.request.frontier_item_id, + modeling_authority.frontier_item.id + ); + assert_eq!( + modeling_authority.frontier_item.question, + "Does verification see the exact receipts?" + ); assert!(modeling_context.contains(modeling_request_id)); assert!(modeling_context.contains("soulVerdictReceiptId: soul-verdict-context")); assert!(modeling_context.contains("verificationResultId: result-verification-context")); diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 88acc882..01a787f5 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -992,6 +992,7 @@ pub use runtime_spine::RUNTIME_SWARM_BINDING_KEY; pub use runtime_spine::RUNTIME_SWARM_BINDING_SCHEMA_VERSION; pub use runtime_spine::RUNTIME_WORKER_LAUNCH_REQUEST_SCHEMA_VERSION; pub use runtime_spine::RUNTIME_WORKER_LAUNCH_REQUEST_TYPE; +pub use runtime_spine::RepoFrontierVerdictModelingLaunchAuthority; pub use runtime_spine::RuntimeHandsReceiptChainSummary; pub use runtime_spine::RuntimeSpineEventOptions; pub use runtime_spine::RuntimeSpineHeartbeatJobOptions; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 5bc91d30..2a72a598 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -354,9 +354,27 @@ pub struct EpiphanyRuntimeWorkerLaunchRequest { pub admitted_model_direction_consideration_request_id: Option, #[cultcache(key = 17, default)] pub repo_frontier_modeling_request_id: Option, + #[cultcache(key = 18, default)] + pub repo_frontier_verdict_modeling_authority_msgpack: Option>, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct RepoFrontierVerdictModelingLaunchAuthority { + pub request: RepoFrontierModelingRequest, + pub frontier_item: crate::RepoFrontierItem, } impl EpiphanyRuntimeWorkerLaunchRequest { + pub fn repo_frontier_verdict_modeling_authority( + &self, + ) -> Result> { + decode_optional_msgpack( + self.repo_frontier_verdict_modeling_authority_msgpack + .as_deref(), + "verdict-bound Modeling launch authority", + ) + } + pub fn launch_document(&self) -> Result { let document: EpiphanyWorkerLaunchDocument = rmp_serde::from_slice(&self.launch_document_msgpack) @@ -792,6 +810,8 @@ pub struct RuntimeSpineHeartbeatJobOptions { pub imagination_consideration_request_id: Option, pub admitted_model_direction_consideration_request_id: Option, pub repo_frontier_modeling_request_id: Option, + pub repo_frontier_verdict_modeling_authority: + Option, pub created_at: String, } @@ -846,6 +866,8 @@ pub struct EpiphanyJobLaunchRequest { pub imagination_consideration_request_id: Option, pub admitted_model_direction_consideration_request_id: Option, pub repo_frontier_modeling_request_id: Option, + pub repo_frontier_verdict_modeling_authority: + Option, } #[derive(Debug, Clone, PartialEq)] @@ -1354,6 +1376,11 @@ pub fn open_runtime_spine_heartbeat_job( options.imagination_consideration_request_id.as_deref(), &options.launch_document, )?; + validate_repo_frontier_verdict_modeling_launch_authority( + &options.role, + options.repo_frontier_modeling_request_id.as_deref(), + options.repo_frontier_verdict_modeling_authority.as_ref(), + )?; validate_non_empty(&options.binding_id, "binding id")?; validate_non_empty(&options.authority_scope, "authority scope")?; validate_non_empty(&options.instruction, "instruction")?; @@ -1445,6 +1472,11 @@ pub fn open_runtime_spine_heartbeat_job( admitted_model_direction_consideration_request_id: options .admitted_model_direction_consideration_request_id, repo_frontier_modeling_request_id: options.repo_frontier_modeling_request_id, + repo_frontier_verdict_modeling_authority_msgpack: options + .repo_frontier_verdict_modeling_authority + .as_ref() + .map(rmp_serde::to_vec_named) + .transpose()?, }; cache.put(&job_id, &request)?; Ok(job) @@ -1485,6 +1517,11 @@ pub fn prepare_runtime_spine_heartbeat_job( options.imagination_consideration_request_id.as_deref(), &options.launch_document, )?; + validate_repo_frontier_verdict_modeling_launch_authority( + &options.role, + options.repo_frontier_modeling_request_id.as_deref(), + options.repo_frontier_verdict_modeling_authority.as_ref(), + )?; validate_non_empty(&options.binding_id, "binding id")?; validate_non_empty(&options.authority_scope, "authority scope")?; validate_non_empty(&options.instruction, "instruction")?; @@ -1602,6 +1639,11 @@ pub fn prepare_runtime_spine_heartbeat_job( admitted_model_direction_consideration_request_id: options .admitted_model_direction_consideration_request_id, repo_frontier_modeling_request_id: options.repo_frontier_modeling_request_id, + repo_frontier_verdict_modeling_authority_msgpack: options + .repo_frontier_verdict_modeling_authority + .as_ref() + .map(rmp_serde::to_vec_named) + .transpose()?, }; let envelopes = vec![ cache.prepare_entry(RUNTIME_IDENTITY_KEY, &identity)?.0, @@ -1613,6 +1655,40 @@ pub fn prepare_runtime_spine_heartbeat_job( Ok(PreparedRuntimeSpineHeartbeatJob { job, envelopes }) } +fn validate_repo_frontier_verdict_modeling_launch_authority( + role: &str, + request_id: Option<&str>, + authority: Option<&RepoFrontierVerdictModelingLaunchAuthority>, +) -> Result<()> { + match (request_id, authority) { + (None, None) => Ok(()), + (Some(_), None) => Err(anyhow!( + "verdict-bound Modeling launch omitted its typed authority body" + )), + (None, Some(_)) => Err(anyhow!( + "verdict-bound Modeling authority body has no indexed request id" + )), + (Some(request_id), Some(authority)) => { + if role != EPIPHANY_MODELING_OWNER_ROLE { + return Err(anyhow!( + "verdict-bound Modeling authority belongs only to the Modeling owner role" + )); + } + if request_id != authority.request.request_id { + return Err(anyhow!( + "verdict-bound Modeling request id does not match its typed authority body" + )); + } + if authority.request.frontier_item_id != authority.frontier_item.id { + return Err(anyhow!( + "verdict-bound Modeling authority does not carry its exact frontier item" + )); + } + Ok(()) + } + } +} + fn validate_proposal_modeling_launch_carrier( role: &str, binding_id: &str, @@ -10083,6 +10159,7 @@ pub(crate) mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority_msgpack: None, }; let mut cache = runtime_spine_cache(store)?; cache.put(job_id, &request)?; @@ -14128,6 +14205,7 @@ pub(crate) mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, created_at: "2026-05-06T00:02:00Z".to_string(), }, )?; diff --git a/epiphany-core/src/substrate_gate.rs b/epiphany-core/src/substrate_gate.rs index 5eadbd1a..b719d356 100644 --- a/epiphany-core/src/substrate_gate.rs +++ b/epiphany-core/src/substrate_gate.rs @@ -285,6 +285,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, }; let grant = substrate_gate_repo_access_grant_for_launch( "grant-1".to_string(), diff --git a/epiphany-core/src/surfaces/worker_launch.rs b/epiphany-core/src/surfaces/worker_launch.rs index dbc0b719..a65aae47 100644 --- a/epiphany-core/src/surfaces/worker_launch.rs +++ b/epiphany-core/src/surfaces/worker_launch.rs @@ -441,6 +441,7 @@ pub fn build_reorient_job_launch_request( imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, } } diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index b7ecbe58..36199af4 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -1352,7 +1352,21 @@ fn worker_output_schema_json( .repo_frontier_modeling_request_id .as_deref() .expect("checked verdict-bound Modeling request identity"); - epiphany_core::epiphany_frontier_verdict_modeling_output_schema(request_id) + let authority = launch_request + .repo_frontier_verdict_modeling_authority()? + .ok_or_else(|| { + anyhow!( + "verdict-bound Modeling launch {request_id:?} omitted its typed authority body" + ) + })?; + if authority.request.request_id != request_id { + return Err(anyhow!( + "verdict-bound Modeling launch identity mismatch: indexed {:?}, authority {:?}", + request_id, + authority.request.request_id + )); + } + epiphany_core::epiphany_frontier_verdict_modeling_output_schema(&authority) } else { epiphany_core::epiphany_role_launch_output_schema(role_id) } @@ -2064,6 +2078,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority_msgpack: None, }; let result = role_worker_result_from_ingress( &launch, @@ -2137,6 +2152,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority_msgpack: None, }; let result = role_worker_result_from_ingress( &launch, @@ -2221,6 +2237,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority_msgpack: None, }; let failed = failed_frontier_planning_role_result(&launch, "candidate mismatch")? .expect("typed planning failure"); @@ -2262,6 +2279,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority_msgpack: None, }; let result = role_worker_result_from_ingress( &launch, @@ -2510,6 +2528,47 @@ mod tests { repo_frontier_modeling_request_id: Some( "frontier-modeling-request-1".to_string(), ), + repo_frontier_verdict_modeling_authority: Some( + epiphany_core::RepoFrontierVerdictModelingLaunchAuthority { + request: epiphany_core::RepoFrontierModelingRequest { + schema_version: epiphany_core::REPO_FRONTIER_MODELING_REQUEST_SCHEMA_VERSION.to_string(), + request_id: "frontier-modeling-request-1".to_string(), + model_revision: 1, + model_hash: "model-hash".to_string(), + route_id: "route-1".to_string(), + frontier_item_id: "frontier-1".to_string(), + frontier_item_hash: "frontier-hash".to_string(), + verification_request_id: "verification-request-1".to_string(), + soul_verdict_receipt_id: "soul-verdict-1".to_string(), + verification_result_id: "verification-result-1".to_string(), + verification_job_id: "verification-job-1".to_string(), + verification_acceptance_receipt_id: "verification-acceptance-1".to_string(), + allowed_disposition: epiphany_core::RepoFrontierVerdictDisposition::Resolved, + requested_at: "2026-08-08T00:00:00Z".to_string(), + contract: epiphany_core::REPO_FRONTIER_MODELING_REQUEST_CONTRACT.to_string(), + }, + frontier_item: epiphany_core::RepoFrontierItem { + id: "frontier-1".to_string(), + migration_body: "runtime".to_string(), + question: "Did the verified consequence hold?".to_string(), + gap: "Awaiting verdict incorporation.".to_string(), + target_claim_ids: vec!["claim-1".to_string()], + source_scope: vec!["epiphany-core".to_string()], + recommended_next_organ: "Hands".to_string(), + adopted_plan: Some(epiphany_core::RepoFrontierAdoptedPlan { + command: "cargo test".to_string(), + ..Default::default() + }), + dependency_item_ids: Vec::new(), + status: epiphany_core::RepoFrontierStatus::Active, + evidence_refs: vec!["prior-evidence".to_string()], + created_at: Some("2026-08-07T00:00:00Z".to_string()), + updated_at: Some("2026-08-07T00:00:00Z".to_string()), + retired_at: None, + superseded_by: None, + }, + }, + ), created_at: now(), }, )?; @@ -2681,6 +2740,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_verdict_modeling_authority: None, created_at: now(), }, )?; diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index f8afbe44..bd1750a8 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -7,13 +7,13 @@ machine at its present memory budget. ## Authoritative live state - Branch: `codex/epiphany-shakedown-live` -- Pushed source release commit: `6f3cdc6168e5bf8b680e141582152b56ef10debe` +- Pushed source boundary: `b290d511` (typed verdict-Modeling authority repair verified locally and pending commit) - Live workspace: `F:\Projects\.epiphany-runtime\shakedown\live-20260808-v53-hands-precedence` - Thread: `shakedown-v49-hands-relinquishment-r1` - Current release: `sha256-67ed6c8dbce5dee81dfaf44effb8f499c61ae98bbdff4d997a665f91deeef8a5` - Release witness: `sha256-c98e36f35057f902c518167db3f036edb4994b02f15f432510f7e6fde1263853` - Thread-state revision: `39` -- Current action: schema-aware retry job `a89fe1ea-a88b-4108-a299-c99ca9b65fb7` is completed but invalid and unreviewed. Do not launch another worker. Repair exact frontier-item identity binding first, explicitly supersede this result, then launch one corrected attempt. +- Current action: schema-aware retry job `a89fe1ea-a88b-4108-a299-c99ca9b65fb7` is completed but invalid and unreviewed. The typed authority repair is locally verified. Commit, package, explicitly supersede this result, then launch exactly one corrected attempt. - Sealed evidence: v49 through v52. Do not mutate them. ## Live causal boundary @@ -92,12 +92,15 @@ retry `a89fe1ea-a88b-4108-a299-c99ca9b65fb7`, which completed. Review without automatic supersession failed closed with `generic frontier revision cannot alter adopted execution anatomy or own plan adoption`. -Next cut: persist one typed verdict-Modeling launch authority containing the -exact `RepoFrontierModelingRequest` and routed `RepoFrontierItem`. Generate -provider `const` constraints for every identity-bearing field, especially the -full adopted plan. Only verdict-owned status, evidence refs, gap, and updated_at -may vary. The completed retry is immutable invalid evidence; supersede it only -after the repair is ready, then pay for one corrected model turn. +The repair now persists one typed verdict-Modeling launch authority containing +the exact `RepoFrontierModelingRequest` and routed `RepoFrontierItem`. Provider +schema generation const-binds every identity-bearing field, including the full +adopted plan; only verdict-owned status, evidence refs, gap, and updated_at may +vary. Persistence rejects missing, orphaned, mismatched, or non-Modeling +authority. The focused schema and Soul-to-Modeling context tests pass, as do all +15 model-runtime and all 15 coordinator tests. The completed retry remains +immutable invalid evidence; commit and package this exact repair, supersede the +old result explicitly, then pay for one corrected model turn. After the Modeling boundary lands, continue attacking the iteration path: diff --git a/state/map.yaml b/state/map.yaml index 6c76421c..f7e19249 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -34,9 +34,9 @@ invariants: - Evidence and git retain history; this map retains only state that changes future decisions. current_status: - summary: Epiphany is a supervised engineering alpha on Starfire, not deployment-ready. Live v53 carries RepoModel revision 6, an exact amended Hands consequence, and an accepted Soul pass. Exact release 61e8be38 now prevents verdict-bound Modeling from escaping into generic Evolution. Live retry proved the remaining schema wound: revise_frontier did not expose or const-bind the adopted plan, so model output implicitly removed execution anatomy and Mind rejected it. Job a89fe1ea-a88b-4108-a299-c99ca9b65fb7 is completed and awaits a coherent typed-authority repair before review. Persona consequence, retention, endurance, restart closure, and Linux/Yggdrasil cognition remain open. + summary: Epiphany is a supervised engineering alpha on Starfire, not deployment-ready. Live v53 carries RepoModel revision 6, an exact amended Hands consequence, and an accepted Soul pass. Verdict-bound Modeling now persists one typed request-plus-frontier-item authority and derives a schema that const-binds all execution identity, including adopted_plan; only verdict-owned fields may vary. Focused schema, context, model-runtime, and coordinator tests pass. Job a89fe1ea-a88b-4108-a299-c99ca9b65fb7 remains immutable invalid evidence and must be explicitly superseded after this exact repair is packaged. Persona consequence, retention, endurance, restart closure, and Linux/Yggdrasil cognition remain open. operational_state: - local_worktree: clean_after_partial_verdict_schema_proof + local_worktree: verified_typed_verdict_modeling_authority_pending_commit operator_wireguard: restored yggdrasil: canonical_small_public_crossing_body starfire: temporary_epiphany_cognition_body @@ -53,7 +53,7 @@ current_status: yggdrasil_epiphany_services: absent resident_physiology: heartbeat_and_self_running unresolved_authority: The local execution amendment is user-authorized and packet-hash bound, not Bifrost-signed. Soul passed the amended consequence but reported that derived reorientation checkpoints carry empty evidence_ids; Modeling must preserve that limitation rather than overstate source provenance. The adopted Mind decision also carries a model-supplied 2025 timestamp; coordinator commit-time timestamp ownership remains open. Exact packaging still takes 6m59s after core changes. Removing one redundant RepoModel pull left worker appearance near 48s and full coordinator launch near 83s, so repeated whole-store transactions remain the dominant 40 MiB launch-path defect. - next_action: Carry the exact routed RepoFrontierItem plus RepoFrontierModelingRequest as one typed verdict-modeling launch authority. Specialize the worker schema so every identity-bearing frontier field, including adopted_plan, is const-bound; only status, evidence_refs, gap, and updated_at may vary. Then explicitly supersede invalid completed job a89fe1ea-a88b-4108-a299-c99ca9b65fb7 and launch one corrected attempt. Preserve the 45.77-second jobCommit timing as the launch-store optimization receipt. + next_action: Commit and package the verified typed verdict-Modeling authority repair. Then explicitly supersede invalid completed job a89fe1ea-a88b-4108-a299-c99ca9b65fb7 and launch exactly one corrected attempt under the authenticated release. Preserve the 45.77-second jobCommit timing as the launch-store optimization receipt. active_subgoals: - Prove Persona, Self, Eyes, Modeling, Imagination, Hands, Soul, Mind, Continuity, and nervous-system behavior individually.