diff --git a/epiphany-core/src/bin/epiphany-swarm.rs b/epiphany-core/src/bin/epiphany-swarm.rs index fa4cd815..eff60f58 100644 --- a/epiphany-core/src/bin/epiphany-swarm.rs +++ b/epiphany-core/src/bin/epiphany-swarm.rs @@ -12,8 +12,7 @@ use epiphany_core::{ load_epiphany_cultmesh_swarm_brake, load_resident_self_state, observe_process_instance, prepare_resident_self_launch, publish_resident_provider_readiness, resident_self_child_claim, resident_self_local_provider_status, terminate_process_instance, - validate_bifrost_persona_feedback_source, validate_persona_feedback_store_separation, - validate_resident_self_store_separation, + validate_persona_feedback_store_separation, validate_resident_self_store_separation, }; use serde_json::json; use std::collections::BTreeMap; @@ -61,21 +60,6 @@ fn main() -> Result<()> { println!("{}", serde_json::to_string_pretty(&projection)?); return Ok(()); } - // Status is non-actuating sight. In particular it must not open the - // provider-owned delivery store: CultCache read locking can create or - // rewrite the sibling lock file, which would let a root-run verifier - // poison the service identity's later access. The resident importer owns - // source authentication immediately before it can consume deliveries. - validate_feedback_source_for_command(&args.command, || { - validate_bifrost_persona_feedback_source( - &args.persona_feedback_source_store, - &args.bifrost_feedback_trust_anchor, - &args.policy.release_runtime_id, - &args.feedback_target_repository, - &args.feedback_target_persona, - ) - .map(|_| ()) - })?; if let Some(pressure) = args.pressure.as_ref() { enqueue_resident_self_pressure(&args.state_store, pressure)?; } @@ -106,16 +90,6 @@ fn main() -> Result<()> { Ok(()) } -fn validate_feedback_source_for_command( - command: &CommandKind, - validate: impl FnOnce() -> Result<()>, -) -> Result<()> { - if matches!(command, CommandKind::Status) { - return Ok(()); - } - validate() -} - fn publish_self_readiness(args: &Args) -> Result<()> { let process = capture_process_instance(std::process::id())?; publish_resident_provider_readiness( @@ -139,21 +113,32 @@ fn publish_self_readiness(args: &Args) -> Result<()> { Ok(()) } +fn run_feedback_import_if_released( + brake_engaged: bool, + import: impl FnOnce() -> Result<()>, +) -> Result<()> { + if brake_engaged { + return Ok(()); + } + import() +} + fn cycle( args: &Args, state: &mut ResidentSelfState, ports: &mut NativePorts, ) -> Result { let now = Utc::now().timestamp_millis().max(0) as u64; - import_bifrost_persona_feedback_deliveries( - &args.persona_feedback_source_store, - &args.persona_feedback_store, - &args.bifrost_feedback_trust_anchor, - &args.policy.release_runtime_id, - &args.feedback_target_repository, - &args.feedback_target_persona, - )?; - if !ports.brake_engaged()? { + let brake_engaged = ports.brake_engaged()?; + run_feedback_import_if_released(brake_engaged, || { + import_bifrost_persona_feedback_deliveries( + &args.persona_feedback_source_store, + &args.persona_feedback_store, + &args.bifrost_feedback_trust_anchor, + &args.policy.release_runtime_id, + &args.feedback_target_repository, + &args.feedback_target_persona, + )?; bridge_admitted_persona_feedback_to_heartbeat( &args.persona_feedback_store, &args.heartbeat_store, @@ -161,7 +146,8 @@ fn cycle( &args.policy.model_provider, &args.persona_model_allowed_data_classifications, )?; - } + Ok(()) + })?; bind_runtime_repository_domain( &args.policy.runtime_store, &args.feedback_target_repository, @@ -605,16 +591,16 @@ mod brake_tests { } #[test] - fn status_never_opens_or_validates_the_bifrost_provider_store() -> Result<()> { + fn engaged_brake_does_not_touch_the_bifrost_provider_store() -> Result<()> { let touched = std::cell::Cell::new(false); - validate_feedback_source_for_command(&CommandKind::Status, || { + run_feedback_import_if_released(true, || { touched.set(true); - anyhow::bail!("poison Bifrost store was touched") + anyhow::bail!("absent Bifrost delivery store was touched") })?; assert!(!touched.get()); assert!( - validate_feedback_source_for_command(&CommandKind::Once, || { - anyhow::bail!("non-status path authenticates provider source") + run_feedback_import_if_released(false, || { + anyhow::bail!("released cognition requires Bifrost") }) .is_err() ); diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 75ae94fb..6813a203 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -14,13 +14,17 @@ Current host authority: - The bare-metal replacement is retired and must not steer deployment. - The small Yggdrasil at `94.130.75.184` is canonical for Bifrost, DNS, SSH, WireGuard, and public applications. -- Starfire is authorized to host Epiphany cognition while resource demand is - measured. +- Starfire is the temporary Epiphany cognition body while the resident footprint + is measured. Yggdrasil retains Bifrost and public crossing authority. +- Live Yggdrasil has two EPYC vCPUs, 1.9 GiB RAM, 2 GiB swap, and a 38 GiB + root disk with about 15 GiB free. Base Bifrost is active. Docker, Epiphany, + Idunn, and the typed Bifrost Persona-feedback sidecar are absent. Building the + complete governed stack there would consume the constrained body before a + useful runtime measurement exists. - Starfire runtime identity is `epiphany-starfire`; its local Verse is bootstrapped and its canonical swarm brake is engaged. -- Native status completes and reports a cold runtime that needs source regather. -- Resident physiology and the governed Starfire-to-Yggdrasil crossing remain - to be started and proved. +- Native Starfire status completes and reports a cold runtime that needs source + regather. An exact Windows release is being packaged as the temporary body. No cognition release, broad Wake, or host reboot is authorized during the braked startup proof. @@ -42,10 +46,10 @@ braked startup proof. ## Next action -Package the exact clean Starfire source, initialize heartbeat and resident Self -stores beneath the engaged brake, start supervised resident physiology, and -prove stable readiness. Then connect the existing Yggdrasil Bifrost transport -without moving cognition or state-admission authority off Starfire. +Finish and authenticate the Starfire package. Start heartbeat and resident Self +under the engaged brake, prove stable physiology, then install the typed +Bifrost Persona-feedback provider on Yggdrasil and establish an authenticated +delivery crossing before any cognition release. ## Immediate Re-entry Instruction diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 7dff42bb..9d7e6e81 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 2a2f3dc3..c3340165 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -4,7 +4,7 @@ experiment: purpose: Native, inspectable agent organism with typed state and explicit organ authority. objective: - current: Run Epiphany's cognition body on Starfire, keep Bifrost crossings on the adopted small Yggdrasil, and prove sustained braked readiness before one bounded Persona conversation. + current: Run Epiphany cognition on Starfire under the canonical brake, retain Bifrost and public crossing authority on the small Yggdrasil, and measure the resident footprint before deciding how much Yggdrasil must grow. architecture: body: Repository, runtime, service processes, stores, interfaces, and deployment substrate. @@ -34,29 +34,32 @@ invariants: - Evidence and git retain history; this map retains only state that changes future decisions. current_status: - summary: The retired bare-metal host is gone. The small Yggdrasil at 94.130.75.184 is the canonical public/crossing body and continues to own Bifrost, DNS, SSH, WireGuard, and public applications. Starfire is the authorized cognition/runtime body while Epiphany's RAM needs are measured. Starfire now has runtime identity epiphany-starfire, a bootstrapped local Verse, and an engaged canonical swarm brake. Native status completes against the cold runtime and correctly requests source regather before work. Resident physiology and the Yggdrasil Bifrost crossing are not yet running end to end. + summary: The small Yggdrasil at 94.130.75.184 is the canonical public and Bifrost host. Live inspection proves Ubuntu 24.04, two EPYC vCPUs, 1.9 GiB RAM, 2 GiB swap, a 38 GiB disk with 15 GiB free, active base Bifrost, PostgreSQL, Redis, nginx, and WireGuard. Epiphany, Idunn, Docker, and the typed Bifrost Persona-feedback sidecar are absent there. Building the complete governed stack locally would consume the constrained body before runtime demand can be measured, so Starfire is the adopted temporary cognition body. Its local Verse and runtime identity exist, its canonical brake is engaged, and its exact Windows package is building. operational_state: local_worktree: deployment_changes_in_progress operator_wireguard: restored yggdrasil: canonical_small_public_crossing_body - starfire: authorized_epiphany_cognition_body + starfire: temporary_epiphany_cognition_body starfire_runtime_identity: epiphany-starfire starfire_swarm_brake: canonical_engaged starfire_native_status: cold_needs_regather - bifrost: active_on_yggdrasil + bifrost: base_application_active_on_yggdrasil + bifrost_persona_feedback: absent_on_yggdrasil + yggdrasil_epiphany_services: absent resident_physiology: not_started - unresolved_authority: Define and prove the split-host provider/health boundary so Starfire cognition and Yggdrasil Bifrost transport remain separate owners. - next_action: Package the exact clean Starfire release, initialize heartbeat and resident Self stores under the engaged brake, start supervised physiology, and verify sustained readiness before wiring Bifrost transport. + unresolved_authority: Establish a typed authenticated delivery crossing from Yggdrasil Bifrost to Starfire before releasing cognition. + next_action: Finish and authenticate the Starfire package, run heartbeat and resident Self under the engaged brake, then build the typed Yggdrasil feedback crossing and measure sustained Starfire resident memory. active_subgoals: - - Start Starfire resident physiology from an authenticated packaged release under the engaged brake. - - Connect Yggdrasil Bifrost as a governed crossing without moving Persona cognition authority. + - Start authenticated Starfire heartbeat and resident Self while the canonical brake is engaged. + - Install the typed Bifrost Persona-feedback provider on Yggdrasil and cross only authenticated deliveries. + - Measure Starfire resident memory to size a future Yggdrasil upgrade. forbidden_actions: - Do not issue a speculative deployment grant. - Do not broadly Wake the swarm. - Do not reboot Yggdrasil as part of diagnosis. - - Do not move RAM-heavy cognition onto the small Yggdrasil until measured demand justifies growing it. + - Do not build the complete governed stack on constrained Yggdrasil until its disk and memory budget has been deliberately increased. - Do not treat stored status, process liveness, or an old receipt as current authority. memory_policy: