Narrow single daemon poke input

This commit is contained in:
Meta Vens 2026-08-11 02:49:11 +02:00
commit 161c6ec8af
6 changed files with 83 additions and 60 deletions

View file

@ -44,7 +44,9 @@ use epiphany_core::load_agent_state_soa_entry;
use epiphany_core::load_arrival_latest_epiphany_cultmesh_bifrost_body_change_publication_intent;
use epiphany_core::load_epiphany_cultmesh_cluster_topology;
use epiphany_core::load_epiphany_cultmesh_daemon_liveness;
use epiphany_core::load_epiphany_cultmesh_daemon_poke_intent;
use epiphany_core::load_epiphany_cultmesh_daemon_restart_policy_directory;
use epiphany_core::load_epiphany_cultmesh_daemon_status;
use epiphany_core::load_epiphany_cultmesh_daemon_service_lifecycle_receipts;
use epiphany_core::load_epiphany_cultmesh_daemon_tool_directory;
use epiphany_core::load_epiphany_cultmesh_eve_surface_directory;
@ -648,16 +650,19 @@ fn run_cli() -> Result<()> {
require_query_bootstrap(&args)?;
let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?;
let daemon_id = args
.daemon_id
.as_deref()
.context("poke-daemon requires --daemon-id, for example epiphany-daemon-hands")?;
let daemon_status = context
.daemon_statuses
.iter()
.find(|status| status.daemon_id == daemon_id)
let daemon_status = load_epiphany_cultmesh_daemon_status(
&args.store,
args.runtime_id.clone(),
daemon_id,
)?
.with_context(|| format!("local Verse has no daemon status for {daemon_id:?}"))?;
let brake = load_epiphany_cultmesh_swarm_brake(&args.store, args.runtime_id.clone())?;
let topology =
load_epiphany_cultmesh_cluster_topology(&args.store, args.runtime_id.clone())?;
let reason = args.reason.clone().unwrap_or_else(|| {
format!(
"Operator requested a typed lifecycle poke for {} after observing status {}.",
@ -674,18 +679,26 @@ fn run_cli() -> Result<()> {
.collect::<String>()
)
});
let poke_result =
write_daemon_poke_intent(&args, &context, daemon_status, intent_id, reason)?;
let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?;
if context.latest_daemon_poke_intent.is_none() {
anyhow::bail!("local Verse query lost daemon poke intent after write");
}
let poke_result = write_daemon_poke_intent(
&args,
brake.as_ref(),
&topology,
&daemon_status,
intent_id.clone(),
reason,
)?;
load_epiphany_cultmesh_daemon_poke_intent(
&args.store,
args.runtime_id.clone(),
&intent_id,
)?
.with_context(|| format!("local Verse lost exact daemon poke intent {intent_id:?}"))?;
println!(
"{}",
serde_json::to_string_pretty(&json!({
"status": "pending-lifecycle-owner",
"store": args.store,
"runtimeId": context.runtime_id,
"runtimeId": args.runtime_id,
"targetDaemonId": poke_result["targetDaemonId"],
"targetClusterId": poke_result["targetClusterId"],
"observedStatus": poke_result["observedStatus"],
@ -6689,13 +6702,14 @@ fn reject_daemon_poke_response_fields(args: &Args) -> Result<()> {
fn write_daemon_poke_intent(
args: &Args,
context: &EpiphanyLocalVerseContext,
brake: Option<&EpiphanyCultMeshSwarmBrakeEntry>,
topology: &[EpiphanyCultMeshClusterTopologyEntry],
daemon_status: &EpiphanyCultMeshDaemonStatusEntry,
intent_id: String,
reason: String,
) -> Result<serde_json::Value> {
assert_swarm_brake_allows_surface(
context,
assert_swarm_brake_allows_surface_entry(
brake,
"daemon.lifecycle_poke",
&daemon_status.cluster_id,
&daemon_status.daemon_id,
@ -6711,7 +6725,7 @@ fn write_daemon_poke_intent(
args.runtime_id.clone(),
poke_intent.clone(),
)?;
let cluster = cluster_topology_for_id(context, &written_intent.target_cluster_id)?;
let cluster = cluster_topology_entry_for_id(topology, &written_intent.target_cluster_id)?;
Ok(json!({
"targetDaemonId": written_intent.target_daemon_id,
"targetClusterId": written_intent.target_cluster_id,
@ -6752,7 +6766,8 @@ fn write_poke_intents_for_non_ready_daemons(
});
pokes.push(write_daemon_poke_intent(
args,
context,
context.swarm_brake.as_ref(),
&context.cluster_topology,
daemon_status,
intent_id,
reason,
@ -6911,20 +6926,6 @@ fn sanitize_id(value: &str) -> String {
.collect()
}
fn assert_swarm_brake_allows_surface(
context: &EpiphanyLocalVerseContext,
surface: &str,
cluster_id: &str,
daemon_id: &str,
) -> Result<()> {
assert_swarm_brake_allows_surface_entry(
context.swarm_brake.as_ref(),
surface,
cluster_id,
daemon_id,
)
}
fn assert_swarm_brake_allows_surface_entry(
brake: Option<&EpiphanyCultMeshSwarmBrakeEntry>,
surface: &str,
@ -6959,17 +6960,6 @@ fn assert_swarm_brake_allows_surface_entry(
Ok(())
}
fn cluster_topology_for_id<'a>(
context: &'a EpiphanyLocalVerseContext,
cluster_id: &str,
) -> Result<&'a EpiphanyCultMeshClusterTopologyEntry> {
context
.cluster_topology
.iter()
.find(|cluster| cluster.cluster_id == cluster_id)
.with_context(|| format!("local Verse has no cluster topology row for {cluster_id:?}"))
}
fn cluster_topology_entry_for_id<'a>(
topology: &'a [EpiphanyCultMeshClusterTopologyEntry],
cluster_id: &str,
@ -7458,6 +7448,22 @@ mod swarm_brake_command_tests {
mod lifecycle_projection_tests {
use super::*;
#[test]
fn single_daemon_poke_uses_narrow_status_brake_topology_and_intent_reads() {
let source = include_str!("epiphany-verse-query.rs");
let start = source.find("\"poke-daemon\" | \"daemon-poke\" => {").unwrap();
let tail = &source[start..];
let end = tail
.find("\n \"poke-down-daemons\"")
.expect("next command arm");
let body = &tail[..end];
assert!(body.contains("load_epiphany_cultmesh_daemon_status"));
assert!(body.contains("load_epiphany_cultmesh_swarm_brake"));
assert!(body.contains("load_epiphany_cultmesh_cluster_topology"));
assert!(body.contains("load_epiphany_cultmesh_daemon_poke_intent"));
assert!(!body.contains("query_epiphany_local_verse_context"));
}
#[test]
fn stale_ready_heartbeat_cannot_resolve_a_later_restart_attempt() {
assert!(!provider_heartbeat_causally_follows_attempt(

View file

@ -3687,3 +3687,11 @@ an aggregate context. Scheduler tick and cluster runbook keep aggregate context
because their output enumerates multiple daemon policies, statuses, topology
rows, and brake scope. Focused tests prove the direct source boundary and that
the narrow brake input preserves lifecycle-poke refusal semantics.
Single-target `epiphany-verse-query poke-daemon` follows the same cut. Exact
daemon status owns target identity, the canonical brake owns refusal, topology
rows supply only the requested display metadata, and the exact immutable intent
owns post-write confirmation. Two aggregate queries and the obsolete
context-shaped brake/topology wrappers are deleted. Bulk poke and triage remain
aggregate enumeration paths. The complete 19-test verse-query binary suite
passes without warnings.

View file

@ -23,6 +23,13 @@ does not claim service physiology. Scheduler tick and cluster runbook retain
aggregate reads because they genuinely enumerate several state families. The
remaining supervisor aggregate consumers are therefore classified.
`epiphany-verse-query poke-daemon` is narrowed as well. It loads one exact
daemon status, the canonical brake, topology-family display metadata, and its
exact written intent by identity. The two aggregate context reads and their
now-dead context wrappers are deleted. Bulk poke, triage, and operator reports
retain aggregate reads because they enumerate daemon state. All 19 verse-query
tests pass with zero warnings.
## Actual receipt-bound turnover accepted - 2026-08-11
Exact pushed `c9a2a979` is now the active actual c006 body. Under a bounded

Binary file not shown.

View file

@ -36,7 +36,7 @@ invariants:
current_status:
summary: Epiphany is a supervised engineering alpha on Starfire, not deployment-ready. Exact b8138a6b active-child SIGTERM and restart, exact 9f369528 deterministic warm packaging, exact c930f505 cross-container ownership, exact ed15f83a resident lifecycle retention, exact 16c4b19f coordinator receipt and Heartbeat artifact retention, exact cce2b8ac narrow model-generation retention, exact eea15e82 model-turn JSON ingress, exact b1e8c89a semantic unattempted-generation retention, exact 6bc3ec3f semantic physical-epoch retirement, and exact 44230a05 Persona conversation retention are proven. Gamecult-ops 059821f owns Yggdrasil stream retention and exact 6ee08a4 owns stable Starfire Persona-permit firewall ingress. Exact 16c4b19f genuine idle and exact a987d2f7 active cognition completed 900-pulse bounded plateaus. Runtime-owned typed fulfillment is accepted live under exact 6dd9b132. Yggdrasil is the small public crossing body, never the release forge.
latest_phase: Exact c9a2a979 is live and braked on actual c006 after accepted two-grant receipt-bound turnover at resident revision 34. The subsequent nervous-system source cut gives restart-policy writing and direct single-daemon reconciliation exact status/policy/brake inputs. Scheduler tick and cluster runbook retain aggregate context because they enumerate multiple owning families. Focused source and brake-semantics tests pass.
latest_phase: Exact c9a2a979 is live and braked on actual c006 after accepted two-grant receipt-bound turnover at resident revision 34. The nervous-system source audit has narrowed restart-policy writing, direct single-daemon reconciliation, and single-target Verse poke to exact status/policy/brake/intent families. Aggregate scheduler, runbook, bulk poke, triage, and report paths retain context because they enumerate multiple owners. Focused tests and all 19 verse-query tests pass without warnings.
operational_state:
local_worktree: exact_c9a2a979_actual_internal_turnover_accepted_next_organ_audit
operator_wireguard: restored
@ -70,7 +70,7 @@ current_status:
yggdrasil_epiphany_service_contract: repaired_in_gamecult_ops_812b427_not_installed
resident_physiology: c006_exact_c9a2a979_alive_braked_revision_34_after_two_receipt_bound_continuation_grants
unresolved_authority: Coordinator receipt, Heartbeat pulse-artifact, genuine-idle and active resource plateaus, exact-grant terminality, restart-persistent cooldown refusal, schedule/action issuance cardinality, runtime-owned typed fulfillment, all three packaged fulfilled-before-receipt lanes, narrow model-generation retention, published model-turn JSON ingress, semantic logical/physical retention, Persona conversation retention, stable Starfire firewall ownership, completed model-adapter session archival, normal coordinator lifecycle opening/error closure/legacy repair/archival, co-resident resident lifecycle retention, authenticated outer-worker attempt retention, deployed supervisor/projector journald ownership, and Docker named-volume atomic snapshot visibility are accepted live. Starfire's Docker Desktop F: bind is rejected for mutable authority after an exact packaged lockless reader observed an empty published snapshot during writer interruption. Historical migrated semantic attempts without recorded physical namespace remain durable and non-retirable. One completed Discord consequence remains blocked by the absent Yggdrasil credential.
next_action: Keep actual c006 exact c9a2a979 alive under its cognitive brake. Continue the narrow local-Verse consumer audit at `epiphany-verse-query poke-daemon`: a single target needs one exact status, the canonical brake, and its exact written intent, not two aggregate Verse projections. Preserve aggregate reads for poke-all, triage, and operator reports that genuinely enumerate daemon state. Yggdrasil never builds.
next_action: Keep actual c006 exact c9a2a979 alive under its cognitive brake. Continue classifying the remaining production `query_epiphany_local_verse_context` callers outside the supervisor and single-target poke. Preserve genuine prompt/report/topology aggregation; cut single-family decision or post-write confirmation paths one owner at a time. Package only after this bounded nervous-system batch closes. Yggdrasil never builds.
active_subgoals:
- Prove Persona, Self, Eyes, Modeling, Imagination, Hands, Soul, Mind, Continuity, and nervous-system behavior individually.

View file

@ -4,8 +4,8 @@ Disposable working memory for one bounded rite.
## Current Subgoal
Cut single-target `epiphany-verse-query poke-daemon` away from the aggregate
local Verse projection.
Classify the remaining production aggregate local-Verse readers outside the
completed supervisor and single-target poke cuts.
## Accepted actual finding
@ -15,19 +15,21 @@ refused stale action with no consequence. Resident state is idle at revision
34, protected consequence families are byte-identical, readiness is active,
and the cognitive brake is engaged.
## Authority map for single-target poke input
## Authority map for remaining classification
- Owner: the requested daemon's exact status owns target identity; the canonical
brake owns poke refusal; the exact written intent owns post-write existence.
- Inputs: one daemon ID/status, one brake, and explicit operator reason/intent
- Owner: each command's output contract decides whether one typed family or an
aggregate projection is legitimate.
- Inputs: remaining production aggregate-query callers and their actual output
fields.
- Outputs: one typed daemon-poke intent and pending-lifecycle-owner projection.
- Derived state: aggregate local Verse context is not single-target authority.
- Forbidden writers: Persona, Hands, unrelated receipts, telemetry, and other
daemon rows cannot influence or be read by this command.
- Shared paths: single poke uses the same narrow brake predicate as bulk poke;
bulk enumeration remains separate.
- Cut line: remove both aggregate queries from the single-target command and
verify the exact intent by key after its write.
- Verification: source-boundary negative, brake scope preservation, missing
daemon refusal, and exact intent round trip.
- Outputs: a keep/cut classification, followed by one bounded owner cut when
justified.
- Derived state: aggregate context is legitimate for prompts, operator reports,
and multi-daemon topology enumeration only.
- Forbidden writers: convenience and post-write reassurance cannot justify
unrelated state-family reads.
- Shared paths: single-target and bulk commands must remain distinct where
their information needs differ.
- Cut line: delete context-shaped wrappers after their last legitimate caller
disappears.
- Verification: source negatives for narrowed commands and complete affected
binary suites without warnings.