From 5573755a97df1c2d8525a7573bce64668c977c64 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 20:04:14 +0100 Subject: [PATCH] Split Persona feedback from Imagination consensus --- .../src/bin/epiphany-eve-provider.rs | 99 ++++++++++++++++++ epiphany-core/src/bin/epiphany-verse-query.rs | 61 +++-------- notes/epiphany-current-algorithmic-map.md | 9 ++ notes/fresh-workspace-handoff.md | 4 + state/ledgers.msgpack | Bin 430143 -> 430606 bytes state/map.yaml | 2 +- 6 files changed, 130 insertions(+), 45 deletions(-) create mode 100644 epiphany-core/src/bin/epiphany-eve-provider.rs diff --git a/epiphany-core/src/bin/epiphany-eve-provider.rs b/epiphany-core/src/bin/epiphany-eve-provider.rs new file mode 100644 index 00000000..a1151190 --- /dev/null +++ b/epiphany-core/src/bin/epiphany-eve-provider.rs @@ -0,0 +1,99 @@ +use anyhow::{Context, Result}; +use epiphany_core::{ + epiphany_cultmesh_eve_connection_receipt_for_intent, + load_latest_epiphany_cultmesh_eve_connection_intent, + write_epiphany_cultmesh_eve_connection_receipt, +}; +use serde_json::json; +use std::{env, path::PathBuf}; + +fn main() -> Result<()> { + let args = Args::parse()?; + let intent = + load_latest_epiphany_cultmesh_eve_connection_intent(&args.store, args.runtime_id.clone())? + .context("Eve provider found no pending connection intent")?; + if intent.target_cluster_id != args.provider_cluster_id { + anyhow::bail!( + "Eve provider {} cannot answer intent owned by {}", + args.provider_cluster_id, + intent.target_cluster_id + ); + } + if let Some(expected_intent_id) = args.intent_id.as_deref() { + if intent.intent_id != expected_intent_id { + anyhow::bail!( + "latest Eve connection intent {:?} does not match requested {:?}", + intent.intent_id, + expected_intent_id + ); + } + } + let receipt = + epiphany_cultmesh_eve_connection_receipt_for_intent(args.receipt_id, &intent, args.status); + let written = write_epiphany_cultmesh_eve_connection_receipt( + &args.store, + args.runtime_id.clone(), + receipt, + )?; + println!( + "{}", + serde_json::to_string_pretty(&json!({ + "schemaVersion": "epiphany.eve_provider_connection_receipt.v0", + "status": written.status, + "runtimeId": args.runtime_id, + "providerClusterId": args.provider_cluster_id, + "intentId": written.intent_id, + "receiptId": written.receipt_id, + "feedbackRoute": written.feedback_route, + "privateStateExposed": written.private_state_exposed, + }))? + ); + Ok(()) +} + +struct Args { + store: PathBuf, + runtime_id: String, + provider_cluster_id: String, + intent_id: Option, + receipt_id: String, + status: String, +} + +impl Args { + fn parse() -> Result { + let mut values = env::args().skip(1); + let command = values.next().unwrap_or_else(|| "accept".to_string()); + if command != "accept" { + anyhow::bail!("unknown command {command:?}; use accept"); + } + let mut store = PathBuf::from(".epiphany-run/cultmesh/local-verse.ccmp"); + let mut runtime_id = "epiphany-local".to_string(); + let mut provider_cluster_id = None; + let mut intent_id = None; + let mut receipt_id = None; + let mut status = "accepted".to_string(); + while let Some(arg) = values.next() { + match arg.as_str() { + "--store" => store = PathBuf::from(values.next().context("missing --store")?), + "--runtime-id" => runtime_id = values.next().context("missing --runtime-id")?, + "--provider-cluster-id" => { + provider_cluster_id = + Some(values.next().context("missing --provider-cluster-id")?) + } + "--intent-id" => intent_id = Some(values.next().context("missing --intent-id")?), + "--receipt-id" => receipt_id = Some(values.next().context("missing --receipt-id")?), + "--status" => status = values.next().context("missing --status")?, + _ => anyhow::bail!("unknown argument {arg:?}"), + } + } + Ok(Self { + store, + runtime_id, + provider_cluster_id: provider_cluster_id.context("missing --provider-cluster-id")?, + intent_id, + receipt_id: receipt_id.context("missing --receipt-id")?, + status, + }) + } +} diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index 10ef858f..4c9a7660 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -1332,6 +1332,15 @@ fn run_cli() -> Result<()> { ); } "collaboration-feedback" | "persona-feedback" => { + if args.receipt_id.is_some() + || args.receipt_status.is_some() + || args.imagination_agent_ids.is_some() + || args.consensus_packet_ref.is_some() + { + anyhow::bail!( + "collaboration-feedback accepts Persona feedback fields only; Imagination owns consensus receipt, participants, packet, status, and adoption gate" + ); + } seed_epiphany_local_verse_context( &args.store, args.runtime_id.clone(), @@ -1341,10 +1350,6 @@ fn run_cli() -> Result<()> { .feedback_id .clone() .unwrap_or_else(|| "collaboration-feedback".to_string()); - let consensus_receipt_id = args - .receipt_id - .clone() - .unwrap_or_else(|| "imagination-consensus-receipt".to_string()); let source_persona_id = args .source_persona_id .clone() @@ -1388,17 +1393,6 @@ fn run_cli() -> Result<()> { "collaboration-feedback requires --public-discussion-ref", )?; let candidate_action_refs = args.candidate_action_refs.clone().unwrap_or_default(); - let imagination_agent_ids = args - .imagination_agent_ids - .clone() - .unwrap_or_else(|| vec!["epiphany.Imagination".to_string()]); - let consensus_packet_ref = args.consensus_packet_ref.clone().unwrap_or_else(|| { - format!("gamecult-local/imagination/consensus-packets/{feedback_id}") - }); - let consensus_status = args - .receipt_status - .clone() - .unwrap_or_else(|| "queued-for-consensus-discovery".to_string()); let feedback = epiphany_cultmesh_bifrost_collaboration_feedback( feedback_id, source_persona_id, @@ -1415,50 +1409,29 @@ fn run_cli() -> Result<()> { args.runtime_id.clone(), feedback.clone(), )?; - let consensus = epiphany_cultmesh_imagination_consensus_receipt_for_feedback( - consensus_receipt_id, - &feedback, - consensus_status, - imagination_agent_ids, - consensus_packet_ref, - ); - let written_consensus = write_epiphany_cultmesh_imagination_consensus_receipt( - &args.store, - args.runtime_id.clone(), - consensus, - )?; let latest_feedback = load_latest_epiphany_cultmesh_bifrost_collaboration_feedback( &args.store, args.runtime_id.clone(), )?; - let latest_consensus = load_latest_epiphany_cultmesh_imagination_consensus_receipt( - &args.store, - args.runtime_id.clone(), - )?; if latest_feedback .as_ref() .map(|feedback| feedback.feedback_id.as_str()) != Some(written_feedback.feedback_id.as_str()) - || latest_consensus - .as_ref() - .map(|receipt| receipt.receipt_id.as_str()) - != Some(written_consensus.receipt_id.as_str()) { - anyhow::bail!( - "local Verse query lost collaboration feedback or Imagination consensus receipt after write" - ); + anyhow::bail!("local Verse query lost collaboration feedback after write"); } println!( "{}", serde_json::to_string_pretty(&json!({ - "status": "ok", + "status": "pending-imagination", "store": args.store, "runtimeId": args.runtime_id, "feedbackId": written_feedback.feedback_id, - "consensusReceiptId": written_consensus.receipt_id, + "consensusReceiptId": null, "requestedConsensusRoute": written_feedback.requested_consensus_route, - "consensusPacketRef": written_consensus.consensus_packet_ref, - "adoptionGate": written_consensus.adoption_gate, + "consensusPacketRef": null, + "adoptionGate": null, + "responseOwner": "Imagination", "commands": { "connectEve": WRAPPER_CONNECT_EVE_COMMAND, "bifrostPublication": DIRECT_BIFROST_PUBLICATION_COMMAND, @@ -1468,9 +1441,9 @@ fn run_cli() -> Result<()> { }, "publicDiscussionRefs": written_feedback.public_discussion_refs, "candidateActionRefs": written_feedback.candidate_action_refs, - "tuiRows": collaboration_feedback_tui_rows(&written_feedback, &written_consensus), + "tuiRows": [format!("FEEDBACK | {} | owner={} | status=pending-imagination | route={} | publicRefs={} | candidateActions={} | private=false", written_feedback.collaboration_topic, written_feedback.source_persona_id, written_feedback.requested_consensus_route, written_feedback.public_discussion_refs.len(), written_feedback.candidate_action_refs.len())], "privateStateIncluded": written_feedback.private_state_included, - "privateStateExposed": written_consensus.private_state_exposed, + "privateStateExposed": false, }))? ); } diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index d886f7b5..5edb78b1 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -45,6 +45,15 @@ - Heartbeat owner: `epiphany-cluster-daemon` writes status. On its first run it derives identity/routing fields from persisted topology and authors the first heartbeat itself. - Negative proof: a real provider heartbeat can precede a pending poke; no poke receipt appears, counterfeit `ready` result is rejected, and `set-daemon-status` is unavailable. +## Persona feedback and Imagination consensus boundary (2026-07-12) + +- Eve provider: `epiphany-eve-provider accept` loads the pending connection intent, verifies `provider_cluster_id == target_cluster_id`, and writes the provider receipt. +- Persona owner: `collaboration-feedback` writes public, bounded feedback only after that provider receipt exists. +- Imagination owner: consensus participant selection, packet reference, receipt status/id, and adoption gate. +- Persona output: `pending-imagination` with null consensus fields and `responseOwner=Imagination`. +- Forbidden writers: Persona cannot pass or synthesize Imagination response fields. +- Negative proof: the full consumer-request/provider-accept/Persona-feedback chain persists no consensus receipt until Imagination answers. + This is the source-grounded map of the live machine. Historical route and bridge anatomy belongs in git history and evidence ledgers, not here. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 99011c62..c39a1ec4 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -20,6 +20,10 @@ The conceptual-substitution audit found observation manufacturing the body it cl Single poke, batch poke, and swarm triage now write only `epiphany.cultmesh.daemon_poke_intent`. They report `pending-lifecycle-owner`, leave receipt/result fields null, and reject caller-supplied receipt id/status, resulting daemon status, or artifact result. The generic `daemon-status` / `set-daemon-status` CLI writer was deleted because it let callers proclaim readiness and stamp a heartbeat. `epiphany-cluster-daemon`, the provider body, now creates its own initial status from persisted topology after bootstrap rather than depending on a seeded fake heartbeat. Physical proof: provider heartbeat `degraded`, poke intent observes `degraded`, provider receipt absent, caller-supplied `ready` result rejected, and generic status writer unavailable. +## 2026-07-12 Persona feedback / Imagination consensus split + +`collaboration-feedback` now writes only bounded Persona feedback after verifying the cited Eve provider receipt exists. It returns `pending-imagination`, leaves consensus receipt/packet/adoption gate null, and rejects caller-supplied consensus receipt id/status, participant ids, or packet reference. The new narrow `epiphany-eve-provider accept` executable owns Eve connection acceptance: it loads the pending intent, verifies the provider cluster owns the target, and writes the connection receipt. Physical proof ran consumer request -> provider acceptance -> Persona feedback and showed no persisted Imagination consensus receipt; counterfeit consensus status was rejected. + This is the re-entry rite for `E:\Projects\EpiphanyAgent`: the waking chant for the local machine-spirit before it touches the forge. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 410bf10b9b66e5bb0a379ddd3bcdf5562a6cb20f..eaf7fbc8874a4337f17d9d16fb10b2b45971506d 100644 GIT binary patch delta 404 zcmYL_zfQw25XMOxDnJMch5}_diM6TPs(|POL!SU9BnH>MG=|hRwwo$b2L>ikk*G4l zz{FIE0Wq=h5WE7#giywXn7D;oTppnA_~<+h5O4 zOT|S$)UuyVZ~bzy1~e1Pet9J15QdstG!P=PE}`cjMVtZ&Eow+m^DyP22Lv>d7&-}p z(lX)9xf&^QWvlL>q_zeW3g*HA?~@)E#BwQe^9-posT2l<85q|wD!)KD;utei1tJ*4 zND_zfA0u6tw>3Cq3>gTbwSz^)RYXJ@V1mJngiwmg5%)u1C-U}fOgfedUU-FKwf%DB|{1-t-|RsaA1 delta 56 zcmeBMBDH^k)CNgLE<-B=!>D5nZ2dBul^F{e8UHj-Won