Download IMPLEMENTATION_PLAN.md from smlflg/agent-process-dashboard: direct link, hf CLI and curl.
- Browser
- Download file 4.02 kB
-
https://huggingface.co/smlflg/agent-process-dashboard/resolve/main/IMPLEMENTATION_PLAN.md
- Command line
-
hf download hf://smlflg/agent-process-dashboard/IMPLEMENTATION_PLAN.md
-
curl -L -o IMPLEMENTATION_PLAN.md https://huggingface.co/smlflg/agent-process-dashboard/resolve/main/IMPLEMENTATION_PLAN.md
Agent Process Dashboard Original MVP Plan
Note: the original MVP was read-only. The current app keeps read-only scanning
but now also supports explicit, confirmed SIGTERM/SIGKILL actions for fresh
dry-run candidates only.
Original direction: standalone GTK desktop app. The MVP was read-only plus
dry-run candidate reporting only, with no kill execution, no generated kill
command, no localhost server, and no network port. /proc is the primary
sampler.
Summary
Build a new standalone GTK app in:
/home/smlflg/Projekte/agent-process-dashboard
The app monitors Samuel's current-user Linux process tree, classifies agent/MCP/bridge processes, shows parent/child fanout, flags stale candidates, and reports what a cleanup would target without executing it.
Superseded direction: the previous FastAPI/static web UI plan is replaced. Keep
its useful /proc, PID identity, classification, tree/group, and risk ideas;
remove localhost server, web frontend, and systemd daemon work from the MVP.
Key Changes
- Python package:
agent_process_dashboard. - UI: GTK3/PyGObject desktop window.
- Core sampler: direct
/procreads, nopsutildependency in the MVP. - Process identity:
boot_id:pid:start_time_ticks:uid. - Safety:
- No
SIGTERM,SIGKILL, renice, restart, or config mutation. - No
/proc/<pid>/environreads. - No executable cleanup command is printed.
- Dry-run output is only candidate PIDs, identity keys, reasons, and exclusions.
- No
Implementation Tasks
Scaffold project files:
pyproject.tomlREADME.mdsrc/agent_process_dashboard/tests/
Build testable core modules:
procfs.py: read/proc, parse stat/status/cmdline/statm/cgroup, handle disappearing PIDs.sanitize.py: mask secrets in argv before display.classifier.py: classify Claude, Codex, Hermes, opencode, Gemini, MCP servers, bridges, wrappers, terminals, editors, browsers, and unknowns.tree.py: build parent/child trees and launch groups.risk.py: compute fanout, bridge, stale, and global warning levels.dryrun.py: generate read-only cleanup candidate reports.snapshot.py: orchestrate sampler, classifier, tree, risk, and dry-run.
Build GTK UI:
- Header KPIs: agent roots, MCP/bridges, max fanout, stale candidates, CPU hot, last scan.
- Left: agent/root group list.
- Center: process tree using
Gtk.TreeStore. - Right: selected process details.
- Bottom: dry-run candidate report.
- Filters: Agent, MCP, Bridge, Stale, High Fanout.
- Poll active snapshots every 2 seconds, idle snapshots every 5-10 seconds.
Risk defaults:
- Per group child count
>= 20: warn. - Per group child count
>= 50: critical. - Per group bridge count
>= 6: warn. - Per group bridge count
>= 12: critical. - Global MCP/bridge count
>= 20: warn. - Global MCP/bridge count
>= 50: critical. - Global agent-related count
>= 30: warn. - Global agent-related count
>= 70: critical. - Bridge age
> 6h: stale candidate. - Bridge age
> 24h: strong stale candidate. - CPU idleness alone never makes a bridge stale.
- Per group child count
Test Plan
Unit tests:
/proc/<pid>/statparser handles spaces and parentheses.- PID reuse produces different
process_key. - Missing processes during scan do not fail a snapshot.
- Cmdline masking handles flags,
--flag=value, env-style args, URLs, and common token prefixes. - Classifier avoids false positives from paths or incidental words.
- Parent links are rejected when parent identity is absent/unstable.
- Healthy idle MCP bridge is not marked stale.
- Dry-run performs no mutation and returns no executable kill command.
Integration smoke:
- Spawn a shell with a child process and verify tree grouping.
- Verify the app spawns no MCP/bridge children.
- Verify no port is opened.
- Verify no
/proc/<pid>/environreads exist in the code. - Target RSS budget: below about 300 MB.