From b8138a6b89966ff68932f4cadfb7d035659b04c0 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 9 Aug 2026 09:33:48 +0100 Subject: [PATCH] Report shutdown cancellation as braked --- epiphany-core/src/bin/epiphany-swarm.rs | 18 ++++++++++++++++-- notes/fresh-workspace-handoff.md | 15 +++++++++++++++ state/map.yaml | 4 ++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-swarm.rs b/epiphany-core/src/bin/epiphany-swarm.rs index 66c4dd10..149f0700 100644 --- a/epiphany-core/src/bin/epiphany-swarm.rs +++ b/epiphany-core/src/bin/epiphany-swarm.rs @@ -188,6 +188,14 @@ fn cancelled_turn_status( } } +fn outcome_after_cancel(shutdown_requested: bool) -> ResidentSelfOutcome { + if shutdown_requested { + ResidentSelfOutcome::Braked + } else { + ResidentSelfOutcome::Failed + } +} + fn cycle( args: &Args, state: &mut ResidentSelfState, @@ -330,7 +338,7 @@ fn cycle( now, )?; *state = load_resident_self_state(&args.state_store)?; - Ok(ResidentSelfOutcome::Failed) + Ok(outcome_after_cancel(shutdown_requested)) } ChildObservation::Missing => { cancel_resident_self_turn( @@ -341,7 +349,7 @@ fn cycle( now, )?; *state = load_resident_self_state(&args.state_store)?; - Ok(ResidentSelfOutcome::Failed) + Ok(outcome_after_cancel(shutdown_requested)) } }; } @@ -687,6 +695,12 @@ mod brake_tests { assert_eq!(cancelled_turn_status(false, false, false), "process-failed"); } + #[test] + fn shutdown_cancellation_is_a_braked_outcome_not_a_failure() { + assert_eq!(outcome_after_cancel(true), ResidentSelfOutcome::Braked); + assert_eq!(outcome_after_cancel(false), ResidentSelfOutcome::Failed); + } + #[test] fn shutdown_wait_returns_immediately_when_already_requested() { let requested = AtomicBool::new(true); diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 44963e9d..bfebef03 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1,5 +1,20 @@ # Fresh workspace handoff +## Active resident shutdown proof — 2026-08-09 + +Exact authenticated `00ee3821` idle SIGTERM exited zero. In the active proof, +the packaged coordinator was frozen as PID 103, PID 1 received SIGTERM, the +child retained pending termination, and resumption terminalized the child +before the resident exited zero in 2.023 seconds. The packaged operator +projection nevertheless reported `failed`; source now maps shutdown +cancellation to `Braked`, with a focused invariant test. Package and replay +that exact correction once. + +An attempted live admission also proved that a second process can write typed +pressure which the resident's in-memory state later overwrites. Preserve the +active6 receipts. This is a resident-store single-writer/command-ingress seam, +not permission to add a retrying sidecar writer. + ## Release-construction bootstrap extracted — 2026-08-09 Commit `76afdaf0ce863f19e9396ef4d21ed8ff3fb39690` moves package diff --git a/state/map.yaml b/state/map.yaml index 65e9a782..fe2712b8 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -35,7 +35,7 @@ invariants: - Evidence and git retain history; this map retains only state that changes future decisions. current_status: - summary: Epiphany is a supervised engineering alpha on Starfire, not deployment-ready. The persistent c005 Linux body proves heartbeat, Self coordination, governed Eyes-to-Modeling cognition, causal routing, native Imagination, dedicated Mind adoption, typed Hands relinquishment, and authenticated hard-stop/body-replacement recovery without external consequence. The active 9b8df0b4 body is bound to the authoritative eyes-tools runtime, Mind, and local Verse and derives awaitFrontierProposal; the old root runtime is retained evidence only. Exact 76afdaf0 separates narrow release construction from live Verse publication and is published but not activated. Bootstrap compilation fell from 7m57s to 30.24s cold and 4.40s warm; full warm packaging remains about 10 seconds. Graceful shutdown, retention, long-duration plateau, log ownership, and stable Starfire firewall ownership remain open. Yggdrasil is the small public crossing body, never the release forge. + summary: Epiphany is a supervised engineering alpha on Starfire, not deployment-ready. Exact 00ee3821 adds resident Self signal ownership. Idle SIGTERM exits zero, and an exact authenticated active coordinator was stopped, given pending SIGTERM, resumed, terminalized, and followed by a zero resident exit. That live proof exposed a false failed operator projection after successful shutdown cancellation; source now derives Braked for shutdown cancellation and awaits exact packaging. Concurrent external writes to the live resident store can be overwritten by its in-memory owner and remain an open authority seam. Retention, long-duration plateau, log ownership, and stable Starfire firewall ownership remain open. Yggdrasil is the small public crossing body, never the release forge. latest_phase: Commit 76afdaf0 moved release construction, filesystem verification, and witness inspection out of monolithic epiphany-core into epiphany-release-construction; core retains only CultMesh publication, load, and authentication. The bootstrap dependency graph excludes epiphany-core, all 19 construction tests pass, and the full core test harness compiles. Exact Linux bootstrap fell from 7m57s to 30.24s cold and 4.40s warm. Exact source 76afdaf0 then produced warning-free 24-binary release sha256-30caab9ef1ea89f9a885d87832b1e312a35288ec3f895bd5b0e83f7f7a6a1aec with witness sha256-89c2ad604254faec3e1e01f753b5dff38a402f43d009074ba4b47b1ec46fdecf. Independent inspection accepted the 12m16s cold build and the identical 10.16s warm replay with Cargo at 0.82s. The packaged full publisher accepted the narrow constructor's witness and changed c005 local-verse.cc from SHA-256 b160c610988753278afbad7f5bad436193144a92e9fd506982099ad58d213909 to 83ed430f5bf0c33996d7c4ee7bf0fa6c9f5f80bc8db94621395ea560852cae81 without body activation. operational_state: local_worktree: release_construction_receipts_pending_commit @@ -69,7 +69,7 @@ current_status: yggdrasil_epiphany_service_contract: repaired_in_gamecult_ops_812b427_not_installed resident_physiology: authenticated_9b8df0b4_c005_bound_to_eyes_tools_nervous_system_with_217dd_and_bd96305e_helpers_running unresolved_authority: SIGTERM is not observed by epiphany-swarm; serve owns an unconditional loop and blocking sleep, so Docker stops end in exit 137 even while idle. Repository Body observation still performs two authenticated full-tree Git index/manifest passes. Execute-mode workers require a persistent process body. Keyed storage has not earned live migration. One Discord consequence remains blocked by the absent Yggdrasil credential. Resident stdout/stderr logs remain an unbounded supervisor-owned surface. - next_action: Commit and push the exact 76afdaf0 construction/package/publication receipts. Implement one signal owner that prevents new work, preserves unclaimed prepared authority, forwards SIGTERM to an exact active child, terminalizes shutdown without failure pressure, and exits zero only after the child is gone. Prove idle and active shutdown plus restart on authoritative stores. + next_action: Commit the shutdown-projection correction, construct one exact release, replay the active-child SIGTERM proof, and require final braked projection with shutdown-cancelled acknowledgement and no failure pressure. Then prove restart and address the live resident-store single-writer seam before retention and endurance. active_subgoals: - Prove Persona, Self, Eyes, Modeling, Imagination, Hands, Soul, Mind, Continuity, and nervous-system behavior individually.