Skip to content

Latest commit

 

History

History
1007 lines (897 loc) · 191 KB

testing-strategy.md

File metadata and controls

1007 lines (897 loc) · 191 KB

Testing Strategy

Maps every runtime situation the stack can be in to the tier that proves it. This is the map behind the integration suite; read that for how to run the live matrix, and this for what is tested where.

The stack's runtime behaviour is a state machine: syncing → held → released; healthy → down → rejected → recovered → readmitted; XvB tiers; container health. A healthy, already-synced box only shows one corner of it, so the rest is simulated at the cheapest tier that can prove each situation honestly.

Appliance TLS continuity is exercised by tests/os/selftest-tls-continuity.sh: a transiently smaller canonical SAN set retains a readable matching keypair that still covers every current name; a genuinely new SAN or an unusable pair requires replacement. The lifecycle phase compares Caddy's served leaf SHA-256 fingerprint, public key, SANs and local private-key digest before and after stopped-stack restore and dashboard password apply. HTTP-only configurations count explicit by-design skips. Read failures and any identity change on a TLS configuration fail the leg; private keys and their digests are not printed as evidence. tests/integration/selftest/selftest-lifecycle-tls.sh covers identity divergence and password fixture cleanup, and the restore health selftest requires a TLS failure to fail lifecycle. The pool-default lifecycle fixture models an HTTP-only box because it exercises pool rendering; the dedicated TLS selftests and live lifecycle phase own certificate and password behavior.

The KVM image-upgrade certificate leg provisions the actual appliance, adds a genuine nonpersistent SAN on its network interface, then drives Check, Download, Install and the confirmed reboot from one Chromium tab. A standard-library Python host coordinator drives SSH; Node and Playwright stay inside the digest-pinned browser container. Host-side SSH confirms a new boot, the temporarily absent address and Caddy running before restoring the address through the real address watcher. The test requires equal final canonical SANs, served leaf SHA-256 and key identity, a successful post-reboot state response and the updated verdict in that same tab, without another trust interaction. Its executable selftests cover certificate replacements and bounded waits; only the KVM job establishes boot and browser behavior.

The four tiers

Tier What it is Simulates Where it runs
1 — Unit dashboard/tests/ (pytest, mocked clients) and tests/stack/ (shell, docker/sudo stubbed) Decision logic & field mapping: sync-gate, failover, node-health debounce, XvB engine, /api/state shapes, pithead config/status logic Every PR (make test)
2 — Contract tests/integration/fakes/test_contract.py The real Monero/Tari clients parsing real daemon wire formats, and requests completing a capped HTTP request through a fake SOCKS5 CONNECT proxy Every PR (docker-free)
3 — Mini-stack tests/integration/mini-stack/ (real dashboard + docker-control vs fake daemons) The control plane end-to-end with real containers: dashboard requests cross the host-runner spool, and hold/release plus reject/readmit actually stop/start p2pool/xmrig-proxy, driven deterministically CI with Docker (make test-mini-stack)
4 — Live matrix tests/integration/run.sh against a real, synced box — and, for the appliance channel, tests/os/run.sh, the KVM battery for the flashed image What only reality proves: real merge-mining, prune/full DB size, Caddy TLS, Tor onions, HugePages, fault injection for real container health verdicts — and, for the image, built-artifact invariants before EFI boot, A/B commit/rollback, install-to-disk Every PR that changes what runs on a box, as a bench-ci job on the PR's head (see What a PR must prove); and the release gate — two independent tier4-kvm phase groups followed by a tier4-e2e aggregate on the exact release commit, required by release.sh's bench-ci/tier4 preflight (see the release recipe)

Stubs do most of the work. The dashboard unit tests drive the hard runtime states with mocked clients; more mocks for the same logic would duplicate them. What stubs can't prove is wiring: that the real clients parse real daemon output (tier 2), that the dashboard's stop/start moves real containers (tier 3), and that real daemons sync/merge-mine and real containers go unhealthy (tier 4). So: stubs for logic, controllable fake daemons for the control-plane wiring, the real box for the irreducibly-real. Each situation is tested once, at the lowest tier that is honest.

The Shell workflow runs make test-bridge-awk in pithead-test-runner:local, built from the pinned Debian 12 image. It requires mawk 1.3.4-20200120, gawk and BusyBox awk, checks exact engine-interface names and near misses, and runs the existing Caddy bind and site-list assertions with each implementation. Docker bridge detection uses a hexadecimal suffix and an exact length check, without awk interval expressions; LAN bridges such as br0 and br-lan remain eligible addresses.

The root pithead tested at tiers 1–4 is generated and git-ignored. Each Make test entry point that reads it depends on the pithead build target, while the live E2E provisioner builds it after cleaning its source checkout. A clean clone therefore exercises the same generated CLI as a local developer; release bundles and appliance images receive a pre-generated copy.

The image CI matrix runs tests/stack/standalone/test_image_permissions.sh for Tor, Monero, P2Pool, XMRig Proxy and the dashboard. It creates a checkout under umask 077, builds the image, then checks runtime script and template access as the image's non-root user with networking disabled. The dashboard probe also checks package file readability, directory traversal and the installed Python environment. The lifecycle phase repeats these builds in isolated image tags without replacing the deployed services. It first requires Tor at the reported c59e5ad6fc7c1fe82eb7558a2f962c18c1266299 revision to fail on its unreadable template. Its per-service logs retain the source SHA and permission verdict; the deploying tier-4 job separately proves normal service startup.

Monero's image build uses build/monero/download.sh to fetch the versioned CLI archive from downloads.getmonero.org, then dlsrc.getmonero.org after a transport failure. Each source gets one attempt with a 20-second connection limit inside a 300-second total transfer deadline: at most 600 seconds of network time, including continuously slow transfers. Both sources use HTTPS and the existing MONERO_HASH pin. A checksum mismatch stops the build immediately; exhausted sources fail explicitly, and partial files are removed before any extraction. The fallback is an alternate endpoint, not a guarantee of independent origins or availability. tests/stack/standalone/test_monero_download.py, run by make test-tools in CI, executes the real downloader against local HTTPS fixtures with shorter deadlines. It checks primary success, slow-primary and HTTP-error recovery, checksum rejection on both sources, bounded exhaustion, HTTPS downgrade refusal and Dockerfile wiring. It needs curl, OpenSSL and sha256sum, without Docker or public-network access. The Dockerfile still requires the current-head tier-4 proof below.

The fakes are the enabler. The whole control plane is env-configurable (MONERO_RPC_URL, TARI_GRPC_ADDRESS, DOCKER_CONTROL_URL, NODE_DOWN_AFTER_SEC, UPDATE_INTERVAL, …), so the real code points at small controllable servers and drives the entire state machine in seconds, in CI, with no chain and no test box.

The appliance stack lifecycle leg repeats encrypted reset/restore with firstboot paused between its entry check and round opening. It checks firstboot exit, released web ports, Caddy stability and the dashboard response after the real CLI restore and up. tests/os/selftest-wizard-startup.sh drives the generated wizard through that window and round preparation, with retained-config retry and installer controls.

What a PR must prove

The tier a change needs follows from the paths its diff touches, never from the size of the diff or from a claim that the change is static, config-only, render-only or one line. Tiers 1 and 2 run on every PR on GitHub. Tier 3 runs when a PR touches the integration harness, dashboard, CLI source, or its workflow; tier 4 is the release gate and, narrowed to what the change touches, the per-PR gate for anything that changes what runs on a box. The rows mirror bench-ci's "Which tier" table.

The diff touches Proof on the PR's head before merge
build/<service>/: a Dockerfile, an entrypoint, a config template, a healthcheck, a seed list tiers 1 to 3 green, then a bench-ci tier4-e2e job with options.mode targeted (or matrix): the branch is built and deployed, the service starts from the rendered file and reports healthy
compose files, config rendering (lib/pithead/*.sh apply, render and inject paths, config.reference.json, templates), the control plane, anything that stops or starts a container the same tier4-e2e targeted or matrix job
deploy, upgrade and restore paths, merge-mining, Tor, real miners tier4-e2e, targeted or matrix, or the phase or scenario that exercises it (phases: ["sweep"] runs every scenario without the destructive phases)
os/, RAUC, the wizard, first boot, the installer, updates tier4-kvm, one phase at a time; the two release phase groups before a release
the RigForge worker to stack contract rigforge tier4-e2e
dashboard logic and its tests, docs, workflows, scripts that never run on a box tiers 1 to 3 are the proof; the PR body names this row as the reason no bench job ran

A tier-1 assertion on a rendered file is required for a config change and never sufficient: it proves the render, not that the daemon accepts the file. #2327 added network = "mainnet" under [common] in build/tari/config.toml.template with a tier-1 test that the rendered file carried the line; every tier-1 to tier-3 check passed, and minotari_node v5.3.1, which accepts only override_from and base_path there, exited before it started on every bench that rendered the template. options.mode: check reads what already runs on the bench and proves nothing about the branch. A job on an older commit does not cover the head. A PR in the first five rows with no job on its head is not ready for review, and the adversarial review returns it.

Tari is the one stack service whose image is upstream (pinned by digest, no build/tari/ Dockerfile), so it has no Build image (tari) CI job to catch this the way the other five services' image builds do. tests/stack/standalone/test_tari_config_parse.sh (make test-tari-config-parse, its own workflow, tari-config-parse.yml — ci.yml is at its file-budget ceiling) closes that gap cheaply: it renders build/tari/config.toml.template the way inject_service_configs does and feeds the result to the pinned minotari_node image with --network none, no chain data, failing the job if the node rejects it with a ConfigError (#2341).

Dashboard connection recovery is covered by dashboard/tests/frontend/app/connectionrecovery.test.mjs: the 60-second failure boundary, reset after success, stale snapshot retention, and advice during sync, normal display and an initial-load failure. dashboard/tests/browser/osupdate-close.test.mjs serves the production OS-update component, clicks Close once after a refused update check, and asserts the native dialog is removed and document.activeElement is its actual OS-updates trigger. osupdate-reboot-verdict.test.mjs exhausts the 300-attempt reconnect loop after a confirmed reboot, then delivers a terminal updated or rolled_back verdict to the same mounted component and asserts the Rebooting dialog clears. The browser suite runs production-page and component journeys through make test-browser in browser.yml, across Chromium, Firefox, WebKit and mobile Chromium. backup-download.test.mjs uses the production backup component over self-signed HTTPS, accepts the certificate interstitial without bypass flags, and requires complete GUI saves of the kit and encrypted fixture: length and SHA-256 match, decryption using the saved kit, gzip/tar integrity and member bytes. It records exact Chromium and pinned Google Chrome for Testing versions, compares fresh profiles with extensions explicitly disabled, and checks that client blocking and interrupted transfers permit retry without a new backup or loss of the displayed kit. The original operator profile and live appliance backup contents remain outside these fixtures. Replacement-certificate acceptance still requires the appliance browser check in QA step 13.8. The KVM provision address-watch leg retains its SAN check, then uses the captured dashboard login over TLS from outside the guest to require HTTP 200 for the deployed OS-update error Close handler, fingerprint-comparison and stop-on-mismatch guidance, and sustained-failure trigger. It runs the exact command in the served guidance over SSH and requires a SHA-256 fingerprint. These checks prove deployed assets and an executable console instruction; they do not prove browser certificate acceptance. tests/os/selftest-dashboard-recovery.sh checks old-handler, missing-asset, HTTP-error, missing-guidance, missing-trigger and failed-command refusals without a guest.

Scenario catalog

Every situation, its trigger, and the tier(s) that cover it. ✅ = covered today; ▶ = exercised by the live matrix / mini-stack when run.

Each tier-1 shell row below names the tests/stack/test-*.sh domain file that actually holds its assertions; tests/stack/run.sh itself is the tier-1 shell suite — it sources every domain file rather than holding assertions of its own (see the test-inventory note under Production-readiness posture for how that sourcing is checked).

run.sh cuts its source order into five contiguous blocks, and the Shell workflow runs each block as its own job (#2631). bash tests/stack/run.sh 2 runs block 2 alone. With no argument it runs all five in turn, each in a fresh process, and prints the summed count. A block starts with nothing but lib.sh. Shared control and backup builders initialize the nine #2048 prerequisite fragments without sourcing predecessors; a separate Shell matrix runs each with only lib.sh in a fresh process. Both matrices must pass for the required Shell status to pass. Block 3 keeps the four dependent approval/SSRF fragments together; block 4 starts the independent editable-key round trips, worker masking and spool audit from a fresh fixture. Each block retains its 12-minute timeout; the split gives both expensive control groups separate budgets. Before any block runs, run.sh checks that every suite file sits in exactly one block, that sourced fragments have domain accounting, and that the workflow matrix lists every block. Audit parser failures stop execution; tally producer failures and counts that are not nonnegative integers stop the full-run verdict.

A domain file is a fragment, not a script. It holds no assertion primitives of its own, so running one directly printed every assert_* call as command not found and still exited 0 for 21 of the 55 — a domain reporting success having executed nothing, and building its fixtures in the caller's working directory on the way past. Each fragment now opens by dereferencing a marker lib.sh sets on the sourced path, so a direct run is refused with a message naming run.sh (#1657). The five tests/stack/test_*.sh files are the deliberate exception: the Makefile runs each of those directly, so they carry no marker check and must not gain one.

A. Configuration permutations

The deploy-time axes — each changes a real runtime path. Full table and assertions in Integration Testing › The config matrix.

Situation Trigger Tier
monero.mode local vs remote (monerod present/absent, profile gating) config 4 ▶
monero.prune pruned vs full (DB size, #32 display) config 1 ✅ (display) · 4 ▶ (real DB)
monero.rpc_lan_access, dashboard.secure, xvb.enabled, dashboard.tari_required config → .env/Caddyfile 4 ▶
LAN-only sources on the *_lan_access ports (#2616): the rule admits loopback, private and CGNAT sources only, compose holds a port on 127.0.0.1 when the rule cannot be installed; a first-network missing FORWARD jump stages loopback without a marker, then rechecks after Compose before permitting LAN binds (#2847). Scoped ups restart safety-stopped nodes alongside their requested services. doctor tells a held port from an exposed one, and every publish of the three ports is an explicit IPv4 bind. A switch-off stops an old all-interface listener before its port rule is removed, including when the following Compose start fails (#2902). A DIY Docker host gets pithead-lan-guard.service, which restores the rule before pithead-egress.service and docker.service after a reboot, and pithead-lan-hold.service, which starts the restart-no node containers only after it; doctor and the dashboard alert name a held or exited node (#2749). Live: a dial from a non-private source is dropped and one from a private source connects, again after the rule is stripped and both boot units run with Tor egress live and verified (#2901), and none connects while the guard's firewall step fails; a monerod or tari killed with SIGSEGV comes back within the timer interval while the rule is live and stays down once the rule is flushed (#3290) firewall 1 ✅ (tests/stack/firewall/lan-guard.sh, lan-guard-transition.sh, lan-guard-first-network.sh, lan-guard-entrypoints.sh, lan-guard-teardown.sh) · 4 ▶ (e2e local-pruned-main-rpclan row, iptables; KVM provision phase, tests/os/appliance-lan-guard-leg.sh, nft)
p2pool.pool main / mini / nano, with omitted keys selecting mini (sidechain, flags, Tor forwarding to the selected P2P port) config 1 ✅ (rendered Tor port and effective pool in sparse wizard configs; invalid P2Pool ports exit before rendering or launching Tor, in test-tor-port-validation.sh) · 4 ▶ (Tor-container TCP dial to the selected target, allowing up to 240 seconds for post-restart listener readiness; persistent refusal fails)
network.subnet moved off the default /24 (#180/#201): docker bridge, Tor render-at-start IP, monerod proxy IP, SSRF CIDR, onion vhost gateway config → live (a subnet move needs a down/up) 1 ✅ (rendered compose) · 4 ▶ (run.sh --subnet)
The four endpoint members of CONTROL_NODE_PREFLIGHT_KEYS (#1888/#1924) stay fixed local placeholders on a non-remote chain; the two login members preserve their masked partner and the dashboard auth render during standalone local edits. The same preflight set forces endpoint and login changes through the staged authenticated probe in remote mode config → render/control 1 ✅ (tests/stack/control/test-control-editable-allowlist.sh, dashboard/tests/service/test_env_key_perimeter.py)
tari.mode local / remote / off (#103/#1855/#1916): tari container/onion present/absent, topology node present for local and remote and absent for off, sync gate against a remote target, an off machine that runs no Tari and merge-mines nothing once Monero sync releases its separate hold, the retained Tari directory identified independently of normal chain growth, P2Pool's final pre-exec launch record, and both setup wizards writing the key explicitly — including ./pithead setup declining Tari and still provisioning config 1 ✅ (harness logic, selftest-tari-mode-off.sh; appliance verdict instruments, appliance-tari-mode-leg.sh --self-test; the CLI wizard's question and its disk-derived default, tests/stack/test-wizard-tari.sh) · 4 ▶ (live matrix)
p2pool.stratum_tls (#261): a live TLS handshake on the published stratum port, served cert matches the pinned fingerprint config → live dial 1 ✅ (render) · 4 ▶ (server-side handshake; a real xmrig client with pools[].tls:true stays deferred, see Known gaps)
pithead test-alert (#2265): configured Telegram, webhook, and ntfy sinks each get one marked message; a failed endpoint does not hide the other verdicts; output carries only sink kind and failure class; unconfigured sinks and the Healthchecks dead-man-switch exclusion are explicit operator command 1 ✅ (real sink objects with mocked HTTP transport, plus CLI dispatch) · 3 ▶ (wire-level delivery is #2263)
network.tor_egress_firewall=true (#270/#855/#2059), the default: the kernel actually DROPs a direct clearnet dial from a mining_net container, on both backends config → live kernel 1 ✅ (rendered iptables + nft rulesets) · 4 ▶ (real dial dropped, with a same-container dial through Tor's SOCKS as the within-row control — Docker backend in run.sh, netavark backend in the KVM battery)
network.tor_egress_firewall=false (#270): the opt-out actually opens a direct clearnet dial, not just that no rule installed config → live kernel 1 ✅ (stubbed iptables installs no rule) · 4 ▶ (real dial succeeds)
p2pool.clearnet=true with the default firewall on (#2790): P2Pool alone reaches public sidechain peers, every other app stays Tor-only, turning the flag off removes its exception from live rules, a stale DIY boot unit cannot restore it, and a failed firewall refresh refuses startup while its exception is selected or pending removal config → kernel → live peers 1 ✅ (rule selection, readback and stale boot unit, test-clearnet-firewall.sh; startup guard, choice-startup.sh; verifier controls, selftest-node-sync-egress.sh) · 4 ▶ (local-pruned-main-p2pool-clearnet)
monero.clearnet_initial_sync / tari.clearnet_initial_sync (#183/#234/#2678): an opted-in node reaches clearnet with the host firewall on; after sync the host claims the marker, removes and verifies only its exception before restart, then attests the live Tor daemon and firewall; failures retry without rearming config → .env → live daemon 1 ✅ (render, marker re-arm, forged and stale completion rejection, dashboard-writable replay rejection with colliding inode/ctime (100 dashboard repetitions on a verified Linux ext4 test directory, with source identity and every case retained in the GitHub unit-job log via make test-clearnet-replay-proof; both CLI chains in test_clearnet_attestation.py), host refresh failure/retry) · 4 ▶ (matrix local-pruned-main-clearnet-sync: live clearnet peers, other app isolation, host-attested Tor transition, dashboard same-text in-place replay refused, firewall on)
Egress firewall status (#2599): the dashboard reports the host's live firewall verdict, warns and sends one clearnet_exposed alert when the rules go missing while the stack runs, and one recovery message when they are back host timer → status file → /api/state + alert 1 ✅ (units, verb and status file in test-tor-egress-check.sh; state mapping, posture and edges in the dashboard suite) · 4 ▶ (fault_firewall_status_alert: runtime flush, the timer's own check, /api/state warns, up clears it; the appliance leg is a KVM boot check)
monero.view_key / tari.view_key (#381/#462): payout-confirmation wallet-rpc/tari-wallet wiring, including Tari wallet volume repair and cross-UID health (#2454/#2498) config → wallet startup → fake wallets → persisted state + configured webhook 1 ✅ (test-payout-wallet-pairs.sh: both chains’ key matching, Tari spend-key derivation and dual-key requirement, retained wallets and legacy adoption; test_tari_wallet_permissions.sh: wrapper ownership and UID drop, bounded gRPC scan grace; Compose and Quadlet assertions require the wallet gRPC healthcheck; selftest-e2e-forwarded-env.sh: e2e.sh forwards the three keys and skips the row without them, #2675; selftest-tari-wallet.sh: the Tari leg's logic) · 3 ✅ (mini-stack: confirmed payout and alert; replay, empty-wallet, and disabled/no-dial controls for both chains, test-real-wallets.sh: both pinned wallets initialize, report their configured addresses and reject wrong-wallet view keys (#2497); a real Tari image with a broken secret reports unhealthy) · 4 ▶ (payout scenario requires IT_MONERO_VIEW_KEY or IT_TARI_VIEW_KEY+IT_TARI_SPEND_PUBLIC_KEY; a new Monero payout landing is real-money real-time, not e2e-reachable; the Tari wallet backfills known past payouts from a set birthday through the local node only, the row reporting each precondition on its own terms — by-design skip with the node reading when the node is not at tip in 900 s, a failure naming the scan precondition when the wallet never answers in 1800 s, a 5400 s payout wait, #2731/#4031; both real payout wallets report reachable and matching configured addresses, and the Tari image passes its gRPC healthcheck with scan grace disabled and clears its first-scan marker, #2498; KVM provision phase, tests/os/appliance-tari-wallet-leg.sh: the wallet Quadlet stays up, reports healthy on a uid-1000 volume and names only the local node)

B. Sync lifecycle (#35)

Situation Trigger Tier
Cold start, chains syncing → hold p2pool+xmrig-proxy both is_syncing 1 ✅ · 3 ▶
Monero synced, Tari required but still syncing → keep holding; the live harness polls fresh dashboard state for up to 300 seconds at 10-second intervals and fails if no done is observed, even after an earlier scenario succeeded monero_synced ∧ ¬tari_synced ∧ TARI_REQUIRED 1 ✅ (selftest-run-state-tari-observation.sh: fresh success, persistent failure and unreadable state) · 3 ▶
Monero synced, Tari non-blocking → release, passive Tari badge (#51) ¬TARI_REQUIRED 1 ✅ · 4 ▶
Both synced → release (one-way latch) gate satisfied 1 ✅ · 3 ▶
Network-height UI override doesn't deadlock the gate p2pool held → height 0 1 ✅
Restart mid-sync / post-release (latch persisted) snapshot reload 1 ✅
Restore onto other hardware → latch re-derived from this machine's chains (#2626) restore's sync-gate-reset marker 1 ✅
apply re-points a required chain (mode or remote endpoint) → gate re-armed (#2763) apply plants sync-gate-reset 1 ✅ · 4 ▶
./pithead restore (same-box) → no marker written (#2626 operator ruling, discriminates from the row above) restore plants no sync-gate-reset 4 ✅ (lifecycle)
./pithead restore → p2pool not held (smoke check on an already-synced bench, not a proof on its own) covered — see the marker row above 4 ✅ (lifecycle)

C. Node health & failover (#31)

Situation Trigger Tier
Local or remote monerod down → reject workers (stop xmrig-proxy) unreachable ≥ NODE_DOWN_AFTER_SEC 1 ✅ · 3 ▶ · 4 ▶
monerod busy / mid-reorg (HTTP 200, status≠OK) → reject workers RPC answers but distrusted 1 ✅ · 3 ▶
Invalid work (#4046) → reject workers: red or unsynchronized Monero node, 0 outgoing peers, monerod lagging P2Pool's peers, P2Pool logging that monerod is not synchronized, P2Pool with no sidechain peers or no ZMQ, a monerod, p2pool or tor container down or unhealthy; a dip shorter than the grace stops nothing, recovery readmits, and a dashboard restart mid-pause does not readmit onto a peerless node MiningGuard (MINING_GUARD_GRACE_SEC, P2POOL_ZMQ_STALE_SEC, P2POOL_LAG_BLOCKS) 1 ✅ (test_mining_guard.py, test_data_service_worker_rejection.py, test_readmission_scenarios.py (scripted apply/Restart all/per-service-restart/reboot/stratum-late/start-period/persisted-rejection cycles, each bounded to NODE_RECOVERY_AFTER_SEC plus one poll of the last trigger clearing), test_pools.py, test_logs.py) · 3 ▶ (mini-stack scenarios 9b and 9c: P2Pool peers and ZMQ, monerod synchronized) · 4 ▶ (--fault-injection fault_node_down: the borrowed rig leaves the stack's pool for its backup and returns on its own) · 4 ▶ (lifecycle after the pool recreate: xmrig-proxy running within the readmission bound once monerod, p2pool and tor report healthy, printing the dashboard's reason on failure (#4166))
Configured Tari RPC unreachable for 15 minutes, including after dashboard restart → rejects when required; optional Tari keeps mining Monero; alerts either way tari_down 1 ✅ · 3 ▶
Recovery hysteresis — readmit only after every required node stable NODE_RECOVERY_AFTER_SEC reachable again 1 ✅
Transient blip / never-reachable Monero → no false reject debounce / ever_up 1 ✅
Monero node isolated or not advancing — the "at tip, with peers" contract for monerod (#2499): the real peer counts (the published RPC is restricted and answers 0, so an in-container helper reads the loopback-only admin RPC, #2921), MoneroChainHealth (0 outgoing peers NODE_STALE_AFTER_SEC, no new height 30 min), the card's Node Health / Peers / Height Moved, node_down-toggle alerts for each condition, build/monero/healthcheck.sh failing past MONERO_HEALTH_PEERLESS_SEC, doctor peers/tip age + FAIL, a monero chain status line, and the tier-4 strand leg (run.sh --monero-stranded) red on both conditions with the numbers; remote node: no verdict 1 ✅ (test_monero_health.py, test_monerod_redial.py (re-dial after an external Tor start, the peerless watchdog, cooldown and cap), test_alert_service_monero_health.py, test_monero_client.py, monero-health-card.test.mjs; the LAN "Monero node offline" banner built from these verdicts and the Tor heal state: test_node_alert.py, test_node_alert_view.py, nodealert.test.mjs, and tests/browser/node-alert.test.mjs in both themes; healthcheck/doctor/status: tests/stack/test-monero-chain.sh covers restricted vs real zero vs no reading in the healthcheck, helper and doctor; standalone/test_tor_recovery_info.sh in tor-recover; test_containers.py the fresh/stale/malformed observation; selftest-monero-peer-wait.sh the peer predicates, the peer-wait capture and the RPC-boundary rows; selftest-monero-p2p.sh the bounded P2P advertisement decoder and non-secret failure diagnostics) · 4 ▶ (run.sh --monero-stranded, which checks that the dashboard watchdog restarts the stranded monerod unattended, that the dashboard restarts a monerod kept peerless after an external restart of the tor container, the actual P2P advertisement, RPC boundary, current-run observation after deployment and restart, and the live tor-recover peer provider; bench-ci phase monero-stranded, about an hour, opt-in; KVM provision also runs the native Quadlet cold-start/restart RPC fixture)
Monero node reachable but out of sync — the post-tor-restart 0-peer strand (#972): raw synchronized passthrough, debounced stale flag, alert via the node_down toggle, monerod restarted alongside an actual tor container restart (compose depends_on: restart + the final #424 auto-heal step), restart monerod leg, doctor WARN synchronized: false ≥ NODE_STALE_AFTER_SEC after being in sync once 1 ✅ (client/data_service/alert/tor_heal pytest, tests/stack doctor + restart + compose invariants) · 2 ✅ (flag over the wire) · 4 (real strand + re-peer needs the bench)
Double outage; readmit only after both required nodes recover both down → both up 1 ✅ (added) · 3 ▶
#35 latch × #31 failover coexist after release down post-release 1 ✅ (added) · 3 ▶
Stop/start fails → retry next cycle (idempotent) docker error 1 ✅
dashboard.fail_closed (#490): default off never holds on an unrecoverable failure (alert-only); true holds (reusing #35's stop/start), releases once it clears (not a one-way latch), no-op before the sync gate releases is_db_unrecoverable() ∨ containers.is_confirmed_bad("dashboard") 1 ✅ · 3 ▶

C1. Outbound third-party integrations

Situation Trigger Tier
Healthchecks.io liveness ping reaches the configured receiver dashboard loop 3 ▶ (fake_hc)
Telegram, webhook, and ntfy receive a configured node-down alert; disabled sinks make no request monerod down / disabled configuration 3 ▶ (fake_sink)
Telegram command polling (getUpdates) rides the same TELEGRAM_API_BASE seam the alert path does, but is off by default (TELEGRAM_COMMANDS_ENABLED) and the mini-stack never enables it — the seam is proven outbound-only here dashboard loop 1 ✅ (mocked transport)

D. Container health verdicts (pithead status)

Situation Trigger Tier
All healthy → exit 0 steady state 1 ✅ · 4 ▶
Required node down / missing → exit 1 stop / rm monerod 1 ✅ (node-down) · 4 ▶ (--fault-injection)
Running but unhealthy → exit 1 healthcheck fails (SIGSTOP) 4 ▶ (--fault-injection)
Miner created/exited under sync-hold / failover → exit 0 (intentional) held / rejected 1 ✅ · 4 ▶
Any service explicitly restarting in either engine snapshot, or whose restart count/start time advances between them, → exit 1; Docker backoff with stable metadata still fails, while stable running history, first start, running replacements and held miners pass crash loop visible as Docker/Podman state or between point-in-time reads 1 ✅ (selftest-container-restarts.sh) · 4 ▶ (stack: Caddy crash loop, baseline miss, status and doctor detection, restoration)
A stop reaches the payout wallet (#2657/#2899): tari-wallet runs under an init (compose init: true; the quadlet renderer's RunInit=true) because its wrapper execs minotari_console_wallet, which would otherwise be PID 1; the pinned gRPC wallet has no signal-driven shutdown, so Compose and the rendered Quadlet use a 10 s stop timeout and may kill it docker stop / podman stop 1 ✅ (standalone/test_compose.sh; test-render-quadlet.sh asserts RunInit=true and StopTimeout=10) · 4 ▶ (local-pruned-main-payout-confirm, when the bench supplies a Tari view key; the appliance's appliance-tari-wallet-leg.sh checks the pinned image and wallet RPC version, records signal dispositions, requires the default 10 s podman stop to finish with the container down in under 25 s, reports the exit code, then checks the same SQLite inode, a nonempty public address compared by fingerprint, wallet state RPC and readable database-integrity logs after restart; the quadlet units are not deployed yet)
Chain service missing/stopped under an active data-migration hold → exit 0; restarting/unhealthy still exits 1 migration marker matches running version 1 ✅ · 4 ▶
Remote mode ignores monerod profile off 1 ✅ · 4 ▶
A stop reaches the Tari node (#2627): tari runs under an init (compose init: true; the quadlet renderer's RunInit=true) because the wrapper and upstream's start script both exec, which would leave minotari_node as PID 1; a PID 1 that reaps nothing can turn zombie and then cannot be signalled docker stop / podman stop 1 ✅ (standalone/test_compose.sh; test-render-quadlet.sh) · 4 ▶ (compose on the appliance's podman: PID 1 is podman's init, appliance-tari-mode-leg.sh; the quadlet units are not deployed yet)

E. XvB switching engine

Situation Trigger Tier
Disabled / zero shares / fail_count ≥ 3 / no sustainable tier → P2POOL guards 1 ✅
Closed-loop ramp/back-off, cold-start seed, VIP-reserve anti-overshoot (#70) controller 1 ✅
Actuated run-loop duty: split remainder dwell honored, steady state at tier + cushion (#423) wall-clock sim 1 ✅
P2POOL / XVB / SPLIT modes, tiers, smart-sleep early exit when enabled; full P2Pool dwell with XvB disabled and no credited average decision 1 ✅ · 4 ▶ (assert_xvb_off_no_dwell_churn: after 60 seconds of dashboard uptime, observe 95 seconds of live logs, longer than two old 30-second churn periods and shorter than the shipped XVB_TIME_ALGO_MS; zero early-dwell exits and at most one P2POOL switch. XvB enabled, an unstarted algorithm or rejected workers skip by design; unreadable probes and restarts fail. Fake-transport controls in selftest-xvb-off-dwell.sh reject the old churn log and exercise both harness callers)
Real XvB endpoint reachable / failing network 4 (real endpoint)
Credited 1h/24h averages converge to tier on live XvB (soak) live donation 4 (real endpoint)

The appliance XvB leg's stubbed polling fixtures use a file-backed clock: each polling sleep advances one simulated second, including inside command substitutions. Host scheduling cannot consume their attempt budget. tests/os/selftest-xvb-poll-clock.sh runs the real self-test with two seconds of simulated host delay per clock read; success, retry, held/flickering gate, unavailable proxy/Tor and unsuccessful route controls retain their assertions. Gate-wait controls also count complete polls and distinguish two released samples before the deadline from one sample or a release after it. The separate stalled-SSH and late-answer controls keep real deadlines. These are tier-1 fixture checks; the runtime polls retain their wall-clock deadlines and require tier-4 appliance proof when changed.

F. Dashboard /api/state field states

Situation Trigger Tier
sync state loading/syncing/done; pruned/full/unknown; db_size metrics 1 ✅
badges (node-down, workers-rejected, miner-held, passive-Tari, pruned/full, low-HR) metrics 1 ✅
system levels (cpu/mem/disk/hugepages), worker pool/online, chart outage breaks metrics 1 ✅
dashboard DB writes failing → db_healthy:false (#131) data dir read-only 1 ✅ (flag logic) · 4 ▶ (--fault-injection, #202)
/metrics Prometheus exposition (#379), through Caddy + basic_auth scrape 1 ✅ (format) · 4 ▶ (--check)
Dashboard sign-in page (#4089): session cookie versus remember lifetime, sign out, session end on password change, per-address rate limit, basic auth still accepted, no-password mode, Caddy session gate and loopback verifier render, sessions survive a full data disk (#4199) scripted HTTP through real Caddy and the dashboard image 1 ✅ (dashboard/tests/web/test_auth.py, dashboard/tests/service/test_auth_sessions.py, tests/stack/dashboard/test-dashboard-login.sh) · 3 ✅ (tests/integration/mini-stack/test-boot-health-proxy.sh login and rotated legs)
share_stats series populated on a mining box (#116) polls land 1 ✅ (shape) · 4 ▶ (--check)
Confirmed running earnings (#787): yesterday as a calendar day vs the trailing 24h/7d/30d spans, the DST-length day boundary, partial marking when a window outruns the recorded payout history, and one roll-up feeding both the dashboard card and /earnings stored payouts 1 ✅ (test_earnings.py, test_telegram_commands.py, components.test.mjs)
Expected-vs-actual earnings summary (#808/#817): one shared 30d window, the combined Monero+XvB row (estimate folded on the expected side because win payouts are inseparable on the actual side), per-stream gates and honest degradation, Tari block counts, XvB win windowing, and the card's render branches in both views metrics + stored payouts 1 ✅ (test_views.py TestEarningsVsActual, test_metrics.py, components.test.mjs)
Client entry point (#903): the 30s poll with its pre-tick abort so a hung Tor circuit can't latch the in-flight guard (#382), disconnected-banner state and recovery with the last snapshot kept, preference seeding from URL/localStorage through the normalizers, zoom/range/avg query building, and the handler wiring the App receives injected fetch/storage/timer fakes 1 ✅ (dashboard.test.mjs)
Stale-tab freshness (#4057, #4058, #4060): reload on a changed state.version.text or the first good poll after a disconnect, the once-per-2-minutes sessionStorage guard, the focus/visibility poll, the hold seam, the stale-page path for network failures and 401/403 on update and config requests with the server's text kept for other errors, and the Configuration draft kept across a reload without a typed secret injected reload/store/fetch/timer fakes; Playwright reload 1 ✅ (freshness.test.mjs, dashboard-freshness.test.mjs, osupdate-stale.test.mjs, controlclient-stale.test.mjs, configdraft.test.mjs) · browser ✅ (config-draft-reload.test.mjs, osupdate-close.test.mjs)
P2Pool initial sidechain bootstrap stats are marked syncing, the served overview explains the state, and synced stats clear it stopped P2Pool writer + injected pool stats 1 ✅ (collector, API, frontend render, fault-leg failure/cleanup selftest) · 4 ▶ (--fault-injection, fault_p2pool_sidechain_sync)
Dashboard reads correct live state on a real stack real daemons 4 ▶

G. CLI lifecycle (pithead)

The unrecorded mutation-lock fixture waits for a separate readiness marker written by its holder after acquisition. Polling the lock itself can take it briefly and make the holder's nonblocking acquisition fail. A tier-1 control holds the lock from another process and verifies that this alone cannot signal readiness; the live-holder cases still check refusal and stale-record diagnostics against the real lock.

Situation Trigger Tier
Config validation, secret preservation, apply no-op/destructive guards sourced fns 1 ✅
setup→up→status→apply→restart→down; idempotency; secret preservation real box 4 ▶ (--lifecycle)
upgrade (image pull/rebuild) real box release staging smoke (docs)
upgrade refuses a Tari major that migrates the node database when the data volume lacks data.mdb's size plus 5 GiB (#2636), before any container is recreated stubbed df/docker, sparse data.mdb (tests/stack/lifecycle/tari-upgrade-space.sh) 1 ✅
os-update and the dashboard's os-verify/os-install refuse a data_migration bundle on the same bound (#2645), through one shared guard: no rauc install, no marker, no floor raised, and the dashboard keeps the staged download. Remote or off Tari, no database, and a non-migrating bundle pass; an unreadable df warns. Removing either call site fails its door's rows stubbed df/rauc, sparse data.mdb (tests/stack/appliance/os-update-migration-space.sh) 1 ✅ · 4 ▶ (the provision phase's migration leg fills /data to below the bound, asserts the refusal leaves the idle slot and /data markers untouched, then frees it and installs)
backup/restore real box 1 ✅ (partial) · 4 ▶ (--lifecycle/--safety-backup)
reset-dashboard (#2346): live .env targets, chain continuity, both reset services running healthy, and resumed worker/hash/share signals real box 1 ✅ (partial) · 4 ✅ (--reset-dashboard --safety-backup)
rotate-secrets (#2344): live new/old RPC, control API and stratum authentication; Monero → p2pool → proxy connectivity, with an authenticated stratum connection held open during the upstream check even without a rig; the reserved rig's accepted share; exact config, secret and miner-service restoration, with runner-owned persistent recovery holds on unverified restoration local probe/handshake fixtures and real box 1 ✅ (probe, complete no-rig phase and recovery guards) · 4 ▶ (--rotate-secrets, requires --safety-backup)
rotate-dashboard-onion (#2345): on an e2e-created, marked one-run Tor fixture whose dashboard and mining identities are minted from scratch after the safety backup, the new address answers over real Tor, the retired address stops answering, fixture mining keys stay unchanged, the Caddyfile drops the old vhost (#546), HOST_IP survives the render (#356), the client-auth key changes, and the original fixture identity restores after success, failure, or interruption real box, real Tor 1 ✅ (tests/stack/dashboard/test-dashboard-onion.sh, stubbed engine; tests/integration/selftest/selftest-rotate-onion-restore.sh, abort path) · 4 ▶ (--rotate-onion)
Encrypted DIY restore after config-reset, with no config, .env, or Caddyfile; reset output contains no failed-shutdown warning and a bounded all-state project census is empty before configless down; real running-container refusal; original configuration and secrets restored; appliance setup page observed before restore; wizard removed, Caddy healthy without churn for 60 seconds, and the dashboard web response restored engine-neutral project census (a Podman-style engine rejects status=restarting) + local reset destination record 1 ✅ (test-restore-configless.sh, selftest-reset-restore.sh) · 4 ▶ (--lifecycle, run-reset-restore.sh)
Mutating verbs hold the mutation lock around writes and release it for human confirmation (#1342/#1482). Apply also locks its parse/render phase, then checks the configuration and live environment revisions after reacquiring the lock; stale snapshots cannot publish or recreate services. Dashboard commit holds one lock through preview validation, canonical publication and child apply. Apply and preview stage their env files per invocation, so another pithead process exiting while apply waits for the lock cannot remove its staged file (#2943). For rotate-secrets the first write is the pre-rotation safety copies rather than the credential rewrite, so the absence of those copies on a held machine is what pins the acquire's lower bound — the credential assertions alone would still pass with the acquire one step too late. Placement is pinned from both sides by mutation, one named case per edit: moving the acquire below the copies, below the retry marker, or above the confirmation each kills a different case, and so does moving the copies above the confirmation while leaving the acquire where it is. Every contended case runs against an uncontended positive control that the same fixture really does perform the mutation being looked for, because "the token is unchanged" and "the fixture never armed" read identically tests/stack/appliance/test-appliance-rotate-secrets-lock.sh, tests/stack/appliance/test-appliance-reset-lock.sh, tests/stack/appliance/test-appliance-os-update-lock.sh, tests/stack/lifecycle/lock-wiring.sh (held-lock and cross-process staging fixtures) 1 ✅ · 4 ▶ (KVM provision password repoint)
doctor runtime verdicts (#383): egress firewall, stratum listening, dashboard answers real box 1 ✅ (stubbed toolchain) · 4 ▶ (--check)
Appliance certificate (#1132/#1141): one shared name-list builder feeds both Caddy's site list and the certificate's SAN list, the mint re-mints only on a real list change (not a hostname -I re-order) and reuses otherwise, doctor FAILs on a name the certificate doesn't cover or a certificate within 30 days of expiry, WARNs (never FAILs) on an unreadable certificate file. render (which mints the certificate) always runs BEFORE up creates either compose bridge (mining_net, proxy_net) this boot, while doctor's re-check runs from the boot health gate's retry loop, always AFTER up — an address that only exists post-up reads as "served but uncovered" unless something accounts for it (#1051/#reboot-leg-fix: this is what stranded both the reboot leg's commit gate and, independently, the OS-update 'updated' verdict behind a boot gate that never passed). mining_net's gateway is excludable by a config-known literal and stays inside the shared, engine-free builder; proxy_net's subnet is Docker/podman auto-assigned (#345) with no literal to exclude it by, so ONLY doctor's certificate check asks the engine, live, for it — and if the engine can't answer (daemon restart, socket permission slip, anything at all), that check WARNs and skips the coverage FAIL for every auto-expanded address this run rather than risk FAILing a healthy box on a tooling hiccup (bridge interfaces outlive an engine blip, so the ambiguity is real); an uncovered PINNED/base name still FAILs regardless, since deriving it needs no engine at all sourced fns / fixture certs (real openssl) / stubbed docker network inspect (per-network calls, both the resolved and the unreachable-engine shapes) 1 ✅ (tests/stack) · 4 (deferred — a real Caddy TLS handshake surviving a moved DHCP lease needs the KVM battery / bench)
Occupied stratum port (#3417): Configuration preview refuses Caddy’s occupied port through the control API, leaves configuration and the running proxy unchanged, leaves no incomplete-apply marker, and requires dashboard hash growth before preview and after refusal; native P2Pool counters are diagnostic only loopback listener fixtures cover wildcard candidates and matching specific binds; the wildcard-listener/specific-candidate case is omitted to avoid test listeners on every interface; borrowed miner 1 (tests/stack/standalone/test_stratum_port.py) · 4 (phases: ["hardening"], requires a borrowed miner; quote the negative control and final-head deploying proof with verified baseline and rig restoration in the PR)
Control channel (#33): apply --dry-run preview, runner claim/validate/commit, fail-closed flag, rw/ro spool mounts; a commit's audit line precedes its published result; hardening clears the old view key in its refused wallet candidate and checks that the preview requires typed confirmation and an unconfirmed commit is refused without changing config.json or .env spool files / sourced fns 1 ✅ (test_control_audit_order.sh, selftest-hardening-wallet.sh, shell + pytest + compose) · 4 (--hardening exercises the systemd path unit on a real box)
Audit + access logs (#349/#3265/#3263): key-names-not-values audit entries, bounded log growth, hostile content served inert; ordinary last-24-hour failures survive rotation within bounded retained generations; only capability-marked appliance boot probes are excluded, with four ordinary failures quiet and five warning retained-log fixtures and real rendered Caddy/API requests 1 ✅ (shell + pytest + node; current -size and legacy generations; selftest-access-log-retention.sh rejects active-only, old-tail and legacy-name-only readers); 3 (mini-stack test-boot-health-proxy.sh: login enabled/disabled, exact counts, direct/front-proxy forgery, capability redaction); 4 (KVM provision reboot: wait for this boot's journal commit as well as the retained RAUC flag, then assert zero failures from current boot probes and one external wrong-password failure; --hardening: wrong passwords, padding beyond 256 KiB, native gzip rotation and deployed count; onion matrix: Tor access)
Out-of-band audit detection + persistence (#530, #1551): a config.json change with no matching commit (host-edit), a rig reporting a change_id the dashboard never spooled (rig-edit), or a rig whose config revision moved with no new change_id beside it (rig-drift) all append to the durable audit_events table (mirrored control.log rows + these three kinds); the existing dashboard-spooled rows reconcile from both the newest control slot and the first 20 raw entries in rigforge#519's terminal control_history ring, so two outcomes inside one poll do not leave the older one accepted while malformed or duplicate entries cannot expand the producer's budget; the two rig-fed kinds share one #724 per-worker flood cap, keyed on a name the device chooses and so bounded in turn by a ceiling on how many names may hold a live window at once (#1695), and the rig feed is validated before the store sees it — an unvalidated revision would otherwise choose the row's own permanent id, which is the one field the audit sanitizer does not cover; Security panel hour/day/month grouping poll-loop diff / real StateManager 1 ✅ (dashboard/tests/service/test_data_service_watch_host_config.py::TestWatchHostConfig, dashboard/tests/service/test_data_service_rig_edit_detection.py::TestRigEditDetection, dashboard/tests/service/test_data_service_mirror_control_audit.py::TestMirrorControlAudit, dashboard/tests/service/test_data_service_reconcile_worker_config.py::TestReconcileWorkerConfig, dashboard/tests/service/workers/test_worker_change_audit.py, dashboard/tests/service/workers/test_worker_name_space_cap.py, dashboard/tests/service/test_storage_service.py::TestAuditEvents, dashboard/tests/frontend/system/securityview.test.mjs grouping) · 4 (deferred — the underlying rig-side-edit-visible-in-the-enriched-feed mechanism is already proven live by the #516 row below; a real box producing a host-edit/rig-edit/rig-drift audit row end-to-end is not yet its own matrix leg)

CLI verb ledger (#2348)

The row-per-situation table above answers "how is this behaviour tested"; it does not answer "does every verb pithead dispatches have a tier-4 answer at all" — that gap is what let five destructive verbs go unexercised unnoticed. This ledger is the totality check: one row per name in PITHEAD_COMMANDS (lib/pithead/41-subcommand-chaining.sh:6), locked by tests/stack/test-cli-verb-ledger-lock.sh so a verb added to the dispatcher without a row here fails tier 1. covered means a real tier-4 run (DIY bench, KVM battery, or both) exercises the verb, per the situations above; missing means nothing does yet, with the issue that owns closing the gap; by-design means the gap is a decision, not an oversight, with the reason inline.

verb tier-4 note
setup covered DIY bench; KVM firstboot wizard
apply covered DIY bench; KVM
render covered DIY bench; KVM boot overlay
up covered DIY bench; KVM boot overlay
down covered DIY bench (appliance parity is #2062)
restart covered DIY bench (appliance parity is #2062)
tor-recover covered DIY bench fault-injection phase exercises ordinary-state refusal and read-only access to the live Tor mount and identity keys; lifecycle checks the shipped authenticated bootstrap probe refuses a healthy Tor. The e2e restoration proof requires a libcurl Digest challenge and authenticated reply on one direct connection, then independent Monero sync and direct Tari sync; selftest-restore-chain-sync.sh exercises its daemon predicates, credential privacy, bounded polling and missing-proof refusals. selftest-restore-curl-connection.sh runs the real transport against a bounded local fixture in CI, proving connection reuse and refusals for a closed nonce session or unauthenticated success. Positive check/apply, identity and chain preservation, and bootstrap-stall refusals are proven by the pure CLI tests, not by poisoning the live baseline
upgrade covered DIY bench (--image-upgrade, opt-in); KVM OS-update leg (combined hardware run still pending, see Known gaps)
status covered DIY bench (appliance parity is #2062)
doctor covered DIY bench; KVM boot overlay
backup covered DIY bench; KVM
restore covered DIY bench; KVM (wizard's restore-at-setup flow, not the CLI verb)
load-images covered KVM boot overlay
firstboot-wizard covered KVM (pithead-firstboot.service)
local-miner covered KVM rig phase, via pithead-boot
os-update covered KVM (appliance-only verb)
factory-reset covered KVM (appliance-only verb)
control-run-pending covered DIY bench
egress-run-pending covered firewall-on clearnet sync on the DIY bench
egress-status covered DIY bench (fault-injection leg, #2599)
lan-guard-check covered DIY bench (LAN rule flush leg, #2846)
onion-client-key covered DIY bench (partly, via the control legs)
uninstall covered DIY bench (--lifecycle's uninstall→setup round trip, #2379) verifies ownership and resets a preexisting Pithead wallet volume if present. With local Tari it activates tari_payout_confirm, creates the Tari wallet service and its owned volume through Compose, removes the container, disables the profile, and verifies the inactive model excludes the volume. With remote Tari it records that creation leg as by-design because the local tari dependency is absent. It checks uninstall removes any owned wallet volume, preserves a separately named unrelated volume, and setup recovers from kept data. Tier-1 stubs prove both modes, the local profile transition, preexisting owned and foreign cases, and refusal to finish on volume inspection failure. The dedicated --uninstall destructive phase is #2343, blocked on bench-ci#347
rotate-secrets covered DIY bench --rotate-secrets with --safety-backup: live authentication and routing, the reserved rig's accepted share, exact restoration and owner-only recovery-copy cleanup (#2344)
rotate-dashboard-onion covered DIY --rotate-onion: isolated fixture, real Tor reachability, old-address retirement, and identity restoration
reset-dashboard covered DIY bench (--reset-dashboard, #2346)
config-reset covered KVM (appliance-only verb, --phase reset leg 0)
support-bundle covered DIY --lifecycle runs run-support-bundle.sh (#3081): apply synthetic dashboard, stratum and disabled-Telegram credentials, seed a unique --rpc-login line into the dashboard container log, collect a real windowed zip with --since and --until, require mode 600, doctor reports, masked config, redacted env, a live Compose census, the requested window and a clean failures list in manifest.json, the seeded line present and redacted in a containers/ log, and reject any fixture credential or the seeded value in any member. tests/stack/control/test-support-bundle-diy.sh (tier 1) covers the DIY collector with engine, journal and systemd stubs: stopped containers, no 200-line limit, the five DIY units, a stopped engine, an unreadable journal and window validation. Restore the starting config and rendered env, wait for stack health, and compare config and env bytes and secret fingerprints. selftest-support-bundle.sh checks missing content, a wrong window, credential leaks, unsafe permissions, unarmed fixtures, partial-archive cleanup and restoration failures.
render-quadlet missing #1217 — the podman/quadlet render has no live run anywhere
recovery-bundle covered KVM (--phase fault, fault E, #4038): a unit made to fail, no containers running, the verb run as root over SSH; asserts exit 0, a mode-600 zip under /data/pithead/support-bundles taken with --since and --until, the failed unit's journal line inside it with a seeded --rpc-login redacted and its value absent from every file, a unit installed at run time collected without a code change, the whole-journal, kernel and boot-list files and the manifest's journal facts, and the path on the serial console; KVM provision phase, tests/os/appliance-support-bundle-leg.sh (#4127): the support-bundle control request with since and until over the dashboard API, the <id>.zip result and browser download, the manifest window, and the retention prune of expired zips; tier 1 tests/stack/control/test-support-bundle-snapshots.sh (#4128): every snapshot file present and non-empty, monerod, Tari, P2Pool and Tor status values, the Tor guard allowlist, address redaction, Caddy window and rotation, the uncapped history export, seeded secrets absent from every new file, and each service stubbed first to hang and then to refuse, with the manifest naming the timed-out and failed steps and the total limit skipping the rest
test-alert by-design deliberately deferred — real notification sinks; wire-level coverage is #2263
logs by-design a passthrough verb; tier 1 is the honest ceiling
version by-design pure-output verb; tier 1 is the honest ceiling
help by-design pure-output verb; tier 1 is the honest ceiling

H. Host / infrastructure (real-only)

Situation Trigger Tier
Real merge-mining share lands; real hashrate on dashboard live mining 4 ▶
p2pool actually reached the Tari node over gRPC (#1397): the merge-mining client's uses chain_id line, which p2pool cannot log without a successful call to the node. Its two sibling lines land ~175 ms earlier and are local, so a check keyed on them would pass with Tari unreachable — that case is a distinct local-only verdict and fails. The startup signal may be delayed by Monero RPC retries. Poll for up to 120 seconds at 2-second intervals, strip ANSI escapes before matching, and reject success across a container epoch change. Log-read failure is binding and distinct from readiness expiry live p2pool log since the current container epoch, with bounded target-filtered output and no first-lines cap 1 ✅ (verdicts, capture bounds and the ANSI control, selftest-mergemine-probe.sh; delayed readiness, persistent failure and epoch controls in selftest-mergemine-readiness.sh) · 4 ✅ (the leg — run against the live stack read-only, not yet inside a full gate run)
A live Tari node stranded from its peers stops reading healthy, and recovers (#2464). An iptables rule in the tari container's own network namespace, tagged pithead-e2e-fault-tari-stranded, drops its traffic to tor. It is not a host DOCKER-USER rule, because same-bridge traffic does not reach that chain without br_netfilter (job 1315). The leg fails straight away if the rule is not in place, and reports the rule's drop counter whenever a verdict wait fails. The leg waits (up to 25 minutes) for the node's first zero-peer reading and records that disconnect latency on its own row, since it varies from about 3 to over 15 minutes (jobs 1324, 1611); it then asserts the verdict goes amber within 10 minutes of that reading plus a poll, then red with a non-zero doctor exit and a red pithead status line within 30 minutes plus a poll. The panel reads red with its reasons, and the red alert reaches a loopback webhook fed by the sender Telegram uses; delivery by Telegram itself is a counted missing skip. After six more minutes of red, neither tari nor p2pool has restarted: detection only, with remediation in #2827. It then removes the rule and asserts the node rejoins on its own, the verdict returns to green without a restart, and the recovery note is sent. The rule is also removed by an EXIT trap, and the leg asserts none is left a local Tari node, passwordless sudo nsenter and iptables on the box 1 ✅ (verdict and alerts: test_tari_health.py; doctor/status: tests/stack/test-tari-chain.sh) · 4 ▶ (run.sh --tari-stranded; bench-ci phase tari-stranded, about an hour, opt-in)
Tor clearnet probe failure (#2458) is corroborated on isolated circuits and a second target before bounded NEWNYM; local Monero re-dials only after a real Tor restart. The fault-injection row blocks the dashboard-to-Tor SOCKS dial in the dashboard's network namespace for 25 minutes, preserving Tor's relay and onion connections, then checks read-only access to the live Tor state and onion identities, the rule's dropped-packet counter, logged targets, NEWNYM, a proxy worker online at every minute and at least one accepted share in each five-minute window, container start times and recovery after unblock. With --no-mining-asserts, the entire Tor clearnet probe fault leg is a named by-design skip before any live probe, config change or firewall rule; it cannot prove mining continuity without a miner. Without that flag, a missing mining witness still fails: the witness is awaited for 180 seconds before the fault and again for 60 seconds after the opt-in recovery apply, so a worker reconnect does not fail the row, and a failure writes the observed proxy state and each listed worker's connection status, uptime and accepted count to tor-probe-witness.log in the phase artifacts. A mining failure during the fault does not shorten it, so the Tor assertions still run. The proxy counter includes shares while the worker is on a donation pool; P2Pool's session hash counter does not. Same-bridge traffic bypasses the host OUTPUT hook. The row never disables the stack's Tor-egress firewall. The fault-injection phase then spends the host NEWNYM budget, disables Tor's network through its control port and requires unattended recovery through the rejected-NEWNYM ladder (fault_tor_newnym_exhausted, an hour or more). The separate tor-recover check/apply contract requires either saturated circuit history plus a peerless, stalled local Monero or, when RPC is unavailable, sustained authenticated bootstrap 95%, no established circuit and repeated recent invalid timing warnings; or, without saturation and with egress still down on both targets, a sustained heal outage, two control-port readings of no circuit or 64 pending circuits, or a persistent bootstrap stall (test_tor_unsaturated_reset.sh). Its pure CLI tests cover positive check/apply paths, refusal, identity/chain preservation and protocol errors; test_tor_bootstrap_recovery.sh covers the unavailable-RPC path and test_tor_heal_outage_recovery.sh the sustained-heal-outage class (#3052: refused without two rounds from one outage, after recovery, with stale evidence, working egress or an unsaturated history) and the read-only tor-history verb the dashboard heal uses to alert on a saturated history. The lifecycle healthy-Tor refusal probe retries only mutation-lock exit 75 every two seconds within a monotonic 60-second command budget (with a two-second kill grace) before judging the original exit-1 and unsaturated-history assertions. tor-recovery-admission.log retains each attempt’s elapsed time and exit status plus lock-record and kernel-owner fields on contention, capped at 16 kernel owners and a five-second sampler deadline; it excludes paths, command arguments and raw CLI output. Persistent contention fails the guard assertions. selftest-tor-probe-fault.sh covers clearing and persistent overlap, other exit codes, diagnostic projection and the post-apply witness wait (a reconnecting stream passes, a stream that never qualifies fails and records its state). The live row does not poison Tor state or exercise positive apply. active rig and local Monero; host nsenter and iptables privilege for the live fault 1 ✅ (test_tor_heal.py, test_tor_heal_refresh.py, test_tor_heal_ladder.py, test_tor_recovery.sh, test_tor_heal_outage_recovery.sh, test_tor_unsaturated_reset.sh, selftest-run-modules.sh, selftest-tor-probe-fault.sh, selftest-fault-rules.sh) · 4 ▶ (fault-injection phase on the tested head)
A local monerod stranded after a Tor restart or left peerless is restarted once by the dashboard within bounds on the appliance (#4157, split from #4076): the Tor restart outside the healer is followed by a re-dial, a peerless strand by one audited restart and recovery to outgoing peers, a second strand inside the 30-minute cooldown is held, the fourth restart in 24 hours is held and announced once, and P2Pool, the chain data and the payout address are untouched reject monerod's SOCKS connections to Tor inside its network namespace, then restart the Tor container (the same block alone for the peerless strands) 1 ✅ (selftest-monerod-redial.sh; unit coverage in test_monerod_redial.py) · 4 (opt-in KVM monerod-redial phase, --timeout-minutes 240)
P2Pool with zero peers for 15 minutes is restarted by the dashboard with 20/40/80-minute backoff, a cap of three per 24 hours, a log line and an audit row, and recovery is judged on sidechain tip progress (#4077); a stopped, restarting or absent p2pool and an unread stats file are never touched zero out and in connections for 15 minutes with a running local p2pool 1 ✅ (test_p2pool_heal.py, selftest-pool-peer-loss.sh, selftest-pool-heal.sh) · 4 (fault-injection row cuts every P2Pool peer path and requires an unattended restart and tip resume; opt-in KVM p2pool-heal phase restarts the guest P2Pool through the appliance container control path)
P2Pool's Tari merge-mining payload against Tari's own validator across the mainnet 350,000 fork (#2586, V6 of #1129). A throwaway, peerless P2Pool built from build/p2pool with the archive under test mines against the box's monerod and a recording Tari node serving mainnet templates at 349,999, 350,000 and 350,001. The fixture in tests/integration/mergemine/, compiled inside Tari's workspace at the pinned tag, runs Tari's monero_randomx_difficulty under MainNet constants on each submission and on two controls built from the same Monero block: the legacy Keccak-state payload and a one-bit-mutated prefix. Tari picks the format by height, so the prefix payload must be rejected at 349,999 and the legacy one accepted there; from 350,000 the prefix payload is accepted and both controls are rejected, each with Tari's reason printed. The one test-only deviation: achieved work is compared with the test difficulty, not mainnet's target (both printed). Nothing reaches Tari mainnet local Monero on the box, both wallets in config.json 1 ✅ (row mapping, skip and cleanup, selftest-mergemine-submit.sh) · 4 ▶ (run.sh --mergemine-submit; bench-ci phase mergemine-submit)
A live Tari node accepts P2Pool 4.18.1's blocks (#2589, V5 of #1129). The shipping minotari_node build runs only MainNet and StageNet. Mainnet is off limits, and StageNet never activates the coinbase-prefix payload. The node is therefore Tari's published -esme image of the release docker-compose.yml pins: the same source revision, built for the testnet target, running LocalNet with the payload active from height 0. The leg prints both images' revisions and build targets, and fails unless the revision and version match the shipping image. The node runs alone on an --internal docker network at LocalNet's fixed difficulty of 1. A throwaway P2Pool built from build/p2pool with the archive under test joins that network and mining_net, reads the box's monerod and mines until it reports blocks at five heights. tests/integration/mergemine/localnet_probe.py then reads every reported block back from the node. Tari's SubmitBlock also answers OK for an orphan, so a block counts only when it is on the node's main chain at the reported height, mined with RandomXM, and every submitted height needs one (at least three). Each accepted block's parent must be the previous accepted block, and P2Pool must take the next height's template after it. Nothing reaches Tari mainnet local Monero on the box, both wallets in config.json 1 ✅ (probe decoding and verdicts, the image pin, skips and cleanup, selftest-mergemine-localnet.sh) · 4 ▶ (run.sh --mergemine-localnet; bench-ci phase mergemine-localnet)
Caddy TLS scheme; Tor onion provisioning; HugePages/AVX2; real disk pressure; prune DB size real host 4 ▶
HugePages each daemon actually holds (#2685): monerod and p2pool are sampled every 10 s for the whole destructive run from /proc/<pid>/smaps_rollup (Private_Hugetlb + Shared_Hugetlb), never from a HugePages_Free delta, which other users of the pool pollute. Red when a running daemon's rollup was never readable, when it held no hugetlb page at any reading, when one instance ran 300 s without one, or when three instances never held one (the restart loop p2pool fell into in #78, before #2562's cap raise made the modern shortfall silent instead); the peaks land in results/hugepages-peak.json, the measurement the appliance's reduced tier is sized from (job 1115@701013bb1faaea1a9a337cde16dbe79fbca797d1: p2pool 1305 pages, monerod 129). The row also carries the standing bound the resize is proved by — this run's combined peak + 256 (second-seed caches) <= REDUCED_PAGES, read from the checked-out branch's own os/overlay/pithead-hugepages live stack, every destructive run 1 ✅ (tally, gate, artifact, run.sh wiring, the pool bound against fixture and real pins, and the /proc read against a stand-in process, selftest-hugepage-probe.sh) · 4 ✅ (job 1115@701013bb1faaea1a9a337cde16dbe79fbca797d1)

I. RigForge worker ↔ Pithead contract (#209)

The two repos share three seams: mining on the proxy's :3333, the enriched worker API on the rig's :8081, and the stratum-auth handshake. Each behaviour sits at the lowest tier that proves it — the worker-API auth model is the #315 none/name/token matrix, not the old single Bearer <rig name>.

Situation Trigger Tier
Worker-API auth header per mode (none/name/token), endpoint-bound read-only workers.list[].api_token override (never the write-capable .token), SSRF guard rejects a miner-IP/name host XMRigWorkerClient logic 1 ✅ (test_xmrig_client, test_worker_read_auth)
Real client authenticates + parses the enriched /1/summary over a real socket — none/name/token matrix, wrong-token 401, miner-down body (rigforge#99 shape) real client vs fake worker API 2 ✅ (fakes/fake_worker_api.py + test_contract.py)
The same socket carries the three blocks that drive Worker Inspect: the rig's effective writable config (#1235), its config_meta provenance (#1345), and the mirrored control outcome (#579) — including the fresh-rig control: null shape and a non-terminal status, both of which must reconcile nothing real client vs fake worker API 2 ✅ (fakes/test_contract.py)
Our fake cannot drift from what a real worker emits (#1412): its rigforge key set is compared both ways against a vendored copy of RigForge's own tests/contract/v1/feed.json, that copy is pinned to the baked RIGFORGE_REF so a pin bump without a re-vendor reds here — and because that ref line is hand-edited text, the vendored bytes are separately byte-compared against RigForge's own copy at the baked ref, so editing PROVENANCE alone can no longer green a stale fixture, and a producer the check cannot reach fails in CI rather than skipping (#1426) — and every status word in control-status.json must be classified terminal or known-non-terminal, on a vocabulary asserted non-empty so an emptied fixture cannot pass having checked nothing vendored producer fixtures 2 ✅ (fakes/contract/v1/ + test_contract.py + test_contract_freshness.py)
The control-status vocabulary's third site (#1422): dashboard's two Python constants are guarded against each other by name, but the pithead script's own control_worker_apply/control_worker_upgrade poll loops carry the same words as literal case arms nowhere cross-checked — a word RigForge adds and neither arm matches falls through to "keep polling" and times out as a normal-looking accepted, the rigforge#320 noop/throttled history repeating unseen. The two arms are shell literals, so a grep needs no rig: their union must equal the terminal words in the same vendored control-status.json the tier-2 guard above anchors to pithead source 1 ✅ (tests/stack/control/test-control-status-vocabulary.sh)
Dashboard parses proxy /workers rows → worker list + hashrate aggregation; offline drop-off window metrics / worker_presence 1 ✅
p2pool.stratum_password renders --access-password (set) / omits it (default-off); the live daemon argv matches the configured mode and rendered password pithead render + proxy entrypoint 1 ✅ (tests/stack, selftest-miner-connection.sh: off, auto, literal and rejected mismatches) · 4 ▶ (live PID 1 argv, including flags appended by the entrypoint; miner login accept/reject remains #3078)
Setup password opt-in, preserved literal/auto credentials, hand-off and Connect a miner identity, explicit absence, TLS fingerprint and no-store responses Wizard/API/frontend units, host carry self-test and installed-identity verdict controls using real config/env reads (missing reads fail); provision (off), install (auto + TLS), live TLS scenario 1 ✅ · 4 ▶ (new identity assertions awaiting branch proof)
Proxy restart / node-down → reject → readmit (real containers) control plane 3 ▶ (mini-stack)
Real worker mines through the real proxy: appears via its stratum name, hashrate aggregates, backup-pool failover live rig + proxy 4 ▶ (run.sh --workers)
Enriched read survives a populated masked-token descriptor — api_ok + RigForge feed resolve through the separately derived read bearer while the write-capable workers.list[].token (#506; the dashboard.workers[] alias was removed in 2.0.0, #1832) remains only a {"__secret__":true} sentinel in the dashboard (the v1.5.2 regression + #508) live rig + workers.list[] populated 4 ▶ (run.sh --rigforge-control, #514)
Worker Inspect edit lands on the rig: editable true, a max_temp_c nudge via /api/control/worker-apply hits the rig's /status + records history, reverted live rig control API on 4 ▶ (run.sh --rigforge-control, #513)
Worker Inspect edit on watchdog_interval_min (#1236): the original is read off the rig's own reported writable config (.rig_config, #1235/rigforge#253), a derived probe one minute away (inside RigForge's 1–1440) is applied, the rig is asserted to report it, then it is restored — and the restore runs even when the assertions red. The retained DONATION-revert diagnostic (#4184 removed the leg that drove it) records both feed values, stamps, dashboard snapshot time and worker state, and exact-ID status on each poll (#2894). A bounded out-of-cycle worker refresh publishes an exact-ID applied DONATION report after a dashboard apply (product path, kept). live rig control API on 1 ✅ (test_worker_refresh.py — exact-ID and value match; test_server_worker_inspect.py — apply trigger; selftest-rigforge-writable-keys.sh — probe derivation, the settle, the refusals, and a mutation kill for each, including no DONATION/donate-level key ever reaching the apply payload (#4184); selftest-donation-handoff-sample.sh — bounded redacted fields and failed reads) · 4 ▶ (run.sh --rigforge-control, #1236)
Worker Inspect edit on pools (#1002b): the rig's own reading is credential-stripped and must not be written back (#113), and the dashboard's last_applied.pools record is stripped the same way, so the operator-supplied probe is both the value applied and the value restored (#2470) live rig control API on 1 ✅ (selftest-rigforge-writable-keys.sh — gate, restore source, probe credential check, malformed probe; selftest-rigforge-pools-settle.sh — the async settle and when the restore ledger retires the probe, #2407) · 4 ▶ (run.sh --rigforge-control, #1002b; operator supplies IT_RIG_POOLS_PROBE)
autotune, watchdog and DONATION writable-key edits live rig control API on Permanently not covered, on purpose — autotune starts a real tuning run; watchdog removes thermal protection from a rig at its temperature ceiling; DONATION cannot be probed from the fleet-standard 0 in any direction without sending the borrowed rig's dev fee to XMRig rather than the owner (#4184), and its write path stays covered against the fake worker (tests/integration/fakes) plus the no-control-header refusal. All three are refused on borrowed hardware; each refusal is a [by-design] leg row and is asserted at tier 1 (selftest-rigforge-writable-keys.sh) so it cannot be undone silently.
Rig-side edit reflects: a direct rig control-API change shows in the enriched feed; a config.json hand-edit shows in the masked prefill live rig + direct dial 4 ▶ (run.sh --rigforge-control, #516)
Control-apply auto-rollback (rigforge#236): a hashrate-tanking change is recorded rolled_back in the worker-apply result + per-worker history live rig + fault-injection 4 ▶ (run.sh --rigforge-control, #517; operator supplies IT_RIG_ROLLBACK_CHANGES)
Per-worker RigForge new-release badge (#596): one fleet-wide latest-release fetch (hourly throttle, disabled = never dials) compared against each rig's reported version, bare-vs-v-prefixed SemVer dashboard.check_for_updates + rig-reported version 1 ✅ (test_update_checker comparison/throttle/no-dial; test_views + node tests for the per-worker plumbing) · 4 (deferred — live badge on a real rig, owed to the #597 bench-loaner session)
One-click rig upgrade (#597): the #596 badge proposes a version, the host re-derives the target from the RigForge release API over Tor and dials the rig's /upgrade; refusals (non-latest, GitHub unreachable/no tag, old rig < v1.11.2 non-202), the anti-beacon throttle, and the poll-cap timeout→accepted fallback /api/control/worker-upgrade + host runner + badge render 1 ✅ (test_server.py + test_control_service.py, tests/stack #597 cases, workerview.test.mjs) · 4 ▶ (run.sh --rigforge-control drives the applied path and the repeat click — see the #1237 row below; still deferred on a bench loaner: badge clears, old-rig refusal)
Control-result retention (#1990): after this phase's own burst of real control requests (worker-apply, pools, reverse, rollback, upgrade), the host-side control_prune_results has kept results/ within its documented count and byte caps, and the stack is still healthy — the release-gate proof that pruning runs on a real drain without breaking anything it touches (the caps themselves, including the protected-file guarantees, are driven directly against synthetic excess at tier 1) control_prune_results + a real drain 1 ✅ (tests/stack/control/control-results-prune.sh — excess results/archives, count/byte caps, protected files) · 4 ▶ (run.sh --rigforge-control, end of phase)
The release gate both ASKS for the write phase and SUPPLIES it: --mode targeted — the run the release runbook mandates — requests --rigforge-control (#1364), and e2e.sh hands it the rig host and token its legs need, dialling the rig from the bench before reporting it as supplied (#1378). The token read survives a rig that has already been written to: a control-apply leaves /opt/rigforge/config.json root-owned, so the read falls back to sudo -n and a read that FAILED reports differently from a file with no token in it (#1466) e2e.sh phase composition + rig_supply 1 ✅ (selftest-e2e-phases.sh — the exact phase set per mode, the supply defaults, the token reaching the detached runner as an environment entry and never as argv, the fallback firing only on a failed read and only after the unprivileged one, and a mutation kill for each)
The scenario sweep runs on its own (#3484): --harness-arg --sweep launches every scenario with the safety backup and no other phase, a pinned scenario beside it is refused before the bench is dialled, and --mode matrix and the default targeted launch stay exactly as they were e2e.sh phase composition + validate_harness_args 1 ✅ (selftest-e2e-sweep.sh — the exact launch per mode, both refusals, the allowlist advertising sweep) · 4 ▶ (tier4-e2e with phases: ["sweep"])
Remote-upgrade chain, selected by the dashboard's own release verdict (#1237): where a newer release is offered, the leg drives a real upgrade — 202 with a pollable id, which is what says the already-on-this-version shortcut cannot have answered — settles on an applied terminal, and reads the new version back off the rig's own summary; the repeat click then converges on a synchronous noop carrying no id, on a precondition that run established. A rig already on latest reports a classified skip, not a pass /api/control/worker-upgrade + host runner + a real rig 1 ✅ (selftest-rigforge-upgrade.sh — both branches, each skip reason, a mutation kill for each) · 4 ▶ (run.sh --rigforge-control; no live gate run has reached it yet)
Stratum auth accept/reject: matching pass mines, wrong/missing pass rejected, rotation live proxy --access-password 4 (deferred — a headless xmrig login probe, real proxy binary)
Dev-fee independence (#173): proxy --donate-level and rig DONATION both honored live proxy + rig 4 (deferred)

The deferred tier-4 legs need a real RigForge rig against a real proxy — provisioned via rigforge.sh setup on a bench box and driven by the live matrix (run.sh --workers), gated on the /var/lock/rig-e2e.lock bench reservation (see docs/dev/release-server.md). They are not re-provable at a lower tier: the auth-header logic (tier 1) and the wire handshake (tier 2) already are, so the only thing left for the real rig is real mining and the real proxy's accept/reject — which only a real xmrig-proxy binary can prove.

J. Appliance image (pithead-os, #77)

The flashed image is the second distribution channel, and it follows the same rule as everything else: logic at tier 1, reality at tier 4 — there is no separate model for it. Tier 4 has one meaning (what only reality proves) and one stack suite, two channel harnesses: tests/integration/run.sh (the live matrix, what the release gate runs against a DIY install) IS the stack-behaviour suite — containers, config hot-apply, fault injection, XvB routing, secret preservation, backup/restore — it just only ever pointed at one of the two channels the product ships. The KVM battery (tests/os/run.sh, see tests/os/README.md) drives the flashed image through the same kind of behaviour from the other side: podman through the docker shim, read-only root, the stack in /data/pithead, the control runner as a systemd unit. Neither harness is a subset of the other — the battery's provision phase provisions in LOCAL node mode, so a scratch KVM disk can never hold a synced chain and everything behind the sync gate (tests/os/phases/provision-initial.sh) never runs there; the stack phase (#2062) closes part of that gap by provisioning a guest in REMOTE node mode against an already-synced bench node and running the live matrix against it. The battery needs KVM + libvirt + root — the bench, not CI — and is the release gate for the image (appliance-release.md). tests/os/verify-image.sh sits below it: static assertions against the built rootfs (variant stamp, baked units, watchdog config), no VM needed, run on every image build.

Measured at develop tip 5e98594f (#2062): the live matrix has ~90 assertion sites across its 15-scenario config matrix plus --lifecycle, --fault-injection, --hardening, --auth-fail-closed, --subnet, --rigforge-control, --xvb-routing-smoke and --image-upgrade, and it had never once run against the appliance runtime before the stack phase. The battery carries 433 assertions, ~72 of them about the running stack, and by design is blind to everything behind the sync gate — a scratch guest on a local node never syncs, so nothing downstream of "released" ran there. The parity table below classifies every gap a ✗ names: by-design means structurally inapplicable to that channel — a scratch KVM guest cannot hold a chain, so a local-node battery row cannot exercise prune/full-DB switching or a real clearnet-egress surface, and a borrowed physical RigForge rig never targets the stack phase's remote-node coordinator — and missing means nothing about the channel rules it out, only that no harness runs it there yet. Both classes and the by-design/covered/missing three-way split come from the live matrix's own skip accounting (tests/integration/lib/skip-accounting.sh, #1365/#1083); the stack phase surfaces that same three-bucket summary from each of its live-matrix invocations in the battery's own output rather than inventing an appliance-side vocabulary next to it.

Behaviour DIY gate (tests/integration) Appliance gate (tests/os)
Containers up, pithead status verdicts ✓ ✓
Dashboard through Caddy, basic_auth ✓ (/metrics leg still missing, #2058) ✓
Tor-only egress enforced (steady-state observation) ✓ one row, red on first execution (#2059)
Egress-firewall opt-out actually opens clearnet ✓ (matrix scenario) ✗ by-design (a scratch guest has no clearnet exposure surface to observe safely)
XvB over Tor, XvB routing ✓ ✗ — the stack phase drove --xvb-routing-smoke once (job 510): the baseline rows and the P2Pool route passed, then the Tor-isolation probe failed and reported only its own static guess, because the probe discards every byte of its output. Not run from the phase until that is readable: #2444
Shares / hashes flowing end to end ✓ ✓ workers online and stratum hashes advancing on the stack phase's remote-node guest (#2062); ✓ an ACCEPTED share, from both the coordinator's own built-in miner and a second, rig-role guest pointed at it, on the rig phase's own share leg (#2063 — the two-guest proof this table used to carry as a ✗). Still missing on a local-node guest, which never clears the sync gate
Config hot-apply matrix (mode, prune, pool, secure, tari, subnet, stratum TLS, payout confirm) ✓ 15 scenarios partial — the stack phase (#2062) applies the remote-safe subset live (pithead apply -y per scenario, pool main→mini, re-apply no-op, secrets preserved). Prune, full-DB and local-node scenarios stay by-design: a scratch guest holds no chain
Secret preservation across re-apply ✓ partial (hostname approval leaves config byte-identical)
Backup → restore round trip ✓ ✓ (provision backup + install-phase restore leg)
Node down → reject workers → readmit ✓ (fault injection) ✗ by-design — measured, not predicted: the DIY gate skips fault injection and the node-down failover leg in remote mode ("no local monerod to break/stop"), so the stack phase's remote-node topology cannot reach them. Closing this needs a local-node guest with a chain, not a flag
Tor / dashboard fault recovery ✓ partial (backup restart). The DIY gate's --hardening phase is by-design on the stack phase's guest too ("remote mode: no local containers/systemd to exercise")
RigForge worker apply / upgrade ✓ (borrowed physical rig) Apply: rig_adopt_leg after the rig share leg previews and commits adoption through the coordinator control routes, waits for adopted/API-reachable state, sends a reversible watchdog_interval_min change (#4184 replaced DONATION, whose only probe from 0 donated the mining rig's dev fee), waits for its exact change_id in worker history to reach applied, and checks the rig's config, unchanged pools and host control-port isolation (#3069, #3994). selftest-rig-adopt.sh covers async acknowledgment, refusal, stale state, failed writes and restoration without KVM. Upgrade still needs the borrowed physical rig.
OS update through the dashboard, A/B commit, migration hold n/a ✓
Boot, install, media channel, power-cut faults, factory reset n/a ✓
Remote-node mode, live ✗ (zero routine coverage, #1446) ✓ — the stack phase (#2062) provisions monero.mode=remote at a reserved node from the first wizard submit, clears the sync gate and mines. The first live remote-node coverage on either channel

What the stack phase's first real runs established, and what they cost. A remote-node guest provisions, releases and mines: containers up, /api/state answering, workers online and stratum hashes advancing, within about fifteen minutes of boot. The DIY gate then runs against it in two invocations — --check, then the destructive phases — in about ten minutes. The scenario invocation names --scenario on purpose (--check returns before the matrix is reached): without one the harness iterates its whole 15-scenario matrix first, nearly all of it monero.mode=local, which a remote-node guest can only serve by building a local chain from nothing. Left unscoped that cost over two hours per invocation and exhausted a 240-minute job.

Three rows that read red on the phase's first real runs were pre-existing DIY gate gaps, all closed by the time this branch merged develop: the canonical-node-set assertion predated the wizard's own local_miner default (#2303), the egress verifier assumed a git checkout on the target (#2302), and doctor's egress-firewall row checked wording doctor no longer emits (#2301). Two more were this phase's own: --check ran before the p2pool container had started (dashboard and caddy come up faster, and the readiness wait only watched those two), which failed every p2pool-dependent row for a reason unrelated to any of them; and the monerod caught up and sync-panel rows were single-sample reads that a Tor-relayed block fetch outlasts. Both fixed here — wait for p2pool explicitly, and bound both waits at 150s/5s.

p2pool merge-mining gRPC round-trip (#1397) read red on this channel because the probe never read p2pool's log (#2326). podman renders .State.StartedAt as Go's time.String(), and docker compose logs --since refuses that value before it sends a request. The error went into the probe's grep with the rest of the output, so the capture came back empty and was reported as "p2pool built no client". The probe now rewrites the start time to RFC 3339, and the row is binding on both channels. On a failure, the row also prints up to 80 diagnostic lines from the current run's p2pool log, without a first-lines cap that would hide delayed startup retries. The target keeps only lines that match an allowlist: errors, the entrypoint's own lines, and Tari lines. The probe then redacts them and masks every IPv4 and IPv6 address, credential-shaped name:value and name=value tokens, and alphanumeric runs of 40 or more characters. From those lines, a log-read error, bad launch arguments and an unreachable Tari node each look different.

The wallet fixture recovery interface (wallet-recovery.md) is proved by selftest-wallet-recovery.sh against a stubbed Docker, baseline start and readiness gate. Its live path is proved by the lifecycle phase on a DIY checkout: tools/prove-wallet-recovery.py arms a separate private snapshot of the harness's own prepared wallet and runs the operator entry point on it with real Docker, the baseline start and the payout-wallet gate. That makes the change a tier4-e2e row of What a PR must prove: a job with phases: [lifecycle] on the PR's head, with a borrowed miner because the lifecycle's Tari mining-continuity trial refuses no_rig.

The wallet supersession proof (#3133), wallet recovery proof (#3483) and CLI connection announcement probe (#3090) require tools from the DIY checkout that the appliance image does not ship. The lifecycle phase identifies the appliance with the CLI's is_appliance predicate and records seven named by-design skips: one supersession row, one recovery row and five connection rows. The appliance wizard owns setup; these skips do not prove appliance credential presentation. On DIY, all three probes remain binding, including when a tool is missing or channel identification fails. Tier-1 channel regressions exercise the skips and these refusal paths; live proof requires both KVM stack and DIY lifecycle runs.

Two parity rows from the matrix above are deliberately not driven from this phase, because this guest cannot satisfy their inputs, and each carries job 510's row-scoped evidence on its own issue: remote-tari-main-secure switches the guest to monero.mode=local, so it starts a local monerod with an empty database on a scratch virtual disk and everything behind the sync gate fails deterministically — #2443, which needs a guest with a seeded chain. And --xvb-routing-smoke's Tor-isolation probe fails on this channel while discarding its own diagnostics, so its red is unreadable from here — #2444, which needs the probe to report what it saw before anyone decides what the failure means.

Situation Trigger Tier
Wizard Q&A → config.json, spool round-trips, token gate, error re-display dashboard/tests/web/test_wizard_*.py (pytest) + dashboard/tests/frontend/wizard/wizard*.test.mjs (node) 1 ✅
Restore-at-setup (#909): encrypted and plaintext archives, volatile secrets and plaintext, TLS-only upload, serialized publication, retry refusal, failed cleanup, bad passphrase, oversize and malformed fallback. Server/client tests cover the transport contract; the shell suites apply a genuine backup, enforce numeric-owner and expansion limits, prove volatile submission/staging/installer carry and restart cleanup, and preserve target files on chain-data collisions (#2195). A failure injected inside the commit (the dashboard swap, the chain merge, the rollback itself) puts back every item already replaced and removes the names the merge added (#2689). dashboard/tests/web/test_wizard_handoff_rig_and_restore.py + dashboard/tests/web/test_wizard_restore_limits.py + dashboard/tests/web/test_wizard_restore_security.py + dashboard/tests/frontend/wizard/wizard-submit.test.mjs + tests/stack/appliance/test-appliance-restore.sh + tests/stack/appliance/test-appliance-restore-legacy.sh + tests/stack/appliance/test-appliance-restore-publish.sh + tests/stack/appliance/test-appliance-restore-reject.sh + tests/stack/appliance/test-appliance-restore-commit.sh + tests/stack/appliance/test-appliance-wizard-spool.sh 1 ✅
Image invariants: variant stamp, enabled units, watchdog/governor config, unwanted-package and unsupported-test-tree absence, dev-keyring refusal tests/os/verify-image.sh (static, no KVM) build-time ✅
The appliance image ships the compose file of the release it names (#1215): build-image.sh stages docker-compose.yml from the tag v<VERSION> when that tag exists, from the tree while it does not (the release being prepared), and refuses a clone that has the tag on origin but never fetched it; the choice is stamped as COMPOSE_SOURCE (tag NAME SHA or tree), and verify-image compares the shipped file against what that stamp resolves to, failing on a stamp that is missing, malformed, names another version than the shipped VERSION, or names a commit the checkout lacks. Pinned by mutation: the refusal dropped, the tag path copying the tree, the version equality dropped, and the tree path shipping HEAD instead of the working tree each kill a named row tests/stack/appliance/test-appliance-build-compose-source.sh (scratch git repo with a local bare origin, both helpers sourced above their scripts' seams; the wiring between the three files is asserted by text) 1 ✅ + build-time ✅
Boot labels: RAUC's selected slot is current; peers say previous, and empty and unknown remain distinct. All four ASCII titles carry USB drive: or Internal disk: when media metadata is known and fit 72 columns. Debug BUILD_LABEL tokens append only to slot menu versions; invalid tokens are ignored and release builders refuse labelled rootfs. record_installed keeps the plain bundle version. Earlier ESP menus keep their previous template after slot updates. The image seeds USB, the installer seeds the target transport, and the per-boot writer corrects the mounted ESP's media independently of slot versions, writing media only on change. tests/stack/appliance/test-appliance-boot-labels.sh (GRUB fixtures, transport stubs, installer seed, serial negative controls), tests/os/selftest-build-label.sh (three writers, token rejection, release entry points and mixed-slot serial controls), tests/os/verify-image-boot-menu.sh, tests/os/verify-image.sh · battery --phase boot (plain first menu and virtio correction), --phase install (labelled USB and installed first menus), --phase update (stale metadata repaired by the installed unit, labelled-to-plain RAUC update/rollback and mixed-slot serial titles) 1 · 4 (requires runs at the changed head)
Dashboard exposure boundary (#1021/#1049/#2070/#2280): the rendered Caddyfile publishes the LAN v4 and the ULA but never the globally-routable v6; the bind line excludes it; a pinned dashboard.host does not reopen it AND still binds the box's own LAN address (#1089: pinned to a NAME, the documented appliance case — a pinned IP literal put the box's own address into the site list too, so a bind derived from $site_hosts and one derived from hostname -I rendered identically and the mutation stayed green); a box with only a public address still binds loopback; EVERY site block carries a bind (the count invariant that caught the unbound HTTPS onion vhost); the onion vhosts bind the container-bridge gateway and not a wildcard. The provision battery adds an unrouted RFC 3849 address and a ULA to the guest LAN interface before the wizard submit, then requires the pinned site, LAN v4 and ULA binds/listeners, no wildcard/public bind or live listener, a refused curl to the global address and doctor's dashboard-listener OK — repeated with the onion-enabled appliance configuration so its vhosts are proven not to reopen the listener; the independent stratum public-IP WARN remains truthful, and the tier-1 public-bind mutation proves that the live row can fail tests/stack/dashboard/test-dashboard.sh (sourced generate_caddyfile, stubbed hostname) · tests/os/appliance-dashboard-exposure-leg.sh · battery --phase provision 1 ✅ · 4 (added — unverified until the next provision battery)
Unmatched-Host catch-alls own :80 (#1123) and :443 (#1132's third bullet) instead of leaving Caddy's own defaults — a reflecting redirect on :80, a silent empty 200 on :443 — to answer a forged Host or SNI: both redirect to the box's own canonical address (never one built from the request), both carry the same bind list as the named vhosts, and the :443 one carries no tls line of its own (proven against real Caddy with caddy adapt: a hostless catch-all falls through to the file's default connection policy, i.e. the certificate the named vhost already loads) tests/stack/dashboard/test-dashboard.sh (sourced generate_caddyfile) + caddy adapt against the rendered file (manual, ahead of #1037) 1 ✅
Optional .env keys under set -u (#1246): a .env that legitimately lacks DASHBOARD_AUTH_HASH_B64 — rendered before the key existed, hand-trimmed, or a context sourcing a partial env — renders without the auth block instead of aborting the command that sourced it. The guard's default is shown to be load-bearing by a copy of pithead with it respelled off: that copy aborts naming the key, and still renders when the key is present. The required keys (DASHBOARD_SECURE, HOST_IP, NETWORK_PREFIX) keep their bare reads on purpose — a default there would trade a loud abort for a silent misconfiguration, and for DASHBOARD_SECURE a silent HTTPS-to-HTTP downgrade tests/stack/appliance/test-appliance-caddyfile-optional-env.sh (sourced generate_caddyfile, partial and complete .env fixtures) 1 ✅
Boot identity units (#980): pithead-ssh-host-keys generates once into /data, never touches an existing key, recovers from an interrupted run; pithead-mount-generator derives the /data + ESP units from the booted disk (sda/nvme/vda naming, a container root generates nothing); loop-wait.sh demands block devices and polls its full budget tests/stack/appliance/test-appliance-identity-boot.sh (sandboxed key dir, staged mountinfo) + tests/stack/test-rauc-loop-wait.sh (loop-wait.sh) 1 ✅
EFI boot; first-boot wizard window; token gate answers battery --phase boot 4 ✅
Secure Boot (#2055 G2): a second guest with firmware.feature0.enabled=yes measures whether the image reaches userspace under Secure Boot; every other guest pins enabled=no. Secure Boot is unsupported by design (#2187): turn it off before booting the appliance. A measured non-boot passes for every image version. A guest that cannot be defined fails as unmeasured. An unexpected boot passes with the existing note to cross-check the guest's SecureBoot EFI variable tests/os/secure-boot-boot-verdict.sh · battery --phase boot 1 ✅ (fixture, tests/stack/appliance/test-appliance-boot-verdicts.sh) · 4 (KVM boot phase)
A/B contract (#2055 G1: legs 1-3 keep the guest unprovisioned throughout, so pithead-boot.service never runs there — they drive the RAUC/GRUB slot mechanism directly over SSH, not pithead-boot's own health-gated commit): uncommitted auto-rollback, committed update persists, rollback off a committed slot, containers refreshed, /data grew, host identity (machine-id + SSH host-key fingerprint) survives the swap — all provable against unconditional units or the bootloader alone battery --phase update legs 1-3 4 ✅
Release packaging (#2824): after the update phase builds a real image and dev-signed bundle, the release packager produces both assets below 2 GiB, both checksum files verify, and decompression reproduces system.img byte-for-byte. The size and hash lines stay in the phase log; the packaged copies are removed at harness cleanup. This proves packaging mechanics, not final release-key signing or physical flash. tests/os/package-appliance-verdict.sh --self-test (small fixture and damaged-checksum refusal) · battery --phase update 1 ✅ · 4 ▶
pithead-boot's own render/up/health-gate/commit path, dashboard-driven battery --phase update leg 4 (phase_update_dashboard) 4 (see the OS-update rows below)
Unhealthy-container commit refusal (#2383): the gate takes a THIRD signal, pithead status exit 0, because doctor --json judges only the revenue containers (monerod/p2pool/tari) — so a non-revenue container left unhealthy or restarting (the dashboard's own healthcheck failing, caddy in a restart loop) passed both earlier gates while the box's own status command already called it broken, and manual battery M9 committed exactly that slot. The sync-hold exception admits only the miner states produced by a deliberate stop (created, exited, or stopped); a restarting miner fails both the real status and revenue verdicts. Its transient record is created 0600 because it carries credentials and remote-access details. The rows status printed for the offending container are folded into the in-flight flag's blocking list, so the fallback boot's rollback verdict names it. The #1265 coverage FAIL still commits, unchanged. Tier 1 drives gate_ready with a stubbed pithead answering doctor and status INDEPENDENTLY (they must be able to disagree, or the row cannot tell a consulted status apart from one riding doctor's exit code), the real status/revenue verdict functions with restarting and stopped miners, plus boot_status_blocking's glyph filter (the legitimate #31/#35 stopped rows must not count) and fail_boot's merge. Tier 4 is the composition tier 1 cannot reach: a real bundle whose dashboard healthcheck is forced to exit 1, installed through the dashboard's own update door with the in-flight flag, a real boot, a real A/B fallback, and the in-flight record's blocking list naming the dashboard container with the served banner module carrying Blocked by: (tests/os/rollback-verdict.sh, tier 1 selftest-rollback-verdict.sh). The fault is written into the bundle's compose file, never its baked dashboard archive: the stack runs the dashboard at its signed, digest-pinned registry image, so a rebuilt archive layer never runs and the gate correctly commits a healthy slot (#2694). Tier 1 checks that break_dashboard_healthcheck changes exactly the dashboard's healthcheck line and refuses a compose file that has none to change tests/stack/appliance/test-appliance-boot-remint.sh (sourced pithead-boot, stubbed CLI) + test-appliance-boot-stack-health.sh (0600 record, image install, fault injection) + test-appliance-boot.sh / doctor/test-doctor.sh (real verdict/status) + battery --phase update leg 5 (phase_update_healthgate_leg) 1 ✅ · 4
Release signing chain and clock (#4012): a rig verifies only against its baked root, so the policy in release-server.md is tested at the real RAUC. A clock earlier than the newest notBefore in the baked keyring is refused by os-update and by the dashboard's verify and install verbs before RAUC runs, and the dashboard keeps the staged download; RAUC's certificate has expired and not yet valid verdicts are reported with the clock reading and a pointer to the policy, never as a bad signature; certificate time checks stay on. Tier 4 builds real bundles on the guest: a leaf under a new root is refused by the old keyring and verifies under the transition keyring, the old leaf still verifies, an expired leaf is refused with a correct clock in the text the updater matches, and a guest clock set to 2001 is refused with the clock named and then restored tests/os/selftest-os-update-clock.sh (real openssl keyring, stubbed rauc) + battery --phase update legs 8 and 9 (tests/os/phases/update-signing-legs.sh) 1 ✅ · 4
Cross-version update (#2056): --phase update builds both A/B slots from the SAME tree with different markers, so it proves the updater mechanism but nothing that only differs between two real releases. --phase crossupdate instead provisions a guest booted from a REAL prior build — bench-ci's tier4-kvm options.old_image resolves the newest appliance image cached for a commit strictly older than the one under test (a nightly develop run leaves one behind daily; once 2.0.0 exists this becomes the published release image) — and upgrades it to the candidate built from HEAD, waiting out pithead-boot's OWN commit gate (serving + doctor + status) rather than committing by hand, then asserting host identity survival, that the config the old version wrote is still honoured in LIVE runtime state (not just on disk), the complete stack via pithead doctor, no unit left failed, and the new dashboard image actually serves battery --phase crossupdate (needs $PITHEAD_OLD_IMAGE; not in --phase all) 4 ✅ (job 402 at 936a86c2)
Owner-level OS upgrade (#3911, #4193): a published appliance image, patched offline to also trust the dev-signed candidate, aged through the dashboard API and upgraded through the dashboard; outcome=updated within the boot-gate timeout plus 50%, a 10-minute soak with one extra reboot, and a hard-reset negative control that must roll back with a recorded cause opt-in battery --phase realupgrade (or realupgrade-main and realupgrade-negctl); guest-less logic in tests/os/selftest-realupgrade.sh 4 (KVM)
Dashboard OS-update verbs: appliance-only refusals, host-derived target, resumable download (partial kept, -C - resume, headroom refusal), verify refusals (signature, compatible, variant, floor/downgrade, tag mismatch — bundle deleted), install writes the in-flight flag via the shared os_update path, an install that arrives while another pithead operation holds the machine comes back rejected rather than as a failed install — with the staged bundle kept for the retry and rauc install never reached (#1482) — reboot gated on an installed update, one verb per drain tests/stack/appliance/test-appliance-os-update-verbs.sh (stubbed rauc/curl/systemctl/df) + test_server.py/test_views.py/test_update_checker.py + osupdate.test.mjs (resume chain, verdict banner, render gates) and osupdate-close.test.mjs (check-error Close reaches native dialog close in one click) and osupdate-reboot-verdict.test.mjs (a terminal verdict supersedes a stale Rebooting phase) 1 ✅
os_bundle_meta's [meta.pithead] parse (#1093), pinned against a REAL rauc info capture, not a hand-written stand-in: tests/stack/fixtures/rauc-info/ holds genuine --output-format=shell and --output-format=json output off one bundle built from the production render_bundle_manifest (recipe + refresh instructions in capture.sh, refresh when the RAUC package pin moves). The fake rauc in tests/stack/appliance/test-appliance-os-update.sh now answers format-honestly instead of returning the same fixture regardless of --output-format, so a caller that regressed to json — the shape RAUC 1.11 ships, which omits [meta.*] entirely — degrades to fail-closed "unstamped" for real in the suite, and os_raise_data_floor records the real bundle's own declared floor end to end through os_update tests/stack/appliance/test-appliance-os-update.sh (real fixtures) 1 ✅
Dashboard OS-update end-to-end: provision, check against a bench-local release server (root-owned test seam, honoured only when the harness build marker /etc/pithead-test-marker is present), download RESUMES from an interrupted transfer — proven by an independent witness (#1051: the server's own request log, not just the resumed_from field the test staged itself and which would hold even if curl silently restarted from zero), a floor above the running version refused with the #1393 premise (the plain below-floor door needs a downgrade bundle the leg does not build and is tier 1's, #1694) and a bad-signature refusal, both with honest errors, install + explicit reboot intent + boot-gated commit lands the new slot, persisted verdict reaches /api/state. The initial authenticated /api/state read waits up to 120 s for HTTP 200 and valid JSON, polling at 5 s intervals with requests capped at 8 s and the remaining deadline; timeout names the last HTTP code and at most 200 body bytes. A ready JSON body without os_update still fails immediately. tests/os/selftest-update-dashboard-readiness.sh (transport/JSON retries, timeout diagnostics and unchanged state assertion) + battery --phase update leg 4 (+ the provision os_update presence check) 1 (readiness fixtures) · 4 (current-head update phase required)
Update-channel hardening (#4011): a tainted release tag, a release publishing no OS bundle, a bundle URL resolving off the release-host allowlist, more than five redirect hops, and a listing over the size cap or timed out are each refused with the refusal naming its reason and no partial bytes kept; the asset-host hop resolves and bytes are fetched only from the terminal URL; a final non-2xx answer discards the partial; version comparison is semantic (2.0.10 above 2.0.9); the check reports the channel's last advance and flags a non-advancing channel stale/frozen and an older offer a possible replay, keeping the high-water mark. tests/os/selftest-os-update-channel.sh (stubbed curl drives every refusal through the real verbs) + battery --phase update leg 4 hostile listings (bench release server behind the guest seam: tainted tag, frozen channel, oversized listing, and recovery) 1 · 4 (current-head update phase required)
The OS-update test seam is gated on a build marker (#4208): a planted root-owned os-update-test-base file redirects the release lookup and the bundle download only while /etc/pithead-test-marker — written by harness image builds, and by the image-upgrade certificate leg on its unmarked bench image, deleted by pithead-install — exists; with no marker the seam dials nothing, os-check and os-download stay on the release hosts over Tor, and a channel fetch with an empty SOCKS proxy exits non-zero with no connection and no output file; with the marker the seam still redirects and drops the SOCKS, and the battery's bench-local legs keep running on it tests/os/selftest-os-update-channel.sh (planted file inert — check and download dial only the release hosts over Tor; sourced os_channel_fetch with an empty SOCKS proxy refuses without dialing, plus its marker-on positive control) · tests/stack/appliance/test-appliance-os-update-verbs.sh (marker-seeded seam redirect stays green in the appliance sandbox) · battery --phase update and --phase image-upgrade 1 · 4 (both phases on the head)
Post-reboot rolled_back verdict (#1051): a dashboard-driven install leaves an in-flight flag naming the target version; booting a DIFFERENT version writes the verdict into the state file and consumes the flag; landing on the target version leaves it alone (the commit gate's success half owns that); no in-flight flag is a no-op. Pulled out of pithead-boot's executed-only body into os_update_rollback_verdict, sourceable the same way as gate_ready/gate_url, because it is pure file logic (an in-flight flag, VERSION, one jq call) that needs no real A/B updater to prove — before this it ran only on a real boot and no tier could drive it with a fixture tests/stack/appliance/test-appliance-boot.sh (sourced pithead-boot, fixture in-flight.json/VERSION) 1 ✅
The boot gate re-mints a certificate that an address outran (#1265): render mints BEFORE up from the address list as it stands, doctor re-checks coverage in the gate loop AFTER up once the list has settled, so a SLAAC/ULA address arriving in between failed doctor on all 90 rounds and a good update rolled back. The loop now re-mints — only when THIS round's doctor failed on coverage and nothing else (gate_blocked_only_by_cert), only from a doctor run this round (gate_doctor_ran), at most three times a boot — through render's own idempotent mint, and restarts Caddy only when the certificate file changed (gate_remint_cert); fail_boot copies the failing checks into the in-flight flag and the fallback boot's rolled_back verdict carries them as blocking and names the first on the console, so "rolled back" no longer implies a bad release. The loop's wiring is asserted by order in the script (the loop sits below the sourcing boundary) tests/stack/appliance/test-appliance-boot-remint.sh (sourced pithead-boot, fixture doctor JSON, stubbed pithead render + restart command) 1 ✅ · 4 (added — unverified until the next battery run; the race needs a late-arriving address, which --phase update does not stage)
An address that arrives after the boot gate committed reaches the certificate and Caddy (#2463): pithead-address-watch.timer runs every five minutes, compares hostname -I with the address set the last render recorded, and when it differs renders under the mutation lock (the mint is idempotent by SAN set) and restarts Caddy inside that same lock when its own render moved the files — even after a render that failed part-way, and for the restart its own failed attempt owed even when the address set flapped back meanwhile; a busy lock defers the render AND the restart to the next tick, writing nothing before the lock is held. Files an apply, up or control commit re-rendered and restarted itself are recorded and named, never restarted over — including when they land in the same tick gap as an address change, where the watch's render is a no-op and the apply's restart stands (#3987 — the stale served record used to restart a current Caddy up to five minutes after every apply, outside the lock, blaming the addresses). It stays out of the way while pithead-boot is activating. Tier 1 drives the script with stubbed hostname/systemctl and a fake pithead render, including a files-only change and a restart that must find the lock held; the image check asserts the timer and script are baked tests/stack/appliance/test-appliance-address-watch.sh (also the IPv6 spelling fix: ipv6_canonical, the mint comparison and doctor) · tests/os/verify-image.sh · tests/os/appliance-address-watch-leg.sh (adds a ULA after provisioning, starts the service, requires the timer enabled and active, the certificate to carry the address and doctor's row green) 1 ✅ · 4 (--phase provision, --phase stack)
The 60-second quiet-Caddy legs catch the address watch firing (#3987): rr_caddy_stable starts pithead-address-watch.service once inside its 60-second window after taking the baseline snapshot, so a watch that restarts a Caddy already serving the current files fails the leg deterministically instead of racing the five-minute timer; a box without the unit installed still passes fake rx docker-inspect state and a file-backed fake clock; the restart during the tick flips the snapshot and fails the leg 1 ✅ (selftest-caddy-stable-address-watch-tick.sh) · 4 (--phase stack, the auth recovery/reset recovery/startup restore rows)
apply reaches the mint on an unchanged config (#1265): the no-change branch on an appliance re-renders the Caddyfile under the hold (apply_refresh_appliance_tls; the idempotent SAN-set mint lives inside generate_caddyfile) and restarts Caddy only when the certificate or the Caddyfile moved; a DIY host takes the old path untouched; the call sits between the control-runner convergence and the "nothing to apply" line, asserted by order in the slice tests/stack/appliance/test-appliance-cert-advisory.sh (sourced pithead, stubbed generate_caddyfile + docker) 1 ✅
The gate commits a coverage-only hold the re-mint could not clear (#1265): gate_remint_cert records what it did (reminted, unchanged, failed, exhausted); gate_cert_advisory admits only unchanged and exhausted, carries doctor's coverage message into the updated verdict as advisory and onto the console beside the apply remedy; a failed render is the slot's own health and the window keeps judging it; the loop's single commit path and the verdict's field are asserted by order and text tests/stack/appliance/test-appliance-cert-advisory.sh (sourced pithead-boot, fixture doctor JSON, stubbed pithead render) 1 ✅ · 4 (added — unverified: the battery stages no late-arriving address)
The /data floor after a data_migration update that FAILED its gate (#1393): the raise records the floor it replaced (or none) in .os-data-floor.prev BEFORE raising, and even when the raise is a no-op; the fallback boot (restore_data_floor_after_fallback, sourced from pithead-boot) puts the floor back from that record and ONLY from a record — with none, the floor stays (never lowered without one) and only the stale marker goes; the commit-side removal consumes the record; and os_update_version_guard refuses a floor above the running version with the true premise (failed migrating update, or a slot installed outside pithead), the open route, and no reset named. The two boot call sites sit below the sourcing boundary and are asserted by the script's text tests/stack/appliance/test-appliance-data-floor.sh (sandbox files, sourced pithead-boot, the real pithead guard) 1 ✅ · 4 ✅ (the provision phase's floor-fallback leg, tests/os/data-floor-fallback-leg.sh, builds its copied-tree synthetic bundle, waits for an observed reboot followed by a nonempty marker other than literal vfail and a commit in the current boot’s journal (the previous slot may carry v1 or vmig), restores the recorded floor after its gate fails, and keeps the floor fail-safe with no record; tests/os/selftest-floor-fallback.sh rejects the old boot, the failing slot even if it commits, missing markers and uncommitted fallback boots)
The post-commit release of the held chain services after a data_migration update (#1684): the up that starts them is retried a bounded number of times with a pause (compose aborts the whole start on one mid-transition container — on the bench, p2pool stopping seconds after the held up started it — and a single swallowed up left every held service down under a dashboard reading updated); the markers go before the first try, the release line the tier-4 battery keys on prints before the first up, and the last failure is one named FAULT line on stderr with the recovery, never a failed boot. Pinned by mutation: one bare up, a dropped announcement, markers moved after the up, the release line moved after the up, and the call site back to the bare swallowed up each kill a named row. The call site sits below the sourcing boundary and is asserted by the script's text tests/stack/appliance/test-appliance-boot-release.sh (stubbed pithead failing a scripted number of times, sourced pithead-boot) 1 ✅ · 4 ▶ (the migration leg's monerod never came back after the commit row is the instrument that found it; #1684 closes on that row green at a tip carrying the fix)
A chain service that dies AFTER a migrating slot commits (#2588, V10 of #1129): the release up succeeded and pithead-boot exited 0, so only the operator's surfaces can report it. On the migration leg's committed guest, with the pending marker consumed, Tari is stopped by its compose label; pithead status must exit non-zero with a ✗ (or ⚠ running but UNHEALTHY) row for it (the hold's own ⚠ row does not count), pithead doctor --json must FAIL the revenue check on it with no migration-pending note, and /api/state must carry the Tari DOWN badge after the running dashboard’s TARI_NODE_DOWN_AFTER_SEC debounce (900 seconds when unset), with 180 seconds of collection/publish slack. Before the debounce ends, at least one readable state must show no badge. Up to three consecutive unreadable samples are tolerated, with the count reset by a readable sample. An early badge fails immediately; a fourth consecutive unreadable sample or no readable pre-debounce observation fails separately. Failures record elapsed seconds and the badge verdict or read error, then proceed to recovery. Invalid, unreadable or out-of-range settings (outside 1–3600 seconds) refuse the fault before injection. Clock readings require successful numeric output; initial failure refuses injection, while failure or backward time during polling fails timing and still runs recovery. ./pithead up, the recovery the boot path's FAULT line names, must bring all three back: status shows it running, doctor no longer fails on it, and the badge clears on a dashboard that kept its start time (a restarted dashboard has no badge to clear). To time the controlled outage from a healthy baseline, the leg first waits until the dashboard has reached the released node: both containers up for 180 s (several times the usual gap between two dashboard Tari polls; a cycle slow enough to leave the window without one can only turn the badge row red) with no Tari gRPC error and no failed data-collection cycle in its log, and an unreadable log counts as not reached tests/os/appliance-chain-fault-leg.sh --self-test (verdicts, the dashboard precondition and its probe's remote command, the leg against a stubbed guest with one red scenario per surface and phase, its call site), driven from tests/os/selftest-row-payloads.sh; tests/os/selftest-chain-fault-timing.sh (default/override deadlines, early/missing/late badge, unreadable state and clock failure with recovery) runs through Make’s appliance selftest*.sh discovery 1 ✅ · 4 ▶ (battery --phase provision, the migration leg)
Install-to-disk copies a COMPLETE system; reinstall keep/fresh paths battery --phase install 4 ✅
RC1 reinstall and setup recovery (#1954/#1955/#1966): a 1.x xmrig_proxy pre-fill reaches the current page as xvb with a value-free migration notice; node preflight refusal retains the safe answers; then a separate post-marker setup fault reaches the named failed page and authenticated retry reopens the same answers for correction. The fault retags only the dashboard service's image, NOT the #2050 whole-file stub: that stub broke every docker compose call including provision_tor's tor-only one, so it faulted three lines before setup ever set DEPLOYMENT_COMPLETED=true — the marker was never on, so #2054's clear of it went unexercised at tier 4 despite the row below reading ✅ (#2061). Retargeting the dashboard image alone lets provision_tor and both render_env calls succeed and fails only in stack_up, well past the marker. The machine it hands back must also be re-provisionable — wizard_keep_failed_config clears DEPLOYMENT_COMPLETED, which setup sets a third of the way in and whose survival made every retry refuse as already provisioned; the retry that follows in the same phase (a fresh browser submit through to "stack containers are running") is what actually discriminates a cleared marker from an uncleared one tests/stack/appliance/test-appliance-setup.sh (the marker clear and its no-.env half) · battery --phase install pre-fill + --phase provision preflight and failed-attempt legs 1 ✅ (marker clear, controlled against a build with only that block removed) · 4 ✅ (re-armed for #2061 and measured on bench-ci job 224: DEPLOYMENT_COMPLETED observed true before the fault and false at the exact moment the failure was recorded — job 187 had only shown a failure was recorded, which reads the same whether the fault fires before or after the marker, so this second assertion is what actually discriminates a regression to the #2050 shape from a real post-marker failure)
Post-provision control on the appliance (#1966): a benign energy edit applies; a disruptive operational edit is refused without typed APPLY, applies with it, and is restored. Doctor returns all {status,message} rows, including a failed result carrying the complete document when its own exit is nonzero with monerod deliberately stopped. A p2pool tail is clamped to 200 lines/65,536 bytes, records an applied result when the byte cap closes its pipe, and redacts the known payout address; wallet-rpc logs remain refused tests/os/appliance-diagnostics-leg.sh + battery --phase provision 1 ✅ (verdict failure controls plus control/diagnostics route and host-runner suites) · 4 (added — unverified until the combined battery)
Dashboard backup recovery (#1965/#1966): the control request survives its own dashboard restart, returns a downloadable encrypted archive plus one-time passphrase, and leaves the stack and dashboard serving; the install phase restores a real archive to a fresh disk and checks the running payout wallet plus Tor onion identity battery --phase provision + --phase install restore leg Candidate tier-1 evidence only; tier 4 added and unverified until the combined battery
RC2 hostname identity (#1957/#1966/#2223): the wizard names the appliance fixture-box; kernel hostname, rendered HOST_IP, /api/state's header source, served certificate DNS+LAN-IP SANs and mDNS resolution through active Avahi must agree initially. A day-two fixture-next preview is pure and approval-gated; a commit without its envelope is refused, while the ordinary authenticated control route applies the host-generated preview. The new identity must survive an unaided reboot and the A/B migration update tests/os/appliance-hostname-leg.sh, tests/os/appliance-config-approval-leg.sh + battery --phase provision 1 ✅ (pure identity/prompt/consumer verdict controls) · 4 (written — unverified until the combined image battery runs)
RC2 sensitive-commit/node rows (#1959/#1898/#1943/#1946, retargeted by #2076): the first live config read is followed by an authenticated read of the shipped configversion.mjs, requiring a non-empty module with Saving is blocked and _config_version_newer but no Config file version (#3239); unreadable assets fail as unexercised. A sensitive day-two commit is refused without the typed confirmation envelope and leaves live identity unchanged; a confirmed one applies, audits against the signed-in actor with no approver field, and converges hostname/mDNS/certificate identity; a dashboard-password repoint commits behind typed APPLY and the envelope, its verdict read from the host result spool (the dashboard poll carries the login it replaces), the new login reads /api/config, and the fixture password is restored the same way (#2367). A snapshot taken before the first password commit is restored host-side after every exit, including lost verdicts and failed restoration previews; cleanup waits for the control spool to drain, preserves the failed assertion, and verifies authenticated /api/config with the original login (#2986). A standalone local Monero node username edit, then a password edit, each previews as a CONFIRM change, applies with typed APPLY, and must leave monerod's and the dashboard's container environment and p2pool's --rpc-login argument carrying the new login (checked against podman's inspect output, where names carry no Docker-style leading slash). The fixture sets p2pool.clearnet host-side first (#165). The dashboard can also commit it, behind the approval envelope, but this leg keeps its proposal to monero.* and tari.*. Reserved reachable Monero/Tari endpoints must pass the host preflight, land in rendered runtime state and the current p2pool container's narrowly extracted arguments (including each nonblank proposed login part in its live --rpc-login, compared without printing it), and make an endpoint-bound current-startup uses chain_id consumer probe pass before the original local-node config is restored; the restore also runs when the leg fails early. The guest-side fake Telegram transport is gone with the approval round-trip, so this leg now drives the ordinary authenticated control route tests/os/appliance-config-approval-leg.sh, tests/os/appliance-node-runtime-leg.sh plus the existing tests/integration/lib/mergemine-probe.sh verdict 1 ✅ (host policy suite in tests/stack/test-confirm-approval.sh; pure round-trip controls) · 4 (written — requires reserved node inputs and remains unverified until the combined battery)
Failing appliance rows carry their evidence, not just a verdict (#2060): the hostname rows preserve empty snapshot columns, fail an unavailable dashboard state as state=empty, and print kernel/static hostname, rendered host, dashboard state, certificate, Avahi, mDNS, card addresses and named HTTP status want-beside-got plus what Avahi published and on which interface (the address moved between runs, the interface is the discriminator); the control-runner rows print the runner result and value read back, reporting runner completion as unknown when the requested value has already landed but no result was written; the doctor row stays total over a FLATTENED checks, the shape it is named after; the bundle rows print the tail of the build log, with a missing log, an empty log and a failed build each getting their own sentence tests/os/appliance-hostname-leg.sh, appliance-diagnostics-leg.sh, provision-browser-submit.sh and appliance-approval-verdict.sh --self-test, plus tests/os/selftest-row-payloads.sh and tests/os/bundle-build-evidence.sh --self-test 1 ✅ (each payload driven against the shapes the verdict refuses, and a mutation of each field reddens its own control) · 4 (the rows themselves stay red until the defects behind them are fixed — this is the evidence step the issue asks for first)
The appliance's mDNS name resolves to a LAN address, never a container bridge (#2060): appliance_mdns_interfaces names every interface holding a global v4 address that is NOT a kernel bridge, and appliance_reconcile_mdns_interfaces writes that list as Avahi's allow-interfaces through the same /etc overlay the console login uses, reporting a change ONLY when the file actually moved so the caller restarts Avahi exactly when there is something new to announce. A positive list rather than a deny-list because the boot render reconciles identity BEFORE up creates either bridge, where a deny-list would come out empty. The rewrite also runs independently of the hostname label: an appliance left on the default auto name had no label to reconcile and returned before Avahi was ever touched tests/stack/appliance/test-appliance-hostname.sh (canned ip output from the measured guest; a config carrying no allow-interfaces line must report no change, the control that catches a silent no-op rewrite), tests/os/verify-image.sh (the shipped config carries the line the rewrite keys on) · battery --phase provision 1 ✅ · 4 (unverified until the next battery run; the mechanism itself is measured — an avahi-daemon + libnss-mdns container with one NIC and one kernel bridge resolves its own name to the bridge without the line and to the NIC with it)
The control POST outlasts the dashboard's own answer window (#2060/#2223): handle_control_* holds the request open until the runner answers or CONTROL_WAIT_S elapses and only THEN returns 202 with the id dashboard_control_request's polling loop needs. The two clients recover on deliberately different terms. The KVM harness helper polls the caller-supplied id whenever a 2xx POST response is empty OR malformed, and also on a synthetic 000 or a proxy 5xx after the request was accepted, refusing received 1xx–4xx. Preview POSTs without a usable returned id may be re-submitted at most three times after transport loss, HTTP 000 or an unstructured proxy 5xx, with each retry capped to the remaining caller deadline: they only stage intents, and only a returned, validated preview is later committed. A complete 2xx preview with a canonical server id remains usable after a trailing curl error. A connection failure before any HTTP response (curl 7 with HTTP 000 and an empty body) may reconnect for any verb, including commit, with at most three total connection attempts under the original deadline. No request reached the listener on those failed connections. Exhausted connection failures fail without polling the unchanged preview. Other commit transport failures, empty responses and proxy 5xx responses remain ambiguous and are polled without re-submitting the mutation; received refusals remain terminal. The browser client is narrower: controlCommitResult, shared by Configuration and Worker adoption, polls the preview id it already holds ONLY when a successful body is exactly empty, and treats a truncated body — one that parses but carries no result status — as terminal, because a half-read answer is a different failure from a lost one and must not be retried into a false success. Thus an 8s -m on the POST or a dropped response would otherwise discard every control operation that did real work — a commit that runs an apply, doctor on an unhealthy box — while their fast siblings answered inside it and passed, which is what made the reds read as the runner losing results. The check reads both numbers from their own sources, so neither side can move alone dashboard/tests/frontend/config/configview.test.mjs, workers/workeradopt.test.mjs; tests/os/appliance-config-approval-leg.sh --self-test, tests/os/selftest-control-admission.sh 1 ✅ (the cap mutated back under the server's window reddens the check; the admission regression fails without reconnecting an undelivered commit and pins single delivery after ambiguous responses) · 4 (unverified until the combined battery runs)
RC2 boot-menu version labels (#1956): serial sees distinct current/previous slot versions after the update commits, with the final boot bounded to bytes emitted after the commit reboot. Run 2026-09-10: the assertion fired and named the defect above — the labels are the instrument that found an unwritten B_VERSION, not a cosmetic row battery --phase update serial assertion from #1956 1 ✅ (menu fixtures) · 4 ✅ (fired red at pithead#2002's head, green at #2054's)
The config-panel commit races its own restart (#2366/#622): a commit that touches the dashboard's own settings recreates that container, so the browser's fetch("/api/control/commit") can be dropped mid-flight (a thrown TypeError) or answer through the proxy at 502/503/504 while the app is down — a case the #2060/#2223 row above does not cover, because there the request already landed a response body. ConfigView.commit now treats either as the expected restart and falls back to polling the preview id it already holds, same as a lost response; a real 4xx/5xx or a poll timeout still surfaces its message, never the raw browser error dashboard/tests/frontend/config/configview.test.mjs 1 ✅ (fetch throws then the poll succeeds; a 502 then success; a real HTTP error still surfaces) · 4 (tier4-kvm provision job's config-apply leg)
Restore leg: a real encrypted backup off a live machine, uploaded instead of the form on a fresh install, wallet + Tor identity restored not regenerated. The closing verdict (#1091) requires the stack to actually come back up (podman ps) AND a value sourced from the restored config — the --wallet argument the stack's own start path rendered into the p2pool container, read with podman inspect — to match: config.json landing on disk alone proves only that the archive was unpacked, not that anything is RUNNING it. The source is the container's command line rather than p2pool's stratum stats (/api/state's .stratum.wallet) because p2pool writes those only once a synced monerod hands it a block template, which a restored guest has no way to reach inside the verdict's window; the first live run failed on that by construction (#1662). The verdict (restore_live_state_verdict) lives in a sourceable file, the same pattern as hugepages_boot_verdict (#1212), so the discrimination is provable with fixtures without a KVM boot. Run 2026-09-10: it fired (#2051) — config and the ORIGINAL wallet restored, podman ps empty after 900 s — with nothing to say why, so the leg now also asserts that provisioning SETTLED on the restored machine (a provisioning that never finished and one that finished and started nothing are opposite causes behind one red), and the #2043 dump reads DEPLOYMENT_COMPLETED and the units' ConditionResult (a condition-skipped unit reads inactive exactly like one that ran, and never appears in systemctl --failed) tests/os/restore-live-state-verdict.sh, tests/stack/appliance/test-appliance-identity-boot.sh (fixture podman ps / wallet strings) · battery --phase install 1 ✅ · 4 ✅ (fired red; the probes named the cause — restore_apply had no parent directory to mv -T into on a fresh disk, so the apply aborted part-applied and the carried DEPLOYMENT_COMPLETED was never cleared. Fixed; the leg now passes end to end including the live-state and Tor-identity rows)
Reinstall pre-fill (#794/#1038): the previous install's non-secret answers reach the wizard page ONLY when the branch that reads them off the target disk (prefill_from_previous_install) actually ran this boot — a wallet-address match on the page's own state alone cannot tell that from some other path producing the same value, the gap that left this leg green for four consecutive batteries with the branch itself unproven. Pairing the outcome with the branch's own console record (its log line, journal+console per pithead-firstboot.service) makes the two tell apart (reinstall_prefill_verdict), the same discrimination #1212 needed for hugepages tests/os/reinstall-prefill-verdict.sh, tests/stack/appliance/test-appliance-identity-boot.sh (reinstall_prefill_verdict, fixture branch/wallet/password strings) + tests/stack/appliance/test-appliance-install.sh (prefill_from_previous_install itself) · battery --phase install 1 ✅ · 4 (changed — unverified until the next battery run)
Fresh Start reinstall (#2447): after a keep install commits, wipe=data keeps both chains, seeds the target grubenv, boots from that disk, completes the wizard, and commits a primary RAUC slot on its second boot tests/os/selftest-install-fresh-start.sh (leg order, returned-installer readiness and refusal) · battery --phase install 1 (leg order) · 4 (requires a run at the fixing head)
Restore leg: the checked-in encrypted v1.20.0 fixture restores to a keep-preserved target; wallet, Tor identity, opaque RPC/onion secrets, and both fixture and target chain sentinels survive without a resync (#2001/#2230). The dashboard password survives in config.json, and its archived bcrypt and fingerprint are kept exactly while the fingerprint matches it (#2579), proven by an authenticated request. The installer applies the restore to the kept target's data before its first boot, replacing its superseded config and role markers while the chain trees remain intact. The fixture's xmrig_proxy.* settings migrate to xvb.* unchanged, drive the rendered XvB settings, and leave no config.json.bak-1x; telegram.control is dropped tests/stack/appliance/test-appliance-restore.sh (install_restore_to_target on a kept target) · battery --phase install 1 ✅ · 4 ✅
Wizard's real HTTP flow provisions the STACK (images verified, direct clearnet egress dropped and Tor-routed egress succeeds from the Monero container through its shipped /usr/bin/curl, a direct IPv6 dial dropped whenever that container holds a global v6 address, as read from /proc/net/if_inet6 with the image's /usr/bin/cat since the image ships no ip, miner up); a direct dial counts as dropped only when it times out, and a probe that cannot run (curl, the v6 guard's cat, or a dial that fails any other way) is a counted unverified failure, never a pass; unaided reboot return; after each of M10's three live-stack power cuts every pre-cut container, stored image digest, a readable monerod height at or above the one flushed before the cut, miner, Caddy, and committed slot return; commit-gate honesty both ways; the migration hold is exercised from the cached image selected by old_image=true. Its full BUILD_COMMIT must be an ancestor of the verified develop commit (origin/develop, or refs/heads/develop in the runner mirror) and outside the PR commits; the resolved base ref and SHA are recorded; baseline and candidate source identities are recorded independently of their shared VERSION. Its own dashboard writer seeds miner_released=true in the existing database and an independent reader verifies persistence without changing owner or mode. Local Monero remains configured until the candidate records its slot-owned marker, stopped P2Pool/proxy at the ordinary pre-commit gate, unattended bootloader commit and post-commit local-chain startup. Only then may the reserved remote-node configuration be applied; direct RPC must report synchronized, P2Pool/proxy must be healthy and live stratum hashes must advance. Same-version and floor fallback remain required; a failed same-version fallback fails the floor leg as unexercised and never installs the floor bundle on an unverified guest (#3759). The owner's real-chain RC3 appliance upgrade is separate acceptance and does not gate the PR tests/os/appliance-egress-leg.sh --self-test (stubbed guest: missing curl or cat, each direct-dial exit, a failed Tor dial, v6 scope) · battery --phase provision 1 ✅ · 4 ✅ (the changed egress probes, bench-ci#532, passed in the 2026-09-24 provision run); the persisted-release migration regression is written but unverified at tier 4; selftest-migration-snapshot.sh checks old-writer persistence and metadata; selftest-migration-recovery.sh checks pre-fix ancestry refusal, direct-sync verdicts, the hold-before-remote ordering and advancing-hash polling
RigForge installed to an internal disk: submit role, disk and typed confirmation together, acknowledge the token-bearing card, boot the target without USB, retain its token in rig/miner configuration, start XMRig with no coordinator configuration or containers, scrub the seed on the target’s mounted FAT ESP. The pool is the guest’s SSH listener; this proves startup, not accepted shares tests/os/selftest-install-rig.sh (verdict and lifecycle failure controls), tests/os/selftest-install-rig-dispatch.sh (host loop: pending rig bypasses bare keep, card then ack before erase, genuine bare keep retained) · battery --phase install 1 ✅ · 4 (requires a run at the changed head; battery --phase install)
Rig role: no containers, mines from the baked binary, takes an A/B update like a coordinator; sister-feed and loopback control-listener readiness each retry up to 12 times, 5 s apart, while the unpinned-source control refusal stays single-shot; after reboot its pithead-boot transaction settles active before the rig result is read; M13's power cut reaches a new boot and returns unattended mining with the slot committed battery --phase rig 1 ✅ (settled-unit wait fixture; selftest-rig-control-readiness.sh: delayed/absent listeners and strict unpinned-source refusal) · 4 ▶ (rig phase)
Physical-presence config channel (#786 sub-issue D): identical-config short-circuit, diff building + secret masking, consumed-marker, the abort/apply state machine (media removed, keypress, countdown timeout, absence of input is not abort), the abort path announces the cancellation on the console/journal (#1061), merge semantics (#965: unnamed settings keep their running values, null clears, an unmergeable file passes through to validation, a minimal stick preserves the dashboard login / appliance defaults / node credentials end to end) tests/stack/appliance/test-appliance-media.sh (sourced, stubbed lsblk/mount) 1 ✅
Physical-presence config channel: exact diff on the console, countdown applies, the changed setting takes effect, the stick is consumed, pulling the stick mid-countdown cancels and the console confirms the cancellation by the exact expected wording (#1061); a MINIMAL stick (#965) keeps the pre-apply dashboard login working against the served dashboard and preserves appliance defaults + node credentials. Checked host stick construction must pass before attachment; readiness, formatting, mount or cleanup failures end the phase without cancellation verdicts from invalid media (bench-ci#2149) tests/os/selftest-media-fixture.sh (bounded readiness, construction failures, owned cleanup and caller guards) · battery --phase media (opt-in) 4 (added — not yet run at the release gate)
Hugepages sizing (#977): tier thresholds over meminfo shapes, the degraded boot shrinks the pool + leaves the plain-words marker + announces the degrade on the console/journal by its exact wording (#1221), doctor WARNs (never FAILs) on it tests/stack/appliance/test-appliance-identity-boot.sh (sourced, fixture meminfo) 1 ✅
Serial getty on appliances (#2462): the boot command line keeps console=ttyS0 for real UARTs, while the unit checks the 8250 type before opening it. A type-0 or absent port skips cleanly; a real port keeps a login prompt across clean exits. Setup announcements also publish the current URL, token and certificate fingerprint atomically in the root-only mode-0600 /run/issue.d/pithead-setup.issue, reload login prompts and copy directly to both consoles. Each new round replaces the file; process exit and both wizard units' ExecStopPost remove it. The setup-again session checks journal minting separately from serial delivery, captures tty1 through /dev/vcs1, and restarts both gettys while the direct writer is paused, with a publication-disabled negative control. Bounded tty1 and serial snapshots plus getty properties are retained in the collected harness log. tests/os/selftest-wizard-console.sh covers publication, replacement, cleanup and verdict failures. The boot phase asserts the guest's UART getty is active, substitutes a type-0 reading in the unit's runtime condition for five minutes, checks no restart or terminal error, then restores the real condition and checks a clean hangup respawns the getty before reboot tests/stack/appliance/test-appliance-serial-getty.sh (type fixtures and shipped-unit wiring), tests/os/verify-image.sh (baked files) · battery --phase boot (live systemd unit) 1 ✅ · 4 (run on the candidate head)
Doctor's HugePages verdict (#2610): a pool short of this machine's budget (hugepages_decision_pages: 3072, or the appliance's recorded reduced pool; never below P2Pool's 1296 pages of dataset plus two caches) WARNs, never FAILs, naming the pool against that target in pages and the shortfall in MiB; below P2Pool's 1040-page dataset, a zero pool included, it names the up to 2592 MiB of ordinary RAM P2Pool falls back to under its 4 GiB limit, pinned at 1039/1040, with that limit read off the Compose file and the Quadlet renderer; from 1040 up to the budget it names the fallback as conditional on monerod's own RandomX pages leaving P2Pool its 1040, pinned at 1040, 1296 and 3071; the 1296 floor is pinned at 1295/1296 on the released tier and labelled in the message; a non-numeric total reads as could-not-read; the host fix names setup's GRUB drop-in, verification of generated kernel entries and a reboot, rather than boot parameters or update-grub; the reduced tier is held to its recorded pool; the appliance wording passes the _dr_leaks sweep with a host-wording control; the full budget reads OK; pithead doctor itself carries the verdict; the DIY persistent HugePages regression (#3274) covers drop-in precedence, ISO-style defaults, idempotency and failures in a shell fixture, then setup in an Ubuntu 24.04 cloud guest, generated kernel entries, a real reboot, retained console and HugePages/THP arguments and a nonzero reservation tests/stack/doctor/test-doctor-memory.sh (sourced, fixture meminfo via PITHEAD_MEMINFO), tests/stack/test-grub-hugepages.sh · tier4-diy-kvm with scenario: hugepages 1 ✅ · 4 ✅ (job 161 at f04c7620)
Hugepages sizing is a no-op on supported RAM: sizing unit ran, full 3072-page pool intact, no degraded marker on the 16 GiB guest — proven on a provisioned boot battery --phase provision 4 (added — unverified until the next battery run)
Hugepages sizing on the FIRST boot: pool intact on the 16 GiB guest AND the sizing unit's own record (systemctl is-active pithead-hugepages.service) shows it actually ran. HugePages_Total alone reads identically whether the unit ran and correctly changed nothing or never ran at all — the baked sysctl reserves the same pool either way — so pairing it with the unit's record is what makes "ran, no-op" and "never ran" distinguishable (#1212). The verdict (hugepages_boot_verdict) lives in a sourceable file for exactly that reason: the discrimination is provable with fixtures, not just a bench boot tests/os/hugepages-boot-verdict.sh, tests/stack/appliance/test-appliance-identity-boot.sh (fixture is-active strings) · battery --phase boot 1 ✅ · 4 (added — unverified until the next battery run)
The hugepage pool's second writer is fenced (#1724): the miner unit runs as root and xmrig raises nr_hugepages through sysfs before a large-page allocation, so the ceiling the render declares bounds the sizer alone. The image ships a drop-in making both hugepage subtrees read-only to that unit. verify-image.sh pins the drop-in that SHIPPED; the battery reads what systemd LOADED (systemctl show xmrig -p ReadOnlyPaths), the pool against the ceiling in pages, and the 1 GiB pool the sizer never writes. hugepages_miner_verdict is fixture-driven at tier 1, including the #1724 state itself (4608 pages with nothing fencing the unit) and the parity between the verdict's page ceiling and the render's MB ceiling. ARMING: behind the #35 sync hold xmrig may never allocate on a guest boot, so a clean battery verdict is the fence unexercised, not the fence proven tests/os/hugepages-boot-verdict.sh, tests/stack/standalone/test_appliance_hugepages.sh (fixture strings) · tests/os/verify-image.sh · battery --phase provision 1 ✅ · 4 (added — unverified until the next battery run)
The journal follows the RESTORED machine-id on the second boot (#1659): journald reads the id once, at its own start — the transient one on an empty-baked image — so without a re-read every boot after the first opened a new persistent journal directory and journalctl -b read a stale one. The first boot cannot show it (the adopted id IS the transient one), so the verdict rides the #895 reboot and pairs the journal-directory count across it with the unit's own -b record (journal_boot_verdict), the same sourceable-verdict pattern as #1212; the restart DECISION (exactly when a transient id was bound and the restored one differs) is proven with a stubbed systemctl tests/os/journal-boot-verdict.sh, tests/stack/appliance/test-appliance-machine-id-journal.sh (fixture counts; stubbed mountpoint/systemctl) · battery --phase boot 1 ✅ · 4 ✅
The persistent journal has ONE home (#1791): /var is an overlay with its upper dir on /data, and the #1030 bind of /data/pithead/journal onto /var/log/journal was unordered against it, so whichever mount finished last owned the path and a boot's journal landed in one of two persistent directories while journalctl --list-boots omitted the boots that went the other way. The fix orders the bind After=var.mount; the verdict rides the same #895 reboot and asks the guest what the VFS resolves at /var/log/journal (stat -c %m and the inode against the bind's directory, because findmnt --target names the bind by mountpoint even while the overlay covers it), whether journald flushed under the bind this boot, and how many boots the persistent journal lists (journal_home_verdict); the unit's ordering is asserted statically at tier 3 tests/os/journal-boot-verdict.sh, tests/stack/appliance/test-appliance-machine-id-journal.sh (fixture shapes, the kept guest's own reading as the failing one) · tests/os/verify-image.sh · battery --phase boot (fired both ways: red on the unfixed image, green on the fixed one) 1 ✅ · 3 ✅ · 4 ✅
Power cuts mid-write and mid-commit; corrupt bundle; Fault D cuts an active first-boot baked-image load and requires the wizard plus repaired image store afterwards — a brick is disqualifying battery --phase fault (opt-in) 4 ✅
Data-reset repair escalation against REAL damage (#1062): a genuine ext4 image, the same two-byte superblock-magic wipe the battery injects, and the system's own fsck/e2fsck/mke2fs — a repairable image is repaired with its payload intact and never reformatted; a destroyed one still reaches the reformat escape. Only mount is stubbed, and its verdict is e2fsck -fn on the image itself, never a counter. The stubbed decision-tree block in tests/stack/appliance/test-appliance-reset.sh proves marker precedence and escalation order (#1086); this suite proves the repair tests/stack/standalone/test_data_reset.sh 1 ✅
Config-reset (the cheap tier, #2347): config.json/.env/Caddyfile and the Tor-only egress firewall are cleared, pithead-firstboot re-arms while pithead-boot stands down (opposite ConditionResults, read only after each unit's ConditionTimestampMonotonic is nonzero; a stalled or unevaluated unit times out by name), and reconfiguring through the wizard's real HTTP flow costs no resync — the monero chain directory survives, monerod's height resumes at or past its pre-reset value, and the Tor onion address (read from the hidden-service hostname file, not .env — #2379's onion-persistence claim, its appliance twin) comes back unchanged. Seven stack-row sites in six phases (provision-reboot, reset-config, reset, crossupdate ×2, update-dashboard, media) wait on provisioning_settled before their day-two legs, because pithead-boot's up can still hold the mutation lock behind Tor's healthcheck (#2661). Tier-1 ordering and failed-setup checks pin these waits; jobs 2510 (reset) and 2520 (update) on ad6247a87 exercised the reset and update-dashboard sites successfully. The other phase sites are not claimed as live proof. A real A/B reset leg health-commits A, installs v2 with os-update, requires B good/primary and previous A good, then takes an encrypted backup. Three rounds exercise wizard setup, CLI encrypted restore -y plus up, and reboot while setup stays open before finishing setup. Every reset boot and final normal reboot must preserve B|v2, previous A good and ORDER="B A". Update leg 1 requires fresh B to stay uncommitted while its setup page serves tests/stack/appliance/test-appliance-boot-verdicts.sh (stubbed systemctl evaluation delay and stalled reply) · tests/stack/appliance/test-appliance-reset-slot-boot.sh (shipped GRUB selection and unit conditions) · tests/stack/appliance/settle-order.sh · battery --phase reset (leg 0 and tests/os/phases/reset-slot.sh) and --phase update (tests/os/phases/update-spare-slot.sh). RC gate job 3b includes reset,stack; the three-round leg adds about 60 minutes 1 ✅ · 4 ✅ (job 1585 on 355ba7bc: earlier leg-0 verdict; jobs 2510 reset and 2520 update on ad6247a87: three routes and fresh-slot/fault controls; RC4 control 2487 on 4f1290d6: regression reproduced)
Coordinator Set up again: the real boot-menu entry exposes the saved pithead role and safe answers, Keep it preserves the original dashboard login and configuration, and coordinator resubmission preserves both local chain sentinels, resumed Monero height, onion address and host identity. Each return requires successful setup completion and authenticated dashboard state tests/os/coordinator-setup-again-leg.sh, battery --phase reset; tests/os/selftest-coordinator-setup-again.sh checks safe prefill and failed boot, session, request, login, chain and identity controls 1 ✅ · 4 ✅ (job 2870 on 9144724252e8c188968348fed218e8319f1d7a68: coordinator prefill, Keep it and resubmission; baseline verified, restore and cleanup passed)
Factory reset returns a machine with a fresh identity (machine-id, SSH host key, container store) and records the wipe on the ESP; a wedged /data — the superblock corrupted on the real partition — is REPAIRED, not erased: the sentinel planted before the corruption survives and the wipe log does not grow (#1062/#1087) battery --phase reset 4 ✅

K. Outbound alert delivery over Tor egress (#2266)

Tiers 1-3 prove the alert path and the SOCKS transport against controllable fakes (tests/integration/fakes/fake_hc.py, fake_socks.py — make test-fakes) and a local listener. What none of them can prove is the part that is not ours: that the third-party endpoint still accepts our traffic from a Tor exit. Telegram, ntfy.sh, a webhook and Healthchecks.io can block, rate-limit or challenge exit nodes at any time, and a fake will never refuse us — #424 is the recorded real-world instance of this class, a stuck Tor guard silently taking out Healthchecks, Telegram and XvB together.

This buys one bit per sink — "the third party still answers us over Tor" — at the cost of live credentials on the reserved bench and an outward message per run, so it is a classified reachability leg, never a gate blocker.

Situation Trigger Tier
Telegram, ntfy and webhook sinks each answer a real pithead test-alert (#2265) dial over the live stack's Tor SOCKS live stack + operator-supplied IT_TELEGRAM_BOT_TOKEN/IT_TELEGRAM_CHAT_ID, IT_NTFY_URL(+IT_NTFY_TOKEN), IT_WEBHOOK_URLS 4 ▶ (run.sh --alert-egress)
Healthchecks answers a real ping over Tor — driven directly through the production HealthchecksClient, since test-alert deliberately excludes this sink ("a ping moves the dead-man switch") live stack + operator-supplied IT_HEALTHCHECKS_PING_URL 4 ▶ (run.sh --alert-egress)
Leg classification: an absent credential self-skips its sink in the missing class, named (#1083); a third party refusing the dial is its own counted verdict (a THIRD-PARTY REFUSAL, summarized separately from IT_FAIL), never a stack failure; a sink test-alert still reports unconfigured after this leg configured it IS a stack bug pure logic, stubbed rx/push_config/pithead 1 ✅ (selftest-alert-egress.sh)

No credential, URL or chat id reaches the run log: IT_TELEGRAM_BOT_TOKEN, IT_NTFY_URL, IT_WEBHOOK_URLS and IT_HEALTHCHECKS_PING_URL all match redact()'s existing TOKEN/ NTFY_URL/WEBHOOK_URLS/PING_URL vocabulary (tests/integration/lib.sh); the operator's Telegram chat id is a routing id, not a secret, and is deliberately exempt from redaction already (selftest-redact-vocab.sh's MUST_SURVIVE) — this leg never echoes it regardless. Every credential travels to the box only through push_config's stdin-over-ssh JSON, never a shell argument or a log line.

What each tier needs from its host

Measured on a macOS host driving the container (#2078), not inferred. "Container" means make test-container, which runs the tier in tests/runner/Dockerfile against the host's Docker daemon. A tier that needs something the container cannot supply says so.

The image's system python3 has no requests, so the XvB gate-payload self-test in tests/os/appliance-xvb-gate-wait.sh runs the dashboard modules through uv when system python3 cannot import requests and uv exists, and otherwise uses python3.

Tier Needs on the host Runs in the container?
1 — dashboard pytest uv only; it fetches the CPython pinned by dashboard/.python-version. No Docker, any OS. Yes
1 — frontend node --test Node 20. No Docker, any OS. Yes
1 — shell suite (tests/stack/) Linux, GNU coreutils, non-root, and a longer tool list than it looks: bash, jq 1.7 or newer, e2fsprogs, a system python3 on PATH, xxd, sudo, and a UTF-8 locale. Refuses on Darwin (#2041); root bypasses the permission-denied fixtures. Missing system Python, xxd, or a UTF-8 locale fails quietly — see the note below. Yes — the container is how a non-Linux host runs this at all
1 — netwatch selftest Docker: it builds the pinned harness images and asks each tool for its version. Yes (host daemon via the socket)
2 — fakes contract uv only. Docker-free by design. Yes
3 — mini-stack Docker, Compose v2, and buildx. Without the buildx plugin Compose falls back to the classic builder, which rejects the RUN --mount=type=cache in dashboard/Dockerfile, and the tier dies at docker compose build failed with nothing naming the cause. The driver must also reach the fakes' host-published ports — from inside a container that is PITHEAD_TEST_HOST, not 127.0.0.1. Yes
4 — live matrix ssh (or --local), plus a reserved, provisioned, already-synced stack to point at. The harness applies configs and recreates containers, so it owns that box for the run even though it only reads the chain dirs. The driver does. The box is external either way — the container removes a toolchain dependency, not the hardware reservation.
1 — standalone soak probe self-test Linux or macOS, Bash 3.2 or newer, Python 3 and jq. bash tests/os/soak-probe.sh --self-test uses canned readings and stubbed SSH. Linux runs through the shell suite; the Shell workflow checks system and Homebrew Bash with BSD userland on macOS. Yes, but not required
4 — appliance battery Native Linux with KVM and libvirt, hugepages, root, a built image, and a reachable registry for bench builds (#2043). No. No container supplies /dev/kvm on macOS or Windows. This tier stays on the Linux bench.
lint (runs inside make test) The exact pins or nothing: shellcheck 0.11.0 and shfmt 3.13.1 (the gate refuses any other version), uv for ruff, Node/npx for Biome, markdownlint and taplo, Docker for buf, and git — most gates enumerate through git ls-files. Yes

A missing tool in this suite does not announce itself. Measured while building the image (#2078), each of these produced a wrong verdict rather than an error, which is the exact failure class the image exists to remove:

Absent Symptom
python3 (system, on PATH — uv's is project-scoped and does not count) The address suites degrade to shape-only and report unchecked/primary — the largest cluster of the 60 failures these four produced between them. The tell is a test that passes: monero_address_type: python3 unusable => shape-only primary.
xxd build/tor/healthcheck-selftest.sh symlinks each command the tor image ships; command -v yields empty, ln links to nothing, and the PATH-isolation case returns the wrong verdict (#1372).
A UTF-8 locale grep calls the generated pithead a binary file and prints binary file matches instead of the line, so the #1084 cosign-pin assertion reads a live pin as absent.
jq 1.6 (present, wrong version — Debian bookworm's) 1.7 preserves number literals and 1.6 does not: echo '{"height": 100.0}' | jq '.height|tostring' renders 100 under 1.6 and "100.0" under 1.7. integral JSON floats do not pass as integer heights reads expected [protocol], got [ok] (#2086). The container pins 1.7.1 — what ubuntu-24.04 runs — by sha256 for this reason.
sudo tests/stack/appliance/test-appliance-wizard-spool.sh builds a real root/page UID boundary with setpriv. It refuses to count itself as passed without both (real root/page boundary requires sudo and setpriv -> not run), which is the honest shape — but the tier is incomplete until the host supplies them. The container does; see tests/runner/Dockerfile for why that is a smaller grant than the Docker socket it already holds.

Two host-level constraints apply to the container itself:

  • Memory — at least 6 GiB for the engine. lint-sh is the memory peak of the whole suite (#1206). It runs one shellcheck process per file, four at a time (#2632). On a 16 GiB GitHub runner the largest single process is the generated pithead at 2.2 GiB, and the four largest files together come to 5.8 GiB. That sum is the worst case if all four run at once; one run sampled 2.7 GiB in total. The symptom of a shortfall is a bare Killed after the shellcheck line, naming neither memory nor a file, so raise the allocation before running the full make test in the container. Every other target measured here fits comfortably; test-container warns when the engine is below the bar. No single file may hold a check past SHELLCHECK_FILE_BUDGET seconds (120): scripts/lint/shellcheck-budget.sh kills it at the budget and names the file (#4026). A test that sources a variable path like "$ROOT/pithead" is followed by -x and re-analyses the sourced file once per source line, so such a suite puts # shellcheck source=/dev/null above those lines when the sourced file is linted on its own.
  • The Docker socket. Tiers 1 (netwatch), 3, test-compose and lint-proto all shell out to Docker, so the container is given the host's socket. That is host-root-equivalent access by itself; it is the same trust the tiers already need when run directly on the host.

Running each tier

make test                 # tiers 1 + 2 (+ harness self-test) — every-PR, no docker/server
make test-fakes           # tier 2 contract test on its own
make test-mini-stack      # tier 3 — needs docker
make test-integration ARGS="--host user@box --dir pithead --lifecycle --fault-injection"  # tier 4
# tier 4, appliance channel (KVM bench). PITHEAD_REGISTRY is NOT optional while VERSION is
# unreleased: only the wizard image is baked, so every other service is pulled as
# pithead-<service>:v$(cat VERSION) at first boot, and without it the appliance provisions and
# then runs ZERO containers (#2043). build-image.sh refuses such a build; see tests/os/README.md.
PITHEAD_REGISTRY=<host:port> PITHEAD_REGISTRY_CA=<ca.crt> PITHEAD_REGISTRY_COSIGN_PUB=<cosign.pub> os/build-image.sh --ssh
os/rauc/mkimage.sh --dev
sudo env PITHEAD_REGISTRY=<host:port> PITHEAD_REGISTRY_CA=<ca.crt> PITHEAD_REGISTRY_COSIGN_PUB=<cosign.pub> \
    tests/os/run.sh --image os/rauc/build/system.img  # sudo's env_reset drops exported vars

Production-readiness posture

What gates a merge vs. a release, the standards every test holds to, and the known gaps. For the full enumerated coverage, make test-inventory generates the list on demand (git-ignored — read it locally). The generator is grep-based, so CI runs it on every PR and fails if any suite it enumerates counts zero — the drift a moved or reshaped suite would otherwise hide. It also holds tests/stack/run.sh and the per-domain files it sources to each other in both directions: a file named by a source line has to exist, and a file on disk has to be sourced by something. Either mismatch ends the same way — run.sh does not stop on a failed source, so the suite reports a pass having skipped every assertion in that domain. It reads those source lines as text, which catches one that is absent or commented out but not one that is present and never reached; a handful of suites are invoked as their own CI step instead and are listed as exempt in the script.

What runs where

Check Tier When Blocking?
Dashboard pytest + ≥80% coverage gate 1 every PR ✅ required
Frontend logic (node --test) 1 every PR ✅ required
Dashboard image test stage (in-container) 1 every PR ✅ required
pithead shell suite + shellcheck 1 every PR ✅ required
Compose interpolation, security/hardening invariants, and generated Caddyfile parsing 1 every PR ✅ required
Fake-daemon contract test 2 every PR ✅ required
Integration harness self-test 4 every PR ✅ required
Test-inventory drift check (every suite still enumerates; every domain file is sourced) — every PR ✅ required
Fake-daemon docker mini-stack 3 PRs touching the harness, dashboard, CLI source, or workflow ✅ (own workflow)
Live config matrix on real nodes 4 manual / pre-release ✅ release gate (#44)
Targeted live run for a change to what runs on a box (build/, compose, config rendering, the control plane, deploy, upgrade, restore, merge-mining, Tor, miners) 4 every such PR, on its head (bench-ci tier4-e2e, targeted or matrix) ✅ required: the adversarial review returns a PR without it
KVM appliance battery (tests/os/run.sh) 4 every PR touching os/, RAUC, the wizard, first boot, the installer or updates, on its head (bench-ci tier4-kvm, one phase at a time); all phases against the exact commit, pre-cut ✅ release gate for the image, enforced by release.sh's bench-ci/tier4 preflight (appliance-release.md)

Tiers 1 and 2 run on every PR; tier 3 runs for the paths named above. Tier 4 is the blocking pre-release gate (see Releasing) because it needs the real synced nodes, and, narrowed to what the diff touches, the per-PR gate for any change to what runs on a box (see What a PR must prove).

The lifecycle Tor recovery probe runs tor-recover check against healthy, ordinary circuit history. It requires exit 1 and the unsaturated-history warning, with no unexpected-abort message or debug advice. The standalone recovery suite exercises deliberate CLI refusals, successful checks and unexpected failures under production shell options; the Tor-probe selftest rejects a false success, wrong guard and generic-abort output. The KVM provision phase runs the same CLI command in its guest immediately after initial provisioning settles, first verifying unsaturated state, then requiring exit 1 and the warning on stderr without unexpected-abort advice. Its pure selftest fails against a generated CLI with the pre-fix dispatch behavior.

Engineering standards

Every scenario, at every tier, holds to the same rules.

  • Deterministic, no sleep-and-hope. Wait on real readiness signals — container health, pithead status, dashboard sync %, miner-released — with timeouts. The only fixed sleeps are poll intervals and the deliberate "stays in state" windows that prove the gate does not act prematurely.
  • Isolated and idempotent. Each scenario starts from a known baseline and restores it. The live matrix snapshots config.json; real daemons retain read/write chain mounts and may advance them. The image-upgrade gate additionally snapshots and restores its enumerated persistent mounts: cp --reflink=always for data-dir bind mounts, refusing on a filesystem that cannot clone them, and a plain copy only for the small named volumes (#2057). The mini-stack tears down with down -v.
  • Actionable failures. Per-scenario pass/fail, continue-on-error to collect the whole matrix, and artifact capture (redacted logs, compose ps, .env-minus-secrets, dashboard responses) on failure. Captures retain Tor's health probe history and bounded container log. The lifecycle phase captures them at a failed missing-image up or dashboard data-dir carry, before later recovery steps can replace the failing container's state.
  • Secrets hygiene. Tokens, RPC creds, and onions are never printed; preservation is checked by hashing on the box; all artifacts pass a redactor.
  • Reproducible. The live run records a manifest (stack VERSION, git rev, image digests).
  • Test code is real code. The same lint (shellcheck) and coverage gate apply to the tests themselves, and the inventory generator fails CI if a suite stops enumerating or shrinks past its floor. The lifecycle restore-health selftest stubs the unrelated live Tor recovery probe; it does not prove that probe. Missing commands fail its fixture even inside command substitutions, conditions or redirected calls, rather than leaving a complete PASS summary.
  • An assertion reads its haystack directly, never through a pipe. The KVM serial checks read the serial file with serial_has; its tier-1 self-test puts a match before a megabyte of later output, and the rig and media phases prove their respective console rows on a guest. grep -q exits at its first match, so under pipefail the writer's broken pipe becomes the pipeline's exit status and the match is thrown away: a directive that was present read as missing, and — in the direction nobody watches — a forbidden pattern that was present read as absent, which is a hardening regression wearing a green tick. Use a file argument or a here-string. A reader that could not run at all is a failure in its own right, never folded into either verdict.

Flake policy

Integration scenarios quarantine, never blind-retry. A scenario that fails intermittently is marked and investigated, not wrapped in a retry loop that hides a real race. The waiters have wide timeouts so a slow-but-correct stack passes while a broken one fails fast with artifacts.

Known gaps

Not yet covered. The road to full production confidence.

  • First green run on real hardware. ✅ Two of the three real-environment tiers are green: the live harness --check (tier 4 read path, 22/22 against a synced, mining box) and the fake-daemon mini-stack (tier 3, 12/12 on a real Docker host). Between them they surfaced and fixed four bugs: the dashboard pruned/full label (#32); the harness's three over-strict assertions (monero-synced, conns, prune display); the fake Tari binding gRPC to loopback; and the mini-stack's container-name/port isolation. Still pending: the full destructive config matrix run on the box (its read path is already proven via --check).
  • Destructive-matrix safety. ✅ run.sh --safety-backup takes a real pithead backup before the destructive scenarios and automatically rolls the box back (down → restore → up) if anything fails; the archive is removed on success. So the matrix can run on a precious box with a one-command config/secret/dashboard rollback net. The image-upgrade gate separately requires CoW snapshots for chain and all other writable-mount recovery.
  • CLI breadth in automation. ✅ backup/restore are exercised end-to-end: by --safety-backup and by a --lifecycle backup→restore round-trip (assert the pool reverts and secrets survive). The opt-in --image-upgrade gate now exercises upgrade across declared image revisions and checks authenticated digest manifests, Pithead-image signatures, exact mounts, both captured chain anchors, stable durable row payloads plus the presence of every volatile key, secrets, workers, mining, and exact old-baseline restoration; its first recorded combined hardware run remains pending. The per-verb breadth of the gap — which verbs have no tier-4 run at all, and why — is now the CLI verb ledger (#2348) rather than one bullet here.
  • Soak / longevity. The nightly KVM provision battery proves the appliance Tor stats fetch and a bounded injected controller/proxy route transition, run while the reserved-node approval has released the sync gate (#2733); the bounded --xvb-routing-smoke additionally observes one real controller/proxy transition and restore on a synced stack. Multi-hour leak, log/DB growth, and long-term convergence coverage remains absent.
  • Load / capacity. No test drives many workers or high share rates to find limits.
  • Security review. The compose hardening invariants are regression-guarded (the #90 section of tests/stack/standalone/test_compose.sh: RPC creds never in a healthcheck command, no-new-privileges / cap_drop on the leaf containers, the Docker socket proxies stay least-privilege), so a past fix can't be silently undone. A full security audit is still a separate exercise (SECURITY.md). These tests pin the decisions we've already made; they don't find new ones.

Coverage-audit follow-ups (2026-06)

A source-vs-tests audit added Tier-1 coverage for a real bug (snapshot serialization failure left the #131 persistence badge green), the firewall install-failure rollback (#270), the wallet hard-fail guards (#250), remote-host/subnet validation (#180), ensure_owner's whole-tree scan (#255), and several dashboard render branches (per-worker api/reject badges, XvB/Unknown pool badges, the #278/#313 Tari-✔ invariant, Gauge done vs syncing). The gaps it surfaced that are not yet covered at an automatable tier — all needing Docker or the real box, so they land at tier 3/4:

  • Firewall rollback, real kernel. ✅ Now a tier-4 --fault-injection case: it shadows iptables with a wrapper that fails every -I insert, re-runs apply_tor_egress_firewall, and asserts the box ends fail-closed (no pithead-tor-egress rule left half-installed), then reinstates the real firewall. The tier-1 stubbed test proves the control flow; this proves the real-kernel strip. Runs at the release gate only (destructive-then-restored, local box).
  • ensure_owner real mixed-ownership tree. ✅ Now a tier-4 --lifecycle step: it plants a root-owned file under the dashboard data dir and asserts the pool-flip apply (which runs ensure_directories → ensure_owner) chowns it to uid 1000 — the #255 "scan contents, not just the dir" regression. Runs at the release gate only (needs root to create a foreign-uid inode).
  • Real-container Monero failover in PR CI. ✅ Mini-stack scenarios 6/7 exercise local Monero rejection/readmission; scenario 11 uses remote RPC and proves outages reject with Tari optional. The tier-4 --fault-injection run covers the real binary/kernel leg.
  • Required Tari outage with real containers. ✅ Mini-stack scenario 4 stops the Tari container and asserts the proxy stops; scenario 5 proves recovery. Live startup, migration and sync readings leave the proxy running. The mini-stack shortens the 15-minute debounce to four seconds; unit tests prove the production window.
  • Non-blocking-Tari sync-gate path with real containers. ✅ Mini-stack scenario 11: recreates the stack with dashboard.tari_required=false (baked in at container boot, so it needs its own compose cycle) and asserts the sync gate releases on monerod alone.
  • monerod busy / mid-reorg failover. ✅ Mini-stack scenario 8: the fake's busy mode (HTTP 200, status≠OK) drives the same reject/readmit cycle as a clean outage.
  • Double outage, both required nodes recover. ✅ Mini-stack scenario 9: both down → rejected; Monero recovery alone does not readmit while required Tari is still down.
  • Partial-start / stop-failure idempotency. The control loop's "container fails to start/stop → retry next cycle" is unit-only; no tier-3/4 scenario injects a docker start/stop error.
  • pithead doctor on a real box. ✅ The --check phase now runs doctor and asserts exit 0 plus the three #383 runtime OK verdicts (egress firewall installed, stratum listening, dashboard answers). ✅ Its NTP/clock-drift check is now fault-injected too (--fault-injection): a PATH-shadowed timedatectl (no real clock skew — mining is time-sensitive) proves doctor classifies a real unsynced report correctly, then the shadow is dropped and recovery is asserted.
  • Disk-full / ENOSPC verdict. ✅ Now a tier-4 --fault-injection case: a 1MiB tmpfs bind-mounted over the dashboard data dir and filled solid forces a real kernel ENOSPC (distinct from fault_db_readonly's EACCES), and asserts db_healthy:false, then unmounts and asserts recovery. The verdict is only readable if the dashboard keeps answering (#4199): a restart on the full dir must still start and serve the status API, a valid session must still pass the sign-in gate when its session-store write hits ENOSPC, and sign-in must report the full disk rather than die.
  • Tor-container-down partial start. ✅ Now a tier-4 --fault-injection case (#563, TOP PRIVACY PRIORITY): docker compose stop tor and assert BOTH no clearnet egress leak appears (reuses bench-verify-egress.sh's /proc/net/tcp proof, the same one the steady-state battery runs) and that doctor fails loudly — its dedicated check_tor_running verdict FAILs with a non-zero exit while the tor container is down and the mining stack runs, never a silent all-clear — then restart tor and re-assert both the egress proof and pithead status. (check_egress_firewall_installed and check_tor_clearnet_egress still info-skip without a running tor container, by design: the dedicated verdict already fails the outage.)
  • P2Pool seed-node DNS from a cold peer cache. ✅ A tier-4 --fault-injection case (#2496): both saved peer lists are set aside and p2pool restarts under a host-network tcpdump on port 53 (the tests/netwatch image). It asserts the Tor default runs with --no-dns (a clearnet config runs without it), p2pool reaches peers and mining resumes, and no seeds*.p2pool.io or *.p2poolpeers.net query appears in the capture. A unique host lookup is the capture's positive control, so a blind capture fails instead of reading as clean.
  • Insecure + main matrix row. ✅ Now a dedicated local-pruned-main-insecure row: the two axes decouple, so a regression specific to insecure+main (vs. the pre-existing insecure+nano row) has somewhere to fail.
  • A real xmrig client over stratum TLS. The p2pool.stratum_tls=true row proves the server side live (a real TLS handshake on the published port, served cert matches the pinned fingerprint); a real rig actually mining with pools[].tls:true set is deferred, the same class of gap as the stratum-password headless-probe row above (a rig-configuration step outside this harness's control, needing a real xmrig binary).
  • verify_release_images() against a real signed bundle. ✅ Now exercised directly (not reimplemented) by scripts/release/release-smoke.sh: the real function runs in the extracted, published bundle dir against the real pinned digests + committed cosign.pub (positive, needs a signed release) and against a digest tampered in a copy of the bundle (negative, fail-closed, runs regardless of signing) — the security-critical proof that the exact function up/upgrade run on every install refuses a mismatched digest, not just that a hand-rolled cosign call does (#376/#459).
  • Per-service runtime uid. ✅ Now asserted every matrix run and at --check: docker exec <svc> id -u for all 9 services against their audited expected uid (tor 100; monerod/p2pool/ xmrig-proxy/dashboard/tari 1000; caddy/docker-proxy/docker-control root, mitigated by cap_drop: ALL + isolation rather than uid) — compose only pinned tari's user: at config time (#255/#91); nothing checked what actually runs.

Adding a scenario

  • Logic (a new decision/branch) → a unit test (tier 1). Cheapest, fastest.
  • A new daemon state the clients must parse → extend the fakes plus the contract test (tier 2), and it becomes drivable in the mini-stack (tier 3).
  • A config axis → one row in tests/integration/scenarios.sh (tier 4). The self-test enforces every axis value is covered.
  • A failure mode needing real containers → a fault in run.sh's fault-injection phase (tier 4) and/or a mini-stack scenario (tier 3).
  • A fault that installs a kernel rule → give its comment the pithead-e2e-fault- prefix. The leg calls fault_rules_clear_all before it injects. While its rule exists, an EXIT trap calls it again: fault_rules_trap_arm just before the insert and fault_rules_trap_disarm after the leg's own delete, or the leg's own abort handler as the stranded legs have. The fault-injection phase clears at its start and end too. fault_rules_clear_all deletes tagged rules in every running container's network namespace and no others, and does nothing when none exist. The trap names EXIT only, which TERM and INT also run (#1401). A SIGKILL runs no trap, so a runner that kills the harness hard has to remove the tag itself. selftest-fault-rules.sh proves each of these with stubbed docker, nsenter and iptables.

Keep each situation at the lowest honest tier; don't re-prove logic with a heavier harness.

Framework choice: hand-rolled, not bats/ShellSpec (#1338)

tests/stack/run.sh's header says the suite is dependency-free — "no bats required". That traces to PR #37 and was never revisited until the question came up again, so it was measured instead of argued.

Decision: keep the hand-rolled suite. Do not adopt bats-core, ShellSpec, shUnit2, or bashunit — not wholesale, not per-tier, not for new tests only.

What was measured

Both leading candidates were installed and run against the real pithead binary. Three representative tests were ported — one pure-bash assertion, one config-render inspection, one touching the shared control sandbox — and mutation-tested to confirm the ports still failed on the defect they guard.

Framework Original Ported Change
bats-core 159 lines 378 2.4x more
ShellSpec 74 lines 197 2.7x more
ShellSpec, control-sandbox slice alone 41 140 3.4x more

Verbosity was the premise of the question. It runs the other way, and it grows worst exactly where the suite is hardest. shUnit2 and bashunit were not port-tested: both share the function-per-test shape that produced the blowup twice, so the remaining uncertainty didn't justify two more spikes — a judgement, not a measurement.

Why it does not fit, structurally

  • set -e. bats wraps every @test in set -e. The suite runs set -uo pipefail without -e, because a large share of run.sh tests rejection paths shaped out=$(cmd); rc=$?. Under bats those abort before the assertion runs — hit in 3 of 3 ports. Sourced control-runner calls and rig-miner journal-reclaim calls use run_sourced_e, which starts a fresh shell with the CLI's production options so the suite's && domain loader cannot suppress errexit (#2095). The rig-miner negative control requires exit status 1 and no success marker after a failing command; the reclaim cases use the same runner and require miner setup to continue.
  • One When per Example. ShellSpec's rule splits a continuous scenario into separate Examples. That doesn't remove the shared-sandbox order dependency, it hides it — and shellspec --random examples, an ordinary flake-hunting flag, would corrupt the run silently.
  • Gates that would break on day one. tests/inventory.sh parses == section == headers; the Makefile's lint-sh target globs git ls-files '*.sh' for shfmt, which never matches .bats — test code would silently lose shfmt coverage. ShellSpec files fail shellcheck --severity=warning outright (SC2148/SC2286/SC2016/SC2034), making a standing lint exemption part of the deal.
  • It does not address the lint-sh ceiling. That failure is size-correlated on one large file (#1206/#1333). Splitting the file is the fix; a framework does not split the file.

What to do instead

  • Finish #1105. Per-domain files under the file budget, invoked as their own process (the test_compose.sh pattern) rather than sourced, gives the per-test isolation a framework was going to sell, with no dependency.
  • A section filter for local iteration — a PITHEAD_TEST_FILTER env var, checked wherever a section header prints, skipping the block unless the name matches — is the one capability worth taking from the framework pitch, at a fraction of the cost. Noted here as the next step, not yet built: today a single test can't run in isolation, so iterating on one function means replaying both sandboxes from the top.

Not recommended: a framework "for new tests only" (two assertion dialects, two lint configurations, two inventory parsers, and a standing question at every new test, in exchange for a filter flag); migrating test_compose.sh as a pilot (it's already process-isolated, so it's the one file that gains nothing while paying the full dependency and lint cost); splitting run.sh directly into .bats files (.bats never matches the shfmt glob, and the set -e problem would land across every rejection-path assertion at once).