Skip to content

portlist kill, cleanup and report; agent adapters; README leads with the answer - #17

Merged
Mr-hunt-007 merged 2 commits into
mainfrom
kill-cleanup-report
Sep 25, 2026
Merged

Mr-hunt-007 merged 2 commits into
mainfrom
kill-cleanup-report

Conversation

@Mr-hunt-007

Copy link
Copy Markdown
Owner

portlist kill 3000

  • Shows what the listener is, who started it, whether the network can reach it, and how it should be stopped, then asks.
  • It stops through the listener's manager when one was measured:
    • docker stop for a port a container publishes
    • brew services stop for a Homebrew service
    • launchctl bootout for a launchd job
    • systemctl stop for a systemd unit, read from the process's cgroup
    • a PM2 app is named and left to PM2
  • Otherwise it sends SIGTERM.
  • Afterwards it scans again and reports if something brought the port straight back.
  • A pipe is never asked a question, so a script must pass --yes.
  • --force sends SIGKILL after 5 seconds. --dry-run stops nothing.
  • The harbour's stop button now goes through the same guard.

portlist cleanup

  • Walks every leftover, the one the network can reach first, with the evidence: how long unused, started by which agent, whether that session has exited.
  • Answers: y stop, n keep, k keep and stop calling it a leftover, a stop the rest, q quit.
  • --idle HOURS also offers anything unused that long. --dry-run and --json stop nothing.

portlist report

  • One self-contained HTML page: no scripts, nothing fetched.
  • Contents: a verdict, what needs a look and why, everything listening, who started what, containers, and how each thing was measured.
  • Secrets in command lines are masked, including flags and passwords in URLs.
  • --redact removes host and user names, addresses, project names, paths and command lines.

Agent adapters

  • Each agent is one file in plcore/adapters/.
  • The ancestry patterns, environment variable names, agent processes and transcript readers are all built from these files. The resulting tables are identical and in the same order.
  • Gemini CLI and OpenCode are new.
  • CONTRIBUTING has a one-file example.

Docs

  • The README leads with the question, then the list, then portlist 8787, then kill, cleanup and report.
  • The site gets a new chapter.
  • The claims about stopping in SECURITY, FEATURES, the FAQ and llms.txt are updated.

Playground

  • Runs all three commands, with plans from the real supervisor detection and real report pages.

Harness

  • The jump check skips frame pairs from a stalled runner.
  • The sandbox train check waits for the train instead of a fixed 5 frames.
  • Both of those failed on a runner that froze for 5 minutes.

Tests

  • Unit tests: 85, 17 of them new. Every stop is faked.
  • Harbour harness: 45 of 45.
  • Playground checks: 21 of 21.
  • flake8 is clean.
  • Verified on a real machine: kill declines when stdin is a pipe, stops with --yes, and confirms the port is free.
  • The playground output is byte-identical across timezones.

…the answer

kill: shows what a listener is and how it should be stopped, asks, then stops
it through its manager when one was measured (docker stop, brew services,
launchctl bootout, systemctl stop; PM2 named) or by SIGTERM, and scans again to
catch a restart. A pipe is never asked; scripts pass --yes. The harbour's stop
button shares the same guard.

cleanup: walks the leftovers, reachable first, with the evidence; y, n, k (stop
calling it a leftover), a, q. --idle, --dry-run, --json.

report: one self-contained HTML page of the machine, secrets in command lines
masked, --redact for one leaving the team.

Agents are one file each in plcore/adapters/; lifecycle and sessions build their
tables from them, unchanged in order. Gemini CLI and OpenCode are new.

The playground runs all three. The harbour check skips frame pairs from a
stalled runner and waits for the simulated train.
Replay and Live rebuild the car park with new cars parked in their bays. The
jump check compared positions by key, so when the rebuilt bays came out in a
different order a new car read as the old one teleporting.
@Mr-hunt-007
Mr-hunt-007 merged commit c81c75d into main Sep 25, 2026
4 checks passed
@Mr-hunt-007
Mr-hunt-007 deleted the kill-cleanup-report branch September 25, 2026 13:45
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