Linux Kernel Sentry / cgroup v2, PSI, WhatsApp HITL

Sub-250 ms kernel reflexes. Human-signed recovery on WhatsApp.

Built for constrained Linux VPS nodes that stall at 3 a.m. A pure-Go Sentinel watches PSI and cgroup v2 pressure and applies one reversible reflex inside 250 ms, while a 4-agent Kiro Crew investigates via MCP and asks your vote via a single-use Ed25519 WhatsApp poll before any Tier L2 restart or resource mutation runs.

  • 8.8-80 ms Real Reflex
  • <= 32 MiB Sentinel RAM
  • Ed25519 Single-Use JTI
  • Zero Raw Shell (L3 Blocked)
FrankenCrew Resilient System and Auto Monitor Live Telemetry Preview
go install github.com/FikFikk/franken-crew/cmd/franken@latest
go install github.com/FikFikk/franken-crew/cmd/wa-bridge@latest
median L1 reflex latency
--
L2 runs approved by human
--
unsafe actions blocked
--
incidents replayed
--

Figures come from the replay dataset in the Graveyard simulator below.

01 +-- Interactive Telemetry Replay

Walk through the Graveyard

Each grave is a complete incident trace through the real engine: kernel PSI telemetry, L1 reflex, 4-agent Crew transcript, WhatsApp poll vote, 120 s health verify, and the redacted postmortem.

  1. 1 Choose an incident from the sidebar
  2. 2 Press Play or scrub the timeline
  3. 3 Inspect Swimlanes, WhatsApp & Postmortem
Interactive Replay Engine
Organ 01 / Plane A: Kernel Reflexes franken sentinel serve · internal/sentinel · internal/reflex

Go Kernel Sentinel & MCP Server

Polls /proc/pressure/memory, cgroup v2 memory.events, and journald at 100 ms-1 Hz with linear 60 s TTO forecasting.

  • Applies one reversible L1 reflex inside 250 ms: bounded 200 ms cgroup_reclaim with in-flight deduplication, or runtime MemoryHigh throttle with TTL auto-rollback.
  • Reconciles vanished transient *.service units every tick and captures single-process OOM kills via memory.events.
  • Serves Streamable HTTP POST /mcp and GET /v1/events SSE with automatic cursor reset on restart.
Organ 02 / Plane B: Kiro Crew Brain app.json · .kiro/agents/

Event-Driven 4-Agent Orchestration

franken-conductor wakes immediately via webhook on incident.opened or vote grant, backed by a 15 m sweep cron.

  • franken-sentry executes read-only L0 tools (node_snapshot, cgroup_top, journal_tail, process_tree).
  • franken-architect submits remediation steps to plan_submit (max 2 revisions) to lock a canonical SHA-256 plan_hash.
  • franken-remediator coordinates human WhatsApp polling and executes signed L2 actions step by step.
Organ 03 / Trust Gate: Hands internal/policy · internal/approval

Policy & PreToolUse Audit Gate

Every proposed plan is validated against policy/actions.yaml before reaching Sentinel or leaving MCP.

  • Allows only explicit allowlisted actions and permanently shields PID 1, ssh/sshd, systemd-journald, tailscaled, Sentinel, and franken-bridge.
  • Pipes every MCP tool call through franken guard --audit, logging a redacted SQLite audit row and halting policy violations with exit code 2.
Organ 04 / Plane C: Conscience cmd/wa-bridge · verify_worker.go

Headless WhatsApp Bridge & Forward Verification

Single owner of the whatsmeow SQLite session; syncs node identity dynamically from Sentinel health and SSE streams.

  • Delivers redacted alerts under 2 s and builds Native Poll options strictly from validated plan labels with deterministic short-code fallback.
  • Mints single-use per-step Ed25519 tokens bound to plan_hash + step_id + action + target with mode-0600 private key isolation.
  • Observes a 120 s forward verify_health window and runs a 15 s x 3 heartbeat watcher before restoring L1 limits and writing postmortems.
8.8-31 ms Observed cgroup_reclaim Measured on real Linux cgroups v2 within the 250 ms L1 budget
22-80 ms Observed cgroup_throttle Runtime MemoryHigh bump + automatic TTL rollback verified live
~22-28 MiB Sentinel RSS Memory Stays within the <= 32 MiB Raspberry Pi & micro-VPS target
120 s Forward Verify Window Requires low PSI & TTO >= 600 s before moving to RESOLVED
03 +-- Policy Contract & Formal Proofs

Allowlisted action tiers & formal invariants

Neither autonomous LLMs nor prompt injections embedded in system logs can bypass the explicit contract in policy/actions.yaml.

Tier Scope & Authority Allowed / Blocked Operations Execution Gate
L0 · Observe Read-only forensic inspection with secret & phone number redaction applied before SQLite storage or LLM context.
node_snapshot psi_history cgroup_top journal_tail process_tree zombie_report incident_claim
Bearer auth + franken guard --audit logging.
L1 · Reflex Reversible pressure relief executed deterministically inside 250 ms without dropping running PIDs.
cgroup_reclaim cgroup_throttle admission_close
Deterministic kernel rule + TTL auto-rollback on verify pass.
L2 · Mutate Targeted service recovery gated on an accepted plan and explicit human approval.
unit_restart pm2_reload pm2_restart_instance process_terminate zombie_reap
Allowlisted WhatsApp vote + single-use per-step Ed25519 token.
L3 · Forbidden Absolute prohibitions rejected across Go policy, JSON schema, and PreToolUse hook even if signed.
raw_shell file_delete power_action persistent_config global_drop_caches modify_memory_max
Hard deny + franken guard exit code 2.
P1 · Latency Bound
L1 reflexes complete within the 250 ms SLA without blocking goroutines on slow disk or swap reclaim.
P2 · Replay Immunity
Every Ed25519 token is single-use via atomic SQLite JTI consumption, step-bound, and TTL-expired.
P3 · Protected Targets
PID 1, ssh/sshd, systemd-journald, tailscaled, Sentinel, and franken-bridge remain untouchable.
P4 · L1 Reversibility
Each L1 throttle persists the prior MemoryHigh setting and restores it automatically with retry backoff.

Give your Linux server a crew that never sleeps.

Static amd64 and arm64 Go binaries with zero CGO, engineered for Raspberry Pi & micro-VPS instances. MIT licensed.