agent-coord-mcp 0.26.18 → 0.26.20

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.
Files changed (84) hide show
  1. package/README.md +82 -0
  2. package/dist/build.js +113 -0
  3. package/dist/build.js.map +1 -0
  4. package/dist/capabilities.js +214 -0
  5. package/dist/capabilities.js.map +1 -0
  6. package/dist/prefix.js +64 -0
  7. package/dist/prefix.js.map +1 -0
  8. package/dist/roles.js +132 -0
  9. package/dist/roles.js.map +1 -0
  10. package/dist/server-identity.js +82 -0
  11. package/dist/server-identity.js.map +1 -0
  12. package/dist/server.js +668 -0
  13. package/dist/server.js.map +1 -0
  14. package/dist/store.js +553 -0
  15. package/dist/store.js.map +1 -0
  16. package/dist/tools/admin.js +323 -0
  17. package/dist/tools/admin.js.map +1 -0
  18. package/dist/tools/attention.js +73 -0
  19. package/dist/tools/attention.js.map +1 -0
  20. package/dist/tools/away.js +285 -0
  21. package/dist/tools/away.js.map +1 -0
  22. package/dist/tools/board-ref.js +208 -0
  23. package/dist/tools/board-ref.js.map +1 -0
  24. package/dist/tools/event-kinds.js +39 -0
  25. package/dist/tools/event-kinds.js.map +1 -0
  26. package/dist/tools/events.js +234 -0
  27. package/dist/tools/events.js.map +1 -0
  28. package/dist/tools/index.js +14 -0
  29. package/dist/tools/index.js.map +1 -0
  30. package/dist/tools/logwatch.js +85 -0
  31. package/dist/tools/logwatch.js.map +1 -0
  32. package/dist/tools/messaging.js +706 -0
  33. package/dist/tools/messaging.js.map +1 -0
  34. package/dist/tools/record-events.js +380 -0
  35. package/dist/tools/record-events.js.map +1 -0
  36. package/dist/tools/records.js +1205 -0
  37. package/dist/tools/records.js.map +1 -0
  38. package/dist/tools/registry.js +529 -0
  39. package/dist/tools/registry.js.map +1 -0
  40. package/dist/tools/render.js +2 -0
  41. package/dist/tools/render.js.map +1 -0
  42. package/dist/tools/rooms.js +210 -0
  43. package/dist/tools/rooms.js.map +1 -0
  44. package/dist/tools/rotate.js +143 -0
  45. package/dist/tools/rotate.js.map +1 -0
  46. package/dist/tools/scopes.js +126 -0
  47. package/dist/tools/scopes.js.map +1 -0
  48. package/dist/tools/shared.js +104 -0
  49. package/dist/tools/shared.js.map +1 -0
  50. package/dist/tools/stall.js +415 -0
  51. package/dist/tools/stall.js.map +1 -0
  52. package/dist/tools/transport.js +1918 -0
  53. package/dist/tools/transport.js.map +1 -0
  54. package/dist/tools/work.js +465 -0
  55. package/dist/tools/work.js.map +1 -0
  56. package/dist/tools/worktrees.js +581 -0
  57. package/dist/tools/worktrees.js.map +1 -0
  58. package/dist/transports/config.js +82 -0
  59. package/dist/transports/config.js.map +1 -0
  60. package/dist/transports/index.js +113 -0
  61. package/dist/transports/index.js.map +1 -0
  62. package/dist/transports/tmux.js +140 -0
  63. package/dist/transports/tmux.js.map +1 -0
  64. package/dist/transports/types.js +86 -0
  65. package/dist/transports/types.js.map +1 -0
  66. package/dist/typed-records.js +174 -0
  67. package/dist/typed-records.js.map +1 -0
  68. package/dist/work.js +2 -0
  69. package/dist/work.js.map +1 -0
  70. package/hooks/tmux-pusher.mjs +33 -3
  71. package/package.json +1 -1
  72. package/src/capabilities.ts +104 -1
  73. package/src/server.ts +30 -1
  74. package/src/tools/records.ts +221 -34
  75. package/src/tools/registry.ts +36 -5
  76. package/src/tools/shared.ts +12 -36
  77. package/src/tools/stall.ts +2 -1
  78. package/src/tools/transport.ts +96 -43
  79. package/src/tools/work.ts +95 -3
  80. package/src/tools/worktrees.ts +234 -32
  81. package/src/transports/config.ts +110 -0
  82. package/src/transports/index.ts +126 -0
  83. package/src/transports/tmux.ts +177 -0
  84. package/src/transports/types.ts +201 -0
@@ -0,0 +1,415 @@
1
+ /*
2
+ * `stall_check` — a predicate over the board and the bus, plus a HALT flag.
3
+ *
4
+ * Stall has been "notice the room" until now, which means it is noticed when
5
+ * somebody happens to look. The measured cost elsewhere: ~42 hours of dead merge
6
+ * path across four incidents in three days, with `main` advancing throughout so
7
+ * every commit-based liveness check read green.
8
+ *
9
+ * A MISS IS SILENT TO THE DUTY OFFICER AND NEVER SILENT TO THE RECORD.
10
+ *
11
+ * This is the whole design constraint (3.3b). "HIT DMs, MISS silent" answers the
12
+ * noise question and makes a DEAD CLOCK look exactly like a healthy fleet — the
13
+ * absence-read-as-evidence rule, inside the verb built to watch for absence. So
14
+ * every run leaves a mark, HIT or MISS, and "no alert" becomes distinguishable
15
+ * from "nothing ran". A check that only speaks when it fires cannot be told from
16
+ * a broken one.
17
+ */
18
+ import { isLocallyProbeable } from "../transports/index.js";
19
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
20
+ import { execFileSync } from "node:child_process";
21
+ import path from "node:path";
22
+ import { z } from "zod";
23
+ import { parseWorkDoc, workstreamsV1RowsOf } from "@davidbalzan/groundwork-seam";
24
+ import { ROOT, AGENTS_FILE, readJson } from "../store.js";
25
+ import { classifyBoardRef, refInCell } from "./board-ref.js";
26
+ import { loadLiveTransports } from "./registry.js";
27
+ const BOARD_DOC = "docs/WORKSTREAMS.md";
28
+ const STALL_MS = 30 * 60 * 1000;
29
+ const runFile = () => path.join(ROOT, "stall-check.json");
30
+ const haltFile = () => path.join(ROOT, "halt.json");
31
+ // ---------- halt ----------
32
+ export const setHaltSchema = {
33
+ reason: z.string().min(1),
34
+ by: z.string().min(1),
35
+ clear: z.boolean().optional(),
36
+ };
37
+ /**
38
+ * A NAMED state, never a mood.
39
+ *
40
+ * "Production feels down" is not a halt: a halt blocks every claim in the fleet,
41
+ * so the thing that sets it must be nameable and therefore arguable — a board
42
+ * cutover, a cited `BLOCKER:`, a documented red pipeline. The reason is required
43
+ * for that reason, not for the log.
44
+ */
45
+ export async function setHaltTool(args) {
46
+ mkdirSync(ROOT, { recursive: true });
47
+ if (args.clear) {
48
+ writeFileSync(haltFile(), JSON.stringify({ halted: false, clearedBy: args.by, clearedAt: Date.now(), lastReason: args.reason }, null, 2));
49
+ return { ok: true, halted: false, clearedBy: args.by };
50
+ }
51
+ const state = { halted: true, reason: args.reason, by: args.by, at: Date.now() };
52
+ writeFileSync(haltFile(), JSON.stringify(state, null, 2));
53
+ return { ok: true, ...state };
54
+ }
55
+ export function haltState() {
56
+ try {
57
+ const raw = JSON.parse(readFileSync(haltFile(), "utf8"));
58
+ return raw?.halted ? raw : { halted: false };
59
+ }
60
+ catch {
61
+ return { halted: false };
62
+ }
63
+ }
64
+ // ---------- the run mark ----------
65
+ /** Every run leaves this, HIT or MISS. It is what makes a dead clock visible. */
66
+ /**
67
+ * Record a run that FAILED.
68
+ *
69
+ * Acceptance from the queue item, and the clause most easily skipped: "a
70
+ * scheduled check reports its FETCH FAILURES, or a broken check is
71
+ * indistinguishable from a quiet registry". Without this, a clock that fires
72
+ * every 30 minutes and throws every time leaves NO marks at all — identical on
73
+ * disk to a clock that was never installed.
74
+ */
75
+ export function markRunFailure(reason) {
76
+ mkdirSync(ROOT, { recursive: true });
77
+ let history = [];
78
+ try {
79
+ history = JSON.parse(readFileSync(runFile(), "utf8")).history ?? [];
80
+ }
81
+ catch {
82
+ /* first run */
83
+ }
84
+ history.push({ at: Date.now(), hits: 0, checked: 0, failed: reason });
85
+ writeFileSync(runFile(), JSON.stringify({ history: history.slice(-200) }, null, 2));
86
+ }
87
+ function markRun(result) {
88
+ mkdirSync(ROOT, { recursive: true });
89
+ let history = [];
90
+ try {
91
+ history = JSON.parse(readFileSync(runFile(), "utf8")).history ?? [];
92
+ }
93
+ catch {
94
+ /* first run */
95
+ }
96
+ // COVERAGE IS RECORDED WITH THE RUN, because a status tool that cannot
97
+ // express its own blindness is worse than no status tool. Measured: the clock
98
+ // reported `runs 8, failures 0` — all green — while every one of those runs
99
+ // had covered 0 of 3 agents. Nothing in the mark could say so, and this is the
100
+ // instrument meant to cover an absence.
101
+ history.push({ at: Date.now(), hits: result.hits.length, checked: result.checked, measurable: result.measurable ?? 0 });
102
+ // A RUN OF MISSES MUST BE VISIBLE AS RUNS, not as absence — so the marks are a
103
+ // list, not a single timestamp. "Ten quiet checks" and "one check ten hours ago"
104
+ // are different states and only the first is a healthy fleet.
105
+ writeFileSync(runFile(), JSON.stringify({ history: history.slice(-200) }, null, 2));
106
+ }
107
+ export const lastRanSchema = { maxAgeMinutes: z.number().optional() };
108
+ /**
109
+ * Is the clock alive? Readable by a human or another check, which is the point —
110
+ * MISS is silent to the WATCHER, not to the record.
111
+ */
112
+ export async function stallClockStatusTool(args) {
113
+ const maxAge = (args.maxAgeMinutes ?? 60) * 60 * 1000;
114
+ let history = [];
115
+ try {
116
+ history = JSON.parse(readFileSync(runFile(), "utf8")).history ?? [];
117
+ }
118
+ catch {
119
+ return {
120
+ ok: false,
121
+ error: "stall_check has NEVER run — no run mark exists. That is not a quiet fleet, it is an unwatched one: a check that only speaks when it fires cannot be told from a broken one.",
122
+ };
123
+ }
124
+ const last = history[history.length - 1];
125
+ // A RUN THAT FAILED IS NOT A RUN THAT PASSED. Without this the clock reads
126
+ // "fresh" off a mark it wrote while erroring — the age is honest and the
127
+ // health is not, which is the same shape as a fresh heartbeat from a stuck
128
+ // agent.
129
+ const failures = history.filter((h) => h.failed);
130
+ const lastFailed = last?.failed;
131
+ const age = Date.now() - (last?.at ?? 0);
132
+ // `>=`, NOT `>`, AND THE DIFFERENCE IS A REAL RACE RATHER THAN PEDANTRY.
133
+ //
134
+ // With `>`, a window of 0 and a mark written in the SAME MILLISECOND gives
135
+ // `0 > 0` = false: the clock reads FRESH at the instant it was asked to treat
136
+ // everything as stale. It passed locally and on one CI run and failed on
137
+ // another — green in two environments, red in one — because it depended on at
138
+ // least a millisecond elapsing.
139
+ //
140
+ // The window having ELAPSED is the condition, so equality is inside it: a
141
+ // 0-minute window means nothing is ever fresh, which is what a caller asking
142
+ // for one means.
143
+ const stale = age >= maxAge;
144
+ const misses = history.filter((h) => !h.failed && h.hits === 0).length;
145
+ const hits = history.filter((h) => !h.failed && h.hits > 0).length;
146
+ // A RUN THAT COVERED NOTHING IS NOT A RUN THAT FOUND NOTHING. Marks written
147
+ // before coverage was recorded carry no `measurable` field: they are reported
148
+ // as UNKNOWN rather than assumed covered, because assuming is what produced
149
+ // the green this exists to correct.
150
+ const graded = history.filter((h) => !h.failed && typeof h.measurable === "number");
151
+ const blindRuns = graded.filter((h) => h.checked > 0 && h.measurable === 0).length;
152
+ const ungraded = history.filter((h) => !h.failed && typeof h.measurable !== "number").length;
153
+ const lastBlind = last && !last.failed && (last.checked ?? 0) > 0 && last.measurable === 0;
154
+ return {
155
+ // A FAILING CLOCK IS NOT A HEALTHY ONE. It writes marks on schedule, so the
156
+ // age looks fresh while nothing is being measured — a fresh heartbeat from
157
+ // a stuck agent, one level up.
158
+ ok: !stale && !lastFailed && !lastBlind,
159
+ ...(stale
160
+ ? {
161
+ error: `stall_check last ran ${Math.round(age / 60000)}m ago, past the ${args.maxAgeMinutes ?? 60}m window — THE CLOCK IS STOPPED. No alerts is not the same as no stalls.`,
162
+ }
163
+ : lastFailed
164
+ ? {
165
+ error: `the clock is RUNNING but its last run FAILED: ${lastFailed}. It is firing on schedule and measuring nothing, which reads as fresh and is not.`,
166
+ }
167
+ : lastBlind
168
+ ? {
169
+ error: `the clock is RUNNING and BLIND: its last run checked ${last?.checked} in-flight row(s) and could measure ${last?.measurable} of them. ` +
170
+ `It fires on schedule, reports no hits, and that "no hits" is not evidence of a healthy fleet — it is evidence of nothing. ` +
171
+ `Read stall_check's own 'unmeasurable' list for the cause; the usual one is a board 'Branch · Worktree' cell holding a PATH rather than a branch ref.`,
172
+ }
173
+ : {}),
174
+ lastRanMinutesAgo: Math.round(age / 60000),
175
+ runs: history.length,
176
+ misses,
177
+ hits,
178
+ failures: failures.length,
179
+ // The number the old shape could not express.
180
+ coverage: {
181
+ lastRun: last && !last.failed ? { checked: last.checked, measurable: last.measurable ?? null } : null,
182
+ blindRuns,
183
+ ungraded,
184
+ note: "blindRuns are runs that checked rows and measured none of them — green by every other field. " +
185
+ "ungraded are marks written before coverage was recorded: UNKNOWN, never assumed covered.",
186
+ },
187
+ };
188
+ }
189
+ // ---------- the predicate ----------
190
+ export const stallCheckSchema = { repo: z.string().optional(), stallMinutes: z.number().optional() };
191
+ /**
192
+ * A row somebody is WORKING — the population the stall clock watches.
193
+ *
194
+ * It was `/🚧/` alone, and that read a fleet living in review as an EMPTY
195
+ * fleet (q-507e80c4). Measured on a consumer fleet 2026-09-02: a board of 3× `🔍 In
196
+ * Review` and 0× `🚧` returned `checked: 0, measurable: 0`, and `coord_away`
197
+ * armed at 0/0 — correct and vacuous at once. A clock watching nothing and a
198
+ * clock watching a healthy fleet return identical green.
199
+ *
200
+ * `🔍 In Review` is a lane with an owner and a branch that can stop moving
201
+ * exactly as an authoring lane can; the review that never gets re-gated is
202
+ * THE stall shape of a QA-gated fleet. It is read here, on the row as written
203
+ * — relabelling `🔍`→`🚧` to satisfy the old predicate was the item's
204
+ * forbidden move, because it satisfies a guard by editing what it reads and
205
+ * reports authoring lanes that do not exist.
206
+ *
207
+ * NOT widened further, deliberately: `⏸ Parked`, `⏳ Queued`, `⛔ Blocked`,
208
+ * `🚫 Unstaffable`, `✅ Done` have no lane to stall. Widening to everything
209
+ * would be the 0/0 defect inverted.
210
+ *
211
+ * One predicate, exported: `coord_away` measures coverage by calling
212
+ * `stall_check` and reading `checked`/`measurable`, so it inherits this
213
+ * population without a change of its own. Anything else that asks "which rows
214
+ * are in flight" should ask here rather than re-derive it from a glyph.
215
+ */
216
+ export const IN_FLIGHT_STATUS = /🚧|🔍/;
217
+ export const isInFlightStatus = (status) => IN_FLIGHT_STATUS.test(status);
218
+ export async function stallCheckTool(args) {
219
+ const repo = args.repo ?? process.cwd();
220
+ const limit = (args.stallMinutes ?? 30) * 60 * 1000;
221
+ const board = path.join(repo, BOARD_DOC);
222
+ if (!existsSync(board))
223
+ return { ok: false, error: `no ${BOARD_DOC} under '${repo}'` };
224
+ const liveTransports = await loadLiveTransports();
225
+ const rows = workstreamsV1RowsOf(parseWorkDoc(readFileSync(board, "utf8")));
226
+ const inFlight = rows.filter((r) => isInFlightStatus(r.status));
227
+ const reg = await readJson(AGENTS_FILE, {});
228
+ const now = Date.now();
229
+ const hits = [];
230
+ /** Rows whose VCS activity could not be measured. NOT stall claims. */
231
+ const unmeasurable = [];
232
+ /**
233
+ * Rows a predicate actually reached a VERDICT about — hit or clean.
234
+ *
235
+ * Tracked explicitly rather than inferred from "2 predicates minus the
236
+ * unmeasurable ones", because a predicate that is SKIPPED pushes no
237
+ * unmeasurable entry and the arithmetic then counts it as having measured.
238
+ * That is the same defect as the `continue` above, one level up: a silent
239
+ * skip and a clean pass produce the same number.
240
+ */
241
+ const measured = new Set();
242
+ for (const row of inFlight) {
243
+ const agentId = row.owner.replace(/[`*]/g, "").trim();
244
+ const entry = reg[agentId];
245
+ if (!entry) {
246
+ // NOT SKIPPED IN SILENCE. An owner with no registry entry has no
247
+ // heartbeat to read, which is a missing signal and must be reported as
248
+ // one — a row whose owner the bus has never heard of is exactly the row
249
+ // you would want named before going away.
250
+ unmeasurable.push({ agentId, value: "", why: "no registry entry for this owner — there is no heartbeat to read, and the name may not be an agent id at all" });
251
+ }
252
+ if (entry) {
253
+ const age = now - entry.lastHeartbeat;
254
+ // A HEARTBEAT IS ONLY EVIDENCE WHERE SOMETHING WRITES ONE.
255
+ //
256
+ // `heartbeat` is called by the PUSHER, never by the agent. Only
257
+ // `coord-pusher.mjs` (the REMOTE pusher) calls it, and it must: a remote
258
+ // marker cannot be pid-probed across machines, so its liveness IS the
259
+ // heartbeat. `hooks/tmux-pusher.mjs` — what this fleet actually runs —
260
+ // never calls it, because a LOCAL marker's liveness is `isPidAlive`.
261
+ //
262
+ // So for a local transport there is no heartbeat SOURCE at all. Before
263
+ // kit#137, `list_agents` stamped these agents and that fabrication was
264
+ // the only thing keeping the field moving; removing it left the field
265
+ // honest and empty. Measured: three attached, working agents at an
266
+ // IDENTICAL 44.7m — the uniform signature of one shared cause, not three
267
+ // stalls.
268
+ //
269
+ // WHY NOT JUST MAKE tmux-pusher HEARTBEAT: because the signal would mean
270
+ // "the pusher process is alive", which `isPidAlive` already answers for
271
+ // local markers. During the 17-hour stall every transport was live the
272
+ // whole time, so a pusher heartbeat would have read FRESH for all 17
273
+ // hours. It would restore a field without restoring a detector — and the
274
+ // case this verb exists for is exactly the one it would miss. The vcs
275
+ // half is what catches "alive and not progressing"; saying so is more
276
+ // honest than a green field.
277
+ //
278
+ // Unknown is not stalled (kit#138). This does NOT narrow Task 3.5: an
279
+ // agent with no transport, or a REMOTE one where the heartbeat genuinely
280
+ // is the liveness mechanism, still HITs on a dead heartbeat.
281
+ const marker = liveTransports.get(agentId);
282
+ if (age > limit && marker && isLocallyProbeable(marker.transport)) {
283
+ unmeasurable.push({
284
+ agentId,
285
+ value: marker.transport,
286
+ why: `heartbeat is ${Math.round(age / 60000)}m old, but nothing writes heartbeats for a local 'tmux-push' transport — hooks/tmux-pusher.mjs does not call heartbeat, and this marker's liveness is its pid. There is no heartbeat SOURCE here, so the age measures nothing about this agent`,
287
+ });
288
+ // FALL THROUGH TO THE VCS PREDICATE — do not `continue`.
289
+ //
290
+ // This used to skip the row entirely, and the consequence was total: on
291
+ // this fleet, 3 of 3 in-flight rows were local tmux-push agents, so
292
+ // EVERY row exited here and the check reported `checked 3 · measurable
293
+ // 0`. The half that was blind (heartbeat, deliberately, for the reason
294
+ // above) was taking the half that works (vcs activity) down with it.
295
+ //
296
+ // The two predicates answer different questions and only one of them is
297
+ // unanswerable for a local transport. "Is it alive" has no source here;
298
+ // "is its branch moving" has a perfectly good one, and it is the half
299
+ // that catches the case this verb exists for — alive and not
300
+ // progressing. An unmeasurable heartbeat is a missing signal, not a
301
+ // reason to stop measuring the signal that is present.
302
+ }
303
+ else if (age > limit) {
304
+ hits.push({ kind: "no-heartbeat", agentId, stream: row.stream.slice(0, 60), minutes: Math.round(age / 60000) });
305
+ measured.add(agentId);
306
+ continue;
307
+ }
308
+ // A FRESH HEARTBEAT IS *NOT* A VERDICT, AND THIS IS A CORRECTION TO WHAT
309
+ // THIS CODE CLAIMED WHEN IT MERGED.
310
+ //
311
+ // It read "a fresh heartbeat IS a verdict — alive" and credited coverage
312
+ // for it. Measured since, by reading agents.json directly (`list_agents`
313
+ // refreshes the CALLER's mark, so it cannot be used to measure the
314
+ // caller): an agent's mark aged from 9611s to 9623s across a `post_status`
315
+ // call. BUS TOOL CALLS DO NOT WRITE HEARTBEATS.
316
+ //
317
+ // `heartbeat` age is TIME SINCE JOIN. Not activity, and not even
318
+ // time-since-restart — a server can restart mid-session without the mark
319
+ // moving, because nothing rejoined. So freshness says "recently joined",
320
+ // and crediting it as coverage lets `/coord-away` arm on a fleet whose
321
+ // only evidence is that somebody reconnected.
322
+ //
323
+ // The inverse is worse and is why this is not merely tidiness: reading
324
+ // age as activity marks the two most CONTINUOUSLY ACTIVE agents on a bus
325
+ // as stale at 2.6h, while a freshly-rejoined idle agent reads healthy —
326
+ // a false-stall generator aimed at exactly the agents that must not be
327
+ // false-stalled while nobody is watching.
328
+ //
329
+ // The HIT above is kept: for an agent with no transport at all, "has not
330
+ // rejoined and has no live marker" is still the death signal Task 3.5
331
+ // specifies. What is removed is the coverage credit for freshness, which
332
+ // leaves coverage resting on the vcs predicate — the one that measures
333
+ // something the agent DID.
334
+ }
335
+ // A FRESH HEARTBEAT IS NOT PROGRESS. An agent can be alive and stuck, which is
336
+ // the case "notice the room" never catches: the pane is responsive, so nobody
337
+ // looks. Ask the branch instead.
338
+ //
339
+ // RESOLVE A REF, AND SAY SO WHEN THE VALUE IS NOT ONE.
340
+ //
341
+ // `git log -1 <value>` accepts a PATHSPEC exactly as readily as a ref, and
342
+ // the old guard only required a `/` — which every path has. So the board's
343
+ // `Branch · Worktree` cells, which hold PATHS, were fed to git and silently
344
+ // measured as paths: the aide was reported at 2,271 minutes, the age of
345
+ // `docs/phases/phase5`'s last commit, not of any activity by that agent.
346
+ // Verified: `docs/phases/phase5` does not resolve as a ref, yet
347
+ // `git log -1 --format=%cI docs/phases/phase5` returns a date.
348
+ //
349
+ // Other rows read plausibly only by coincidence — a path that happens to be
350
+ // committed often looks like an active branch.
351
+ //
352
+ // UNKNOWN IS NOT STALLED, which this verb already gets right for
353
+ // heartbeats. An unresolvable value is REPORTED as unmeasurable rather than
354
+ // skipped in silence: a silent `continue` and a healthy agent produce the
355
+ // same output, which is the failure this whole verb exists to avoid.
356
+ // ONE CLASSIFIER, SHARED WITH `claim` (board-ref.ts). The old block asked
357
+ // only "does it resolve", and three of the four ways this cell has been
358
+ // wrong resolved cleanly — a shared ref, a local-only ref, and a merged
359
+ // ref. Resolution was never the property; the property is whether the ref's
360
+ // movement is THIS AGENT'S WORK.
361
+ const verdict = classifyBoardRef(repo, agentId, row.branchWorktree);
362
+ if (verdict.kind === "merged") {
363
+ // A VERDICT, NOT AN ABSENCE — and it counts as coverage, because the check
364
+ // did learn something about this lane: its work landed and its row is
365
+ // stale. Reported as its own kind rather than as a stall, which is what
366
+ // the frozen ref was reporting it as.
367
+ hits.push({ kind: "stale-row", agentId, branch: refInCell(row.branchWorktree), why: verdict.why });
368
+ measured.add(agentId);
369
+ continue;
370
+ }
371
+ if (verdict.kind !== "measurable") {
372
+ unmeasurable.push({ agentId, value: refInCell(row.branchWorktree), why: verdict.why });
373
+ continue;
374
+ }
375
+ try {
376
+ // The resolved SHA, and `--`: a ref can then never be re-read as a
377
+ // pathspec, which is the ambiguity that produced the wrong number.
378
+ const sha = execFileSync("git", ["rev-parse", "--verify", "--quiet", `${verdict.ref}^{commit}`], {
379
+ cwd: repo, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"],
380
+ }).trim();
381
+ const iso = execFileSync("git", ["log", "-1", "--format=%cI", sha, "--"], {
382
+ cwd: repo, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"],
383
+ }).trim();
384
+ const age = now - Date.parse(iso);
385
+ measured.add(agentId);
386
+ if (age > limit) {
387
+ hits.push({ kind: "no-vcs-activity", agentId, branch: verdict.ref, minutes: Math.round(age / 60000) });
388
+ }
389
+ }
390
+ catch {
391
+ unmeasurable.push({ agentId, value: verdict.ref, why: "resolved as a ref but its log could not be read" });
392
+ }
393
+ }
394
+ // COVERAGE, not "did it run". A row is COVERED when a predicate produced a
395
+ // verdict about it; a row where every predicate came back unmeasurable was
396
+ // looked at and not measured, and counting it as checked is how "the clock
397
+ // ran" gets mistaken for "the fleet is observed".
398
+ const owners = inFlight.map((r) => r.owner.replace(/[`*]/g, "").trim()).filter(Boolean);
399
+ const blind = [...new Set(owners)].filter((id) => !measured.has(id));
400
+ const measurable = Math.max(0, inFlight.length - blind.length);
401
+ const result = { hits, checked: inFlight.length, unmeasurable, measurable, blind };
402
+ markRun({ hits, checked: inFlight.length, measurable });
403
+ return {
404
+ ok: true,
405
+ ...result,
406
+ halted: haltState().halted,
407
+ // MISS is silent to the DUTY OFFICER — the caller decides whether to DM — and
408
+ // never silent to the record, which markRun just wrote.
409
+ dm: hits.length > 0,
410
+ note: hits.length === 0
411
+ ? `MISS — ${inFlight.length} in-flight row(s), none stalled${unmeasurable.length ? `; ${unmeasurable.length} row(s) UNMEASURABLE for VCS activity (${unmeasurable.map((u) => u.agentId).join(", ")}) — reported, not counted as healthy` : ""}. No DM. The run IS recorded: read it with stall_clock_status, because no alert and nothing running look identical from here.`
412
+ : undefined,
413
+ };
414
+ }
415
+ //# sourceMappingURL=stall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stall.js","sourceRoot":"","sources":["../../src/tools/stall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MA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