diff --git a/Cargo.lock b/Cargo.lock index c71a3f96..7d7fd56e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2186,6 +2186,7 @@ dependencies = [ "epiphany-model-adapter", "epiphany-openai-adapter", "epiphany-openai-codex-spine", + "epiphany-state-model", "epiphany-tool-adapter", "rmp-serde", "serde", diff --git a/epiphany-core/src/repo_model_gateway.rs b/epiphany-core/src/repo_model_gateway.rs index 25dbe136..43acac8d 100644 --- a/epiphany-core/src/repo_model_gateway.rs +++ b/epiphany-core/src/repo_model_gateway.rs @@ -101,9 +101,9 @@ pub const LEGACY_REPO_FRONTIER_PLAN_DECISION_RECEIPT_SCHEMA_VERSION: &str = pub const REPO_FRONTIER_PLAN_DECISION_CONTRACT: &str = "epiphany.repo_frontier_plan_decision.v0"; pub const REPO_FRONTIER_PLANNING_CONTRACT: &str = "epiphany.repo_frontier_planning.v1"; pub const REPO_FRONTIER_RESEARCH_REQUEST_SCHEMA_VERSION: &str = - "epiphany.self.repo_frontier_research_request.v0"; + "epiphany.self.repo_frontier_research_request.v1"; pub const REPO_FRONTIER_RESEARCH_REQUEST_CONTRACT: &str = - "epiphany.repo_frontier_research_request.v0"; + "epiphany.repo_frontier_research_request.v1"; pub const REPO_FRONTIER_WORK_PROPOSAL_CONTRACT: &str = "epiphany.repo_frontier_work_proposal.inert.v0"; pub const REPO_FRONTIER_AUTONOMOUS_PROPOSAL_BINDING_SCHEMA_VERSION: &str = @@ -590,6 +590,11 @@ pub struct RepoFrontierResearchRequest { pub thread_id: String, #[cultcache(key = 11)] pub contract: String, + /// Immutable public source identities already owned by the admitted + /// frontier. This is the strict GitHub subset of `evidence_refs`, not a + /// worker-authored search hint. + #[cultcache(key = 12, default)] + pub public_source_refs: Vec, } #[derive(Debug, Clone, PartialEq, Eq, DatabaseEntry)] diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index e163baf3..1baf8118 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -8738,10 +8738,18 @@ pub fn select_and_commit_repo_frontier_research_request( let item = actionable_frontier_item_for_organ(&model, &challenges, "Eyes", false) .ok_or_else(|| anyhow!("current model has no actionable Eyes frontier"))?; let item_hash = format!("{:x}", Sha256::digest(rmp_serde::to_vec_named(item)?)); + let mut public_source_refs = item + .evidence_refs + .iter() + .filter(|source_ref| immutable_github_source_ref(source_ref)) + .cloned() + .collect::>(); + public_source_refs.sort(); + public_source_refs.dedup(); let request_id = format!( "repo-frontier-research-{:x}", Sha256::digest( - format!("{}:{}:{}:{item_hash}", identity.runtime_id, thread.thread_id, model_hash) + format!("{}:{}:{item_hash}", identity.runtime_id, model_hash) .as_bytes() ) ); @@ -8758,10 +8766,15 @@ pub fn select_and_commit_repo_frontier_research_request( runtime_id: identity.runtime_id, thread_id: thread.thread_id, contract: REPO_FRONTIER_RESEARCH_REQUEST_CONTRACT.to_string(), + public_source_refs, }; if let Some(existing) = cache.get::(&request_id)? { let mut replay = request.clone(); replay.requested_at = existing.requested_at.clone(); + // The frontier owns this request. The thread records where it was + // created, but later coordinator incarnations must not fork or + // invalidate the same current-model request. + replay.thread_id = existing.thread_id.clone(); return if existing == replay { Ok(existing) } else { @@ -8840,9 +8853,6 @@ fn repo_frontier_research_request_is_current( return Err(anyhow!("invalid frontier Research request")); } let identity = require_identity(cache)?; - let thread = cache - .get::(crate::THREAD_STATE_KEY)? - .ok_or_else(|| anyhow!("frontier Research request lost thread state"))?; let entry = cache .get::(crate::MEMORY_GRAPH_KEY)? .ok_or_else(|| anyhow!("frontier Research request lost current model"))?; @@ -8850,7 +8860,7 @@ fn repo_frontier_research_request_is_current( let model = entry.snapshot()?; let model_hash = crate::memory_graph_model_hash(&model)?; if request.runtime_id != identity.runtime_id - || request.thread_id != thread.thread_id + || request.thread_id.is_empty() || request.model_revision != model.model_revision || request.model_hash != model_hash { @@ -8861,13 +8871,18 @@ fn repo_frontier_research_request_is_current( return Ok(false); }; let item_hash = format!("{:x}", Sha256::digest(rmp_serde::to_vec_named(item)?)); + let mut expected_public_source_refs = item + .evidence_refs + .iter() + .filter(|source_ref| immutable_github_source_ref(source_ref)) + .cloned() + .collect::>(); + expected_public_source_refs.sort(); + expected_public_source_refs.dedup(); let expected_request_id = format!( "repo-frontier-research-{:x}", Sha256::digest( - format!( - "{}:{}:{}:{item_hash}", - identity.runtime_id, thread.thread_id, model_hash - ) + format!("{}:{}:{item_hash}", identity.runtime_id, model_hash) .as_bytes() ) ); @@ -8888,7 +8903,8 @@ fn repo_frontier_research_request_is_current( && request.request_id == expected_request_id && request.frontier_item_id == item.id && request.frontier_item_hash == item_hash - && request.source_scope == item.source_scope) + && request.source_scope == item.source_scope + && request.public_source_refs == expected_public_source_refs) } /// Read-only Self signal for proposal planning. It uses the same eligibility @@ -10665,6 +10681,43 @@ fn safe_sorted_unique_paths(paths: &[String]) -> bool { }) } +fn immutable_github_source_ref(source_ref: &str) -> bool { + let Some(rest) = source_ref.strip_prefix("github://") else { + return false; + }; + let Some((owner, rest)) = rest.split_once('/') else { + return false; + }; + let Some((repository, revision_and_path)) = rest.split_once('@') else { + return false; + }; + let Some((revision, path)) = revision_and_path.split_once('/') else { + return false; + }; + let repository_component = |value: &str| { + !value.is_empty() + && value.len() <= 100 + && value.bytes().all(|byte| { + byte.is_ascii_alphanumeric() || matches!(byte, b'-' | b'_' | b'.') + }) + }; + repository_component(owner) + && repository_component(repository) + && revision.len() == 40 + && revision + .bytes() + .all(|byte| byte.is_ascii_digit() || matches!(byte, b'a'..=b'f')) + && !path.is_empty() + && path.len() <= 512 + && path.split('/').all(|segment| { + !segment.is_empty() + && !matches!(segment, "." | "..") + && segment.bytes().all(|byte| { + byte.is_ascii_alphanumeric() || matches!(byte, b'-' | b'_' | b'.') + }) + }) +} + fn validate_hands_consequence_grant( store_path: &Path, intent_id: &str, @@ -16593,6 +16646,14 @@ pub(crate) mod tests { unreachable!() }; item.recommended_next_organ = next_organ.into(); + if next_organ == "Eyes" { + item.evidence_refs.push( + "github://GameCult/Epiphany@0123456789abcdef0123456789abcdef01234567/README.md" + .into(), + ); + item.evidence_refs.sort(); + item.evidence_refs.dedup(); + } let bytes = rmp_serde::to_vec_named(&patch)?; result.repo_model_patch_msgpack = Some(bytes.clone()); let mut amended = review; @@ -16725,6 +16786,10 @@ pub(crate) mod tests { "2026-07-13T04:02:00Z", )?; assert_eq!(research_request.model_revision, eyes_challenge.model_revision); + assert_eq!( + research_request.public_source_refs, + vec!["github://GameCult/Epiphany@0123456789abcdef0123456789abcdef01234567/README.md"] + ); assert_eq!( select_and_commit_repo_frontier_research_request( &eyes_store, @@ -16732,7 +16797,98 @@ pub(crate) mod tests { )?, research_request ); + let mut cache = runtime_spine_cache(&eyes_store)?; + cache.pull_all_backing_stores()?; + let mut transitioned = cache + .get::(crate::THREAD_STATE_KEY)? + .unwrap(); + transitioned.thread_id = "later-coordinator-incarnation".into(); + cache.put(crate::THREAD_STATE_KEY, &transitioned)?; + assert_eq!( + select_and_commit_repo_frontier_research_request( + &eyes_store, + "2026-07-13T04:04:00Z", + )?, + research_request + ); assert!(runtime_has_uncovered_actionable_eyes_frontier(&eyes_store)?); + let job_id = "eyes-current-frontier-job"; + let launch_document = EpiphanyWorkerLaunchDocument::Role( + crate::EpiphanyRoleWorkerLaunchDocument { + thread_id: transitioned.thread_id.clone(), + role_id: crate::EPIPHANY_RESEARCH_OWNER_ROLE.into(), + state_revision: transitioned.state()?.revision, + objective: None, + dynamic_prompt_context: None, + repository_body_observation_basis: None, + proposal_modeling_context: None, + claim_repair_context: None, + frontier_planning_context: None, + frontier_research_context: Some( + crate::RepoFrontierResearchContextProjection::from(&research_request), + ), + frontier_plan_mind_context: None, + imagination_consideration_context: None, + admitted_model_direction_consideration_context: None, + active_subgoal_id: None, + active_subgoals: Vec::new(), + active_graph_node_ids: Vec::new(), + investigation_checkpoint: None, + scratch: None, + invariants: Vec::new(), + graphs: None, + recent_evidence: Vec::new(), + recent_observations: Vec::new(), + graph_frontier: None, + graph_checkpoint: None, + planning: None, + churn: None, + }, + ); + let launch = EpiphanyRuntimeWorkerLaunchRequest { + schema_version: RUNTIME_WORKER_LAUNCH_REQUEST_SCHEMA_VERSION.into(), + job_id: job_id.into(), + binding_id: crate::EPIPHANY_RESEARCH_ROLE_BINDING_ID.into(), + role: crate::EPIPHANY_RESEARCH_OWNER_ROLE.into(), + authority_scope: "research".into(), + instruction: "Inspect the exact current Eyes frontier.".into(), + output_contract_id: crate::ROLE_WORKER_OUTPUT_CONTRACT_ID.into(), + document_kind: worker_launch_document_kind(&launch_document).into(), + launch_document_msgpack: encode_worker_launch_document(&launch_document)?, + metadata: BTreeMap::new(), + organ_launch_contract: crate::default_launch_organ_contract( + "research", + "role", + crate::ROLE_WORKER_OUTPUT_CONTRACT_ID, + ), + proposal_modeling_request_id: None, + claim_repair_request_id: None, + frontier_planning_request_id: None, + frontier_plan_mind_request_id: None, + imagination_consideration_request_id: None, + admitted_model_direction_consideration_request_id: None, + repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: Some(research_request.request_id.clone()), + repo_frontier_verdict_modeling_authority_msgpack: None, + }; + cache.put(job_id, &launch)?; + let covered = EyesEvidencePacket { + schema_version: EYES_EVIDENCE_PACKET_SCHEMA_VERSION.into(), + packet_id: "eyes-current-frontier-packet".into(), + source_result_id: "eyes-current-frontier-result".into(), + source_job_id: job_id.into(), + source_role_id: "research".into(), + evidence_ids: vec!["evidence-current-frontier".into()], + observation_ids: vec!["observation-current-frontier".into()], + source_refs: research_request.source_scope.clone(), + summary: "The current frontier was inspected.".into(), + uncertainty: "Bounded to the exact request.".into(), + emitted_at: "2026-07-13T04:05:00Z".into(), + contract: "Eyes packet emitted from a reviewed Research lane finding; it makes the source-gathering evidence claim citable before Mind admission.".into(), + source_lookup_receipt_ids: Vec::new(), + }; + cache.put(&covered.packet_id, &covered)?; + assert!(!runtime_has_uncovered_actionable_eyes_frontier(&eyes_store)?); let (planning_store, planning_challenge) = claim_challenge_fixture(root.path(), "planning-gate", "Imagination")?; diff --git a/epiphany-core/src/surfaces/worker_launch.rs b/epiphany-core/src/surfaces/worker_launch.rs index 08d94fe9..8a6eeed5 100644 --- a/epiphany-core/src/surfaces/worker_launch.rs +++ b/epiphany-core/src/surfaces/worker_launch.rs @@ -39,9 +39,9 @@ pub const REPO_FRONTIER_PLANNING_CONTEXT_SCHEMA_VERSION: &str = pub const REPO_FRONTIER_PLANNING_CONTEXT_CONTRACT: &str = "epiphany.repo_frontier_planning_context.v0"; pub const REPO_FRONTIER_RESEARCH_CONTEXT_SCHEMA_VERSION: &str = - "epiphany.worker.repo_frontier_research_context.v0"; + "epiphany.worker.repo_frontier_research_context.v1"; pub const REPO_FRONTIER_RESEARCH_CONTEXT_CONTRACT: &str = - "epiphany.repo_frontier_research_context.v0"; + "epiphany.repo_frontier_research_context.v1"; pub const REPO_FRONTIER_PLAN_MIND_CONTEXT_SCHEMA_VERSION: &str = "epiphany.worker.repo_frontier_plan_mind_context.v0"; pub const REPO_FRONTIER_PLAN_MIND_CONTEXT_CONTRACT: &str = @@ -160,6 +160,8 @@ pub struct RepoFrontierResearchContextProjection { pub frontier_item_id: String, pub frontier_item_hash: String, pub source_scope: Vec, + #[serde(default)] + pub public_source_refs: Vec, pub contract: String, } @@ -174,6 +176,7 @@ impl From<&crate::RepoFrontierResearchRequest> for RepoFrontierResearchContextPr frontier_item_id: request.frontier_item_id.clone(), frontier_item_hash: request.frontier_item_hash.clone(), source_scope: request.source_scope.clone(), + public_source_refs: request.public_source_refs.clone(), contract: REPO_FRONTIER_RESEARCH_CONTEXT_CONTRACT.to_string(), } } diff --git a/epiphany-openai-runtime/Cargo.toml b/epiphany-openai-runtime/Cargo.toml index b75c2def..60a1f8eb 100644 --- a/epiphany-openai-runtime/Cargo.toml +++ b/epiphany-openai-runtime/Cargo.toml @@ -26,6 +26,7 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread"] } uuid = { version = "1", features = ["v4"] } [dev-dependencies] +epiphany-state-model = { path = "../epiphany-state-model" } tempfile = "3" [[bin]] diff --git a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs index 3fd3a9a0..8d52f1b2 100644 --- a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs +++ b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs @@ -1333,13 +1333,14 @@ mod tests { ) -> Result { let session_id = worker_model_session_id(worker_job_id); let job_id = format!("openai-worker-{worker_job_id}"); - let model_request = EpiphanyModelRequest::new( + let mut model_request = EpiphanyModelRequest::new( request_id, format!("worker-{worker_job_id}"), DEFAULT_PROVIDER, "gpt-test", "Call one source tool.", ); + model_request.source_worker_job_id = Some(worker_job_id.to_string()); let provider_request = EpiphanyOpenAiModelRequest::new( request_id, format!("worker-{worker_job_id}"), @@ -1443,6 +1444,48 @@ mod tests { )); } + fn put_test_source_grant( + store: &Path, + launch: &epiphany_core::EpiphanyRuntimeWorkerLaunchRequest, + ) -> Result<()> { + let request = epiphany_core::EpiphanyJobLaunchRequest { + expected_revision: None, + binding_id: launch.binding_id.clone(), + kind: epiphany_state_model::EpiphanyJobKind::Specialist, + scope: launch.authority_scope.clone(), + owner_role: launch.role.clone(), + authority_scope: launch.authority_scope.clone(), + linked_subgoal_ids: Vec::new(), + linked_graph_node_ids: Vec::new(), + instruction: launch.instruction.clone(), + launch_document: launch.launch_document()?, + output_contract_id: launch.output_contract_id.clone(), + organ_launch_contract: launch.organ_launch_contract.clone(), + max_runtime_seconds: None, + proposal_modeling_request_id: launch.proposal_modeling_request_id.clone(), + claim_repair_request_id: launch.claim_repair_request_id.clone(), + frontier_planning_request_id: launch.frontier_planning_request_id.clone(), + frontier_plan_mind_request_id: launch.frontier_plan_mind_request_id.clone(), + imagination_consideration_request_id: launch + .imagination_consideration_request_id + .clone(), + admitted_model_direction_consideration_request_id: launch + .admitted_model_direction_consideration_request_id + .clone(), + repo_frontier_modeling_request_id: launch.repo_frontier_modeling_request_id.clone(), + repo_frontier_research_request_id: launch.repo_frontier_research_request_id.clone(), + repo_frontier_verdict_modeling_authority: None, + }; + let grant = epiphany_core::substrate_gate_repo_access_grant_for_launch( + format!("substrate-grant-{}", launch.job_id), + launch.job_id.clone(), + &request, + now(), + ); + epiphany_core::put_substrate_gate_repo_access_grant_receipt(store, &grant)?; + Ok(()) + } + #[test] fn repeated_tool_loop_seals_outer_worker_job() -> Result<()> { let temp = tempdir()?; @@ -1471,6 +1514,7 @@ mod tests { proposal_modeling_context: None, claim_repair_context: None, frontier_planning_context: None, + frontier_research_context: None, frontier_plan_mind_context: None, imagination_consideration_context: None, admitted_model_direction_consideration_context: None, @@ -1502,12 +1546,14 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority: None, created_at: now(), }, )?; let launch_request = runtime_worker_launch_request(&store, "worker-job-loop")?.expect("launch request"); + put_test_source_grant(&store, &launch_request)?; let openai_summary = seed_pending_tool_summary( &store, "worker-job-loop", @@ -1581,6 +1627,7 @@ mod tests { proposal_modeling_context: None, claim_repair_context: None, frontier_planning_context: None, + frontier_research_context: None, frontier_plan_mind_context: None, imagination_consideration_context: None, admitted_model_direction_consideration_context: None, @@ -1612,6 +1659,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority: None, created_at: now(), }, @@ -1664,6 +1712,7 @@ mod tests { proposal_modeling_context: None, claim_repair_context: None, frontier_planning_context: None, + frontier_research_context: None, frontier_plan_mind_context: None, imagination_consideration_context: None, admitted_model_direction_consideration_context: None, @@ -1695,12 +1744,14 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority: None, created_at: now(), }, )?; let launch_request = runtime_worker_launch_request(&store, "worker-job-round-limit")? .expect("launch request"); + put_test_source_grant(&store, &launch_request)?; let openai_summary = seed_pending_tool_summary( &store, "worker-job-round-limit", diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index 85e9e9cd..fcbc960f 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -2248,6 +2248,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority_msgpack: None, }; let basis = epiphany_core::RepositoryBodyObservationBasis { @@ -2385,6 +2386,7 @@ mod tests { proposal_modeling_context: Some(context), claim_repair_context: None, frontier_planning_context: None, + frontier_research_context: None, frontier_plan_mind_context: None, imagination_consideration_context: None, admitted_model_direction_consideration_context: None, @@ -2426,6 +2428,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority_msgpack: None, }; @@ -2472,6 +2475,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority_msgpack: None, }; let result = role_worker_result_from_ingress( @@ -2552,6 +2556,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority_msgpack: None, }; let result = role_worker_result_from_ingress( @@ -2684,6 +2689,7 @@ mod tests { imagination_consideration_request_id: Some(request.request_id.clone()), admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority_msgpack: None, }; let result = role_worker_result_from_ingress( @@ -2740,6 +2746,7 @@ mod tests { proposal_modeling_context: None, claim_repair_context: None, frontier_planning_context: None, + frontier_research_context: None, frontier_plan_mind_context: None, imagination_consideration_context: None, admitted_model_direction_consideration_context: None, @@ -2780,6 +2787,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority_msgpack: None, }; let failed = failed_frontier_planning_role_result(&launch, "candidate mismatch")? @@ -2822,6 +2830,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority_msgpack: None, }; let context = epiphany_core::RepoFrontierPlanMindContextProjection { @@ -3093,8 +3102,9 @@ mod tests { repository_body_observation_basis: Some(body_basis.clone()), proposal_modeling_context: None, claim_repair_context: None, - frontier_planning_context: None, - frontier_plan_mind_context: None, + frontier_planning_context: None, + frontier_research_context: None, + frontier_plan_mind_context: None, imagination_consideration_context: None, admitted_model_direction_consideration_context: None, active_subgoal_id: None, @@ -3127,6 +3137,7 @@ mod tests { repo_frontier_modeling_request_id: Some( "frontier-modeling-request-1".to_string(), ), + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority: Some( epiphany_core::RepoFrontierVerdictModelingLaunchAuthority { request: epiphany_core::RepoFrontierModelingRequest { @@ -3316,8 +3327,9 @@ mod tests { repository_body_observation_basis: None, proposal_modeling_context: None, claim_repair_context: None, - frontier_planning_context: None, - frontier_plan_mind_context: None, + frontier_planning_context: None, + frontier_research_context: None, + frontier_plan_mind_context: None, imagination_consideration_context: None, admitted_model_direction_consideration_context: None, active_subgoal_id: None, @@ -3348,6 +3360,7 @@ mod tests { imagination_consideration_request_id: None, admitted_model_direction_consideration_request_id: None, repo_frontier_modeling_request_id: None, + repo_frontier_research_request_id: None, repo_frontier_verdict_modeling_authority: None, created_at: now(), }, diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 4ed9dc94..c34ea918 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -4419,21 +4419,29 @@ Imagination without adding a lifecycle-specific process rule. - Owner: the exact actionable Eyes frontier in the uniquely admitted current RepoModel owns whether Self must launch Research. - Inputs: current model revision/hash and admission receipt; exact frontier item - id/hash/source scope; authoritative runtime/thread identity; typed Research + id/hash/local source scope and strict immutable GitHub evidence refs; + authoritative runtime identity; creation-thread provenance; typed Research worker launch; accepted Eyes packet source job. - Outputs: one immutable `RepoFrontierResearchRequest`, its exact typed launch projection, and an uncovered/covered readiness decision. -- Derived state: historical `research_result_accepted` is evidence about an old - pass, and a terminal `Completed` role binding is evidence about its old job; - neither owns the current frontier. Only a currently `Pending` or `Running` - Research job suppresses another launch. -- Forbidden writers: timestamps, generic accepted Research state, and unrelated - Eyes packets cannot consume current readiness. +- Derived state: request `thread_id` records the coordinator incarnation that + created it but is not request identity or liveness authority. Historical + `research_result_accepted` is evidence about an old pass, and a terminal + `Completed` role binding is evidence about its old job; neither owns the + current frontier. Only a currently `Pending` or `Running` Research job + suppresses another launch. +- Forbidden writers: mutable coordinator thread state, timestamps, generic + accepted Research state, and unrelated Eyes packets cannot invalidate, + replace, or consume current readiness. Worker prompts cannot invent a public + target; only a canonical immutable ref already admitted in frontier evidence + enters the Research launch. - Shared path: status, direct coordinator execution, and resident execution use the same current-frontier selector and worker-launch carrier. - Cut line: only an accepted Eyes packet whose source job carries the exact current request may cover the frontier. Model or frontier advance makes the old request inert. -- Verification: deterministic selection/replay, exact carrier validation, - historical-acceptance routing, and the full 680-test library pass are green; - exact packaged copied-state public Eyes-to-Mind proof remains open. +- Verification: deterministic selection/replay across a coordinator-thread + transition, strict public-ref projection, exact carrier validation, exact + packet coverage, historical-acceptance routing, the full 680-test core pass, + 24 Self-policy tests, and 39 OpenAI runtime tests are green. Exact packaged + copied-state public Eyes-to-Mind proof remains open. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 5036bac2..a8239321 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -2,13 +2,35 @@ ## Public Eyes evidence is grant-bound and Mind-admissible - 2026-08-11 -Latest pushed source is exact `8fb61ac2`; a causal Eyes-frontier routing cut is -implemented locally with 680/680 core library tests and 24/24 Self-policy tests -passing. Actual c011 remains exact +Latest pushed source is exact `d7b199e5`; a corrected causal Eyes-frontier owner +cut is implemented locally. The full core library passes 680/680 with one +intentional helper ignored, Self-policy passes 24/24, and the OpenAI runtime +passes 39/39 across library and both binary surfaces. Actual c011 remains exact `465af24d`, alive, cognitively braked at resident revision 384, with no active lease or admitted work and zero defunct children. Do not disturb it before the new source passes copied-state gates. +Copied d7 replay did launch Research and Mind accepted its result, but that was +not the required public proof. The worker inspected only local frontier scope; +the accepted packet carried no `github://` source or `EyesSourceLookupReceipt`. +After acceptance, status still derived `launchResearch`. Operator-safe +diagnostics proved the request, launch, and packet job IDs matched: coverage +failed only because the mutable canonical coordinator thread had advanced away +from the request's creation thread. The same launch lacked a typed immutable +public target, so a root fixture file was correctly invisible. + +The repaired owner is the exact admitted RepoModel frontier. Research request +identity now derives from runtime identity, model hash, and exact frontier hash; +the thread is retained as creation provenance but cannot invalidate or fork the +request. A strict `github://owner/repository@40hex/path` subset of the +Modeling-owned frontier `evidence_refs` is copied into the v1 request and exact +worker launch context. The regression creates a request, changes coordinator +incarnation, replays the same request, binds an exact launch and packet, and +proves the frontier becomes covered. OpenAI fixture failures also exposed and +closed missing launch-carrier fields and missing source-worker/grant provenance +in tool-loop tests. Temporary debug prints were removed; formatting churn was +discarded rather than canonized. + The source-tool authority wound is closed in source. Research, Modeling, and Verification launches receive exact immutable read grants; Research alone receives `publicSourceRead` and sees `epiphany_public.github_file`. Every diff --git a/state/map.yaml b/state/map.yaml index a8303a9b..71bbbd51 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -38,7 +38,7 @@ current_status: summary: Epiphany is a supervised engineering alpha on Starfire, not deployment-ready. Exact b8138a6b active-child SIGTERM and restart, exact 9f369528 deterministic warm packaging, exact c930f505 cross-container ownership, exact ed15f83a resident lifecycle retention, exact 16c4b19f coordinator receipt and Heartbeat artifact retention, exact cce2b8ac narrow model-generation retention, exact eea15e82 model-turn JSON ingress, exact b1e8c89a semantic unattempted-generation retention, exact 6bc3ec3f semantic physical-epoch retirement, and exact 44230a05 Persona conversation retention are proven. Gamecult-ops 059821f owns Yggdrasil stream retention and exact 6ee08a4 owns stable Starfire Persona-permit firewall ingress. Exact 16c4b19f genuine idle and exact a987d2f7 active cognition completed 900-pulse bounded plateaus. Runtime-owned typed fulfillment is accepted live under exact 6dd9b132. Yggdrasil is the small public crossing body, never the release forge. latest_phase: Live c010 inspection found six defunct model-worker grandchildren adopted by resident PID 1. Exact 465af24d makes resident Self enumerate typed runtime worker process claims and call exact nonblocking waitpid only for those claimed PIDs before each once/serve cycle and before retention. Coordinator Child handles remain separately owned. Six Windows process tests, nine swarm tests, and the Unix exact-child test pass. The warning-free 24-binary Linux release sha256-089e000511f0420bfaab1136952b8cf94677a72d5c30a3fb3e6a26996bd3726f with witness sha256-20ca293589b33d3b2e6ea5a7411db544741fe18360ecbd4423cdfa000d1ad7c6 is live as c011. A typed operator proposal drove exact Modeling request repo-frontier-proposal-modeling-1c15a1d0d22e52cff8d735f331658c6a9a652b183d29f35902a7ca6dbc676f50 through Heartbeat, Self, coordinator, adopted worker PID 152, terminal fulfillment, settlement, and zero-zombie reaping. Its authenticated review continuation completed and emitted admitted-direction Imagination request c72af0e16fbc767966e63f56f058ae3741f07d2af4b12bab7b65dd8d8fab4bbb. That preserved grant then launched adopted worker PID 275; it terminalized normally, settled at revision 384, and was reaped with PID 1 again returning to zero defunct children. It produced no further admitted work. c011 is braked at revision 384 with no active lease. The reaper cut is accepted across two genuine worker kinds. Yggdrasil never builds. operational_state: - local_worktree: causal_current_eyes_frontier_request_and_completed_binding_relaunch_cut_tests_green_pending_commit_package_live_proof + local_worktree: frontier_owned_research_identity_and_typed_public_source_target_tests_green_pending_commit_package_live_proof operator_wireguard: restored starfire_persona_permit_firewall: persistent_exact_gamecult_ops_6ee08a4 yggdrasil: canonical_small_public_crossing_body @@ -70,7 +70,7 @@ current_status: yggdrasil_epiphany_service_contract: repaired_in_gamecult_ops_812b427_not_installed resident_physiology: c011_exact_465af24d_alive_braked_revision384_after_modeling_and_imagination_terminal_settlement_and_zero_zombie_reaping unresolved_authority: Coordinator receipt, Heartbeat pulse-artifact, genuine-idle and active resource plateaus, exact-grant terminality, restart-persistent cooldown refusal, schedule/action issuance cardinality, runtime-owned typed fulfillment, all three packaged fulfilled-before-receipt lanes, genuine packaged Imagination option generation, narrow model-generation retention, published model-turn JSON ingress, semantic logical/physical retention, Persona conversation retention, stable Starfire firewall ownership, completed model-adapter session archival, normal coordinator lifecycle opening/error closure/legacy repair/archival, co-resident resident lifecycle retention, authenticated outer-worker attempt retention, deployed supervisor/projector journald ownership, Docker named-volume atomic snapshot visibility, deterministic incremental release construction, and canonical-brake refusal of direct daemon lifecycle actuation are accepted. Starfire's Docker Desktop F: bind is rejected for mutable authority after an exact packaged lockless reader observed an empty published snapshot during writer interruption. Historical migrated semantic attempts without recorded physical namespace remain durable and non-retirable. One completed Discord consequence remains blocked by the absent Yggdrasil credential. Exact aa841873 also makes legacy coordinator repair one full-snapshot transaction so a later hostile family cannot leave an earlier partial repair. - next_action: Keep exact c011 alive and cognitively braked. Exact 18966e55 packaged cleanly, but copied-state replay exposed the remaining policy seam: a completed historical Research binding still blocked a causally newer uncovered Eyes frontier. Commit and package the completed-binding relaunch cut; only Pending or Running Research may suppress the exact uncovered frontier. Replay on fresh copied c011 state, accept one immutable public Research lookup through Eyes into Mind, then prove an otherwise exact request without publicSourceRead refuses before adapter or network consequence with byte-identical state. Only then replace c011. Do not build on Yggdrasil. + next_action: Keep exact c011 alive and cognitively braked. Copied-state d7 replay launched and accepted Research, but the packet remained uncovered because mutable coordinator thread state invalidated the frontier-owned request; its launch also lacked a typed immutable public target and therefore inspected only local scope. Commit and package the corrected owner cut: request identity derives from runtime plus admitted model/frontier, thread is creation provenance only, and strict immutable GitHub refs flow from Modeling-owned frontier evidence into the exact Research context. Replay on fresh copied c011 state, accept one immutable public Research lookup through Eyes into Mind, then prove an otherwise exact request without publicSourceRead refuses before adapter or network consequence with byte-identical state. Only then replace c011. Do not build on Yggdrasil. active_subgoals: - Prove Persona, Self, Eyes, Modeling, Imagination, Hands, Soul, Mind, Continuity, and nervous-system behavior individually. @@ -81,7 +81,7 @@ active_subgoals: organ_readiness: persona: partial; cross-host request/receipt/permit organs, distinct identities, exact release admission, unique permit completion, signed failure/unknown receipts, and no-repost behavior are live. Exact Bifrost cb3239aa fixes positional permit bodies and binds the Discord bridge command receipt to the signed request. A completed public consequence remains unproven because Yggdrasil has no Discord bot credential. self: partial; proposal recovery, Mind admission, current-model Hands routing, Soul lifecycle precedence, verdict incorporation, proposal preemption, challenge-aware Eyes routing, in-process status ownership, causal Research/Soul-to-Modeling routing, and grant-owned lifecycle projection are live. Exact d4907ee8 proves first-attempt proposal Modeling fulfillment, exact grant terminalization, and one terminal downstream review whose receipt carries the post-transaction awaitFrontierProposal action without replay. - eyes: proven for one bounded Windows challenged-claim circuit and one coordinated Linux resident circuit. Linux Eyes job eaf25324 invoked exactly three governed native read-only source tools, completed a typed role result, and was accepted as evidence ev-research-856fb6d1 with no external consequence. Exact source 8fb61ac2 adds outer-worker/grant-bound immutable GitHub reading and typed EyesSourceLookupReceipt admission. The copied c011 proof found historical Research acceptance suppressing a newer Eyes frontier; the local causal request/launch/coverage cut passes 680 library tests, while exact packaged public Eyes-to-Mind proof remains open. + eyes: proven for one bounded Windows challenged-claim circuit and one coordinated Linux resident circuit. Linux Eyes job eaf25324 invoked exactly three governed native read-only source tools, completed a typed role result, and was accepted as evidence ev-research-856fb6d1 with no external consequence. Exact source 8fb61ac2 adds outer-worker/grant-bound immutable GitHub reading and typed EyesSourceLookupReceipt admission. Copied d7 state proved launchResearch and accepted one local-only packet, then exposed that mutable thread state incorrectly invalidated the frontier request and that no public target reached the worker. The corrected owner cut passes the 680-test core suite, the focused cross-incarnation cover test, 24 Self-policy tests, and all 39 OpenAI runtime tests; exact packaged public Eyes-to-Mind proof remains open. modeling: proven for the current bounded Windows circuit, the causal Linux resident Eyes-to-Modeling route, governed live directory observation, typed resident grant sight, first-attempt proposal-frontier publication, and single-consumption coordinator review. Exact d4907ee8 proves one outer job, one terminal review, post-transaction awaitFrontierProposal publication, and no replay. Broader Body-map coverage remains open. imagination: proven for three bounded live circuits, exact packaged receipt-free settlement, and genuine packaged model-produced option generation. Exact acd91e6e accepted signed public feedback into one proposal-only request, derived all causal identity and quoted-evidence references from authenticated runtime context, atomically published worker result plus candidate companion, settled Self once without retry, and neither adopted the proposal nor granted Hands. The rejected b661ec4b copied run remains evidence that model-authored evidence identifiers were an illicit provenance mouth; its three failed attempts were braked and sealed. hands: proven for bounded consequences; native patch, command, commit, push, and typed receipts bind reviewed path ceilings to exact changed-path subsets.