feat(host-stats): host pressure dashboard pane (Node + Rust parity) - #700
Merged
Conversation
…3/LB7/LB9/LB13-LB16)
…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)
…ngle-flight refresh
…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
… + per-section watchdog coverage
…ode .finally parity)
…md pane-kind list
…e host-stats delta
…l-suite-only reach)
…est (workspace-load flake)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a Host Stats pane (kind
host-stats, picker shortcut H, gated byhostStatsAvailable— 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 — neverbroadcast_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) accepthostStats: 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
/proc+/sysfixture files; cgroup v2 leaf semantics (Freshell's own unlimited-cgroup case exercised); disk aggregation worst-device-wins; darwin CPU viaos.cpus()deltas (Node), Rust darwin cpu unavailable (noted divergence).test/server/ws-hoststats.test.ts(subscriber gating, auth gate, both rate floors, last-subscriber teardown).host-stats-pane.spec.tsin 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 undercargo test --workspace.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 --locked0 · strict clippy (-D warnings) 0 · contract regen idempotent · e2e both legs at final HEAD ·npm run build0.