Surface Idunn poke route on tool refusal

This commit is contained in:
Meta Vens 2026-06-19 02:26:54 +01:00
commit f3d02368c3
5 changed files with 44 additions and 6 deletions

View file

@ -2054,6 +2054,27 @@ fn run_cli() -> Result<()> {
let degraded_tool_directory =
load_epiphany_cultmesh_daemon_tool_directory(&args.store, args.runtime_id.clone())?;
let degraded_tool_report = daemon_tool_directory_report(&degraded_tool_directory);
let degraded_hands_status = context
.daemon_statuses
.iter()
.find(|status| status.daemon_id == "epiphany-daemon-hands")
.context("missing degraded Hands daemon status")?;
let degraded_tool_refusal =
assert_daemon_ready_for_tool_invocation(degraded_hands_status, hands_repo_action)
.expect_err("degraded Hands tool invocation should fail closed")
.to_string();
if !degraded_tool_refusal.contains("owner=Idunn")
|| !degraded_tool_refusal.contains("hostedBody=Epiphany")
|| !degraded_tool_refusal.contains("sight=epiphany-verse-query swarm-status")
|| !degraded_tool_refusal.contains(WRAPPER_POKE_NON_READY_COMMAND)
|| !degraded_tool_refusal.contains(
"singlePoke=epiphany-verse-query poke-daemon --daemon-id epiphany-daemon-hands",
)
{
anyhow::bail!(
"local Verse query smoke degraded tool refusal lost Idunn poke/readback routing"
);
}
let degraded_overview_status = if degraded_report.non_ready_count == 0
&& degraded_tool_report.host_attention_count == 0
{
@ -6769,11 +6790,15 @@ fn assert_daemon_ready_for_tool_invocation(
) -> Result<()> {
if status.status != "ready" {
anyhow::bail!(
"host daemon {} is not ready for tool invocation {}; daemonStatus={}; operatorAction={}",
"host daemon {} is not ready for tool invocation {}; daemonStatus={}; operatorAction={}; owner={}; hostedBody={}; sight=epiphany-verse-query swarm-status; poke={}; singlePoke=epiphany-verse-query poke-daemon --daemon-id {}",
status.daemon_id,
capability.capability_id,
status.status,
status.operator_action
status.operator_action,
SERVICE_LIFECYCLE_OWNER,
SERVICE_LIFECYCLE_HOSTED_BODY,
WRAPPER_POKE_NON_READY_COMMAND,
status.daemon_id
);
}
if !status
@ -6782,9 +6807,15 @@ fn assert_daemon_ready_for_tool_invocation(
.any(|action| action == "submitTypedToolIntent")
{
anyhow::bail!(
"host daemon {} does not advertise submitTypedToolIntent for capability {}",
"host daemon {} does not advertise submitTypedToolIntent for capability {}; daemonStatus={}; operatorAction={}; owner={}; hostedBody={}; sight=epiphany-verse-query swarm-status; poke={}; singlePoke=epiphany-verse-query poke-daemon --daemon-id {}",
status.daemon_id,
capability.capability_id
capability.capability_id,
status.status,
status.operator_action,
SERVICE_LIFECYCLE_OWNER,
SERVICE_LIFECYCLE_HOSTED_BODY,
WRAPPER_POKE_NON_READY_COMMAND,
status.daemon_id
);
}
Ok(())

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -123,7 +123,7 @@ active_subgoals:
accepted_design:
- Distributed Epiphany dreaming is a CultMesh typed-document problem, not prompt folklore. CultCache owns local typed documents, Epiphany owns export/import/adoption policy, CultNet owns wire/provenance/shard delivery, and CultMesh owns Verses, peer exchange, leases, shard logs, replicas, and watchable runtime surfaces. Start with local dream document types and a local store before public Verse wiring.
- The local CultMesh daemon tool directory now has both discovery and invocation receipts at the operator edge. `epiphany-verse-query tools` lists globally available, receipt-gated daemon capabilities; `epiphany-verse-query invoke-tool --capability-id <id>` records `epiphany.cultmesh.daemon_tool_invocation_intent.v0` plus `epiphany.cultmesh.daemon_tool_invocation_receipt.v0` from the advertised capability, reports requesting/host display names, body domains, private Verse ids, and Eve surfaces from cluster topology, and refuses when the host daemon is not ready. `tools/epiphany_local_run.ps1 -Mode tool-invoke` wraps the same path with explicit requester/capability/intent/receipt parameters. Tool availability is global across local agents, but execution and authority remain with the hosting daemon and its typed receipt contract. Status tools now embed `daemonStatusReadback` with host cluster id, daemon status, body domain/kind, private Verse id, Eve surface, hosted tool capability ids, and private-state seal; live wrapper proof `local-20260619-015644-193-d31ca95c` routed Persona to Hands `status` and printed `daemonStatus=status=ready:cluster=epiphany.cluster.hands:daemon=epiphany-daemon-hands:surface=eve://epiphany/hands:tools=3:private=False`. Eve connection tools now embed `eveConnectionReadback` with target cluster/surface, public discussion eligibility, supported actions, connection command, wrapper connection command, feedback route, and private-state seal while leaving actual connection receipt creation to `connect-eve`; live wrapper proof `local-20260619-020458-304-b180a17c` routed Persona to Persona `eve-connect` and printed `eveConnection=target=epiphany.cluster.persona:surface=eve://epiphany/persona:publicDiscussion=True:actions=3:private=False`. Hands/Soul authority tools now embed `authorityToolReadback` so global invocation returns the authority gate, input contract, receipt contract, intent/receipt routes, host cluster, and private-state seal without pretending the tool bus owns action or verification; live wrapper proofs `local-20260619-021628-143-7bf7f2e0` and `local-20260619-021701-458-852cfa6f` routed Persona to Hands `repo-action` and Soul `verify` with `privateStateExposed=false`. The Self-hosted `service-health` tool embeds `serviceHealthReadback` in the invocation result instead of only pointing at receipt-directory: live wrapper proof `local-20260619-015010-170-38e1c830` returned status `attention`, service lifecycle/action rows, failed-check anatomy, and no private-state exposure. Production invocation and source smoke now share `service_health_readback_from_idunn`, and the smoke rejects payloads that lose Idunn ownership, service lifecycle/action rows, failed-check anatomy, or the private-state seal.
- The local CultMesh daemon tool directory now has both discovery and invocation receipts at the operator edge. `epiphany-verse-query tools` lists globally available, receipt-gated daemon capabilities; `epiphany-verse-query invoke-tool --capability-id <id>` records `epiphany.cultmesh.daemon_tool_invocation_intent.v0` plus `epiphany.cultmesh.daemon_tool_invocation_receipt.v0` from the advertised capability, reports requesting/host display names, body domains, private Verse ids, and Eve surfaces from cluster topology, and refuses when the host daemon is not ready. Down-host refusals now surface Idunn-owned liveness sight and poke routes directly in the wrapper failure text: `epiphany-verse-query swarm-status`, `tools/epiphany_local_run.ps1 -Mode swarm-poke-down`, and the single-daemon `poke-daemon` command. `tools/epiphany_local_run.ps1 -Mode tool-invoke` wraps the same path with explicit requester/capability/intent/receipt parameters. Tool availability is global across local agents, but execution and authority remain with the hosting daemon and its typed receipt contract. Status tools now embed `daemonStatusReadback` with host cluster id, daemon status, body domain/kind, private Verse id, Eve surface, hosted tool capability ids, and private-state seal; live wrapper proof `local-20260619-015644-193-d31ca95c` routed Persona to Hands `status` and printed `daemonStatus=status=ready:cluster=epiphany.cluster.hands:daemon=epiphany-daemon-hands:surface=eve://epiphany/hands:tools=3:private=False`. Eve connection tools now embed `eveConnectionReadback` with target cluster/surface, public discussion eligibility, supported actions, connection command, wrapper connection command, feedback route, and private-state seal while leaving actual connection receipt creation to `connect-eve`; live wrapper proof `local-20260619-020458-304-b180a17c` routed Persona to Persona `eve-connect` and printed `eveConnection=target=epiphany.cluster.persona:surface=eve://epiphany/persona:publicDiscussion=True:actions=3:private=False`. Hands/Soul authority tools now embed `authorityToolReadback` so global invocation returns the authority gate, input contract, receipt contract, intent/receipt routes, host cluster, and private-state seal without pretending the tool bus owns action or verification; live wrapper proofs `local-20260619-021628-143-7bf7f2e0` and `local-20260619-021701-458-852cfa6f` routed Persona to Hands `repo-action` and Soul `verify` with `privateStateExposed=false`. The Self-hosted `service-health` tool embeds `serviceHealthReadback` in the invocation result instead of only pointing at receipt-directory: live wrapper proof `local-20260619-015010-170-38e1c830` returned status `attention`, service lifecycle/action rows, failed-check anatomy, and no private-state exposure. Production invocation and source smoke now share `service_health_readback_from_idunn`, and the smoke rejects payloads that lose Idunn ownership, service lifecycle/action rows, failed-check anatomy, or the private-state seal.
- The local Verse swarm brake is now operator-writable from the same CLI surface and enforced at the main local wrapper plus direct coordinator/heartbeat runner edges. `epiphany-verse-query swarm-brake --brake-status engaged|released` writes the typed `epiphany.cultmesh.swarm_brake.v0` document with scope, reason, operator id, affected clusters, protected surfaces, expiry, and private-state seal. `tools/epiphany_local_run.ps1` queries that document before live `plan`, `run`, or `mvp` work and fails closed when engaged; `status` remains readable. `epiphany-mvp-coordinator --local-verse-store <path>` refuses before app-server startup when the brake is engaged, and `epiphany-heartbeat-store tick|pump|heat|queue-mention|routine --local-verse-store <path>` refuses heartbeat-driving work while leaving init/status/complete/repair-stale outside that live-run brake.
- The first Rust CultMesh integration slice is landed and repaired to compile from repo-contained vendored crates. `vendor/cultmesh-rs` is a small Rust node/database facade over vendored CultCache and CultNet with document-set registration and durable typed put/get/delete. `vendor/cultcache-rs` now reads and writes the `cultcache.store.v1` snapshot format used by `state/ledgers.msgpack`, so `epiphany-state status` is a working re-entry rite again. `epiphany-core` depends on `vendor/cultcache-rs`, `vendor/cultnet-rs`, and `vendor/cultmesh-rs`, exposes an `EpiphanyCultMeshStatusEntry`, records typed `EpiphanyCultMeshVersePolicyEntry` documents for the internal/local-area/global Verse tiers, and records typed `EpiphanyCultMeshGlobalRoomPolicyEntry` documents for threaded public global rooms such as dreams, architecture, research, Personas, GameCult, and governance. Native operator status is now a typed `EpiphanyCultMeshOperatorStatusEntry` in the internal Verse; it names Codex as bridge transport, Epiphany as authority owner, prompt-authority separation, and the quarantined Rider/Unity optional surfaces. Native operator snapshots are typed `EpiphanyCultMeshOperatorSnapshotEntry` documents distilled from operator-safe status artifacts; local status runs write operator run intent, operator snapshot, and run receipt into `.epiphany-run/cultmesh/local-verse.ccmp`, leaving JSON artifacts as display/evidence rather than the local-run read authority.
- Mind's CultNet contract surface is native enough for the next Aquarium/CultMesh cut: `epiphany-core::mind_gateway` defines thought, state-effect proposal, gateway-review, commit-receipt, rejection-receipt, and Verse-adoption document contracts; runtime-spine advertises those mutation/read contracts; CultMesh persists matching `EpiphanyCultMeshMindContractEntry` policy documents so the private state guardian boundary is inspectable as typed state.

View file

@ -121,6 +121,13 @@ function Invoke-Checked {
$process.WaitForExit()
$exitCode = $process.ExitCode
if ($exitCode -ne 0) {
$stderrTail = ""
if ($StderrPath -ne "" -and (Test-Path -LiteralPath $StderrPath)) {
$stderrTail = ((Get-Content -LiteralPath $StderrPath -Tail 20) -join "`n").Trim()
}
if ($stderrTail -ne "") {
throw "$Label failed with exit code $exitCode`n$stderrTail"
}
throw "$Label failed with exit code $exitCode"
}
}