@ai-dossier/worktree-pool 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,317 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.DEFAULT_KILL_GRACE_MS = void 0;
37
+ exports.findWorktreeProcesses = findWorktreeProcesses;
38
+ exports.resolveRootedChild = resolveRootedChild;
39
+ exports.firstSegmentUnder = firstSegmentUnder;
40
+ exports.killProcesses = killProcesses;
41
+ exports.killWorktreeProcesses = killWorktreeProcesses;
42
+ const node_child_process_1 = require("node:child_process");
43
+ const fs = __importStar(require("node:fs"));
44
+ const path = __importStar(require("node:path"));
45
+ const HAS_PROC = process.platform === 'linux' && fs.existsSync('/proc');
46
+ /** Default SIGTERM-to-SIGKILL grace period, shared by every caller (return/gc/reap). */
47
+ exports.DEFAULT_KILL_GRACE_MS = 5000;
48
+ function readCmdline(pid) {
49
+ try {
50
+ const raw = fs.readFileSync(`/proc/${pid}/cmdline`);
51
+ if (raw.length === 0)
52
+ return null;
53
+ const parts = raw
54
+ .toString('utf-8')
55
+ .split('\0')
56
+ .filter((p) => p.length > 0);
57
+ return parts.length > 0 ? parts.join(' ') : null;
58
+ }
59
+ catch {
60
+ return null;
61
+ }
62
+ }
63
+ const DELETED_SUFFIX = ' (deleted)';
64
+ /**
65
+ * A process's cwd — surviving deletion of the directory it points at. This is
66
+ * exactly the `reap` scenario (imboard-ai/ai-dossier#760): `gc` (pre-fix) or a
67
+ * hand-run `git worktree remove` can delete a worktree directory while a
68
+ * process still has it as cwd. Linux then reports the cwd symlink target as
69
+ * `<original path> (deleted)` rather than failing the readlink — strip the
70
+ * marker so the path still matches the worktree it was rooted in.
71
+ */
72
+ function readCwd(pid) {
73
+ try {
74
+ const link = fs.readlinkSync(`/proc/${pid}/cwd`);
75
+ return link.endsWith(DELETED_SUFFIX) ? link.slice(0, -DELETED_SUFFIX.length) : link;
76
+ }
77
+ catch {
78
+ return null;
79
+ }
80
+ }
81
+ /**
82
+ * Approximate process start time from `/proc/<pid>`'s own directory ctime.
83
+ * Not exact (exact requires parsing `/proc/<pid>/stat`'s `starttime` field
84
+ * against `/proc/uptime` and the kernel's clock ticks per second), but
85
+ * adequate for the hour-granularity `--older-than` filtering `reap` does.
86
+ */
87
+ function readStartTimeMs(pid) {
88
+ try {
89
+ return fs.statSync(`/proc/${pid}`).ctimeMs;
90
+ }
91
+ catch {
92
+ return null;
93
+ }
94
+ }
95
+ function listPids() {
96
+ try {
97
+ return fs
98
+ .readdirSync('/proc')
99
+ .filter((name) => /^\d+$/.test(name))
100
+ .map((name) => Number.parseInt(name, 10));
101
+ }
102
+ catch {
103
+ return [];
104
+ }
105
+ }
106
+ function readPpid(pid) {
107
+ try {
108
+ const statusText = fs.readFileSync(`/proc/${pid}/status`, 'utf-8');
109
+ const match = /^PPid:\s*(\d+)/m.exec(statusText);
110
+ return match ? Number.parseInt(match[1], 10) : null;
111
+ }
112
+ catch {
113
+ return null;
114
+ }
115
+ }
116
+ /** This process and every ancestor up the ppid chain — never a kill candidate. */
117
+ function selfAndAncestorPids() {
118
+ const pids = new Set([process.pid]);
119
+ if (!HAS_PROC)
120
+ return pids;
121
+ let current = process.pid;
122
+ for (let i = 0; i < 64; i++) {
123
+ const ppid = readPpid(current);
124
+ if (ppid === null || ppid <= 1 || pids.has(ppid))
125
+ break;
126
+ pids.add(ppid);
127
+ current = ppid;
128
+ }
129
+ return pids;
130
+ }
131
+ /** True when `childAbs` is `rootAbs` itself or strictly inside it. */
132
+ function isUnder(childAbs, rootAbs) {
133
+ const rel = path.relative(rootAbs, childAbs);
134
+ return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel));
135
+ }
136
+ /**
137
+ * True when `root` appears in `command` at a real path boundary — as the
138
+ * whole string, or followed by a path separator, whitespace, or a quote —
139
+ * never as a bare substring. Pool worktree directory names are
140
+ * `pool-<timestamp>-<pid>` (see `pool-state.ts`'s `POOL_DIR_NAME_PATTERN`),
141
+ * so a same-batch replenish routinely produces siblings that share a long
142
+ * numeric prefix (`pool-1700000000-1234` vs `pool-1700000000-12345`) — an
143
+ * unbounded `String.includes` would treat one worktree's root as a
144
+ * substring of the sibling's cwd/argv and kill a process that is not
145
+ * actually rooted there. `isUnder` already gets this right for cwd
146
+ * comparisons via `path.relative`; this is the same guarantee for the
147
+ * command-line fallback.
148
+ */
149
+ function commandRootedAt(command, root) {
150
+ let from = 0;
151
+ for (;;) {
152
+ const idx = command.indexOf(root, from);
153
+ if (idx === -1)
154
+ return false;
155
+ const after = command[idx + root.length];
156
+ if (after === undefined || after === path.sep || /[\s"'`]/.test(after))
157
+ return true;
158
+ from = idx + 1;
159
+ }
160
+ }
161
+ /**
162
+ * Non-Linux fallback: `ps` gives pid + command only, no reliable cwd. A
163
+ * process is "rooted" here only when the absolute root path appears, at a
164
+ * real path boundary, in its command line.
165
+ */
166
+ function findViaPs(rootAbsPath) {
167
+ let out;
168
+ try {
169
+ out = (0, node_child_process_1.execFileSync)('ps', ['-Ao', 'pid=,command='], { encoding: 'utf-8' });
170
+ }
171
+ catch (err) {
172
+ const msg = err instanceof Error ? err.message : String(err);
173
+ console.error(`Warning: process discovery via 'ps' failed (${msg}) — nothing will be found`);
174
+ return [];
175
+ }
176
+ const self = selfAndAncestorPids();
177
+ const results = [];
178
+ for (const line of out.split('\n')) {
179
+ const trimmed = line.trim();
180
+ if (!trimmed)
181
+ continue;
182
+ const match = /^(\d+)\s+(.*)$/.exec(trimmed);
183
+ if (!match)
184
+ continue;
185
+ const pid = Number.parseInt(match[1], 10);
186
+ if (self.has(pid))
187
+ continue;
188
+ const command = match[2];
189
+ if (commandRootedAt(command, rootAbsPath)) {
190
+ results.push({ pid, cwd: null, command, ageMs: null });
191
+ }
192
+ }
193
+ return results;
194
+ }
195
+ /**
196
+ * Every live process whose cwd or command line is rooted under
197
+ * `rootAbsPath` (a single worktree, or the whole pool directory — callers
198
+ * decide the scope). Never returns this process or any of its ancestors.
199
+ */
200
+ function findWorktreeProcesses(rootAbsPath) {
201
+ const root = path.resolve(rootAbsPath);
202
+ if (!HAS_PROC)
203
+ return findViaPs(root);
204
+ const protect = selfAndAncestorPids();
205
+ const results = [];
206
+ for (const pid of listPids()) {
207
+ if (protect.has(pid))
208
+ continue;
209
+ const cwd = readCwd(pid);
210
+ const command = readCmdline(pid);
211
+ const cwdMatches = cwd !== null && isUnder(cwd, root);
212
+ const cmdMatches = !cwdMatches && command !== null && commandRootedAt(command, root);
213
+ if (!cwdMatches && !cmdMatches)
214
+ continue;
215
+ results.push({
216
+ pid,
217
+ cwd,
218
+ command: command ?? '(unknown command)',
219
+ ageMs: (() => {
220
+ const start = readStartTimeMs(pid);
221
+ return start === null ? null : Date.now() - start;
222
+ })(),
223
+ });
224
+ }
225
+ return results;
226
+ }
227
+ /**
228
+ * Given a process discovered by {@link findWorktreeProcesses} against the
229
+ * whole pool directory, the child path (under `poolDirAbs`) it is rooted
230
+ * at — its cwd when known, otherwise a best-effort extraction from its
231
+ * command line. `null` when neither yields a path under `poolDirAbs`.
232
+ */
233
+ function resolveRootedChild(proc, poolDirAbs) {
234
+ if (proc.cwd !== null && isUnder(proc.cwd, poolDirAbs))
235
+ return proc.cwd;
236
+ const idx = proc.command.indexOf(poolDirAbs);
237
+ if (idx === -1)
238
+ return null;
239
+ const rest = proc.command.slice(idx + poolDirAbs.length);
240
+ if (rest.length === 0)
241
+ return poolDirAbs;
242
+ if (!rest.startsWith(path.sep))
243
+ return null;
244
+ const end = rest.search(/[\s"'`]/);
245
+ const segment = end === -1 ? rest : rest.slice(0, end);
246
+ return poolDirAbs + segment;
247
+ }
248
+ /** First path segment of `childAbs` relative to `rootAbs`, or `null` when it is not under it. */
249
+ function firstSegmentUnder(rootAbs, childAbs) {
250
+ const rel = path.relative(rootAbs, childAbs);
251
+ if (rel === '' || rel.startsWith('..') || path.isAbsolute(rel))
252
+ return null;
253
+ const [first] = rel.split(path.sep);
254
+ return first || null;
255
+ }
256
+ function isAlivePid(pid) {
257
+ try {
258
+ process.kill(pid, 0);
259
+ return true;
260
+ }
261
+ catch {
262
+ return false;
263
+ }
264
+ }
265
+ function sleep(ms) {
266
+ return new Promise((resolve) => setTimeout(resolve, ms));
267
+ }
268
+ /**
269
+ * SIGTERM every process in `targets`, wait up to `graceMs` for exit, then
270
+ * SIGKILL survivors. Best-effort and never throws — a stray dev server must
271
+ * not be able to block a `return`, `gc`, or `reap`. ESRCH (already exited
272
+ * between discovery and kill) is not an error.
273
+ */
274
+ async function killProcesses(targets, graceMs = exports.DEFAULT_KILL_GRACE_MS) {
275
+ const killed = [];
276
+ const errors = [];
277
+ const termed = [];
278
+ for (const target of targets) {
279
+ try {
280
+ process.kill(target.pid, 'SIGTERM');
281
+ termed.push(target);
282
+ }
283
+ catch (err) {
284
+ const msg = err instanceof Error ? err.message : String(err);
285
+ if (!/ESRCH/.test(msg))
286
+ errors.push(`SIGTERM ${target.pid}: ${msg}`);
287
+ }
288
+ }
289
+ if (termed.length > 0) {
290
+ const deadline = Date.now() + graceMs;
291
+ while (Date.now() < deadline && termed.some((t) => isAlivePid(t.pid))) {
292
+ await sleep(200);
293
+ }
294
+ }
295
+ for (const target of termed) {
296
+ if (isAlivePid(target.pid)) {
297
+ try {
298
+ process.kill(target.pid, 'SIGKILL');
299
+ killed.push({ pid: target.pid, command: target.command, signal: 'SIGKILL' });
300
+ }
301
+ catch (err) {
302
+ const msg = err instanceof Error ? err.message : String(err);
303
+ if (!/ESRCH/.test(msg))
304
+ errors.push(`SIGKILL ${target.pid}: ${msg}`);
305
+ }
306
+ }
307
+ else {
308
+ killed.push({ pid: target.pid, command: target.command, signal: 'SIGTERM' });
309
+ }
310
+ }
311
+ return { killed, errors };
312
+ }
313
+ /** {@link findWorktreeProcesses} + {@link killProcesses} for a single worktree path. */
314
+ async function killWorktreeProcesses(rootAbsPath, graceMs = exports.DEFAULT_KILL_GRACE_MS) {
315
+ return killProcesses(findWorktreeProcesses(rootAbsPath), graceMs);
316
+ }
317
+ //# sourceMappingURL=process-scan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-scan.js","sourceRoot":"","sources":["../src/process-scan.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsMA,sDAwBC;AAQD,gDAUC;AAGD,8CAKC;AAqBD,sCAwCC;AAGD,sDAKC;AA7TD,2DAAkD;AAClD,4CAA8B;AAC9B,gDAAkC;AA2ClC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAA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AC5B,IAAI,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;gBACpC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;YAC/E,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC7D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;oBAAE,MAAM,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED,wFAAwF;AACjF,KAAK,UAAU,qBAAqB,CACzC,WAAmB,EACnB,OAAO,GAAG,6BAAqB;IAE/B,OAAO,aAAa,CAAC,qBAAqB,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;AACpE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-dossier/worktree-pool",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Pre-warmed git worktree pool for instant issue setup",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",