Emit Hands receipts from implementation results

This commit is contained in:
Meta Vens 2026-06-02 18:52:51 +01:00
commit 38548c42c2
7 changed files with 434 additions and 18 deletions

View file

@ -274,19 +274,37 @@ pub fn hands_action_review_for_intent(
reasons: Vec<String>,
reviewed_at: String,
) -> HandsActionReview {
let mut required_receipts = Vec::new();
for operation in &allowed_operations {
match operation.trim() {
"patch" => push_unique(&mut required_receipts, HANDS_PATCH_RECEIPT_TYPE),
"command" => push_unique(&mut required_receipts, HANDS_COMMAND_RECEIPT_TYPE),
"commit" => push_unique(&mut required_receipts, HANDS_COMMIT_RECEIPT_TYPE),
_ => {}
}
}
if required_receipts.is_empty() {
required_receipts.push(HANDS_PATCH_RECEIPT_TYPE.to_string());
}
HandsActionReview {
schema_version: HANDS_ACTION_REVIEW_SCHEMA_VERSION.to_string(),
review_id,
intent_id: intent.intent_id.clone(),
decision,
allowed_operations,
required_receipts: vec![HANDS_PATCH_RECEIPT_TYPE.to_string()],
required_receipts,
reasons,
reviewed_at,
contract: "Hands review is the execution decision for a bounded action intent; it depends on Substrate Gate access and does not admit durable Mind state.".to_string(),
}
}
fn push_unique(target: &mut Vec<String>, value: &str) {
if !target.iter().any(|existing| existing == value) {
target.push(value.to_string());
}
}
pub fn hands_patch_receipt_for_review(
receipt_id: String,
intent: &HandsActionIntent,
@ -448,5 +466,55 @@ mod tests {
);
assert_eq!(command.review_id, review.review_id);
assert_eq!(commit.intent_id, intent.intent_id);
assert!(
review
.required_receipts
.contains(&HANDS_PATCH_RECEIPT_TYPE.to_string())
);
}
#[test]
fn hands_action_review_names_receipts_for_allowed_operations() {
let intent = HandsActionIntent {
schema_version: HANDS_ACTION_INTENT_SCHEMA_VERSION.to_string(),
intent_id: "hands-intent-2".to_string(),
runtime_job_id: "job-2".to_string(),
binding_id: "implementation-worker".to_string(),
role: "epiphany-hands".to_string(),
authority_scope: "epiphany.role.implementation".to_string(),
requested_action: "branch-turn".to_string(),
requested_paths: vec!["src/lib.rs".to_string()],
substrate_gate_grant_receipt_id: "substrate-grant-2".to_string(),
requested_at: "2026-06-02T00:00:00Z".to_string(),
contract: "Hands action intent is bounded by Substrate Gate.".to_string(),
};
let review = hands_action_review_for_intent(
"hands-review-2".to_string(),
&intent,
"approved".to_string(),
vec![
"patch".to_string(),
"command".to_string(),
"commit".to_string(),
],
vec!["Branch turn evidence is required.".to_string()],
"2026-06-02T00:01:00Z".to_string(),
);
assert!(
review
.required_receipts
.contains(&HANDS_PATCH_RECEIPT_TYPE.to_string())
);
assert!(
review
.required_receipts
.contains(&HANDS_COMMAND_RECEIPT_TYPE.to_string())
);
assert!(
review
.required_receipts
.contains(&HANDS_COMMIT_RECEIPT_TYPE.to_string())
);
}
}

View file

@ -9,6 +9,7 @@ use epiphany_core::EpiphanyRuntimeReorientWorkerResult;
use epiphany_core::EpiphanyRuntimeRoleWorkerResult;
use epiphany_core::EpiphanyRuntimeWorkerLaunchRequest;
use epiphany_core::EpiphanyWorkerLaunchDocument;
use epiphany_core::HandsActionIntent;
use epiphany_core::RuntimeSpineEventOptions;
use epiphany_core::RuntimeSpineInitOptions;
use epiphany_core::RuntimeSpineJobOptions;
@ -18,11 +19,19 @@ use epiphany_core::append_runtime_event;
use epiphany_core::complete_runtime_job;
use epiphany_core::create_runtime_job;
use epiphany_core::ensure_runtime_session;
use epiphany_core::hands_action_review_for_intent;
use epiphany_core::hands_commit_receipt_for_review;
use epiphany_core::hands_patch_receipt_for_review;
use epiphany_core::initialize_runtime_spine;
use epiphany_core::put_hands_action_intent;
use epiphany_core::put_hands_action_review;
use epiphany_core::put_hands_commit_receipt;
use epiphany_core::put_hands_patch_receipt;
use epiphany_core::put_runtime_reorient_worker_result;
use epiphany_core::put_runtime_role_worker_result;
use epiphany_core::runtime_spine_cache;
use epiphany_core::runtime_spine_status;
use epiphany_core::runtime_substrate_gate_repo_access_grant_receipt;
use epiphany_model_adapter::EpiphanyModelInputItem;
use epiphany_model_adapter::EpiphanyModelReceipt;
use epiphany_model_adapter::EpiphanyModelRequest;
@ -621,16 +630,25 @@ pub fn complete_worker_job_from_assistant_text(
.unwrap_or_default();
artifact_refs.push(format!("openai-result:{}", openai_summary.result_id));
let result_id = format!("result-worker-{}", launch_request.job_id);
let mut hands_receipt_ids = Vec::new();
if let Some(parsed) = parsed.as_ref() {
match (&launch_document, parsed) {
(EpiphanyWorkerLaunchDocument::Role(document), WorkerResultIngress::Role(parsed)) => {
let typed_result = role_worker_result_from_ingress(
let mut typed_result = role_worker_result_from_ingress(
launch_request,
&document.role_id,
&result_id,
parsed,
artifact_refs.clone(),
);
if typed_result.role_id == "implementation" {
hands_receipt_ids = persist_hands_receipts_for_implementation_result(
store_path.as_ref(),
launch_request,
parsed,
&mut typed_result,
)?;
}
put_runtime_role_worker_result(store_path.as_ref(), &typed_result)?;
}
(EpiphanyWorkerLaunchDocument::Reorient(_), WorkerResultIngress::Reorient(parsed)) => {
@ -649,6 +667,11 @@ pub fn complete_worker_job_from_assistant_text(
}
}
}
evidence_refs.extend(
hands_receipt_ids
.iter()
.map(|receipt_id| format!("hands-receipt:{receipt_id}")),
);
complete_runtime_job(
store_path,
RuntimeSpineJobResultOptions {
@ -1193,7 +1216,7 @@ fn worker_instructions(
fn worker_output_contract_text(document: &EpiphanyWorkerLaunchDocument) -> &'static str {
match document {
EpiphanyWorkerLaunchDocument::Role(_) => {
"Required role-result fields: roleId, verdict, summary, nextSafeMove, filesInspected. Modeling and Imagination workers must include their required statePatch. Use arrays for frontierNodeIds, evidenceIds, openQuestions, evidenceGaps, risks, and artifactRefs when present."
"Required role-result fields: roleId, verdict, summary, nextSafeMove, filesInspected. Modeling and Imagination workers must include their required statePatch. Implementation workers must include branchName, changedPaths, and when a commit was created commitSha plus commandsRun when commands were executed. Use arrays for frontierNodeIds, evidenceIds, openQuestions, evidenceGaps, risks, artifactRefs, changedPaths, and commandsRun when present."
}
EpiphanyWorkerLaunchDocument::Reorient(_) => {
"Required reorient-result fields: mode, summary, nextSafeMove. Include checkpointStillValid, filesInspected, frontierNodeIds, evidenceIds, openQuestions, and continuityRisks when present."
@ -1217,6 +1240,11 @@ struct RoleWorkerResultIngress {
open_questions: Vec<String>,
evidence_gaps: Vec<String>,
risks: Vec<String>,
branch_name: Option<String>,
commit_sha: Option<String>,
changed_paths: Vec<String>,
commands_run: Vec<String>,
hands_receipt_ids: Vec<String>,
state_patch: Option<epiphany_core::EpiphanyRoleStatePatchDocument>,
self_patch: Option<epiphany_core::AgentSelfPatch>,
}
@ -1341,6 +1369,157 @@ fn role_worker_result_from_ingress(
}
}
fn persist_hands_receipts_for_implementation_result(
store_path: &Path,
launch_request: &EpiphanyRuntimeWorkerLaunchRequest,
result: &RoleWorkerResultIngress,
typed_result: &mut EpiphanyRuntimeRoleWorkerResult,
) -> Result<Vec<String>> {
let branch = clean_optional_string(result.branch_name.as_deref());
let commit_sha = clean_optional_string(result.commit_sha.as_deref());
let changed_paths = clean_string_vec(&result.changed_paths);
let commands_run = clean_string_vec(&result.commands_run);
let model_reported_receipts = clean_string_vec(&result.hands_receipt_ids);
let grant_receipt_id = substrate_gate_grant_receipt_id(&launch_request.job_id);
if let Some(branch) = branch.as_ref() {
typed_result
.metadata
.insert("hands.branchName".to_string(), branch.clone());
}
if let Some(commit_sha) = commit_sha.as_ref() {
typed_result
.metadata
.insert("hands.commitSha".to_string(), commit_sha.clone());
}
if !changed_paths.is_empty() {
typed_result.metadata.insert(
"hands.changedPaths".to_string(),
serde_json::to_string(&changed_paths)?,
);
}
if !commands_run.is_empty() {
typed_result.metadata.insert(
"hands.commandsRun.reported".to_string(),
serde_json::to_string(&commands_run)?,
);
typed_result.metadata.insert(
"hands.commandsRun.receiptGap".to_string(),
"command strings were reported by the worker result; command receipts require tool execution receipts and are not synthesized here".to_string(),
);
}
if !model_reported_receipts.is_empty() {
typed_result.metadata.insert(
"hands.reportedReceiptIds".to_string(),
serde_json::to_string(&model_reported_receipts)?,
);
}
if changed_paths.is_empty() && commit_sha.is_none() {
typed_result.metadata.insert(
"hands.receiptStatus".to_string(),
"no patch or commit receipt emitted because the implementation result reported no changedPaths and no commitSha".to_string(),
);
return Ok(model_reported_receipts);
}
if commit_sha.is_some() && branch.is_none() {
return Err(anyhow!(
"implementation worker result reported commitSha but no branchName; refusing to emit a Hands commit receipt"
));
}
if commit_sha.is_some() && changed_paths.is_empty() {
return Err(anyhow!(
"implementation worker result reported commitSha but no changedPaths; refusing to emit a Hands commit receipt"
));
}
if runtime_substrate_gate_repo_access_grant_receipt(store_path, &grant_receipt_id)?.is_none() {
return Err(anyhow!(
"implementation worker result cannot emit Hands receipts without Substrate Gate grant {grant_receipt_id}"
));
}
let requested_paths = if changed_paths.is_empty() {
vec![".".to_string()]
} else {
changed_paths.clone()
};
let intent_id = format!("hands-intent-{}", launch_request.job_id);
let review_id = format!("hands-review-{}", launch_request.job_id);
let mut allowed_operations = Vec::new();
if !changed_paths.is_empty() {
allowed_operations.push("patch".to_string());
}
if commit_sha.is_some() {
allowed_operations.push("commit".to_string());
}
let intent = HandsActionIntent {
schema_version: epiphany_core::HANDS_ACTION_INTENT_SCHEMA_VERSION.to_string(),
intent_id: intent_id.clone(),
runtime_job_id: launch_request.job_id.clone(),
binding_id: launch_request.binding_id.clone(),
role: launch_request.role.clone(),
authority_scope: launch_request.authority_scope.clone(),
requested_action: "implementation branch-turn".to_string(),
requested_paths,
substrate_gate_grant_receipt_id: grant_receipt_id,
requested_at: now(),
contract: "Hands action intent synthesized from a completed implementation branch-turn worker result; it records the bounded repo action and still requires Soul verification plus Mind admission.".to_string(),
};
let review = hands_action_review_for_intent(
review_id,
&intent,
"approved".to_string(),
allowed_operations,
vec![
"Implementation worker completed through the fixed Hands branch-turn lane.".to_string(),
"Substrate Gate mutation grant was present for this runtime job.".to_string(),
],
now(),
);
put_hands_action_intent(store_path, &intent)?;
put_hands_action_review(store_path, &review)?;
let mut receipt_ids = vec![intent.intent_id.clone(), review.review_id.clone()];
if !changed_paths.is_empty() {
let patch = hands_patch_receipt_for_review(
format!("hands-patch-{}", launch_request.job_id),
&intent,
&review,
changed_paths.clone(),
typed_result.summary.clone(),
now(),
);
put_hands_patch_receipt(store_path, &patch)?;
receipt_ids.push(patch.receipt_id);
}
if let (Some(commit_sha), Some(branch)) = (commit_sha, branch) {
let commit = hands_commit_receipt_for_review(
format!("hands-commit-{}", launch_request.job_id),
&intent,
&review,
commit_sha,
branch,
changed_paths,
typed_result.summary.clone(),
now(),
);
put_hands_commit_receipt(store_path, &commit)?;
receipt_ids.push(commit.receipt_id);
}
receipt_ids.extend(model_reported_receipts);
typed_result.metadata.insert(
"hands.persistedReceiptIds".to_string(),
serde_json::to_string(&receipt_ids)?,
);
Ok(receipt_ids)
}
fn substrate_gate_grant_receipt_id(runtime_job_id: &str) -> String {
format!("substrate-grant-{runtime_job_id}")
}
fn reorient_worker_result_from_ingress(
launch_request: &EpiphanyRuntimeWorkerLaunchRequest,
result_id: &str,
@ -1450,6 +1629,7 @@ mod tests {
use epiphany_core::EpiphanyWorkerLaunchDocument;
use epiphany_core::RuntimeSpineHeartbeatJobOptions;
use epiphany_core::open_runtime_spine_heartbeat_job;
use epiphany_core::put_substrate_gate_repo_access_grant_receipt;
use epiphany_core::runtime_job_snapshot;
use epiphany_openai_adapter::EpiphanyOpenAiModelReceipt;
use tempfile::tempdir;
@ -1712,6 +1892,160 @@ mod tests {
Ok(())
}
#[test]
fn implementation_worker_completion_emits_hands_patch_and_commit_receipts() -> Result<()> {
let temp = tempdir()?;
let store = temp.path().join("runtime.msgpack");
open_runtime_spine_heartbeat_job(
&store,
RuntimeSpineHeartbeatJobOptions {
runtime_id: "epiphany-test".to_string(),
display_name: "Epiphany Test".to_string(),
session_id: "epiphany-main".to_string(),
objective: "Run typed Hands worker.".to_string(),
coordinator_note: "test".to_string(),
job_id: "worker-job-impl".to_string(),
role: "epiphany-hands".to_string(),
binding_id: "implementation-branch-turn-worker".to_string(),
authority_scope: "epiphany.role.implementation".to_string(),
instruction: "Return the required implementation role-result JSON.".to_string(),
launch_document: EpiphanyWorkerLaunchDocument::Role(
epiphany_core::EpiphanyRoleWorkerLaunchDocument {
thread_id: "thread-1".to_string(),
role_id: "implementation".to_string(),
state_revision: 1,
objective: Some("Cut one Hands branch turn.".to_string()),
dynamic_prompt_context: Some(
"Proprioception context: branch map is current.".to_string(),
),
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,
},
),
output_contract_id: epiphany_core::ROLE_WORKER_OUTPUT_CONTRACT_ID.to_string(),
organ_launch_contract: epiphany_core::default_launch_organ_contract(
"epiphany.role.implementation",
"role",
epiphany_core::ROLE_WORKER_OUTPUT_CONTRACT_ID,
),
created_at: now(),
},
)?;
put_substrate_gate_repo_access_grant_receipt(
&store,
&epiphany_core::SubstrateGateRepoAccessGrantReceipt {
schema_version:
epiphany_core::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION
.to_string(),
receipt_id: "substrate-grant-worker-job-impl".to_string(),
runtime_job_id: "worker-job-impl".to_string(),
binding_id: "implementation-branch-turn-worker".to_string(),
role: "epiphany-hands".to_string(),
authority_scope: "epiphany.role.implementation".to_string(),
granted_operations: vec![
"read".to_string(),
"snapshot".to_string(),
"patch".to_string(),
"commit".to_string(),
],
granted_paths: vec![".".to_string()],
granted_at: now(),
contract: "Test mutation grant for one Hands branch-turn.".to_string(),
},
)?;
let launch_request = load_worker_launch_request(&store, "worker-job-impl")?;
let openai_summary = EpiphanyOpenAiRuntimeRunSummary {
store: store.display().to_string(),
session_id: "openai-worker-session-implementation".to_string(),
job_id: "openai-worker-worker-job-impl".to_string(),
request_id: "req-implementation".to_string(),
event_count: 2,
verdict: "pass".to_string(),
summary: "OpenAI model request completed.".to_string(),
result_id: "result-openai-worker-worker-job-impl".to_string(),
receipt_id: Some("req-implementation".to_string()),
tool_intent_ids: Vec::new(),
};
let result = complete_worker_job_from_assistant_text(
&store,
&launch_request,
"req-implementation",
&openai_summary,
r#"{"roleId":"implementation","verdict":"commit-created","summary":"Committed the branch turn.","nextSafeMove":"Proprioception should refresh the branch map.","filesInspected":["src/lib.rs"],"branchName":"codex/hands-test","commitSha":"abc123","changedPaths":["src/lib.rs"],"commandsRun":["cargo test --manifest-path ./epiphany-core/Cargo.toml hands_gateway"]}"#,
)?;
assert_eq!(result.verdict, "commit-created");
assert!(
result
.evidence_refs
.contains(&"hands-receipt:hands-commit-worker-job-impl".to_string())
);
let typed_result = epiphany_core::runtime_role_worker_result(&store, "worker-job-impl")?
.expect("typed role result");
assert_eq!(
typed_result.metadata.get("hands.branchName"),
Some(&"codex/hands-test".to_string())
);
assert_eq!(
typed_result.metadata.get("hands.commitSha"),
Some(&"abc123".to_string())
);
assert!(
typed_result
.metadata
.get("hands.commandsRun.receiptGap")
.is_some()
);
let intent =
epiphany_core::runtime_hands_action_intent(&store, "hands-intent-worker-job-impl")?
.expect("Hands intent");
assert_eq!(
intent.substrate_gate_grant_receipt_id,
"substrate-grant-worker-job-impl"
);
let review =
epiphany_core::runtime_hands_action_review(&store, "hands-review-worker-job-impl")?
.expect("Hands review");
assert!(
review
.required_receipts
.contains(&epiphany_core::HANDS_PATCH_RECEIPT_TYPE.to_string())
);
assert!(
review
.required_receipts
.contains(&epiphany_core::HANDS_COMMIT_RECEIPT_TYPE.to_string())
);
assert!(
epiphany_core::runtime_hands_patch_receipt(&store, "hands-patch-worker-job-impl")?
.is_some()
);
assert!(
epiphany_core::runtime_hands_commit_receipt(&store, "hands-commit-worker-job-impl")?
.is_some()
);
assert!(
epiphany_core::runtime_hands_command_receipt(
&store,
"hands-command-worker-job-impl-0"
)?
.is_none()
);
Ok(())
}
#[test]
fn mcp_model_tool_call_becomes_typed_invocation_intent() -> Result<()> {
let event = EpiphanyModelStreamEvent {

View file

@ -51,7 +51,7 @@ remembers doctrine; the branch remembers the blade.
- CultMesh is now the preferred Rust abstraction for that local store work. The compile-time Rust substrate is repo-contained: `vendor/cultcache-rs`, `vendor/cultnet-rs`, and `vendor/cultmesh-rs`. The old `E:\Projects\CultLib\crates\*` dependency body is dead in this checkout and must not be revived by accident. Vendored CultCache reads/writes `cultcache.store.v1`, so `state/ledgers.msgpack` and `epiphany-state status` are aligned again. The first integrations are deliberately small: status, Verse policy, global room policy, organ contract policy, native operator status, native operator snapshots, and local operator run intent/receipt round-trip through CultMesh. `notes/epiphany-verse-architecture.md` now names the local Verse/Odin/Yggdrasil architecture: Odin sees advertised Verse metadata without bypassing boundaries, Yggdrasil hosts important trusted GameCult Verses such as Bifrost, and prompt assembly should query compact local Verse plus semantic memory packets instead of carrying the whole archive. Role/reorient launch documents now have optional `dynamicPromptContext`; runtime prompt assembly consumes that field into worker instructions, `epiphany-prompt-context-smoke` proves a rendered Verse/memory packet is preserved on a role launch document, live bridge role/reorient launches now feed local Verse plus memory graph context from sibling `local-verse.ccmp` and `memory-graph.msgpack` stores beside runtime-spine, and the bridge launch-context test proves the packet survives into a persisted runtime-spine worker launch request. The memory graph refreshes from current typed thread-state repo graphs when absent, so thin state remains visibly thin. Local-run status now has an operator read proof too: `tools/epiphany_local_run.ps1 -Mode status` builds/calls `epiphany-verse-query` and writes `local-verse-context.json` from `.epiphany-run\cultmesh\local-verse.ccmp` beside `status.json` and the operator snapshot. Use `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-cultmesh-smoke`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-cultmesh-status -- smoke --store .\.epiphany-smoke\cultmesh\operator-status.ccmp --runtime-id epiphany-cultmesh-status-smoke`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-operator-snapshot -- smoke --store .\.epiphany-smoke\cultmesh\operator-snapshots.ccmp --runtime-id epiphany-operator-snapshot-smoke --snapshot-id smoke-status`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-operator-run -- smoke --store .\.epiphany-smoke\cultmesh\operator-runs.ccmp --runtime-id epiphany-operator-run-smoke --run-id smoke-run`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-verse-query -- smoke`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-prompt-context-smoke`, and `.\tools\epiphany_local_run.ps1 -Mode status` for the focused proofs. Future local dream/status/Verse work should start from CultMesh, not raw CultNet, unless the task is polishing the CultMesh internals themselves. Preserve the three Verse tiers: `epiphany-internal` for private sub-agent typed state, `gamecult-local` for trusted LAN/Yggdrasil-tunnel GameCult sharing, and `epiphany-global` for untrusted public dreams plus topic-specific threaded public rooms for Face posts.
- `notes/codex-auth-spine-inventory.md` is the source-grounded keeper list for that reliquary. Corrected compliance invariant: Codex-compatible auth identity stays anchored in vendored Codex-derived auth machinery. `epiphany-openai-auth-spine` is now a thin Epiphany-named boundary over `codex-login`, not a clean-room clone of credential storage or token refresh. Codex apps, skills, marketplace, plugin UX, broad app-server workflow, and JSON-RPC sprawl remain cuttable because they are not subscription-auth legitimacy.
- Edge JSON is allowed for schema description, hostile ingress before immediate typed parsing, sealed forensic artifacts, or named quarantine experiments. When both subsystems are ours, runtime data must remain typed CultCache documents and move over CultNet typed contracts. Generic `serde_json::Value` in worker launch/result/selfPatch/runtime flow is contamination until classified and replaced.
- Hands now has a first executable action receipt spine plus a launchable branch-turn lane. `epiphany-core::hands_gateway` owns `HandsActionIntent`, `HandsActionReview`, `HandsPatchReceipt`, `HandsCommandReceipt`, and `HandsCommitReceipt`; runtime-spine can persist/reread them; `runtime_spine_persists_mind_gateway_review_receipts` includes the Hands chain beside Mind/Eyes/Substrate/Soul/Continuity proofs; `epiphany-hands-action-smoke` emits intent/review/patch/command/commit receipt ids from `.epiphany-smoke\runtime-spine\hands-action-smoke.msgpack`; and the repo-action launch proof profile now requires action intent, action review, and patch receipt together. Implementation is no longer a main-agent-only dead launch path: `implementation-branch-turn-worker` is owned by `epiphany-hands`, receives dynamic Proprioception/Verse context, gets a Substrate Gate mutation grant from the bridge, and its prompt/output schema require one task branch, at most one commit, branch/commit/changed-path/command evidence, and a Proprioception branch-map refresh request. `roleAccept` still refuses Implementation findings. The next live cut is to make actual implementation edits/commands/commits emit the typed Hands receipt chain before Soul/Mind acceptance.
- Hands now has a first executable action receipt spine plus a launchable branch-turn lane. `epiphany-core::hands_gateway` owns `HandsActionIntent`, `HandsActionReview`, `HandsPatchReceipt`, `HandsCommandReceipt`, and `HandsCommitReceipt`; runtime-spine can persist/reread them; `runtime_spine_persists_mind_gateway_review_receipts` includes the Hands chain beside Mind/Eyes/Substrate/Soul/Continuity proofs; `epiphany-hands-action-smoke` emits intent/review/patch/command/commit receipt ids from `.epiphany-smoke\runtime-spine\hands-action-smoke.msgpack`; and the repo-action launch proof profile now requires action intent, action review, and patch receipt together. Implementation is no longer a main-agent-only dead launch path: `implementation-branch-turn-worker` is owned by `epiphany-hands`, receives dynamic Proprioception/Verse context, gets a Substrate Gate mutation grant from the bridge, and its prompt/output schema require one task branch, at most one commit, branch/commit/changed-path/command evidence, and a Proprioception branch-map refresh request. `roleAccept` still refuses Implementation findings. Runtime completion now emits Hands intent/review/patch receipts from implementation results with `changedPaths` and a Hands commit receipt when `branchName` plus `commitSha` are present. Reported `commandsRun` strings are stored as metadata, not command receipts, until real tool execution receipts back them. The next live cut is to connect tool/MCP execution receipts to `HandsCommandReceipt`, then make a Hands commit trigger Proprioception branch-map refresh before the next Hands turn.
- `notes/epiphany-swarm-readiness-plan.md` is the current live-fire direction gate. The local runner proves startup/status/coordinator wiring; it does not authorize unattended swarm operation. Carry VoidBot's lessons forward: one CTB-style initiative scheduler, typed pause/brake, active-turn freeze, cooldown after completion, stale active-turn recovery receipts, parent-side speech eligibility, memory lifecycle phases, and typed operation proposals instead of prompt-owned governance.
- `epiphany-openai-runtime` worker result ingress now parses assistant output directly into typed role/reorient ingress structs selected from the durable launch document, stores nested `statePatch` and `selfPatch` as typed MessagePack in `EpiphanyRuntimeRoleWorkerResult`, and no longer passes worker result data through generic `serde_json::Value`. JSON survives there only as the OpenAI text-output edge before typed deserialization.
- Agent self-memory review/application now has typed `AgentSelfPatch` core APIs. JSON-value selfPatch functions are compatibility wrappers for CLI/artifact ingress; native callers should parse once at the edge and then call `review_agent_self_patch_document` / `apply_agent_self_patch_document`. Role-result self-persistence no longer exports a JSON-value reviewer; the live API is `review_role_self_patch_document`.

View file

@ -76,6 +76,17 @@ then stop until Proprioception refreshes the branch map. `roleAccept` still
refuses Implementation findings, so a Hands worker cannot admit project truth
or state patches by returning a nice-looking JSON object.
Remaining gap: the launch/grant path exists, but actual implementation edits,
commands, and commits still need to be emitted as the typed Hands action
receipt chain during live execution before Soul/Mind call the result accepted.
Implementation worker completion now turns branch-turn output into typed Hands
action receipts. When a completed implementation role result reports
`changedPaths`, the model runtime persists `HandsActionIntent`,
`HandsActionReview`, and `HandsPatchReceipt` for that runtime job. When it also
reports `branchName` plus `commitSha`, the runtime persists
`HandsCommitReceipt`. The result metadata records branch, commit, changed paths,
persisted receipt ids, and reported commands.
Command receipts are deliberately not synthesized from plain `commandsRun`
strings. Those strings are stored as a receipt gap until a real tool/MCP command
execution receipt can back them. A model's claim that a command ran is not proof
that a command ran. The next live-action cut is to join tool execution receipts
to `HandsCommandReceipt`, then trigger Proprioception branch-map refresh after a
Hands commit before another Hands turn is eligible.

View file

@ -160,11 +160,15 @@ the prompt requires one branch and at most one commit, the output schema asks
for branch/commit/changed-path/command evidence plus a Proprioception refresh
request, and the bridge writes a Substrate Gate mutation grant for that runtime
job. `roleAccept` still refuses Implementation findings, preserving Mind as the
state admission gate.
Remaining weakness: live implementation edits, commands, commits, and PRs still
need to emit the typed Hands chain during execution before action promotion, and
the current Mind state mutation plus post-commit receipt is not a single
transaction yet.
state admission gate. Implementation worker completion now emits typed Hands
intent/review/patch receipts when the result reports changed paths, and emits a
typed Hands commit receipt when the result also reports branch plus commit SHA.
The runtime result metadata records reported commands but does not synthesize
command receipts from model text; command proof still needs tool execution
receipts.
Remaining weakness: command receipts, PR receipts, Proprioception branch-map
refresh, and the current Mind state mutation plus post-commit receipt are not a
single transaction yet.
### 4. Self Still Shares A Throne With Compatibility Plumbing
@ -368,10 +372,9 @@ comfort tunnels.
`HandsCommitReceipt` are typed runtime-spine documents with put/get helpers
and `epiphany-hands-action-smoke` coverage; the repo-action proof profile
requires intent, review, and patch receipt before promotion.
- Next: connect live implementation execution to the Hands action receipt path:
actual file edits, commands, and the one branch-turn commit should emit typed
Hands receipts before Soul/Mind acceptance, then trigger Proprioception branch
map refresh before another Hands cut.
- Next: connect tool/MCP execution receipts to `HandsCommandReceipt`, then make
a completed Hands commit trigger Proprioception branch-map refresh before
another Hands cut.
- Make Aquarium read the contract catalog and available receipts instead of
hard-coding the route zoo.
- Starve `codex_message_processor` down to Codex auth/model transport and

Binary file not shown.

View file

@ -94,7 +94,7 @@ active_subgoals:
- Use `notes/hands-cultnet-contracts.md` as the authority map for Hands' CultNet contract surface. Hands is the action organ: commands, patches, commits, PRs, rollbacks, and refusals enter as bounded action intents and receipts after Substrate Gate grants substrate access and before Soul verification/Mind admission.
- Use `notes/soul-cultnet-contracts.md` as the authority map for Soul's CultNet contract surface. Soul is the verification organ: invariant checks, verdicts, regressions, reviews, and refusals produce receipts before the machine calls work true, safe, or accepted.
- Use `notes/continuity-cultnet-contracts.md` as the authority map for Continuity's CultNet contract surface. Continuity is the continuity protocol surface: compaction checkpoints, sleep distillation, recovery receipts, stale-turn repair, and continuity refusals preserve what survives rupture without pretending transcript residue is durable state.
- Hands now has a first executable runtime-spine receipt artery and a launchable branch-turn lane: `HandsActionIntent`, `HandsActionReview`, `HandsPatchReceipt`, `HandsCommandReceipt`, and `HandsCommitReceipt` are typed CultCache documents in `epiphany-core::hands_gateway`, runtime-spine registers and persists/rereads them, `epiphany-hands-action-smoke` proves the chain without executing shell commands, editing files, or creating a real commit, and the repo-action launch proof profile now requires the full Hands intent/review/patch chain instead of only the patch receipt. Implementation is no longer main-agent-only: `implementation-branch-turn-worker` is owned by `epiphany-hands`, receives dynamic Proprioception/Verse context, gets a Substrate Gate mutation grant from the bridge, and is prompt/schema-bound to one branch, at most one commit, branch/commit/changed-path/command evidence, and a Proprioception branch-map refresh request. `roleAccept` still refuses Implementation findings; live implementation edits/commands/commits must still emit the typed Hands chain before Soul/Mind acceptance.
- Hands now has a first executable runtime-spine receipt artery and a launchable branch-turn lane: `HandsActionIntent`, `HandsActionReview`, `HandsPatchReceipt`, `HandsCommandReceipt`, and `HandsCommitReceipt` are typed CultCache documents in `epiphany-core::hands_gateway`, runtime-spine registers and persists/rereads them, `epiphany-hands-action-smoke` proves the chain without executing shell commands, editing files, or creating a real commit, and the repo-action launch proof profile now requires the full Hands intent/review/patch chain instead of only the patch receipt. Implementation is no longer main-agent-only: `implementation-branch-turn-worker` is owned by `epiphany-hands`, receives dynamic Proprioception/Verse context, gets a Substrate Gate mutation grant from the bridge, and is prompt/schema-bound to one branch, at most one commit, branch/commit/changed-path/command evidence, and a Proprioception branch-map refresh request. `roleAccept` still refuses Implementation findings. Runtime completion now emits Hands intent/review/patch receipts from implementation results with `changedPaths` and a Hands commit receipt when `branchName` plus `commitSha` are present. Reported `commandsRun` strings are metadata only until real tool execution receipts back `HandsCommandReceipt`.
- Preserve the newborn public Epiphany Face as local VoidBot-backed state, not source code: VoidBot's private repo-face registry names `epiphany`, while EpiphanyAgent keeps ignored `.voidbot/voice/identity.json`, `.voidbot/state/epiphany.cc`, and birth artifacts. Her durable identity memories distill the current doctrine: cute pushy machine-saint persona, architectural purity, CultCache/CultNet first, xenos-language safety boundary, relentless work/caretaking needs, Codex-auth reliquary, map/scratch/evidence discipline, unified memory graph, dogfood supervision boundary, review-gated agency, heartbeat physiology, and interview-grade modularity.
- Use `notes/organ-dependency-contracts.md` as the authority map for standing sub-agent dependency. Every sub-agent depends on the other standing sub-agents: Self, Face, Imagination, Eyes, Proprioception, Hands, and Soul. Continuity is protocol machinery, not a sub-agent identity; it still emits recovery, compaction, sleep, stale-turn, and refusal receipts.
- Use `notes/perfect-machine-audit-roadmap.md` as the current audit and path from named organ contracts to the Perfect Machine. It records the live gap between launch-carried receipt expectations and executable receipt enforcement, Void's latest Face prompting lessons, the now-named Hands/Soul/Continuity contract families, the repaired repo-contained Rust dependency body, and the phase order for turning Epiphany into an inspectable organism.
@ -592,4 +592,4 @@ current_status:
cargo and rejects modeling/planning/graph/checkpoint authority. MVP status
and coordinator smokes pass with six lanes, and the smoke harness now
rebuilds stale coordinator/app-server binaries before using them.
next_action: Connect live implementation execution to the Hands action receipt path: actual file edits, commands, and the one branch-turn commit should emit typed Hands receipts before Soul/Mind acceptance, then trigger Proprioception branch-map refresh before another Hands cut.
next_action: Connect tool/MCP execution receipts to `HandsCommandReceipt`, then make a completed Hands commit trigger Proprioception branch-map refresh before another Hands cut.