Narrow daemon policy state input

This commit is contained in:
Meta Vens 2026-08-11 02:38:51 +02:00
commit 5611becb5e
9 changed files with 151 additions and 43 deletions

View file

@ -31,6 +31,7 @@ use epiphany_core::idunn_recover_memory_semantic_projection_from_cultmesh;
use epiphany_core::load_epiphany_cultmesh_cluster_topology;
use epiphany_core::load_epiphany_cultmesh_daemon_restart_policy;
use epiphany_core::load_epiphany_cultmesh_daemon_service_lifecycle_receipts;
use epiphany_core::load_epiphany_cultmesh_daemon_status;
use epiphany_core::load_epiphany_cultmesh_managed_service_policies;
use epiphany_core::load_epiphany_cultmesh_managed_service_policy;
use epiphany_core::load_epiphany_cultmesh_managed_service_policy_with_digest;
@ -3586,12 +3587,12 @@ fn run_tick(args: &Args, iteration: u64, next_wake_utc: Option<String>) -> Resul
fn write_policy(args: Args) -> Result<()> {
require_supervisor_bootstrap(&args)?;
let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?;
let daemon_status = context
.daemon_statuses
.iter()
.find(|status| status.daemon_id == args.daemon_id)
.with_context(|| format!("local Verse has no daemon status for {:?}", args.daemon_id))?;
let daemon_status = load_epiphany_cultmesh_daemon_status(
&args.store,
args.runtime_id.clone(),
&args.daemon_id,
)?
.with_context(|| format!("local Verse has no daemon status for {:?}", args.daemon_id))?;
let command = args
.restart_command
.clone()
@ -4625,6 +4626,17 @@ mod semantic_projector_authority_tests {
}
}
#[test]
fn policy_write_reads_only_the_exact_daemon_status_family() {
let source = include_str!("epiphany-daemon-supervisor.rs");
let start = source.find("fn write_policy(").unwrap();
let tail = &source[start..];
let end = tail.find("\nfn ").unwrap();
let body = &tail[..end];
assert!(body.contains("load_epiphany_cultmesh_daemon_status"));
assert!(!body.contains("query_epiphany_local_verse_context"));
}
#[test]
fn workspace_coverage_launch_uses_only_specialized_process_authority() {
let source = include_str!("epiphany-daemon-supervisor.rs");

View file

@ -6397,6 +6397,15 @@ pub fn load_epiphany_cultmesh_daemon_liveness(
Ok(rows)
}
pub fn load_epiphany_cultmesh_daemon_status(
store_path: impl AsRef<Path>,
runtime_id: impl Into<String>,
daemon_id: &str,
) -> Result<Option<EpiphanyCultMeshDaemonStatusEntry>> {
let node = open_epiphany_cultmesh_node(store_path, runtime_id)?;
node.get(daemon_id)
}
pub fn load_epiphany_cultmesh_daemon_restart_policy_directory(
store_path: impl AsRef<Path>,
runtime_id: impl Into<String>,
@ -9818,6 +9827,14 @@ mod tests {
None
);
assert!(load_epiphany_cultmesh_cluster_topology(&store, "epiphany-test")?.is_empty());
assert_eq!(
load_epiphany_cultmesh_daemon_status(
&store,
"epiphany-test",
"epiphany-daemon-hands"
)?,
None
);
assert!(load_epiphany_cultmesh_daemon_liveness(&store, "epiphany-test")?.is_empty());
assert!(
load_epiphany_cultmesh_daemon_restart_policy_directory(&store, "epiphany-test")?
@ -9840,6 +9857,39 @@ mod tests {
Ok(())
}
#[test]
fn exact_daemon_status_loader_reads_only_the_requested_envelope() -> Result<()> {
let temp = tempfile::tempdir()?;
let store = temp.path().join("epiphany-daemon-status.ccmp");
let statuses = write_epiphany_cultmesh_daemon_statuses(
&store,
"epiphany-test",
"2026-06-17T00:00:00Z",
)?;
let expected = statuses
.into_iter()
.find(|status| status.daemon_id == "epiphany-daemon-hands")
.expect("Hands daemon status exists");
assert_eq!(
load_epiphany_cultmesh_daemon_status(
&store,
"epiphany-test",
"epiphany-daemon-hands"
)?,
Some(expected)
);
assert_eq!(
load_epiphany_cultmesh_daemon_status(
&store,
"epiphany-test",
"epiphany-daemon-absent"
)?,
None
);
Ok(())
}
#[test]
fn daemon_status_refuses_private_state_exposure() -> Result<()> {
let mut status = epiphany_cultmesh_daemon_statuses("2026-06-17T00:00:00Z")

View file

@ -490,6 +490,7 @@ pub use cultmesh_integration::load_epiphany_cultmesh_daemon_poke_intent;
pub use cultmesh_integration::load_epiphany_cultmesh_daemon_poke_receipt;
pub use cultmesh_integration::load_epiphany_cultmesh_daemon_restart_policy;
pub use cultmesh_integration::load_epiphany_cultmesh_daemon_restart_policy_directory;
pub use cultmesh_integration::load_epiphany_cultmesh_daemon_status;
pub use cultmesh_integration::load_epiphany_cultmesh_daemon_service_lifecycle_receipt;
pub use cultmesh_integration::load_epiphany_cultmesh_daemon_service_lifecycle_receipts;
pub use cultmesh_integration::load_epiphany_cultmesh_daemon_tool_directory;

View file

@ -3658,3 +3658,25 @@ terminal completed, resident state is idle at revision 34, the four protected
Hands/Persona/deployment-family envelopes are byte-identical, and final
authenticated readiness is active, brake-engaged, and reason-free. Actual
receipt-bound turnover is accepted.
## Narrow local Verse decision inputs
Aggregate local Verse context is an operator and topology projection, not a
default decision input. A command may read it only when its output genuinely
depends on several state families.
- Owner: each typed state family owns the decisions made from that family.
- Inputs: the single-daemon restart-policy writer reads one exact daemon-status
envelope plus explicit CLI policy fields.
- Outputs: one daemon restart policy bound to the status-owned daemon and
cluster identity.
- Derived state: Persona, Hands, receipt, telemetry, and unrelated daemon rows
remain projection data and cannot influence this write.
- Shared paths: `policy` and `write-policy` converge on the same writer.
- Cut line: `write_policy` no longer calls
`query_epiphany_local_verse_context`; reconciliation and runbook construction
retain aggregate reads because they enumerate policies, statuses, topology,
and brake scope.
- Verification: the exact loader returns only the requested typed envelope and
remains non-creating on an absent store; a source-boundary test refuses
aggregate-query regression in `write_policy`.

View file

@ -1,5 +1,20 @@
# Fresh workspace handoff
## Exact daemon-policy input cut - 2026-08-11
The refreshed Perfect Machine roadmap no longer names exact `16407f7e`,
resident revision 26, or multi-grant turnover as current work. Exact
`c9a2a979`, revision 34, and the accepted two-grant actual replay are current.
The next nervous-system audit cut removes aggregate local-Verse context from
the single-daemon restart-policy writer. One exact typed daemon-status envelope
now owns the daemon and cluster identity copied into policy state. Persona,
Hands, receipts, telemetry, and unrelated daemon rows are not loaded. Aggregate
context remains with reconciliation and runbook paths that genuinely enumerate
topology, policies, statuses, and brake state. The exact loader test and the
negative source-boundary test pass. Continue classifying aggregate consumers;
do not package until a meaningful bounded batch earns a live body.
## Actual receipt-bound turnover accepted - 2026-08-11
Exact pushed `c9a2a979` is now the active actual c006 body. Under a bounded

View file

@ -1,6 +1,6 @@
# Perfect Machine audit roadmap
Updated: 2026-08-10
Updated: 2026-08-11
## Objective
@ -12,13 +12,13 @@ actual c006 behavior are the live gates.
## Current body
- Source branch: `codex/epiphany-shakedown-live`.
- Accepted runtime implementation: exact `16407f7e`.
- Accepted runtime implementation: exact `c9a2a979`.
- Linux release:
`sha256-66cf1c2f4d88e7885a36870277cf4b143204de9c9b0dad0ed8f809983b3c55af`.
`sha256-78b09d7c32867c71d593951f328a191b7261600a1d9e81d7fdcd35ce7414f218`.
- Witness:
`sha256-5f41248bb11c01f19125f16bf39f3dfcc2a802de211f3eae7e2caf292d59e4b3`.
`sha256-ddf32da018f5a53eb87f3ed5b87ccfa57616203970d6fdab9641ee1ac8f71f24`.
- Actual c006: Heartbeat and resident Self alive in distinct containers,
cognitive brake engaged, resident revision 26, readiness `active` with no
cognitive brake engaged, resident revision 34, readiness `active` with no
reasons.
- Build body: Starfire. Yggdrasil is the small public crossing and never builds
this graph.
@ -27,7 +27,7 @@ actual c006 behavior are the live gates.
| Faculty | Owner | Accepted proof | Remaining live gate |
|---|---|---|---|
| Self | resident Self state machine | single-consumption Heartbeat grants, typed fulfillment, exact recovery/requeue, cooldown and brake behavior; actual c006 completed its retained proposal-Modeling grant once | broader autonomous frontier turnover across several consecutive causal grants |
| Self | resident Self state machine | single-consumption Heartbeat grants, typed fulfillment, exact recovery/requeue, cooldown and brake behavior; actual c006 completed two receipt-bound causal grants after its retained proposal-Modeling grant | autonomous turnover from a genuinely new typed frontier; current `awaitFrontierProposal` is correctly idle |
| Substrate Gate | `substrate_gate` | scoped read/mutation grants on Eyes and Hands paths | audit remaining utility and compatibility actuators for bypasses |
| Eyes | Eyes gateway and authenticated source tools | challenged-claim Windows circuit and governed Linux tool circuit accepted into Mind | one broader foreign/public Verse evidence adoption path |
| Modeling | runtime-owned typed Modeling contracts | causal Eyes-to-Modeling acceptance, direct proposal Modeling, archived fulfillment | broader Body-map coverage across a changing live repository |
@ -36,8 +36,8 @@ actual c006 behavior are the live gates.
| Soul | Soul gateway | consequence-bound verdict, causal Modeling route, retention and replay | collapse remaining verifier-specific broad projections into narrow receipt reads |
| Mind | canonical transactions and specialized admission | atomic RepoModel admission, launch-owned adjudication, semantic/runtime retention | audit remaining state families for legacy writers and run longer memory behavior |
| Persona | Persona turn, speech audit, public mouth | cross-host request/permit/receipt, signed failure and unknown no-repost behavior, conversation retention | one completed public consequence; currently blocked by absent Yggdrasil Discord credential |
| Continuity | runtime/resident recovery and retention | graceful shutdown, exact process-death recovery, session closure/archive, lifecycle retention, non-resurrection | latest-body long-duration plateau and later deployed restart supervision |
| Nervous system | Heartbeat, runtime spine, Idunn, CultMesh | detached scheduling, typed jobs, provider readiness, active/warming transitions across PID namespaces | latest-body 900-pulse plateau; continue narrowing whole-Verse reads |
| Continuity | runtime/resident recovery and retention | graceful shutdown, exact process-death recovery, session closure/archive, lifecycle retention, non-resurrection, and latest-body long-duration plateau | later deployed restart supervision |
| Nervous system | Heartbeat, runtime spine, Idunn, CultMesh | detached scheduling, typed jobs, provider readiness, active/warming transitions across PID namespaces, latest-body 923-pulse plateau, and two consecutive causal grants | continue narrowing whole-Verse reads |
| Body | Rust binaries, named-volume CultCache stores, model transport | deterministic 24-binary packaging, fast warm replay, named-volume interruption proof | deployment-sized endurance and remaining inspection surfaces |
## Accepted coordinated circuits
@ -64,6 +64,14 @@ exact-zero state/workspace growth, Heartbeat RSS 28.63-28.88 MiB, resident RSS
`active` under the engaged brake. Receipts:
`.epiphany-run/c006-endurance-16407f7e`.
Exact `c9a2a979` then completed two consecutive receipt-bound causal grants on
actual c006. The first performed one exact Modeling failure-review supersession;
the second refused stale action before consequence and settled on
`awaitFrontierProposal`. Both grants terminalized, resident state returned idle
at revision 34, protected consequence families stayed byte-identical, and the
cognitive brake was re-engaged. Receipts:
`.epiphany-run/c006-continuation-c9a2a979`.
## Active rite
### Narrow local Verse consumers
@ -76,14 +84,15 @@ actually enumerates daemon rows. Continue classifying remaining
`query_epiphany_local_verse_context` production callers by output ownership;
do not replace a legitimate aggregate projection with a pile of ad hoc reads.
## Selected next broad circuit
## Selected next bounded cut
Run autonomous frontier turnover across Self, Eyes, Modeling, Imagination, and
Mind. Map the current live frontier owner, then use copied exact `16407f7e`
state to prove several consecutive causal grants and typed settlements without
Hands or Persona consequence. Only after copied-state acceptance may actual
c006 receive an explicit bounded brake window; the brake must be re-engaged and
readiness re-proven at closure. `state/map.yaml` owns the exact current action.
Finish classifying production whole-Verse readers by the state families they
actually own. Aggregate operator projections, cluster reconciliation, and
commands that genuinely enumerate topology may retain the complete context.
Single-daemon policy writes and lifecycle gates must use exact daemon-status
and brake loaders instead of reading unrelated Persona, Hands, receipt, and
telemetry families. Cut one owner at a time with source-order negatives; do not
replace a legitimate aggregate with a collection of accidental queries.
## Completion standard

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 on actual c006 as release sha256-78b09d7c32867c71d593951f328a191b7261600a1d9e81d7fdcd35ce7414f218 with witness sha256-ddf32da018f5a53eb87f3ed5b87ccfa57616203970d6fdab9641ee1ac8f71f24. The bounded actual replay reproduced copied receipt-bound turnover: grant 44 superseded the malformed Modeling result once in receipt 1786407375735; distinct grant 48 then refused stale reviewModelingResult because live action was awaitFrontierProposal and closed in receipt 1786407379115. Both grants are terminal completed, resident state is idle at revision 34, the cognitive brake is engaged, readiness is active and reason-free, and Hands/Persona/deployment envelopes stayed byte-identical.
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 makes one exact daemon-status envelope own restart-policy identity; the policy writer no longer reads unrelated aggregate local-Verse state, and focused positive/negative tests pass.
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: Treat actual c006 action awaitFrontierProposal as typed waiting state, not permission to invent a proposal. Keep exact c9a2a979 alive under the cognitive brake, inspect the remaining organ matrix and current authoritative stores, then select one bounded next audit with an existing owner and falsifiable completion condition. Yggdrasil never builds.
next_action: Keep actual c006 exact c9a2a979 alive under its cognitive brake. Continue the narrow local-Verse consumer audit at direct single-daemon reconciliation: it needs one exact daemon status, its exact restart policy, and the canonical brake, not Persona, Hands, receipt, or unrelated telemetry families. Preserve aggregate context for scheduler tick and cluster runbook enumeration. Yggdrasil never builds.
active_subgoals:
- Prove Persona, Self, Eyes, Modeling, Imagination, Hands, Soul, Mind, Continuity, and nervous-system behavior individually.
@ -88,7 +88,7 @@ organ_readiness:
soul: proven for the current bounded route-chain consequence; exact d3bfbda0 launched Verification through typed plan-decision provenance, result f23fe2b6 was accepted at revision 57, and Self then derived Modeling before any repeated Hands authority.
mind: proven for launch-owned resident frontier adjudication; two historical attempts failed closed, exact bd96305e derived immutable identity from authenticated launch, authorized retry 2d2a3e8b completed, and Self atomically committed terminal adopt decision e7d7f3c7. Broader memory retention and long-duration behavior remain open.
continuity: partial; authenticated 55660d78 terminalized the copied v28 dead worker once and refused duplicate restart, while sealed v28 remained unchanged. Exact 100d8854 closes only all-terminal sessions, emits one deterministic event, and refuses post-close jobs. Exact 42bc665a proves bounded retention and restart sequence recovery. A digest-pinned Linux runtime-spine at b5140288 repeated closure invariants on Yggdrasil. Authenticated c005 proves typed resident state survives hard exit, executable-body replacement, runtime-topology correction, and restart while preserving awaitFrontierProposal. Exact b8138a6b proves active-child and idle SIGTERM closure with exit zero and final braked state. Exact c930f505 proves cross-container resident ownership refusal without state mutation while Heartbeat retains its distinct typed lock. Exact ed15f83a packages resident lifecycle retention. Exact 16c4b19f packages coordinator receipt retention without resurrection. Exact 75b84180 packaged Linux proves worker start gating, claimed/active orphan death recovery, canonical resident requeue, and one distinct same-request retry without dual live authority. Exact 7637b1cf packages and proves atomic generic job/result/event plus terminal-failure process closure, canonical resident settlement, and a distinct same-request retry with no dual live authority. Exact 2e66433f packaged Self proves admitted-model-direction valid-result-before-receipt closes once without retry. Exact 52ee6b53 packages the corrected full-backing resident retention fence. Exact 53678374 packages authenticated failed and fulfilled outer-worker archival: window one retires only the older exact seven-envelope family, retained authority stays live, archived failure cannot resurrect, and archived fulfillment remains queryable. Direct packaged proposal Modeling and deployed journald ownership are accepted. Exact a4756857 packages CultCache 0ba8745 and proves named-volume publication across forty SIGKILL writers plus ten million concurrent lockless reads; copied c006 once and SIGTERM restart remain braked and clean. Its unconsumed nonterminal grant exactly matches Heartbeat's running coordinator turn and is coherently held by the brake.
nervous_system: partial; detached scheduling, runtime jobs, typed feedback, ordinary Windows coverage-store identity, and operator projection work. Exact c0055772 proves Linux heartbeat acknowledgement/regrant, Self single-consumption launch, authenticated plan coordinator completion, and a persistent resident body. The accepted Linux Eyes-to-Modeling circuit proves detached role workers, native read-only tool loops, typed admission, and causal next-organ routing. Exact 16407f7e now adds cross-container readiness ownership and an actual c006 923-pulse braked plateau: zero grant/lease/revision violations, exact stable stores, narrow RSS bands, both role owners live, and final readiness active. Broader multi-grant pressure turnover and remaining legitimate whole-Verse consumers remain open. Yggdrasil is not a release forge at its current memory budget.
nervous_system: partial; detached scheduling, runtime jobs, typed feedback, ordinary Windows coverage-store identity, and operator projection work. Exact c0055772 proves Linux heartbeat acknowledgement/regrant, Self single-consumption launch, authenticated plan coordinator completion, and a persistent resident body. The accepted Linux Eyes-to-Modeling circuit proves detached role workers, native read-only tool loops, typed admission, and causal next-organ routing. Exact 16407f7e adds cross-container readiness ownership and an actual c006 923-pulse braked plateau. Exact c9a2a979 adds two consecutive causal grants with clean terminal settlement. Remaining legitimate whole-Verse consumers remain under source audit. Yggdrasil is not a release forge at its current memory budget.
forbidden_actions:
- Do not issue a speculative deployment grant.

View file

@ -4,8 +4,8 @@ Disposable working memory for one bounded rite.
## Current Subgoal
Inspect the remaining organ matrix after accepted actual receipt-bound turnover
and select one bounded next audit from authoritative state.
Cut direct single-daemon reconciliation away from the aggregate local Verse
projection.
## Accepted actual finding
@ -15,21 +15,20 @@ 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 next selection
## Authority map for direct reconciliation input
- Owner: the canonical map and live typed stores own what remains open; the
`awaitFrontierProposal` projection does not own backlog creation.
- Inputs: current organ readiness, unresolved authority, typed runtime state,
retained receipts, live readiness, and the accepted evidence ledger.
- Outputs: one named bounded audit with a single owner, exact body, negative
gate, and receipt path.
- Derived state: historical phase prose and old action summaries are context,
not current authority.
- Forbidden writers: idle Heartbeat, operator guesswork, or stale proposal
artifacts may not fabricate work merely to keep c006 busy.
- Shared paths: map, handoff, algorithmic map, and live status must agree on the
chosen audit before the brake opens.
- Cut line: delete or demote stale open-work claims before implementing another
mechanism.
- Verification: the next audit must falsify a live invariant at its owning
layer and preserve the external-consequence gates.
- Owner: the requested daemon's exact status and restart policy own direct
reconciliation; the canonical brake owns consequence refusal.
- Inputs: one daemon status, one exact policy or explicit override, one brake,
and explicit CLI force/reason fields.
- Outputs: one bounded daemon-poke attempt or a typed no-op/refusal.
- Derived state: aggregate local Verse context is not direct reconciliation
authority.
- Forbidden writers: Persona, Hands, unrelated receipts, telemetry, and other
daemon rows cannot influence or be read by this command.
- Shared paths: direct `reconcile` and its action helper must consume the same
narrow brake input; scheduler enumeration remains separate.
- Cut line: replace direct reconcile's whole-context query and context-shaped
brake helper without weakening scope/surface checks.
- Verification: source-boundary negative, engaged/released brake behavior, and
exact-status absence refusal.