Skip to content

feat(host-stats): host pressure dashboard pane (Node + Rust parity) - #700

Merged
danshapiro merged 25 commits into
mainfrom
the-usual/host-pressure-pane
Sep 1, 2026
Merged

feat(host-stats): host pressure dashboard pane (Node + Rust parity)#700
danshapiro merged 25 commits into
mainfrom
the-usual/host-pressure-pane

Conversation

@danshapiro

Copy link
Copy Markdown
Owner

What

Adds a Host Stats pane (kind host-stats, picker shortcut H, gated by hostStatsAvailable — Linux/WSL/macOS only): an at-a-glance host load dashboard with a 9-tile live tier (CPU/load/memory/paging/PSI/disk-IO/network/limits/freshell-itself) streaming at 2s/5s cadences only while at least one client is subscribed (zero server cost otherwise), and a request-only tier (top processes, process health, inotify, disks, thermals/battery) refreshed solely via an explicit "Refresh measurements" button with single-flight + per-connection and cross-connection rate floors. Unavailable or never-measured values render as (never zeros); stale on-request data desaturates on a shared 30s→5min ramp.

Both servers implement it: Node (server/host-stats/ readers + service, ws-handler wiring) and Rust (freshell-platform readers, freshell-ws interest registry + trait bridge + terminal.rs dispatch, freshell-server concrete collector with targeted per-connection delivery — never broadcast_tx). Wire contract pinned three ways: zod schemas + regenerated frozen contract artifacts + Rust field-level shape tests. REST (POST /api/tabs, /api/panes/:id/split) and MCP (new-tab/split-pane) accept hostStats: true. On refresh failure the pane keeps previous values and timestamp; refresh completion is announced accessibly (one-shot sr-only status, no per-second live regions).

Coverage

  • Per-task TDD with independent review of every commit; 45 /proc+/sys fixture files; cgroup v2 leaf semantics (Freshell's own unlimited-cgroup case exercised); disk aggregation worst-device-wins; darwin CPU via os.cpus() deltas (Node), Rust darwin cpu unavailable (noted divergence).
  • WS integration suite test/server/ws-hoststats.test.ts (subscriber gating, auth gate, both rate floors, last-subscriber teardown).
  • Playwright host-stats-pane.spec.ts in MATRIX_SPECS — green on both legs (Node 5/5 ~30s, Rust 5/5 ~28s).

Also in this PR (disclosed)

  • test(codex): close fork/exec /proc cmdline race in sidecar identity test — pre-existing workspace-load flake root-caused during gate debugging (post-fork/pre-exec cmdline reads parent argv), fixed test-only. The test is feature-gated (real-transport), so it only exists under cargo test --workspace.
  • Pre-existing load flakes observed but NOT from this change (recorded, not fixed): auto_resume_e2e + restore_spawn_gate + pane_ledger deadline-under-load timeouts, all green in isolation.

Verification (final integration gate at HEAD)

focused lanes 82/82 & 9/9 & 516/516 · typecheck 0 · lint 0 errors · coordinated full suite success (the first run's 5 failures were 2 real Gauge-mock gaps — fixed — plus 3 environment-only proxy-warning pollution) · cargo test --workspace --locked 0 · strict clippy (-D warnings) 0 · contract regen idempotent · e2e both legs at final HEAD · npm run build 0.

…ixture, deadline param, cgroup unlimited fallback, serde null-vs-absent, subscribed reducer, clock-offset sign, crate direction, targeted delivery, RED procs, e2e matrix)
…te, pids-limit semantics, disk aggregation, inotify reader, darwin CPU, refresh cooldown, surface tests, WsState sweep, cadence ownership, rust test-validity, RED sequencing, exact staging, a11y age label, doc verification)
…iber-gated sampling + registry getMaxTerminals
Widen RegistryPaneKindSchema (+Node/Rust mirrors) with 'host-stats' so
tabs.sync registry records carrying host-stats panes round-trip
(resolves the known typecheck:client error at tab-registry-snapshot.ts:87),
and expose hostStats: true on POST /api/tabs, POST /api/panes/:id/split,
and MCP new-tab/split-pane as a cheap content kind (no terminal spawned),
mirroring the browser/editor precedents in both servers.
…dge, interest-gated cadence, targeted send, refresh floor
@danshapiro
danshapiro merged commit bb1fb59 into main Sep 1, 2026
3 checks passed
@danshapiro
danshapiro deleted the the-usual/host-pressure-pane branch September 1, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant