Skip to content

ReaperProbes

Defined in: src/process-reaper.ts:37

Low-level probes, injectable so the reaper is unit-testable without real /proc.

optional inodeToPortMap(): Map<number, number>

Defined in: src/process-reaper.ts:55

Build the full listening inode→port map from /proc/net/tcp[6]. Optional: used by scanListeningPortsByWorktree to build the map ONCE per sweep rather than re-building it per-PID. Falls back to portsForPid when absent.

Map<number, number>


killPid(pid, signal?): void

Defined in: src/process-reaper.ts:47

Terminate a pid (defaults to SIGTERM).

number

Signals

void


listeningPorts(): Set<number>

Defined in: src/process-reaper.ts:43

All locally-listening TCP ports (for the class-3 counter-check).

Set<number>


portsForPid(pid): number[]

Defined in: src/process-reaper.ts:41

Listening TCP ports owned by a single pid (reads its fd table).

number

number[]


readTranscript(path): string

Defined in: src/process-reaper.ts:45

Transcript text for a path; "" when missing/unreadable.

string

string


run(bin, args): void

Defined in: src/process-reaper.ts:49

Run a counter-command.

string

string[]

void


scanProcs(): object[]

Defined in: src/process-reaper.ts:39

Every process with its cwd + comm (name). Cheap — no per-pid fd reads.

object[]


optional socketInodesForPid(pid): number[]

Defined in: src/process-reaper.ts:61

Return the socket inodes owned by a single pid (reads its fd table). Optional: used alongside inodeToPortMap for the single-map batched scan. Falls back to portsForPid when absent.

number

number[]