feat(wake): W6 — off-host dead-man beacon + pluggable alarm-sink adapter
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful

A8 of the wake canon (EPIC #892, W6): the independent liveness leg.

beacon.sh:
- MONOTONIC EMITTER (emit): strictly-increasing seq + emit_ts each cycle,
  shipped off-host via a pluggable sink adapter. The primitive the detector
  run-loop calls each poll (§1.3).
- DEAD-MAN / ABSENCE alarm (record + check): the off-host monitor's receiver
  and absence check. A missing/stale-past-SLO beacon FIRES the alarm and ROUTES
  it to a human/other-host, depending on nothing the dying host does (§1.3/§4-G1).
- PLUGGABLE alarm-sink / beacon-sink ADAPTER INTERFACE: the framework ships the
  emitter + interface; the operator owns the target endpoint, resolved BY NAME
  (load_credentials), never inlined (§1.4). FAIL-CLOSED: unconfigured OR
  unreachable target FAILS LOUD — no silent no-alarm host (§4-G2a).
- DEGRADED MODES (honest, not silent): a same-host sibling is REJECTED as
  non-independent (shares user-manager/host/sender/socket/session); an isolated
  host degrades to a FLAGGED different-supervision-root beacon; capture-pane is
  a liveness HINT only (§1.3).

detector.sh: a single minimal, opt-in W6 emit seam in the run-loop (inert unless
the operator wires WAKE_BEACON_SINK_CMD; a beacon emit failure never kills the
loop but is loud). No store/ack/digest/sign code touched.

test-wake-beacon.sh: RED-FIRST harness (10 invariant groups), wired into
test:framework-shell. manifest.txt bumped 0.4.0 -> 0.5.0 + inventory.

Part of #892

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0158NZqN2n2ymKFeJAZ4GUCb
This commit is contained in:
mosaic-coder
2026-07-25 21:18:51 -05:00
parent 320f5bfb6f
commit 060977c732
5 changed files with 722 additions and 3 deletions

View File

@@ -25,7 +25,7 @@
"lint": "eslint src",
"typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests && pnpm run test:framework-shell",
"test:framework-shell": "python3 src/lease-broker/daemon_deadline_unittest.py && python3 src/lease-broker/normative_fragments_unittest.py && python3 src/lease-broker/receipt_challenge_unittest.py && python3 src/lease-broker/context_recovery_unittest.py && python3 src/lease-broker/recovery_runtime_unittest.py && python3 src/lease-broker/recovery_b1_adversarial_unittest.py && python3 src/lease-broker/framework_skill_portability_unittest.py && python3 src/mutator-gate/runtime_tools_unittest.py && python3 src/mutator-gate/runtime_launch_guard_unittest.py && python3 src/mutator-gate/version_coupling_unittest.py && python3 framework/tools/lease-broker/check-runtime-launches.py --root ../.. && bash framework/tools/codex/test-pr-diff-context.sh && bash framework/tools/qa/test-deps-preflight.sh && bash framework/tools/git/test-pr-review-gitea-comment.sh && bash framework/tools/git/test-pr-review-repo-host-override.sh && bash framework/tools/git/test-ci-queue-wait-branch-absent.sh && bash framework/tools/git/test-git-credential-mosaic.sh && bash framework/tools/git/test-gitea-token-identity.sh && bash framework/tools/_scripts/test-install-ordering-guard.sh && bash framework/tools/tmux/agent-send.test.sh && bash framework/tools/wake/test-wake-store-ack.sh && bash framework/tools/wake/test-wake-digest-hmac.sh && bash framework/tools/wake/test-wake-detector.sh && bash framework/tools/wake/test-wake-fn-oracle.sh && bash framework/tools/wake/test-wake-reconcile.sh"
"test:framework-shell": "python3 src/lease-broker/daemon_deadline_unittest.py && python3 src/lease-broker/normative_fragments_unittest.py && python3 src/lease-broker/receipt_challenge_unittest.py && python3 src/lease-broker/context_recovery_unittest.py && python3 src/lease-broker/recovery_runtime_unittest.py && python3 src/lease-broker/recovery_b1_adversarial_unittest.py && python3 src/lease-broker/framework_skill_portability_unittest.py && python3 src/mutator-gate/runtime_tools_unittest.py && python3 src/mutator-gate/runtime_launch_guard_unittest.py && python3 src/mutator-gate/version_coupling_unittest.py && python3 framework/tools/lease-broker/check-runtime-launches.py --root ../.. && bash framework/tools/codex/test-pr-diff-context.sh && bash framework/tools/qa/test-deps-preflight.sh && bash framework/tools/git/test-pr-review-gitea-comment.sh && bash framework/tools/git/test-pr-review-repo-host-override.sh && bash framework/tools/git/test-ci-queue-wait-branch-absent.sh && bash framework/tools/git/test-git-credential-mosaic.sh && bash framework/tools/git/test-gitea-token-identity.sh && bash framework/tools/_scripts/test-install-ordering-guard.sh && bash framework/tools/tmux/agent-send.test.sh && bash framework/tools/wake/test-wake-store-ack.sh && bash framework/tools/wake/test-wake-digest-hmac.sh && bash framework/tools/wake/test-wake-detector.sh && bash framework/tools/wake/test-wake-fn-oracle.sh && bash framework/tools/wake/test-wake-reconcile.sh && bash framework/tools/wake/test-wake-beacon.sh"
},
"dependencies": {
"@mosaicstack/brain": "workspace:*",