Skip to content

refactor: tag kill plans as range or orphan - #33

Merged
OhadC merged 4 commits into
mainfrom
kill-plan-kind
Nov 9, 2026
Merged

OhadC merged 4 commits into
mainfrom
kill-plan-kind

Conversation

@OhadC

@OhadC OhadC commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

Kill plans are tagged by kind. An orphan plan has no port names, so it can't be built with any.

-type KillPlan = { scope; names; targets; withRuns: boolean }
+type KillPlan = RangePlan | OrphanPlan
+type RangePlan  = { kind: "range";  scope; names; targets }
+type OrphanPlan = { kind: "orphan"; scope; targets }
 killRange (cli.ts)
-  killTrees(visiblePids(plan), plan.withRuns)
+  killTrees(visiblePids(plan), RangeKill.killsRuns(plan))   # range → true, orphan → false

Also:

  • ListenerScan (mac): an lsof address listed before any p line gets pid: null instead of a fake pid 0.
  • ProcessTree.killTree drops its unused platform param and reads process.platform.

Evidence

  • Before: n*:21000\np42\nn*:21001 → { port: 21000, pid: 0 }; nothing tested which kills look for leeway-run parents.
    After: → { port: 21000, pid: null }; RangeKill.killsRuns tests: a range plan → true, orphan-port and orphans plans → false.
  • pnpm verify: green (274 passed, 3 skipped). pnpm test:linux: not run locally (podman not on PATH), so it rests on CI.

Merge Danger

Door: two-way

Blast Radius: none

KillPlan is internal to the CLI. The leeway kill output is unchanged.

@OhadC
OhadC merged commit c748ebd into main Nov 9, 2026
12 checks passed
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