From 24023265f4dd067ffd132c09232088aaf0591353 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 24 Aug 2026 22:50:59 +0200 Subject: [PATCH] Remove live Hands receipt rereads --- epiphany-core/src/lib.rs | 3 -- epiphany-core/src/runtime_spine.rs | 30 ------------------- epiphany-core/src/substrate_gate.rs | 2 +- epiphany-openai-runtime/src/lib.rs | 17 +---------- epiphany-tool-mcp-runtime/src/main.rs | 2 +- .../src/native_source.rs | 30 ------------------- 6 files changed, 3 insertions(+), 81 deletions(-) diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 10ed30bf..449ed15a 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -264,9 +264,6 @@ pub use runtime_spine::retain_failed_runtime_worker_attempts; pub use runtime_spine::retain_fulfilled_runtime_worker_attempts; pub use runtime_spine::review_repo_frontier_planning_failure; pub(crate) use runtime_spine::runtime_authenticated_public_source_lookups_for_worker; -pub use runtime_spine::runtime_hands_command_receipt; -pub use runtime_spine::runtime_hands_commit_receipt; -pub use runtime_spine::runtime_hands_patch_receipt; pub(crate) use runtime_spine::runtime_has_actionable_hands_frontier; pub use runtime_spine::runtime_identity; pub use runtime_spine::runtime_job; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index ce163413..f054e495 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -7596,16 +7596,6 @@ pub fn put_hands_patch_receipt( } } -pub fn runtime_hands_patch_receipt( - store_path: impl AsRef, - receipt_id: &str, -) -> Result> { - validate_non_empty(receipt_id, "Hands patch receipt id")?; - let mut cache = runtime_spine_cache(store_path)?; - cache.pull_all_backing_stores()?; - cache.get::(receipt_id) -} - pub fn put_hands_command_receipt( store_path: impl AsRef, receipt: &HandsCommandReceipt, @@ -7649,16 +7639,6 @@ pub fn put_hands_command_receipt( } } -pub fn runtime_hands_command_receipt( - store_path: impl AsRef, - receipt_id: &str, -) -> Result> { - validate_non_empty(receipt_id, "Hands command receipt id")?; - let mut cache = runtime_spine_cache(store_path)?; - cache.pull_all_backing_stores()?; - cache.get::(receipt_id) -} - pub fn put_hands_commit_receipt( store_path: impl AsRef, receipt: &HandsCommitReceipt, @@ -7768,16 +7748,6 @@ pub fn put_hands_commit_receipt( } } -pub fn runtime_hands_commit_receipt( - store_path: impl AsRef, - receipt_id: &str, -) -> Result> { - validate_non_empty(receipt_id, "Hands commit receipt id")?; - let mut cache = runtime_spine_cache(store_path)?; - cache.pull_all_backing_stores()?; - cache.get::(receipt_id) -} - fn validate_coordinator_run_receipt(receipt: &EpiphanyCoordinatorRunReceipt) -> Result<()> { validate_non_empty(&receipt.receipt_id, "coordinator run receipt id")?; validate_non_empty(&receipt.session_id, "coordinator run receipt session id")?; diff --git a/epiphany-core/src/substrate_gate.rs b/epiphany-core/src/substrate_gate.rs index 76adb335..7892a007 100644 --- a/epiphany-core/src/substrate_gate.rs +++ b/epiphany-core/src/substrate_gate.rs @@ -71,7 +71,7 @@ pub fn substrate_gate_operation_for_governed_tool( match (server, tool_name) { ( "epiphany_source", - "read_file" | "directory_inventory" | "git_show" | "read_hands_receipt", + "read_file" | "directory_inventory" | "git_show", ) | ("epiphany_state", "resident_grant_lifecycle") => { Some(SUBSTRATE_GATE_SOURCE_READ_OPERATION) diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index 2783bc2a..bf00b08c 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -330,7 +330,7 @@ pub fn build_worker_model_request( .context("failed to render sealed worker reasoning projection for model input")?; let mut instructions = worker_instructions(launch_request, &launch_document); if launch_request.binding_id == epiphany_core::EPIPHANY_VERIFICATION_ROLE_BINDING_ID { - instructions.push_str("\n\nTool mandate: before returning `needs-evidence` because source files, artifact directories, command artifacts, commit diffs, Hands receipt bodies, or resident grant lifecycle are not inspectable, call the governed read-only tools available on this request. Use `mcp__epiphany_source__read_file` for cited source/artifact files, `mcp__epiphany_source__directory_inventory` for bounded workspace directory counts and bytes, `mcp__epiphany_source__git_show` for commit diffs, `mcp__epiphany_source__read_hands_receipt` for Hands patch/command/commit receipts, and `mcp__epiphany_state__resident_grant_lifecycle` for exact or bounded recent grant-owned lifecycle state. Directory totals are authoritative only when the tool reports `complete=true`. Grant launchability is authoritative only from the typed state projection, never artifact names or acknowledgement presence. If a tool fails, cite that failed tool result and the exact remaining blocker."); + instructions.push_str("\n\nTool mandate: before returning `needs-evidence` because source files, artifact directories, command artifacts, commit diffs, or resident grant lifecycle are not inspectable, call the governed read-only tools available on this request. Use `mcp__epiphany_source__read_file` for cited source/artifact files, `mcp__epiphany_source__directory_inventory` for bounded workspace directory counts and bytes, `mcp__epiphany_source__git_show` for commit diffs, and `mcp__epiphany_state__resident_grant_lifecycle` for exact or bounded recent grant-owned lifecycle state. The sealed Verification projection already contains the exact Hands patch, command, and commit receipts. Directory totals are authoritative only when the tool reports `complete=true`. Grant launchability is authoritative only from the typed state projection, never artifact names or acknowledgement presence. If a tool fails, cite that failed tool result and the exact remaining blocker."); } else if launch_request.binding_id == epiphany_core::EPIPHANY_RESEARCH_ROLE_BINDING_ID { instructions.push_str("\n\nEvidence mandate: the runtime obtains every immutable public GitHub source named by the typed Research request before this model turn and supplies the exact tool calls and receipts in the input. Cite each requested sourceRef in filesInspected and its evidenceReceiptId in evidence, preserve its contentSha256 in the finding, and report a source gap if any supplied lookup failed. Use the remaining bounded tools only for additional repository or resident-state inspection appropriate to the claim. Never substitute a branch, tag, arbitrary URL, or model memory for immutable public evidence. Directory totals are authoritative only when the inventory reports `complete=true`; grant launchability is authoritative only from the typed lifecycle projection."); } else if launch_request.binding_id == epiphany_core::EPIPHANY_MODELING_ROLE_BINDING_ID { @@ -821,20 +821,6 @@ fn repository_source_tools() -> Vec { }) .to_string(), }, - EpiphanyModelToolDefinition { - name: "mcp__epiphany_source__read_hands_receipt".to_string(), - description: "Read a typed Hands patch, command, or commit receipt body from the runtime-spine store for Soul verification.".to_string(), - parameters_json: serde_json::json!({ - "type": "object", - "additionalProperties": false, - "properties": { - "receiptId": {"type": "string"}, - "kind": {"type": "string", "enum": ["patch", "command", "commit"]} - }, - "required": ["receiptId", "kind"] - }) - .to_string(), - }, EpiphanyModelToolDefinition { name: "mcp__epiphany_state__resident_grant_lifecycle".to_string(), description: "Read grant-owned resident Self lifecycle state from the explicitly launch-bound resident store. Use an exact grantId when known or a bounded recent limit. This is observation only; terminal and launchable fields remain derived from the typed grant/state owner.".to_string(), @@ -3207,7 +3193,6 @@ mod tests { assert!(tool_names.contains(&"mcp__epiphany_source__read_file")); assert!(tool_names.contains(&"mcp__epiphany_source__directory_inventory")); assert!(tool_names.contains(&"mcp__epiphany_source__git_show")); - assert!(tool_names.contains(&"mcp__epiphany_source__read_hands_receipt")); assert!(tool_names.contains(&"mcp__epiphany_state__resident_grant_lifecycle")); assert!(!tool_names.contains(&"mcp__epiphany_public__github_file")); assert!( diff --git a/epiphany-tool-mcp-runtime/src/main.rs b/epiphany-tool-mcp-runtime/src/main.rs index 18688293..d748e402 100644 --- a/epiphany-tool-mcp-runtime/src/main.rs +++ b/epiphany-tool-mcp-runtime/src/main.rs @@ -78,7 +78,7 @@ async fn execute_to_receipt( Some(path) => path.clone(), None => std::env::current_dir()?, }; - execute_epiphany_source(intent, &options.store, &cwd) + execute_epiphany_source(intent, &cwd) } else if intent.server == "epiphany_public" { execute_epiphany_public(intent).await } else if intent.server == "epiphany_state" { diff --git a/epiphany-tool-mcp-runtime/src/native_source.rs b/epiphany-tool-mcp-runtime/src/native_source.rs index 70c19957..42bfaecf 100644 --- a/epiphany-tool-mcp-runtime/src/native_source.rs +++ b/epiphany-tool-mcp-runtime/src/native_source.rs @@ -9,7 +9,6 @@ use std::thread; pub fn execute_epiphany_source( intent: &EpiphanyToolInvocationIntent, - store: &Path, cwd: &Path, ) -> Result { let arguments: Value = @@ -21,7 +20,6 @@ pub fn execute_epiphany_source( "read_file" => read_file(cwd, &arguments), "directory_inventory" => directory_inventory(cwd, &arguments), "git_show" => git_show(cwd, &arguments), - "read_hands_receipt" => read_hands_receipt(store, &arguments), other => Err(anyhow!("unknown epiphany_source tool {other:?}")), } } @@ -220,28 +218,6 @@ fn read_retained(mut input: impl Read, limit: usize) -> Result { Ok(text) } -fn read_hands_receipt(store: &Path, arguments: &Value) -> Result { - let id = required_string(arguments, "receiptId")?; - match required_string(arguments, "kind")? { - "patch" => { - let r = epiphany_core::runtime_hands_patch_receipt(store, id)? - .ok_or_else(|| anyhow!("Hands patch receipt {id:?} not found"))?; - serde_json::to_value(r).context("encoding Hands patch receipt") - } - "command" => { - let r = epiphany_core::runtime_hands_command_receipt(store, id)? - .ok_or_else(|| anyhow!("Hands command receipt {id:?} not found"))?; - serde_json::to_value(r).context("encoding Hands command receipt") - } - "commit" => { - let r = epiphany_core::runtime_hands_commit_receipt(store, id)? - .ok_or_else(|| anyhow!("Hands commit receipt {id:?} not found"))?; - serde_json::to_value(r).context("encoding Hands commit receipt") - } - other => Err(anyhow!("unsupported Hands receipt kind {other:?}")), - } -} - fn confined_path(cwd: &Path, requested: &str) -> Result { let root = cwd .canonicalize() @@ -313,13 +289,11 @@ mod tests { r#"{"path":"body.txt","startLine":2,"maxLines":2}"#, ), dir.path(), - dir.path(), )?; assert_eq!(value["content"], "2: two\n3: three"); assert!( execute_epiphany_source( &intent("read_file", r#"{"path":"../escape"}"#), - dir.path(), dir.path() ) .is_err() @@ -347,7 +321,6 @@ mod tests { r#"{"path":"artifacts","maxDepth":2,"maxEntries":10,"maxSamples":10}"#, ), dir.path(), - dir.path(), )?; assert_eq!(value["complete"], true); assert_eq!(value["entryCount"], 4); @@ -359,7 +332,6 @@ mod tests { execute_epiphany_source( &intent("directory_inventory", r#"{"path":"../escape"}"#), dir.path(), - dir.path(), ) .is_err() ); @@ -379,7 +351,6 @@ mod tests { r#"{"path":"artifacts","maxEntries":2}"#, ), dir.path(), - dir.path(), )?; assert_eq!(value["complete"], false); assert_eq!(value["entryCount"], 2); @@ -393,7 +364,6 @@ mod tests { r#"{"path":"nested","maxDepth":0,"maxEntries":10}"#, ), dir.path(), - dir.path(), )?; assert_eq!(depth_limited["complete"], false); assert_eq!(depth_limited["depthLimitHit"], true);