From 8e70640b9f9e73ef4655477cd7799ea6c45d4c29 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 2 Jun 2026 14:31:41 +0100 Subject: [PATCH] Persist Hands action receipt chain --- .../src/bin/epiphany-hands-action-smoke.rs | 98 +++++++++++ epiphany-core/src/hands_gateway.rs | 156 ++++++++++++++++++ epiphany-core/src/lib.rs | 6 + epiphany-core/src/runtime_spine.rs | 141 ++++++++++++++++ notes/epiphany-fork-implementation-plan.md | 2 +- notes/fresh-workspace-handoff.md | 1 + notes/hands-cultnet-contracts.md | 20 +++ notes/perfect-machine-audit-roadmap.md | 20 ++- state/ledgers.msgpack | Bin 174306 -> 174607 bytes state/map.yaml | 3 +- 10 files changed, 439 insertions(+), 8 deletions(-) create mode 100644 epiphany-core/src/bin/epiphany-hands-action-smoke.rs diff --git a/epiphany-core/src/bin/epiphany-hands-action-smoke.rs b/epiphany-core/src/bin/epiphany-hands-action-smoke.rs new file mode 100644 index 00000000..8044991f --- /dev/null +++ b/epiphany-core/src/bin/epiphany-hands-action-smoke.rs @@ -0,0 +1,98 @@ +use anyhow::Result; +use epiphany_core::HANDS_ACTION_INTENT_SCHEMA_VERSION; +use epiphany_core::HandsActionIntent; +use epiphany_core::RuntimeSpineInitOptions; +use epiphany_core::hands_action_review_for_intent; +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_patch_receipt; +use epiphany_core::runtime_hands_action_intent; +use epiphany_core::runtime_hands_action_review; +use epiphany_core::runtime_hands_patch_receipt; +use serde_json::json; +use std::path::PathBuf; + +fn main() -> Result<()> { + let store = PathBuf::from(".epiphany-smoke") + .join("runtime-spine") + .join("hands-action-smoke.msgpack"); + + initialize_runtime_spine( + &store, + RuntimeSpineInitOptions { + runtime_id: "epiphany-hands-action-smoke".to_string(), + display_name: "Epiphany Hands Action Smoke".to_string(), + created_at: "2026-06-02T00:00:00Z".to_string(), + }, + )?; + + let intent = HandsActionIntent { + schema_version: HANDS_ACTION_INTENT_SCHEMA_VERSION.to_string(), + intent_id: "hands-intent-smoke".to_string(), + runtime_job_id: "job-implementation-smoke".to_string(), + binding_id: "implementation-worker".to_string(), + role: "epiphany-hands".to_string(), + authority_scope: "epiphany.role.implementation".to_string(), + requested_action: "patch".to_string(), + requested_paths: vec!["tools/epiphany_local_run.ps1".to_string()], + substrate_gate_grant_receipt_id: "substrate-grant-smoke".to_string(), + requested_at: "2026-06-02T00:00:10Z".to_string(), + contract: "Smoke intent proves Hands action starts as typed runtime-spine state." + .to_string(), + }; + put_hands_action_intent(&store, &intent)?; + + let review = hands_action_review_for_intent( + "hands-review-smoke".to_string(), + &intent, + "approved".to_string(), + vec!["patch".to_string()], + vec![ + "Substrate Gate grant id is named; this smoke does not execute the patch.".to_string(), + ], + "2026-06-02T00:00:20Z".to_string(), + ); + put_hands_action_review(&store, &review)?; + + let patch = hands_patch_receipt_for_review( + "hands-patch-smoke".to_string(), + &intent, + &review, + vec!["tools/epiphany_local_run.ps1".to_string()], + "Recorded a typed patch receipt for the bounded Hands action path.".to_string(), + "2026-06-02T00:00:30Z".to_string(), + ); + put_hands_patch_receipt(&store, &patch)?; + + let stored_intent = + runtime_hands_action_intent(&store, "hands-intent-smoke")?.expect("stored Hands intent"); + let stored_review = + runtime_hands_action_review(&store, "hands-review-smoke")?.expect("stored Hands review"); + let stored_patch = + runtime_hands_patch_receipt(&store, "hands-patch-smoke")?.expect("stored Hands patch"); + + if stored_review.intent_id != stored_intent.intent_id { + anyhow::bail!("Hands review lost its intent edge"); + } + if stored_patch.intent_id != stored_intent.intent_id + || stored_patch.review_id != stored_review.review_id + { + anyhow::bail!("Hands patch receipt lost its intent/review edge"); + } + + println!( + "{}", + serde_json::to_string_pretty(&json!({ + "status": "ok", + "store": store, + "intentId": stored_intent.intent_id, + "reviewId": stored_review.review_id, + "patchReceiptId": stored_patch.receipt_id, + "changedPaths": stored_patch.changed_paths, + }))? + ); + + Ok(()) +} diff --git a/epiphany-core/src/hands_gateway.rs b/epiphany-core/src/hands_gateway.rs index ff955f66..8da42b00 100644 --- a/epiphany-core/src/hands_gateway.rs +++ b/epiphany-core/src/hands_gateway.rs @@ -1,3 +1,4 @@ +use cultcache_rs::DatabaseEntry; use serde::Deserialize; use serde::Serialize; @@ -19,6 +20,81 @@ pub const HANDS_ROLLBACK_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.rollback pub const HANDS_ACTION_REFUSAL_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.action_refusal_receipt.v0"; +#[derive(Debug, Clone, PartialEq, Eq, DatabaseEntry)] +#[cultcache(type = "epiphany.hands.action_intent", schema = "HandsActionIntent")] +pub struct HandsActionIntent { + #[cultcache(key = 0)] + pub schema_version: String, + #[cultcache(key = 1)] + pub intent_id: String, + #[cultcache(key = 2)] + pub runtime_job_id: String, + #[cultcache(key = 3)] + pub binding_id: String, + #[cultcache(key = 4)] + pub role: String, + #[cultcache(key = 5)] + pub authority_scope: String, + #[cultcache(key = 6)] + pub requested_action: String, + #[cultcache(key = 7)] + pub requested_paths: Vec, + #[cultcache(key = 8)] + pub substrate_gate_grant_receipt_id: String, + #[cultcache(key = 9)] + pub requested_at: String, + #[cultcache(key = 10)] + pub contract: String, +} + +#[derive(Debug, Clone, PartialEq, Eq, DatabaseEntry)] +#[cultcache(type = "epiphany.hands.action_review", schema = "HandsActionReview")] +pub struct HandsActionReview { + #[cultcache(key = 0)] + pub schema_version: String, + #[cultcache(key = 1)] + pub review_id: String, + #[cultcache(key = 2)] + pub intent_id: String, + #[cultcache(key = 3)] + pub decision: String, + #[cultcache(key = 4)] + pub allowed_operations: Vec, + #[cultcache(key = 5)] + pub required_receipts: Vec, + #[cultcache(key = 6)] + pub reasons: Vec, + #[cultcache(key = 7)] + pub reviewed_at: String, + #[cultcache(key = 8)] + pub contract: String, +} + +#[derive(Debug, Clone, PartialEq, Eq, DatabaseEntry)] +#[cultcache(type = "epiphany.hands.patch_receipt", schema = "HandsPatchReceipt")] +pub struct HandsPatchReceipt { + #[cultcache(key = 0)] + pub schema_version: String, + #[cultcache(key = 1)] + pub receipt_id: String, + #[cultcache(key = 2)] + pub intent_id: String, + #[cultcache(key = 3)] + pub review_id: String, + #[cultcache(key = 4)] + pub substrate_gate_grant_receipt_id: String, + #[cultcache(key = 5)] + pub runtime_job_id: String, + #[cultcache(key = 6)] + pub changed_paths: Vec, + #[cultcache(key = 7)] + pub summary: String, + #[cultcache(key = 8)] + pub emitted_at: String, + #[cultcache(key = 9)] + pub contract: String, +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct HandsCultNetContract { @@ -129,6 +205,49 @@ pub fn default_hands_cultnet_contracts() -> Vec { ] } +pub fn hands_action_review_for_intent( + review_id: String, + intent: &HandsActionIntent, + decision: String, + allowed_operations: Vec, + reasons: Vec, + reviewed_at: String, +) -> HandsActionReview { + 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()], + 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(), + } +} + +pub fn hands_patch_receipt_for_review( + receipt_id: String, + intent: &HandsActionIntent, + review: &HandsActionReview, + changed_paths: Vec, + summary: String, + emitted_at: String, +) -> HandsPatchReceipt { + HandsPatchReceipt { + schema_version: HANDS_PATCH_RECEIPT_SCHEMA_VERSION.to_string(), + receipt_id, + intent_id: intent.intent_id.clone(), + review_id: review.review_id.clone(), + substrate_gate_grant_receipt_id: intent.substrate_gate_grant_receipt_id.clone(), + runtime_job_id: intent.runtime_job_id.clone(), + changed_paths, + summary, + emitted_at, + contract: "Hands patch receipt proves which files changed under the reviewed action and named Substrate Gate grant; Soul and Mind still decide verification and durable admission.".to_string(), + } +} + #[cfg(test)] mod tests { use super::*; @@ -155,4 +274,41 @@ mod tests { .contains(&HANDS_PATCH_RECEIPT_TYPE.to_string()) ); } + + #[test] + fn hands_action_review_and_patch_receipt_preserve_the_chain() { + let intent = HandsActionIntent { + schema_version: HANDS_ACTION_INTENT_SCHEMA_VERSION.to_string(), + intent_id: "hands-intent-1".to_string(), + runtime_job_id: "job-1".to_string(), + binding_id: "implementation-worker".to_string(), + role: "epiphany-hands".to_string(), + authority_scope: "epiphany.role.implementation".to_string(), + requested_action: "patch".to_string(), + requested_paths: vec!["src/lib.rs".to_string()], + substrate_gate_grant_receipt_id: "substrate-grant-1".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-1".to_string(), + &intent, + "approved".to_string(), + vec!["patch".to_string()], + vec!["Substrate Gate grant is present.".to_string()], + "2026-06-02T00:01:00Z".to_string(), + ); + let receipt = hands_patch_receipt_for_review( + "hands-patch-1".to_string(), + &intent, + &review, + vec!["src/lib.rs".to_string()], + "Applied focused patch.".to_string(), + "2026-06-02T00:02:00Z".to_string(), + ); + + assert_eq!(review.intent_id, intent.intent_id); + assert_eq!(receipt.review_id, review.review_id); + assert_eq!(receipt.substrate_gate_grant_receipt_id, "substrate-grant-1"); + } } diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index b7a1aad6..861222fc 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -428,6 +428,9 @@ pub use runtime_spine::plan_runtime_spine_heartbeat_launch; pub use runtime_spine::put_continuity_recovery_receipt; pub use runtime_spine::put_coordinator_run_receipt; pub use runtime_spine::put_eyes_evidence_packet; +pub use runtime_spine::put_hands_action_intent; +pub use runtime_spine::put_hands_action_review; +pub use runtime_spine::put_hands_patch_receipt; pub use runtime_spine::put_mind_gateway_review; pub use runtime_spine::put_mind_state_commit_receipt; pub use runtime_spine::put_runtime_reorient_worker_result; @@ -437,6 +440,9 @@ pub use runtime_spine::put_substrate_gate_repo_access_grant_receipt; pub use runtime_spine::replace_or_append_epiphany_job_binding; pub use runtime_spine::runtime_continuity_recovery_receipt; pub use runtime_spine::runtime_eyes_evidence_packet; +pub use runtime_spine::runtime_hands_action_intent; +pub use runtime_spine::runtime_hands_action_review; +pub use runtime_spine::runtime_hands_patch_receipt; pub use runtime_spine::runtime_hello_frame; pub use runtime_spine::runtime_job_snapshot; pub use runtime_spine::runtime_mind_gateway_review; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 90155e09..ba31907d 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -717,6 +717,9 @@ pub fn runtime_spine_cache(store_path: impl AsRef) -> Result { cache.register_entry_type::()?; cache.register_entry_type::()?; cache.register_entry_type::()?; + cache.register_entry_type::()?; + cache.register_entry_type::()?; + cache.register_entry_type::()?; cache.register_entry_type::()?; cache.register_entry_type::()?; cache.register_entry_type::()?; @@ -1253,6 +1256,103 @@ pub fn runtime_substrate_gate_repo_access_grant_receipt( cache.get::(receipt_id) } +pub fn put_hands_action_intent( + store_path: impl AsRef, + intent: &HandsActionIntent, +) -> Result<()> { + validate_non_empty(&intent.intent_id, "Hands action intent id")?; + validate_non_empty(&intent.runtime_job_id, "Hands action runtime job")?; + validate_non_empty(&intent.binding_id, "Hands action binding")?; + validate_non_empty(&intent.role, "Hands action role")?; + validate_non_empty(&intent.authority_scope, "Hands action authority scope")?; + validate_non_empty(&intent.requested_action, "Hands requested action")?; + validate_non_empty( + &intent.substrate_gate_grant_receipt_id, + "Hands Substrate Gate grant receipt", + )?; + validate_non_empty(&intent.requested_at, "Hands action requested timestamp")?; + if intent.requested_paths.is_empty() { + return Err(anyhow!("Hands action intent must name requested paths")); + } + let mut cache = runtime_spine_cache(store_path)?; + cache.pull_all_backing_stores()?; + require_identity(&cache)?; + cache.put(&intent.intent_id, intent)?; + Ok(()) +} + +pub fn runtime_hands_action_intent( + store_path: impl AsRef, + intent_id: &str, +) -> Result> { + validate_non_empty(intent_id, "Hands action intent id")?; + let mut cache = runtime_spine_cache(store_path)?; + cache.pull_all_backing_stores()?; + cache.get::(intent_id) +} + +pub fn put_hands_action_review( + store_path: impl AsRef, + review: &HandsActionReview, +) -> Result<()> { + validate_non_empty(&review.review_id, "Hands action review id")?; + validate_non_empty(&review.intent_id, "Hands action review intent")?; + validate_non_empty(&review.decision, "Hands action review decision")?; + validate_non_empty(&review.reviewed_at, "Hands action review timestamp")?; + if review.allowed_operations.is_empty() { + return Err(anyhow!("Hands action review must name allowed operations")); + } + let mut cache = runtime_spine_cache(store_path)?; + cache.pull_all_backing_stores()?; + require_identity(&cache)?; + cache.put(&review.review_id, review)?; + Ok(()) +} + +pub fn runtime_hands_action_review( + store_path: impl AsRef, + review_id: &str, +) -> Result> { + validate_non_empty(review_id, "Hands action review id")?; + let mut cache = runtime_spine_cache(store_path)?; + cache.pull_all_backing_stores()?; + cache.get::(review_id) +} + +pub fn put_hands_patch_receipt( + store_path: impl AsRef, + receipt: &HandsPatchReceipt, +) -> Result<()> { + validate_non_empty(&receipt.receipt_id, "Hands patch receipt id")?; + validate_non_empty(&receipt.intent_id, "Hands patch intent")?; + validate_non_empty(&receipt.review_id, "Hands patch review")?; + validate_non_empty( + &receipt.substrate_gate_grant_receipt_id, + "Hands patch Substrate Gate grant receipt", + )?; + validate_non_empty(&receipt.runtime_job_id, "Hands patch runtime job")?; + validate_non_empty(&receipt.summary, "Hands patch summary")?; + validate_non_empty(&receipt.emitted_at, "Hands patch timestamp")?; + if receipt.changed_paths.is_empty() { + return Err(anyhow!("Hands patch receipt must name changed paths")); + } + let mut cache = runtime_spine_cache(store_path)?; + cache.pull_all_backing_stores()?; + require_identity(&cache)?; + cache.put(&receipt.receipt_id, receipt)?; + Ok(()) +} + +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_soul_verdict_receipt( store_path: impl AsRef, receipt: &SoulVerdictReceipt, @@ -3332,6 +3432,47 @@ mod tests { runtime_substrate_gate_repo_access_grant_receipt(&store, "substrate-grant-1")? .expect("Substrate Gate grant should persist"); assert_eq!(stored_grant, substrate_grant); + let hands_intent = HandsActionIntent { + schema_version: crate::HANDS_ACTION_INTENT_SCHEMA_VERSION.to_string(), + intent_id: "hands-intent-1".to_string(), + runtime_job_id: "job-implementation-1".to_string(), + binding_id: "implementation-worker".to_string(), + role: "epiphany-hands".to_string(), + authority_scope: "epiphany.role.implementation".to_string(), + requested_action: "patch".to_string(), + requested_paths: vec!["src/lib.rs".to_string()], + substrate_gate_grant_receipt_id: "substrate-grant-1".to_string(), + requested_at: "2026-05-06T00:06:30Z".to_string(), + contract: "Hands action intent persists as runtime-spine proof.".to_string(), + }; + put_hands_action_intent(&store, &hands_intent)?; + let hands_review = crate::hands_action_review_for_intent( + "hands-review-1".to_string(), + &hands_intent, + "approved".to_string(), + vec!["patch".to_string()], + vec!["Substrate Gate grant is present.".to_string()], + "2026-05-06T00:06:40Z".to_string(), + ); + put_hands_action_review(&store, &hands_review)?; + let hands_patch = crate::hands_patch_receipt_for_review( + "hands-patch-1".to_string(), + &hands_intent, + &hands_review, + vec!["src/lib.rs".to_string()], + "Applied focused patch.".to_string(), + "2026-05-06T00:06:50Z".to_string(), + ); + put_hands_patch_receipt(&store, &hands_patch)?; + let stored_intent = runtime_hands_action_intent(&store, "hands-intent-1")? + .expect("Hands action intent should persist"); + assert_eq!(stored_intent, hands_intent); + let stored_review = runtime_hands_action_review(&store, "hands-review-1")? + .expect("Hands action review should persist"); + assert_eq!(stored_review, hands_review); + let stored_patch = runtime_hands_patch_receipt(&store, "hands-patch-1")? + .expect("Hands patch receipt should persist"); + assert_eq!(stored_patch, hands_patch); let stored_verdict = runtime_soul_verdict_receipt(&store, "soul-verdict-1")? .expect("Soul verdict should persist"); assert_eq!(stored_verdict, soul_verdict); diff --git a/notes/epiphany-fork-implementation-plan.md b/notes/epiphany-fork-implementation-plan.md index 11e04604..b83c8531 100644 --- a/notes/epiphany-fork-implementation-plan.md +++ b/notes/epiphany-fork-implementation-plan.md @@ -88,7 +88,7 @@ The landed machine now has: - first Rust CultMesh local-node integration: `vendor/cultmesh-rs` now provides the repo-contained CultMesh surface over vendored CultCache/CultNet, and `epiphany-core` depends on that surface for local `EpiphanyCultMeshStatusEntry`, `EpiphanyCultMeshVersePolicyEntry`, and `EpiphanyCultMeshGlobalRoomPolicyEntry` round-trip smokes instead of treating raw CultNet as the ergonomic app-facing database layer - first local Verse query surface: `notes/epiphany-verse-architecture.md` names Verse/Odin/Yggdrasil ownership, `epiphany-verse-query` can seed/query a compact CultMesh-backed local Verse context bundle for operator inspection and future dynamic prompt assembly without granting semantic memory, public sharing, or state-admission authority, and `tools/epiphany_local_run.ps1 -Mode status` now writes that packet as `local-verse-context.json` beside native status/operator snapshot artifacts - first dynamic prompt launch handoff: role/reorient worker launch documents carry optional `dynamicPromptContext`, runtime prompt assembly consumes that field into worker instructions, `epiphany-prompt-context-smoke` proves rendered Verse/memory context can ride a role launch document without admitting unrelated private-looking text, live bridge role/reorient launch paths 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 dynamic packet survives in a persisted runtime-spine worker launch request -- first Hands/Soul/Continuity contract catalogs: action, verification, and continuity now have native `epiphany-core` contract families, runtime-spine advertisement, CultMesh policy documents, and local CultMesh smoke coverage beside Mind/Substrate Gate/Eyes +- first Hands/Soul/Continuity contract catalogs: action, verification, and continuity now have native `epiphany-core` contract families, runtime-spine advertisement, CultMesh policy documents, and local CultMesh smoke coverage beside Mind/Substrate Gate/Eyes; Hands now also has typed runtime-spine document bodies/helpers for `HandsActionIntent`, `HandsActionReview`, and `HandsPatchReceipt`, with `epiphany-hands-action-smoke` proving the action receipt chain without live file execution - live-specialist runner must be rebuilt around heartbeat/runtime-spine result receipts - first Phase 6 Aquarium operator shell extracted to sibling repo `E:\Projects\EpiphanyAquarium`, a Tauri v2 + React/WebGL client over the existing status bridge, dogfood artifacts, and GUI action artifacts, with its own distilled interface state/memory/doctrine plus durable checkpoint preparation, bounded status/coordinator artifact buttons, fixed modeling/verification/reorient launch and read-back buttons, and explicit review-gated reorient acceptance - first Unity editor/runtime bridge through native `epiphany-unity-bridge`, native `epiphany-unity-bridge-smoke`, and the GUI Inspect Unity action, resolving exact project-pinned editors and writing runtime artifacts while refusing wrong or missing versions diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 404d2588..4e253744 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -51,6 +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. `epiphany-core::hands_gateway` owns `HandsActionIntent`, `HandsActionReview`, and `HandsPatchReceipt`; runtime-spine can persist/reread them; `runtime_spine_persists_mind_gateway_review_receipts` includes the Hands chain beside Mind/Eyes/Substrate/Soul/Continuity proofs; and `epiphany-hands-action-smoke` emits intent/review/patch receipt ids from `.epiphany-smoke\runtime-spine\hands-action-smoke.msgpack`. This smoke does not execute commands or edit files. The next live cut is to route real implementation edits/commands/commits through that chain after Substrate Gate grants access. - `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`. diff --git a/notes/hands-cultnet-contracts.md b/notes/hands-cultnet-contracts.md index ad107a2a..861077e4 100644 --- a/notes/hands-cultnet-contracts.md +++ b/notes/hands-cultnet-contracts.md @@ -42,3 +42,23 @@ Mind admits durable state after the action and verification receipts exist. Hands is not a permission organ. It is the actuator. The wrench does not bless itself. + +## Executable Slice + +The first runtime-spine proof chain now exists: + +```text +HandsActionIntent +-> HandsActionReview +-> HandsPatchReceipt +``` + +`epiphany-core::hands_gateway` owns the typed document bodies and constructors. +`epiphany-core::runtime_spine` can persist and reread the intent, review, and +patch receipt from the runtime-spine CultCache store. `epiphany-hands-action-smoke` +proves the compact chain without executing shell commands or editing files. + +This is still a receipt artery, not full action execution. The next live-action +cut must connect actual implementation edits/commands/commits to this path +after Substrate Gate grants access and before Soul/Mind call the result +accepted. diff --git a/notes/perfect-machine-audit-roadmap.md b/notes/perfect-machine-audit-roadmap.md index 74ca51aa..97a32c9c 100644 --- a/notes/perfect-machine-audit-roadmap.md +++ b/notes/perfect-machine-audit-roadmap.md @@ -147,10 +147,14 @@ runtime-spine, and enforces Soul verdict proof before Mind admits verification-shaped state. Reorient acceptance emits a typed `epiphany.continuity.recovery_receipt`, persists/rereads it through runtime-spine, and enforces Continuity recovery proof before Mind admits -recovery-shaped state. Remaining weakness: Hands receipts are still mostly -launch-carried expectations, not enforced proof chains before action promotion, -and the current Mind state mutation plus post-commit receipt is not a single -transaction yet. +recovery-shaped state. Hands now has a first executable runtime-spine proof +chain for action documents: `HandsActionIntent` -> `HandsActionReview` -> +`HandsPatchReceipt` can be persisted and reread from the runtime store, and +`epiphany-hands-action-smoke` proves the chain without executing a patch. +Remaining weakness: live implementation edits, commands, commits, and PRs still +do not have to pass through that Hands chain before action promotion, and the +current Mind state mutation plus post-commit receipt is not a single transaction +yet. ### 4. Self Still Shares A Throne With Compatibility Plumbing @@ -349,8 +353,12 @@ comfort tunnels. receipts before Mind admission. - Landed: Reorient acceptance produces and enforces typed Continuity recovery receipts before Mind admission. -- Next: add Hands action receipts when action lanes become live, or collapse - Mind review/state mutation/commit into one storage-owner admission primitive. +- Landed: first Hands action receipt spine. `HandsActionIntent`, + `HandsActionReview`, and `HandsPatchReceipt` are typed runtime-spine + documents with put/get helpers and `epiphany-hands-action-smoke` coverage. +- Next: connect live implementation edits/commands/commits to the Hands action + chain, or collapse Mind review/state mutation/commit into one storage-owner + admission primitive. - 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 diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 536334d09e2c0fbc3e00bd3a40a3ce5c959a7559..3883a54b3ab7b5aedba72f695846ab22bd3e4833 100644 GIT binary patch delta 305 zcmYk0u}Z{15Qfc`XCYXKU^5`t?RiN+A%$R}Xd%d9Ww&fbcQM&rvy+RdEG#T7G(Lh@ z3KrrETrb$zTKfu$dnrU1rudofpYQW+aPvNRT8`$^I7>Ev=UgkD~9Zj$L;w zdg&NDcv!r9O-9KEAB9Pd;xtR++lA@M+Q-kHFu4a~8&JXnwGMNrYD2n2?wvLWLf#`= zx`c2D3JZso&!ES)C24E+4WS|6TmQo`PBb=u;h`X@#wbxc8p5uXwGV#?J^8*Dopwr? zmWP#lF8X5bOM8akDmy{gA%!57&<17(I*{uXRw#mfqe review -> patch receipt without executing shell commands or editing files. Live implementation edits/commands/commits must still be routed through this Hands path after Substrate Gate and before Soul/Mind acceptance. - 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. @@ -591,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: Choose the next chain carefully: prove one Hands action path through typed action intent/review/receipt once implementation/action lanes become live, or collapse Mind review/state mutation/commit into one storage-owner admission primitive if the admission surface is still split-brained. + next_action: Choose the next chain carefully: connect live implementation edits/commands/commits to the Hands action receipt path, or collapse Mind review/state mutation/commit into one storage-owner admission primitive if the admission surface is still split-brained.