Skip to content

Add live TUI dashboard (--ui) with a scan-flow screenshot#4

Merged
grloper merged 1 commit into
mainfrom
claude/wraith-security-sensor-0pjajs
Jul 12, 2026
Merged

Add live TUI dashboard (--ui) with a scan-flow screenshot#4
grloper merged 1 commit into
mainfrom
claude/wraith-security-sensor-0pjajs

Conversation

@grloper

@grloper grloper commented Jul 12, 2026

Copy link
Copy Markdown
Owner

--ui turns any mode (run/attach/scan) into a full-screen terminal dashboard instead of the scrolling log: one row per traced process with live syscall/event counters and a colour-coded verdict, a feed of recent detections, and an aggregate status bar. It is most useful for scan, where many processes are watched at once.

Engine (tracer.rs): generalise the output sink from a bare event closure to a Reporter trait that also receives per-process ProcStat snapshots. run keeps its closure API (wrapped in an internal FnReporter), while a new run_with drives an arbitrary reporter. Progress snapshots are gated behind Reporter::wants_refresh, so the plain/JSON/test paths build no snapshots and pay only a counter increment — the hot path is unchanged. Refreshes fire on every detection and process-lifecycle change, throttled to ~20 fps otherwise.

UI (ui.rs): a hand-rolled ANSI dashboard — no TUI dependency, so the supply chain stays nix + libc. Terminal size via a TIOCGWINSZ ioctl; a guard plus a SIGINT/SIGTERM handler always restore the alternate screen and cursor, even on Ctrl-C. The frame renderer is a pure function, unit-tested for width-fit, verdict rendering, and the event feed cap.

CLI (wraith.rs): --ui/--dashboard; the dashboard also honours --json. Also: scan now excludes its own process and its entire ancestor chain (the shell/terminal that launched it), so a broad --match can't attach to — and hang on — the tool that started it.

Docs: README gains a hero screenshot of the scan flow (docs/scan-demo.svg, an SVG rendered from a real captured dashboard frame) and a --ui section.

42 unit + 10 end-to-end tests, clippy clean.

Claude-Session: https://claude.ai/code/session_01117vzFc51mLKYnKW2SnWzg

`--ui` turns any mode (run/attach/scan) into a full-screen terminal
dashboard instead of the scrolling log: one row per traced process with
live syscall/event counters and a colour-coded verdict, a feed of recent
detections, and an aggregate status bar. It is most useful for `scan`,
where many processes are watched at once.

Engine (tracer.rs): generalise the output sink from a bare event closure
to a `Reporter` trait that also receives per-process `ProcStat` snapshots.
`run` keeps its closure API (wrapped in an internal `FnReporter`), while a
new `run_with` drives an arbitrary reporter. Progress snapshots are gated
behind `Reporter::wants_refresh`, so the plain/JSON/test paths build no
snapshots and pay only a counter increment — the hot path is unchanged.
Refreshes fire on every detection and process-lifecycle change, throttled
to ~20 fps otherwise.

UI (ui.rs): a hand-rolled ANSI dashboard — no TUI dependency, so the
supply chain stays `nix` + `libc`. Terminal size via a TIOCGWINSZ ioctl; a
guard plus a SIGINT/SIGTERM handler always restore the alternate screen and
cursor, even on Ctrl-C. The frame renderer is a pure function, unit-tested
for width-fit, verdict rendering, and the event feed cap.

CLI (wraith.rs): `--ui`/`--dashboard`; the dashboard also honours `--json`.
Also: `scan` now excludes its own process and its entire ancestor chain
(the shell/terminal that launched it), so a broad `--match` can't attach
to — and hang on — the tool that started it.

Docs: README gains a hero screenshot of the scan flow (docs/scan-demo.svg,
an SVG rendered from a real captured dashboard frame) and a --ui section.

42 unit + 10 end-to-end tests, clippy clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01117vzFc51mLKYnKW2SnWzg
@grloper
grloper merged commit f26f152 into main Jul 12, 2026
3 checks passed
@grloper
grloper deleted the claude/wraith-security-sensor-0pjajs branch July 12, 2026 21:23
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.

2 participants