agent-coord-mcp 0.26.21 → 0.26.23
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.
- package/dist/capabilities.js +270 -2
- package/dist/capabilities.js.map +1 -1
- package/dist/closing-line.js +83 -0
- package/dist/closing-line.js.map +1 -0
- package/dist/commit-cite.js +55 -0
- package/dist/commit-cite.js.map +1 -0
- package/dist/gated-head.js +67 -20
- package/dist/gated-head.js.map +1 -1
- package/dist/server-spread.js +195 -0
- package/dist/server-spread.js.map +1 -0
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/store.js +32 -0
- package/dist/store.js.map +1 -1
- package/dist/tools/away.js +67 -7
- package/dist/tools/away.js.map +1 -1
- package/dist/tools/board-ref.js +44 -4
- package/dist/tools/board-ref.js.map +1 -1
- package/dist/tools/event-kinds.js +5 -1
- package/dist/tools/event-kinds.js.map +1 -1
- package/dist/tools/events.js +40 -4
- package/dist/tools/events.js.map +1 -1
- package/dist/tools/herdr-delivery.js +99 -0
- package/dist/tools/herdr-delivery.js.map +1 -0
- package/dist/tools/messaging.js +72 -6
- package/dist/tools/messaging.js.map +1 -1
- package/dist/tools/record-events.js +85 -5
- package/dist/tools/record-events.js.map +1 -1
- package/dist/tools/records.js +310 -44
- package/dist/tools/records.js.map +1 -1
- package/dist/tools/registry.js +67 -3
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/seat-build.js +182 -0
- package/dist/tools/seat-build.js.map +1 -0
- package/dist/tools/shared.js.map +1 -1
- package/dist/tools/stall.js +1095 -18
- package/dist/tools/stall.js.map +1 -1
- package/dist/tools/transport.js +71 -3
- package/dist/tools/transport.js.map +1 -1
- package/dist/tools/worktrees.js +14 -0
- package/dist/tools/worktrees.js.map +1 -1
- package/dist/transports/herdr.js +297 -0
- package/dist/transports/herdr.js.map +1 -0
- package/dist/transports/index.js +10 -4
- package/dist/transports/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/coord-attention-clock.mjs +2 -0
- package/scripts/coord-stall-clock.mjs +52 -11
- package/src/capabilities.ts +284 -2
- package/src/closing-line.ts +85 -0
- package/src/commit-cite.ts +58 -0
- package/src/gated-head.ts +128 -26
- package/src/server-spread.ts +233 -0
- package/src/server.ts +2 -2
- package/src/store.ts +32 -0
- package/src/tools/away.ts +82 -9
- package/src/tools/board-ref.ts +70 -3
- package/src/tools/event-kinds.ts +19 -2
- package/src/tools/events.ts +42 -4
- package/src/tools/herdr-delivery.ts +87 -0
- package/src/tools/messaging.ts +71 -6
- package/src/tools/record-events.ts +78 -5
- package/src/tools/records.ts +316 -44
- package/src/tools/registry.ts +68 -4
- package/src/tools/seat-build.ts +201 -0
- package/src/tools/shared.ts +22 -0
- package/src/tools/stall.ts +1266 -23
- package/src/tools/transport.ts +69 -2
- package/src/tools/worktrees.ts +13 -0
- package/src/transports/herdr.ts +311 -0
- package/src/transports/index.ts +10 -4
package/dist/capabilities.js
CHANGED
|
@@ -41,6 +41,70 @@ import { recordAuthorityFor } from "./roles.js";
|
|
|
41
41
|
import { subscriptionHealth } from "./tools/events.js";
|
|
42
42
|
import { configuredTransport, runningTransport, isTmuxKind, targetOf, } from "./transports/index.js";
|
|
43
43
|
import { readAllTransportMarkers } from "./tools/registry.js";
|
|
44
|
+
import { queueWriteSchema } from "./tools/queue-write.js";
|
|
45
|
+
import { treeProvenance } from "./tools/tree-provenance.js";
|
|
46
|
+
import { detectSpread } from "./server-spread.js";
|
|
47
|
+
import { HerdrTransport, herdrKeyName } from "./transports/herdr.js";
|
|
48
|
+
import { HERDR } from "./transports/types.js";
|
|
49
|
+
/**
|
|
50
|
+
* ⛔⛆⛆ THE PROBE DECISIONS ARE EXPORTED AS PURE PREDICATES, AND THE MUTATION
|
|
51
|
+
* MATRIX IS WHY.
|
|
52
|
+
*
|
|
53
|
+
* Their first form computed `present` inline and built an evidence string from
|
|
54
|
+
* the same raw values. Deleting a conjunct from `present` reddened NOTHING: the
|
|
55
|
+
* tests asserted the EVIDENCE TEXT, which the mutation did not touch, and the
|
|
56
|
+
* probe's own fixed input could not produce the rejected case. ⭐⭐ ***A
|
|
57
|
+
* predicate that cannot be handed the input it is supposed to reject is not
|
|
58
|
+
* guarded — it is decorative, which is the defect one row over and the same
|
|
59
|
+
* shape this row is about.***
|
|
60
|
+
*
|
|
61
|
+
* Exported so a control can pass the failing shape directly.
|
|
62
|
+
*/
|
|
63
|
+
export function retagAccepted(parse) {
|
|
64
|
+
// BOTH halves matter: the new member must parse AND a pre-existing one must
|
|
65
|
+
// still parse. Without the control a schema that accepted ANY string would pass.
|
|
66
|
+
return parse("retag") === true && parse("reprioritise") === true;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* `#283`'s load-bearing property, and it is NOT "it answered": an unfetchable
|
|
70
|
+
* tree must report `"unknown"` and NEVER `0`. A distance of `0` from an
|
|
71
|
+
* unfetched ref and from a fetched one are byte-identical and mean opposite
|
|
72
|
+
* things — so a numeric `behind` on a tree that was never fetched is the exact
|
|
73
|
+
* failure the verb exists to prevent.
|
|
74
|
+
*/
|
|
75
|
+
export function treeProvenanceRefusesZero(r) {
|
|
76
|
+
return r.behind === "unknown" && r.fetched === false && r.stale === false;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* `#293`'s load-bearing property (0.26.22): a seat that publishes NO module path
|
|
80
|
+
* makes the fleet `CANNOT_COMPARE` — it is never dropped from the population so
|
|
81
|
+
* the readable rest can answer `AGREED`. ⛔ BOTH CONTROLS ARE CONJUNCTS ON
|
|
82
|
+
* PURPOSE: readable seats on one side of the install must still `AGREED` and on
|
|
83
|
+
* two sides must still `DIVERGED`, or a detector that answered
|
|
84
|
+
* `CANNOT_COMPARE` for everything would pass this probe while detecting nothing.
|
|
85
|
+
*
|
|
86
|
+
* ⭐ AND THIS PROBE EXISTS BECAUSE THE GATE ONE ROW OVER FIRED ON ITS OWN PR:
|
|
87
|
+
* `#293` bumped `0.26.22` with behaviour and no probe, `main` moved under
|
|
88
|
+
* `#292`, and qa measured `probedThrough 0.26.21 < running 0.26.22 → ok:false`.
|
|
89
|
+
* The remedy is the probe, not a softer comparison — softening it would turn
|
|
90
|
+
* the verb back into the label read ⟨q-1c8e35f9⟩ exists to end.
|
|
91
|
+
*/
|
|
92
|
+
/**
|
|
93
|
+
* ⟨q-8a3f1c05⟩ / #303 — IN-FLIGHT IS DERIVED FROM THE SEAM, NOT MATCHED ON A GLYPH.
|
|
94
|
+
* A 0.26.21 server read `⛔ Blocked — was 🚧 until the base went red` as IN FLIGHT
|
|
95
|
+
* (the regex `/🚧|🔍/` matched the mention); the seam's `workStateOf` reads the
|
|
96
|
+
* LEADING glyph and answers blocked. All three conjuncts matter: the old answer
|
|
97
|
+
* for the blocked row must be refused AND the two genuine in-flight states must
|
|
98
|
+
* still read in flight, or a predicate that answers false to everything passes.
|
|
99
|
+
* The version label did not move for #303 (still 0.26.22), so `check-probe-coverage`
|
|
100
|
+
* could not see the behaviour arrive — this probe is what sees it.
|
|
101
|
+
*/
|
|
102
|
+
export function inFlightDerivedFromSeam(inFlight) {
|
|
103
|
+
return inFlight("⛔ Blocked — was 🚧 until the base went red") === false && inFlight("🔍 In Review") === true && inFlight("🚧 In Progress") === true;
|
|
104
|
+
}
|
|
105
|
+
export function spreadPoisonedByUnreadableSeat(states) {
|
|
106
|
+
return states.unreadable === "CANNOT_COMPARE" && states.agreed === "AGREED" && states.diverged === "DIVERGED";
|
|
107
|
+
}
|
|
44
108
|
/**
|
|
45
109
|
* Each probe calls a behaviour that did not exist before its release and
|
|
46
110
|
* reports what it observed. A probe that could pass without the code being
|
|
@@ -106,6 +170,104 @@ const PROBES = [
|
|
|
106
170
|
};
|
|
107
171
|
},
|
|
108
172
|
},
|
|
173
|
+
/**
|
|
174
|
+
* ⛔⛆⛆ THE PROBES BELOW CLOSE THE WINDOW ⟨q-1c8e35f9⟩ MEASURED.
|
|
175
|
+
*
|
|
176
|
+
* Before them the newest `since` was `0.26.15`, so `capabilities` answered
|
|
177
|
+
* `ok · missing: []` identically on every version from `0.26.16` to `0.26.21`
|
|
178
|
+
* — the whole set the fleet was about to install.
|
|
179
|
+
*
|
|
180
|
+
* ⚠ AND THE TRAP THE ROW NAMES IS THE ONE TO AVOID WHILE WRITING THESE:
|
|
181
|
+
* `away-means-david-away` EXISTS, its NAME matches the changed area, and its
|
|
182
|
+
* ASSERTION predates the change — it tests `0.26.13`'s refusal list, not
|
|
183
|
+
* `#216`'s query mode. ⭐⭐ ***A probe whose name matches while its assertion
|
|
184
|
+
* predates reads as coverage and is not. So each probe below asserts a
|
|
185
|
+
* behaviour that DID NOT EXIST before its own `since`, and would throw or
|
|
186
|
+
* return `false` on the release before it.***
|
|
187
|
+
*/
|
|
188
|
+
{
|
|
189
|
+
// #284 — `queue_write` gained `op: "retag"`. On 0.26.20 the enum has three
|
|
190
|
+
// members and parsing `"retag"` throws, which is the probe's whole point.
|
|
191
|
+
id: "queue-write-retag",
|
|
192
|
+
since: "0.26.21",
|
|
193
|
+
run: () => {
|
|
194
|
+
const parse = (v) => queueWriteSchema.op.safeParse(v).success === true;
|
|
195
|
+
const present = retagAccepted(parse);
|
|
196
|
+
return {
|
|
197
|
+
present,
|
|
198
|
+
evidence: `queue_write op accepts "retag": ${parse("retag")} (control "reprioritise": ${parse("reprioritise")}) -> present=${present}`,
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
// #283 — every `repo`-taking verb reports the tree it read. The load-bearing
|
|
204
|
+
// property is NOT that it answers, it is that an unfetchable tree yields
|
|
205
|
+
// `"unknown"` and NEVER `0`: a distance of 0 from an unfetched ref and from a
|
|
206
|
+
// fetched one are byte-identical and mean opposite things.
|
|
207
|
+
id: "tree-provenance-unknown-not-zero",
|
|
208
|
+
since: "0.26.21",
|
|
209
|
+
run: () => {
|
|
210
|
+
const r = treeProvenance("/nonexistent-path-for-capability-probe");
|
|
211
|
+
const present = treeProvenanceRefusesZero(r);
|
|
212
|
+
return {
|
|
213
|
+
present,
|
|
214
|
+
evidence: `unreachable tree -> behind=${JSON.stringify(r.behind)} fetched=${r.fetched} stale=${r.stale} -> present=${present}`,
|
|
215
|
+
};
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
// #293 — `detectSpread` did not exist before 0.26.22. The property is not
|
|
220
|
+
// "it answers": an UNREADABLE seat must poison the verdict rather than be
|
|
221
|
+
// dropped, while readable seats still resolve to AGREED / DIVERGED.
|
|
222
|
+
id: "server-spread-unreadable-poisons",
|
|
223
|
+
since: "0.26.22",
|
|
224
|
+
run: () => {
|
|
225
|
+
const installed = { mtime: 1_000, module: "/installed-for-capability-probe" };
|
|
226
|
+
const a = { agentId: "a", serverStartedAt: 2_000, serverModule: installed.module };
|
|
227
|
+
const b = { agentId: "b", serverStartedAt: 3_000, serverModule: installed.module };
|
|
228
|
+
const older = { agentId: "older", serverStartedAt: 500, serverModule: installed.module };
|
|
229
|
+
const mute = { agentId: "mute" };
|
|
230
|
+
const states = {
|
|
231
|
+
unreadable: detectSpread([a, mute], installed).state,
|
|
232
|
+
agreed: detectSpread([a, b], installed).state,
|
|
233
|
+
diverged: detectSpread([a, older], installed).state,
|
|
234
|
+
};
|
|
235
|
+
const present = spreadPoisonedByUnreadableSeat(states);
|
|
236
|
+
return {
|
|
237
|
+
present,
|
|
238
|
+
evidence: `unreadable seat -> ${states.unreadable} · same side -> ${states.agreed} · two sides -> ${states.diverged} -> present=${present}`,
|
|
239
|
+
};
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
// #303 (shipped under 0.26.22, no bump) — `isInFlightStatus` derives from the seam.
|
|
244
|
+
id: "in-flight-derives-from-seam",
|
|
245
|
+
since: "0.26.22",
|
|
246
|
+
run: () => {
|
|
247
|
+
const blocked = isInFlightStatus("⛔ Blocked — was 🚧 until the base went red");
|
|
248
|
+
const review = isInFlightStatus("🔍 In Review");
|
|
249
|
+
const present = inFlightDerivedFromSeam(isInFlightStatus);
|
|
250
|
+
return { present, evidence: `"⛔ Blocked — was 🚧 …" in flight: ${blocked} (0.26.21 said true) · "🔍 In Review": ${review} -> present=${present}` };
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
// Phase 5.4 Task 4 (0.26.23) — the herdr transport exists and refuses by name: a scripted
|
|
255
|
+
// dead pane reads dead from herdr's own reply, and a tmux key name is refused, not typed.
|
|
256
|
+
id: "herdr-transport-registered",
|
|
257
|
+
since: "0.26.23",
|
|
258
|
+
run: () => {
|
|
259
|
+
const scripted = new HerdrTransport({
|
|
260
|
+
run: (a) => (a[0] === "status"
|
|
261
|
+
? { ok: true, status: 0, stdout: "server:\n status: running\n", stderr: "" }
|
|
262
|
+
: { ok: false, status: 0, stdout: "", stderr: "", json: { error: { code: "pane_not_found", message: "pane w0:p0 not found" } }, error: { code: "pane_not_found", message: "pane w0:p0 not found" } }),
|
|
263
|
+
sleep: () => { },
|
|
264
|
+
});
|
|
265
|
+
const key = herdrKeyName("C-u");
|
|
266
|
+
const exists = scripted.paneExists("w0:p0");
|
|
267
|
+
const present = scripted.kind === HERDR && exists === false && key.ok === false;
|
|
268
|
+
return { present, evidence: `HerdrTransport.kind=${scripted.kind} · scripted pane_not_found -> paneExists=${exists} · herdrKeyName("C-u").ok=${key.ok} -> present=${present}` };
|
|
269
|
+
},
|
|
270
|
+
},
|
|
109
271
|
{
|
|
110
272
|
id: "record-authority",
|
|
111
273
|
since: "0.24.0",
|
|
@@ -118,6 +280,65 @@ const PROBES = [
|
|
|
118
280
|
},
|
|
119
281
|
},
|
|
120
282
|
];
|
|
283
|
+
/**
|
|
284
|
+
* ⛔⛆⛆ `missing: []` MEANS TWO DIFFERENT THINGS AND THIS SEPARATES THEM.
|
|
285
|
+
*
|
|
286
|
+
* "Nothing is missing" and "nothing was tested" produce the SAME answer today.
|
|
287
|
+
* ⭐⭐ ***Measured 2026-09-14: `capabilities` answered `ok · missing: []`
|
|
288
|
+
* IDENTICALLY on `0.26.20` and `0.26.21` — the probe set stops at `since
|
|
289
|
+
* 0.26.15`, so every version the fleet was about to install was unprobed, and
|
|
290
|
+
* the verb the fleet reaches for to prove a restart took could not see the three
|
|
291
|
+
* changes it would have been asked to certify.***
|
|
292
|
+
*
|
|
293
|
+
* That is `0`-vs-`unknown` inside the instrument the six delivery states END on:
|
|
294
|
+
* while this is blind, `observed` is unmeasurable BY CONSTRUCTION and every
|
|
295
|
+
* "delivered" claim in the fleet rests on a version LABEL.
|
|
296
|
+
*
|
|
297
|
+
* ⚠ THE COMPARISON IS AGAINST THE LABEL, WHICH IS NOT EVIDENCE — and that is
|
|
298
|
+
* deliberate rather than sloppy. The label is the only statement of intent
|
|
299
|
+
* available about what this process is SUPPOSED to be; the probes are the only
|
|
300
|
+
* evidence about what it IS. Comparing them is precisely how a divergence
|
|
301
|
+
* becomes visible, and this function says which side is which rather than
|
|
302
|
+
* blending them.
|
|
303
|
+
*/
|
|
304
|
+
function coverageOf(probes, versionLabel) {
|
|
305
|
+
const cmp = (a, b) => {
|
|
306
|
+
const pa = a.split(".").map((n) => Number.parseInt(n, 10));
|
|
307
|
+
const pb = b.split(".").map((n) => Number.parseInt(n, 10));
|
|
308
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i += 1) {
|
|
309
|
+
const x = Number.isFinite(pa[i]) ? pa[i] : 0;
|
|
310
|
+
const y = Number.isFinite(pb[i]) ? pb[i] : 0;
|
|
311
|
+
if (x !== y)
|
|
312
|
+
return x < y ? -1 : 1;
|
|
313
|
+
}
|
|
314
|
+
return 0;
|
|
315
|
+
};
|
|
316
|
+
const sinces = probes.map((p) => p.since).filter((v) => /^\d+(\.\d+)*$/.test(v));
|
|
317
|
+
const probedThrough = sinces.length ? sinces.reduce((hi, v) => (cmp(v, hi) > 0 ? v : hi)) : null;
|
|
318
|
+
const labelUsable = /^\d+(\.\d+)*$/.test(versionLabel);
|
|
319
|
+
if (!probedThrough || !labelUsable) {
|
|
320
|
+
return {
|
|
321
|
+
probedThrough,
|
|
322
|
+
running: versionLabel,
|
|
323
|
+
covered: false,
|
|
324
|
+
verdict: `COVERAGE UNKNOWN — ${!probedThrough ? "no probe declares a numeric `since`" : "the version label is not numeric"}. ` +
|
|
325
|
+
`Unknown is not covered: this cannot be read as "nothing is missing".`,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
const covered = cmp(probedThrough, versionLabel) >= 0;
|
|
329
|
+
return {
|
|
330
|
+
probedThrough,
|
|
331
|
+
running: versionLabel,
|
|
332
|
+
covered,
|
|
333
|
+
verdict: covered
|
|
334
|
+
? `PROBES REACH THE RUNNING VERSION — newest probe \`since ${probedThrough}\`, label \`${versionLabel}\`. ` +
|
|
335
|
+
`So \`missing: []\` here means TESTED-AND-PRESENT rather than untested.`
|
|
336
|
+
: `UNPROBED WINDOW \`${probedThrough}\` → \`${versionLabel}\` — every behaviour introduced after ` +
|
|
337
|
+
`\`${probedThrough}\` is UNTESTED by this verb. \`missing: []\` below therefore does NOT mean "nothing is ` +
|
|
338
|
+
`missing"; it means "nothing in that window was looked at". A restart certified on this answer certifies the ` +
|
|
339
|
+
`versions it can see and is silent about the ones it cannot.`,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
121
342
|
export function probeCapabilities(context) {
|
|
122
343
|
const probes = PROBES.map((p) => {
|
|
123
344
|
try {
|
|
@@ -133,7 +354,9 @@ export function probeCapabilities(context) {
|
|
|
133
354
|
}
|
|
134
355
|
});
|
|
135
356
|
const missing = probes.filter((p) => !p.present).map((p) => p.id);
|
|
357
|
+
const coverage = coverageOf(probes, context.versionLabel);
|
|
136
358
|
return {
|
|
359
|
+
coverage,
|
|
137
360
|
answeredBy: {
|
|
138
361
|
pid: process.pid,
|
|
139
362
|
startedAtIso: new Date(Date.now() - Math.round(process.uptime() * 1000)).toISOString(),
|
|
@@ -142,7 +365,14 @@ export function probeCapabilities(context) {
|
|
|
142
365
|
},
|
|
143
366
|
probes,
|
|
144
367
|
missing,
|
|
145
|
-
|
|
368
|
+
/**
|
|
369
|
+
* ⛔ `ok` NOW REQUIRES COVERAGE AS WELL AS PRESENCE. It previously meant
|
|
370
|
+
* "no probe failed", which on an unprobed version is "no probe ran" — the
|
|
371
|
+
* reading this row exists to stop. A reader asking "is this server good?"
|
|
372
|
+
* gets `false` when the honest answer is "I cannot tell", and `coverage`
|
|
373
|
+
* says which of the two it is.
|
|
374
|
+
*/
|
|
375
|
+
ok: missing.length === 0 && coverage.covered,
|
|
146
376
|
note: "Every line above was produced by CALLING the code in this process. `versionLabel` is a label someone typed " +
|
|
147
377
|
"into package.json and is context, never evidence — a published tarball has already been observed carrying a " +
|
|
148
378
|
"change its version said it could not. THIS ANSWER IS ABOUT ONE PROCESS: a release is delivered when every " +
|
|
@@ -152,6 +382,8 @@ export function probeCapabilities(context) {
|
|
|
152
382
|
}
|
|
153
383
|
/* ── the verb ──────────────────────────────────────────────────────────────── */
|
|
154
384
|
import { resolveServerIdentity } from "./server-identity.js";
|
|
385
|
+
import { seatBuildOf, installedFrom, psReader } from "./tools/seat-build.js";
|
|
386
|
+
import { isInFlightStatus } from "./tools/stall.js";
|
|
155
387
|
export const capabilitiesSchema = {};
|
|
156
388
|
/**
|
|
157
389
|
* Build the transport capability by CALLING things, then compare.
|
|
@@ -195,11 +427,47 @@ export async function probeTransport() {
|
|
|
195
427
|
disagreeingAgents,
|
|
196
428
|
};
|
|
197
429
|
}
|
|
430
|
+
/**
|
|
431
|
+
* ⟨q-8a3f1c05⟩ — EVERY LIVE SEAT'S BUILD STATE, STATED. The restart operation read
|
|
432
|
+
* `capabilities` to certify a stage and it could not see a pusher; this is that verb
|
|
433
|
+
* answering the question it was asked. `seats[]` carries each live seat's PUSHER half
|
|
434
|
+
* (keyed by the `--agent` on its own command line, against the installed hook's mtime);
|
|
435
|
+
* `answering` carries the SERVER half of the one process that can know it — this one.
|
|
436
|
+
* Servers carry no `--agent`, so no other seat's server is observable from here, and
|
|
437
|
+
* each seat entry says so rather than borrowing its marker's attach-time stamp.
|
|
438
|
+
*/
|
|
439
|
+
export async function seatBuilds() {
|
|
440
|
+
const id = resolveServerIdentity();
|
|
441
|
+
const installed = installedFrom(id.path);
|
|
442
|
+
const startedAt = Date.now() - Math.round(process.uptime() * 1000);
|
|
443
|
+
const answering = seatBuildOf({ agentId: "(answering process)", marker: undefined, installed, ps: psReader, server: { pid: process.pid, startedAt, buildMtime: installed.buildMtime } }).server;
|
|
444
|
+
const seats = [];
|
|
445
|
+
try {
|
|
446
|
+
for (const { marker, live } of await readAllTransportMarkers()) {
|
|
447
|
+
if (!live)
|
|
448
|
+
continue;
|
|
449
|
+
seats.push(seatBuildOf({ agentId: marker.agentId, marker, installed, ps: psReader, server: null }));
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
catch {
|
|
453
|
+
/* an unreadable transports dir yields no seats — an empty list, not a healthy fleet */
|
|
454
|
+
}
|
|
455
|
+
const toIso = (ms) => (ms === null ? null : new Date(ms).toISOString());
|
|
456
|
+
return {
|
|
457
|
+
installed: { module: installed.module, hookPath: installed.hookPath, hookMtime: toIso(installed.hookMtime), buildMtime: toIso(installed.buildMtime) },
|
|
458
|
+
answering,
|
|
459
|
+
seats,
|
|
460
|
+
note: "seats[] states each live seat's PUSHER against the installed hook's own mtime (hooks/tmux-pusher.mjs, read directly), " +
|
|
461
|
+
"keyed by the --agent on the pusher's command line. The SERVER half is known only for the answering process " +
|
|
462
|
+
"(`answering`): servers carry no --agent, so another seat's server cannot be keyed from ps — ask that seat's own " +
|
|
463
|
+
"`status`, which states both halves for itself. A seat that reads current here and stale in its own status is half-restarted.",
|
|
464
|
+
};
|
|
465
|
+
}
|
|
198
466
|
export async function capabilitiesTool() {
|
|
199
467
|
const id = resolveServerIdentity();
|
|
200
468
|
const report = probeCapabilities({ module: id.path, versionLabel: id.version });
|
|
201
469
|
try {
|
|
202
|
-
return { ...report, transport: await probeTransport() };
|
|
470
|
+
return { ...report, transport: await probeTransport(), seats: await seatBuilds() };
|
|
203
471
|
}
|
|
204
472
|
catch (e) {
|
|
205
473
|
// A THROWN TRANSPORT PROBE IS NOT A BROKEN VERB. An unknown configured value
|
package/dist/capabilities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,QAAQ,GAET,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAa9D;;;;GAIG;AACH,MAAM,MAAM,GAAY;IACtB;QACE,EAAE,EAAE,0BAA0B;QAC9B,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,GAAG,EAAE;YACR,MAAM,CAAC,GAAG,iBAAiB,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;YACpD,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;YAC/B,OAAO;gBACL,OAAO,EAAE,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,QAAQ,CAAC;gBACpE,QAAQ,EAAE,oCAAoC,CAAC,CAAC,IAAI,mBAAmB,IAAI,GAAG;aAC/E,CAAC;QACJ,CAAC;KACF;IACD;QACE,EAAE,EAAE,yBAAyB;QAC7B,K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 — A CLOSING LINE STATES AN ARTEFACT IT HAS NOT READ.
|
|
3
|
+
*
|
|
4
|
+
* Measured 2026-09-14 in one clock: #318 merged 18:12:42Z · "Remote branch
|
|
5
|
+
* deleted" posted 18:12:53.626Z · head_ref_deleted 18:13:27Z — the claim
|
|
6
|
+
* preceded its artefact by 33.4s; #319 by 61.7s. Then qa re-read
|
|
7
|
+
* `git ls-remote --heads origin` after #321 and withdrew the same line for
|
|
8
|
+
* FIVE merges (#309 #311 #315 #317 #321) where the remote was NEVER deleted:
|
|
9
|
+
* `gh --delete-branch` had not deleted the remote when the local delete
|
|
10
|
+
* errored, and the closing line reported THE FLAG IT PASSED rather than the
|
|
11
|
+
* remote it never read. A closing line already verifies the squash by content;
|
|
12
|
+
* the ref gets the same rule. The grammar admits exactly two forms for a
|
|
13
|
+
* deletion: a post-delete observation — `remote ref read: 0 refs at <ts>` —
|
|
14
|
+
* or the weaker `delete requested`, which claims no state. A closing that
|
|
15
|
+
* asserts deletion in any other wording is refused at the send, by the same
|
|
16
|
+
* check that requires a DONE to cite its PR, naming both forms.
|
|
17
|
+
*
|
|
18
|
+
* Dated adoption floor: qa's 18:36:30.939Z message — "From here every closing
|
|
19
|
+
* line reads the remote before claiming a delete". Closings at or before it
|
|
20
|
+
* are LISTED, never raised.
|
|
21
|
+
*/
|
|
22
|
+
export const CLOSING_GRAMMAR_ADOPTED_MS = 1789410990939; // 2026-09-14T18:36:30.939Z
|
|
23
|
+
/** A merge-closing line: a `done` whose text says MERGED. */
|
|
24
|
+
export const isMergeClosing = (text) => /\bMERGED\b/.test(text);
|
|
25
|
+
/**
|
|
26
|
+
* A deletion CLAIM is a statement, read by POSITION: the wording at the start
|
|
27
|
+
* of a sentence. The same words quoted mid-sentence — qa's own correction says
|
|
28
|
+
* `My "remote branch deleted" lines … were wrong` — are a mention, not a claim.
|
|
29
|
+
*/
|
|
30
|
+
export const DELETE_CLAIM = /(?:^|[.;!]\s+|\n\s*)(?:(?:Remote|Local and remote|Remote and local) (?:branch|ref) deleted|Deleted the remote (?:branch|ref))\b/;
|
|
31
|
+
/** The observation form: what `git ls-remote --heads origin <branch>` returned, and when. */
|
|
32
|
+
export const REMOTE_READ = /remote ref read:\s*(\d+)\s*refs?\s+at\s+(\S+?)(?=[.;,)]?(?:\s|$))/i;
|
|
33
|
+
/** The weaker form: a command was issued; the state is left unclaimed. */
|
|
34
|
+
export const DELETE_REQUESTED = /\bdelete requested\b/i;
|
|
35
|
+
export const ACCEPTED_FORMS = "`remote ref read: 0 refs at <ISO ts>` (an `ls-remote` observation taken AFTER the delete) or `delete requested` (a command issued; state unclaimed)";
|
|
36
|
+
export function closingLineOf(text) {
|
|
37
|
+
const merged = isMergeClosing(text);
|
|
38
|
+
const claimsDelete = DELETE_CLAIM.test(text);
|
|
39
|
+
const r = REMOTE_READ.exec(text);
|
|
40
|
+
const form = r ? "read" : DELETE_REQUESTED.test(text) ? "requested" : null;
|
|
41
|
+
return { merged, claimsDelete, form, ...(r ? { read: { refs: Number(r[1]), at: r[2] } } : {}) };
|
|
42
|
+
}
|
|
43
|
+
/** The refusal: a merge closing that asserts deletion without either accepted form. */
|
|
44
|
+
export function checkClosingLine(text) {
|
|
45
|
+
const closing = closingLineOf(text);
|
|
46
|
+
if (closing.merged && closing.claimsDelete && closing.form === null) {
|
|
47
|
+
return {
|
|
48
|
+
ok: false,
|
|
49
|
+
closing,
|
|
50
|
+
error: `a merge-closing line asserts a branch deletion it has not shown it read — "Remote branch deleted" reports a flag passed, not a remote observed (2 of 2 measured were premature, 5 of 7 were false). ` +
|
|
51
|
+
`State the deletion in one of the two accepted forms: ${ACCEPTED_FORMS}.`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return { ok: true, closing };
|
|
55
|
+
}
|
|
56
|
+
/** Every merge closing in a log, judged; `beforeAdoption` for those at or before the floor. */
|
|
57
|
+
export function closingsIn(logText, floorMs = CLOSING_GRAMMAR_ADOPTED_MS) {
|
|
58
|
+
const out = [];
|
|
59
|
+
for (const l of logText.split("\n")) {
|
|
60
|
+
if (!l.trim())
|
|
61
|
+
continue;
|
|
62
|
+
let o;
|
|
63
|
+
try {
|
|
64
|
+
o = JSON.parse(l);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (o.record?.type !== "done")
|
|
70
|
+
continue;
|
|
71
|
+
const text = String(o.text ?? "");
|
|
72
|
+
const c = closingLineOf(text);
|
|
73
|
+
if (!c.merged)
|
|
74
|
+
continue;
|
|
75
|
+
const cited = (o.record.cites ?? []).map((x) => (String(x?.ref ?? "").match(/#(\d+)/) ?? [])[1]).find(Boolean);
|
|
76
|
+
const inText = (text.match(/MERGED[^\n]*?#(\d+)/) ?? [])[1];
|
|
77
|
+
const pr = cited ?? inText;
|
|
78
|
+
const ts = Number(o.ts ?? 0);
|
|
79
|
+
out.push({ pr: pr ? Number(pr) : null, from: String(o.from ?? ""), ts, claimsDelete: c.claimsDelete, form: c.form, beforeAdoption: ts <= floorMs });
|
|
80
|
+
}
|
|
81
|
+
return out.sort((a, b) => a.ts - b.ts);
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=closing-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closing-line.js","sourceRoot":"","sources":["../src/closing-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAC,CAAC,2BAA2B;AAEpF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,iIAAiI,CAAC;AAC9J,6FAA6F;AAC7F,MAAM,CAAC,MAAM,WAAW,GAAG,oEAAoE,CAAC;AAChG,0EAA0E;AAC1E,MAAM,CAAC,M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,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IACtJ,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⟨q-cc0819dc⟩ — A `done` MAY CITE A COMMIT WHEN THE WORK HAS NO PR BY RULE.
|
|
3
|
+
*
|
|
4
|
+
* Docs-direct work (queue curation, canon, board moves) is pushed straight to the shared
|
|
5
|
+
* branch by policy; the `done` gate demanded a `{kind:'pr'}` cite, so the compliant path did
|
|
6
|
+
* not exist and the aide downgraded to `fyi` (2026-09-12 15:50). The fix accepts a commit
|
|
7
|
+
* cite — and only a commit that is REAL: a fabricated sha must not become a citable DONE.
|
|
8
|
+
*
|
|
9
|
+
* What "real" means here, stated so the ancestry call below is not mistaken for a merge test:
|
|
10
|
+
* is this exact commit object reachable from origin/main in `repo`? A docs-direct push puts
|
|
11
|
+
* THE COMMIT ITSELF on the shared branch, so reachability is the right question for it — this
|
|
12
|
+
* is not "was this branch's work squashed in", which `--is-ancestor` cannot answer
|
|
13
|
+
* (docs/LANDEDNESS.md); a squash-merged PR is cited by its PR, never by its branch sha.
|
|
14
|
+
*
|
|
15
|
+
* Full 40-hex only, REFUSED rather than normalised: a prefix is a claim about a sha the
|
|
16
|
+
* joiners (verdict/landing/closure readers) compare in full; normalising here would write a
|
|
17
|
+
* sha the sender never saw. No network: one local `git` in `repo`, which the caller passes
|
|
18
|
+
* because the send path has no repository of its own.
|
|
19
|
+
*/
|
|
20
|
+
import { execFileSync } from "node:child_process";
|
|
21
|
+
export const FULL_SHA = /^[0-9a-f]{40}$/;
|
|
22
|
+
export const SHARED_BRANCH_CANDIDATES = ["origin/main", "origin/master"];
|
|
23
|
+
function git(repo, args) {
|
|
24
|
+
try {
|
|
25
|
+
const out = execFileSync("git", ["-C", repo, ...args], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] });
|
|
26
|
+
return { status: 0, out: out.trim() };
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
return { status: Number(e.status ?? 1), out: "" };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Verify one commit cite against the shared branch of `repo`. */
|
|
33
|
+
export function verifyCommitCite(ref, repo) {
|
|
34
|
+
const sha = String(ref ?? "").trim();
|
|
35
|
+
if (!FULL_SHA.test(sha)) {
|
|
36
|
+
return { ok: false, why: `commit cite '${sha}' is not a full 40-hex sha — refused, not normalised: a prefix is a claim the joiners compare in full` };
|
|
37
|
+
}
|
|
38
|
+
if (!repo) {
|
|
39
|
+
return { ok: false, why: `commit cite ${sha.slice(0, 7)} cannot be verified without \`repo\` — pass the repository whose origin/main carries it (no network is used)` };
|
|
40
|
+
}
|
|
41
|
+
if (git(repo, ["rev-parse", "--verify", "--quiet", `${sha}^{commit}`]).status !== 0) {
|
|
42
|
+
return { ok: false, why: `commit ${sha.slice(0, 7)} does not exist in ${repo} — a sha the repository has never seen cannot be a citable DONE` };
|
|
43
|
+
}
|
|
44
|
+
for (const branch of SHARED_BRANCH_CANDIDATES) {
|
|
45
|
+
if (git(repo, ["rev-parse", "--verify", "--quiet", branch]).status !== 0)
|
|
46
|
+
continue;
|
|
47
|
+
// Is the cited commit reachable from the shared branch? (the reachability question,
|
|
48
|
+
// asked of the commit object itself — see the header for why that is the right one here)
|
|
49
|
+
if (git(repo, ["merge-base", "--is-ancestor", sha, branch]).status === 0)
|
|
50
|
+
return { ok: true, sha, branch };
|
|
51
|
+
return { ok: false, why: `commit ${sha.slice(0, 7)} exists but is not reachable from ${branch} — work that is done is on the shared branch; a commit that is not is not done` };
|
|
52
|
+
}
|
|
53
|
+
return { ok: false, why: `${repo} has no origin/main or origin/master to verify commit ${sha.slice(0, 7)} against — fetch the shared branch first` };
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=commit-cite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit-cite.js","sourceRoot":"","sources":["../src/commit-cite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AAMzE,SAAS,GAAG,CAAC,IAAY,EAAE,IAAc;IACvC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QAClH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;IACxC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,MAAM,EAAE,MAAM,CAAE,CAAyB,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;IAC7E,CAAC;AACH,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,IAAwB;IACpE,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAA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AAyD,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,0CAA0C,EAAE,CAAC;AACvJ,CAAC"}
|
package/dist/gated-head.js
CHANGED
|
@@ -50,6 +50,9 @@ export function shaAgrees(a, b) {
|
|
|
50
50
|
return false;
|
|
51
51
|
return x.length <= y.length ? y.startsWith(x) : x.startsWith(y);
|
|
52
52
|
}
|
|
53
|
+
/** Who JUDGED: the typed gater when scribed, else the sender. Never `from` alone. */
|
|
54
|
+
export const gaterOf = (v) => v.gatedBy ?? v.from;
|
|
55
|
+
const nonEmpty = (x) => (typeof x === "string" && x.trim() ? x : undefined);
|
|
53
56
|
/** The PR number a verdict record is about, from its `cites`. */
|
|
54
57
|
function citedPr(cites) {
|
|
55
58
|
if (!Array.isArray(cites))
|
|
@@ -87,44 +90,88 @@ export function verdictsFor(logText, pr) {
|
|
|
87
90
|
continue;
|
|
88
91
|
if (citedPr(r.cites) !== pr)
|
|
89
92
|
continue;
|
|
93
|
+
const gatedBy = nonEmpty(r.payload?.gatedBy);
|
|
94
|
+
const scribe = nonEmpty(r.payload?.scribe);
|
|
90
95
|
verdicts.push({
|
|
91
96
|
head: String(r.payload?.headRefOid ?? ""),
|
|
92
97
|
ts: Number(o.ts ?? 0),
|
|
93
98
|
from: String(o.from ?? ""),
|
|
94
99
|
result: String(r.payload?.result ?? ""),
|
|
100
|
+
...(gatedBy ? { gatedBy } : {}),
|
|
101
|
+
...(scribe ? { scribe } : {}),
|
|
95
102
|
});
|
|
96
103
|
}
|
|
97
104
|
return { verdicts, lines: lines.length, unparsed };
|
|
98
105
|
}
|
|
106
|
+
export const fmtLate = (ms) => (ms < 60_000 ? `${Math.round(ms / 1000)}s` : ms < 3_600_000 ? `${Math.floor(ms / 60_000)}m${Math.round((ms % 60_000) / 1000)}s` : `${Math.floor(ms / 3_600_000)}h${Math.floor((ms % 3_600_000) / 60_000)}m`);
|
|
99
107
|
/**
|
|
100
|
-
* Was `head` gated by a PASS
|
|
108
|
+
* Was `head` gated by a typed PASS bound to it — in any channel, at any time?
|
|
101
109
|
*
|
|
102
|
-
* `
|
|
103
|
-
*
|
|
104
|
-
*
|
|
110
|
+
* `mergedAt` is DISCLOSURE, not a filter: when known and the earliest matching
|
|
111
|
+
* PASS postdates it, the answer is still gated and `verified` says by how long
|
|
112
|
+
* the record trailed the merge. The EARLIEST matching PASS is the one cited,
|
|
113
|
+
* so a PR comment that preceded the merge is not shadowed by a bus record that
|
|
114
|
+
* followed it (#309's shape).
|
|
105
115
|
*/
|
|
106
|
-
export function
|
|
116
|
+
export function gatedBy(verdicts, head, mergedAt = null) {
|
|
107
117
|
const passes = verdicts.filter((v) => v.result === "pass");
|
|
108
118
|
if (passes.length === 0) {
|
|
109
|
-
return { gated: false, reason: `no PASS verdict
|
|
119
|
+
return { gated: false, reason: `no typed PASS verdict exists for this PR in any channel — not checked, which is not the same as checked and passing` };
|
|
110
120
|
}
|
|
111
|
-
const
|
|
112
|
-
|
|
121
|
+
const matches = passes.filter((v) => shaAgrees(v.head, head)).sort((a, b) => a.ts - b.ts);
|
|
122
|
+
const by = matches[0];
|
|
123
|
+
if (!by) {
|
|
113
124
|
return {
|
|
114
125
|
gated: false,
|
|
115
|
-
reason: `
|
|
116
|
-
|
|
117
|
-
crossed: passes.map((v) => ({ gatedSha: v.head, at: v.ts })),
|
|
126
|
+
reason: `the head being judged (${head.slice(0, 7)}) matches no typed PASS in any channel — the thing merged is not the thing gated`,
|
|
127
|
+
crossed: passes.map((v) => ({ gatedSha: v.head, at: v.ts, channel: v.channel ?? "bus" })),
|
|
118
128
|
};
|
|
119
129
|
}
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
const lateByMs = mergedAt !== null && Number.isFinite(mergedAt) ? Math.max(0, by.ts - mergedAt) : null;
|
|
131
|
+
// ⟨q-6f4a19c8⟩ — the seat-naming record, when the earliest match cannot name one.
|
|
132
|
+
const seatRecord = by.channel === "pr" ? matches.find((v) => v.channel !== "pr") : undefined;
|
|
133
|
+
const gater = seatRecord ? gaterOf(seatRecord) : gaterOf(by);
|
|
134
|
+
const attribution = by.channel === "pr" && !seatRecord ? "account" : "seat";
|
|
135
|
+
const scribed = (v) => (v.gatedBy && v.gatedBy !== v.from ? `, scribed by ${v.from}` : "");
|
|
136
|
+
const who = seatRecord
|
|
137
|
+
? `${gater} (bus${scribed(seatRecord)}), first seen on the PR at ${new Date(by.ts).toISOString()} as ${by.from}`
|
|
138
|
+
: by.channel === "pr"
|
|
139
|
+
? `${by.from} (on the PR — a shared account, not a seat; no bus verdict names this head)`
|
|
140
|
+
: `${gater} (on the bus${scribed(by)})`;
|
|
141
|
+
const verified = lateByMs === null
|
|
142
|
+
? `verified at head ${head.slice(0, 7)} by ${who}`
|
|
143
|
+
: lateByMs > 0
|
|
144
|
+
? `verified at head ${head.slice(0, 7)} by ${who}; the verdict was RECORDED ${fmtLate(lateByMs)} AFTER the merge — the content was judged, the merge was not covered when it happened`
|
|
145
|
+
: `verified at head ${head.slice(0, 7)} by ${who} before the merge`;
|
|
146
|
+
return { gated: true, by, lateByMs, verified, gater, attribution, ...(seatRecord ? { seatRecord } : {}) };
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The typed verdict line on a PR page (#313's grammar): `QA GATE — **PASS** @ \`sha\``
|
|
150
|
+
* or the merge-time `**GATE: PASS** … @ \`sha\``. Uppercase PASS/FAIL as a whole
|
|
151
|
+
* word on a line that opens with the gate marker and carries an `@ sha`. Prose
|
|
152
|
+
* that says "passes", "verdict" or "FAILs" does not match — #299's shape, where
|
|
153
|
+
* a PASS|FAIL substring scan would have counted an explicit non-verdict review.
|
|
154
|
+
*/
|
|
155
|
+
export const VERDICT_COMMENT = /^(?:QA GATE|\*\*GATE|GATE)\b[^\n]*?\b(PASS|FAIL)\b(?:\s*\([^)\n]*\))?[^\n]*?@\s*`?([0-9a-f]{7,40})`?/;
|
|
156
|
+
export function verdictShasIn(comments) {
|
|
157
|
+
const out = [];
|
|
158
|
+
for (const c of comments) {
|
|
159
|
+
for (const line of String(c.body ?? "").split("\n")) {
|
|
160
|
+
const m = VERDICT_COMMENT.exec(line);
|
|
161
|
+
if (m)
|
|
162
|
+
out.push({ result: m[1].toUpperCase(), sha: m[2] });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return out;
|
|
166
|
+
}
|
|
167
|
+
/** PR comments as verdict records — the second channel. A comment with no typed line yields nothing. */
|
|
168
|
+
export function prVerdictsIn(comments) {
|
|
169
|
+
const out = [];
|
|
170
|
+
for (const c of comments) {
|
|
171
|
+
for (const v of verdictShasIn([c])) {
|
|
172
|
+
out.push({ head: v.sha, ts: Date.parse(String(c.createdAt ?? "")) || 0, from: String(c.author ?? "pr-comment"), result: v.result.toLowerCase(), channel: "pr" });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return out;
|
|
129
176
|
}
|
|
130
177
|
//# sourceMappingURL=gated-head.js.map
|