@cohortapp/agent-sdk 2.18.35 → 2.18.37
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/docs/runbooks/cadence-requeue-storm-recovery.md +186 -0
- package/lib/assurance/first-reply.mjs +16 -0
- package/lib/assurance/notice-plane.mjs +218 -0
- package/lib/assurance/notice-voice.mjs +35 -2
- package/lib/assurance/room-budget.mjs +68 -2
- package/lib/budget-escalate.mjs +42 -4
- package/lib/cadence-bus.mjs +359 -46
- package/lib/comms/machine-status.mjs +377 -0
- package/package.json +1 -1
- package/scripts/ci/check-durable-write-seam.mjs +3 -3
- package/scripts/daemon/assurance.mjs +391 -15
- package/scripts/daemon/cadence-consumer.mjs +165 -9
- package/scripts/daemon/deliver.mjs +104 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/comms/machine-status.mjs — recognising a machine narrating itself, in a
|
|
3
|
+
* sentence nobody has written yet.
|
|
4
|
+
*
|
|
5
|
+
* WHY A SHAPE TEST AND NOT A REGISTER
|
|
6
|
+
*
|
|
7
|
+
* `first-reply.RETIRED_FIRST_REPLIES` is a register of exact sentences, and it
|
|
8
|
+
* works for what it is for: a stale seat re-emitting a line that shipped once.
|
|
9
|
+
* It is structurally incapable of stopping the NEXT one. The history is the
|
|
10
|
+
* proof — each fix added the previous sentence to the register and wrote a new
|
|
11
|
+
* one, and the owner received the new one:
|
|
12
|
+
*
|
|
13
|
+
* 2026-08 "On it." / "Looking now." → registered
|
|
14
|
+
* 2026-09 "Hit a problem — …. Retrying now; …" → registered
|
|
15
|
+
* 2026-09 "Couldn't finish this — …. I've stopped …" → registered
|
|
16
|
+
* 2026-10 "The work on \"X\" broke before it finished: … → NOT registered,
|
|
17
|
+
* I'm running it again now." because it was
|
|
18
|
+
* the current one
|
|
19
|
+
*
|
|
20
|
+
* A blacklist of the past cannot refuse the future. This module refuses the
|
|
21
|
+
* SHAPE, so a sentence the codebase has never contained can be refused on its
|
|
22
|
+
* first outing. `machine-status.test.mjs` invents eleven and pins that.
|
|
23
|
+
*
|
|
24
|
+
* ── WHAT THIS MODULE IS, EXACTLY: A HEURISTIC BACKSTOP ──────────────────────
|
|
25
|
+
*
|
|
26
|
+
* Say this plainly, because the first version of these docs over-claimed and an
|
|
27
|
+
* adversarial pass on 2026-10-02 collected the receipts. The shape test is a
|
|
28
|
+
* VOCABULARY, and a vocabulary is finite: four status sentences invented that
|
|
29
|
+
* day named no apparatus noun on the list and went straight out — they are the
|
|
30
|
+
* last four entries of `INVENTED` in `machine-status.test.mjs`, and they are not
|
|
31
|
+
* quoted here because that test proves its own sentences are absent from this
|
|
32
|
+
* tree. The words they needed are on the lists now. The next four will not be,
|
|
33
|
+
* until someone adds them.
|
|
34
|
+
*
|
|
35
|
+
* THE STRUCTURAL GUARANTEE IS THE ORIGIN GATE, not this file: `deliver()`
|
|
36
|
+
* refuses `kind` in `notice-plane.MACHINE_STATUS_DELIVERY_KINDS`, which covers
|
|
37
|
+
* every emitter in the tree whatever words it chooses, and `noticePlane` decides
|
|
38
|
+
* before the transport is asked at all. This module exists for the residual
|
|
39
|
+
* case — a body deliberately routed as a `reply` that is really machine status —
|
|
40
|
+
* and the honest claim for it is "it catches the family the composers write in,
|
|
41
|
+
* including rewordings of it", which IS mutation-verified: rewording
|
|
42
|
+
* `fallbackNotice`'s template to escape the list turns the 132-sentence cross
|
|
43
|
+
* product red. Treat a sentence it misses as a gap in a list, not a breach of a
|
|
44
|
+
* guarantee.
|
|
45
|
+
*
|
|
46
|
+
* WHAT THE SHAPE ACTUALLY IS — AND WHY IT IS NARROW
|
|
47
|
+
*
|
|
48
|
+
* The owner named the tell himself: "those are templated strings from the board
|
|
49
|
+
* state machine, not composed output". The distinguishing feature is not that
|
|
50
|
+
* the message reports a failure — a real answer may well report one — it is
|
|
51
|
+
* that THE SUBJECT OF THE FAILURE IS THE MACHINE'S OWN APPARATUS. Compare:
|
|
52
|
+
*
|
|
53
|
+
* "the migration broke halfway through, so the staging rows are mixed"
|
|
54
|
+
* → the WORK failed. Substantive. A person needs this. ALLOWED.
|
|
55
|
+
* "the working session ended with an error. I'm running it again now"
|
|
56
|
+
* → the APPARATUS failed. Operator plane. REFUSED.
|
|
57
|
+
*
|
|
58
|
+
* So a refusal requires BOTH halves: an apparatus subject AND a status
|
|
59
|
+
* predicate. One alone is not enough, and that is what keeps the false-positive
|
|
60
|
+
* rate at zero for real answers. A substantive body is additionally exonerated
|
|
61
|
+
* (a link, a code fence, a list, or simply length), because a message carrying
|
|
62
|
+
* content a person can act on is an answer that mentions a failure, not a
|
|
63
|
+
* notice.
|
|
64
|
+
*
|
|
65
|
+
* SHARED VOCABULARY, ONE LIST. `assurance.looksLikePeerOutcomeNotice` already
|
|
66
|
+
* recognises this exact shape INBOUND, to stop a seat acking a peer's notice and
|
|
67
|
+
* spawning a session behind it. It read its own copy of the predicate list.
|
|
68
|
+
* Emitter, inbound recogniser and outbound refusal now read the lists here, so
|
|
69
|
+
* the three cannot drift — the same convention as `narratorPatterns()`: emitter
|
|
70
|
+
* and recogniser are edited together or not at all.
|
|
71
|
+
*
|
|
72
|
+
* PURE. No clock, no disk, no env, no network.
|
|
73
|
+
*
|
|
74
|
+
* @module lib/comms/machine-status
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
"use strict";
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* THE APPARATUS. Nouns that name the machine's own working parts rather than
|
|
81
|
+
* anything the asker cares about.
|
|
82
|
+
*
|
|
83
|
+
* Every entry is a thing that exists only because this is a machine: a session,
|
|
84
|
+
* a time limit it was given, the box it runs on, the retry it is about to do.
|
|
85
|
+
* None of them is a noun a colleague would use about the WORK.
|
|
86
|
+
*
|
|
87
|
+
* `the work on "X"` is here and is the 2026-10-01 sentence's own subject;
|
|
88
|
+
* `the work` bare is NOT, because "the work is nearly done" is a normal thing
|
|
89
|
+
* for a person to be told.
|
|
90
|
+
*
|
|
91
|
+
* @type {readonly RegExp[]}
|
|
92
|
+
*/
|
|
93
|
+
export const APPARATUS_SUBJECT = Object.freeze([
|
|
94
|
+
/\bworking session\b/i,
|
|
95
|
+
/\bthe session (?:running|that was running|handling)\b/i,
|
|
96
|
+
/\bmy (?:session|machine|end|box|daemon)\b/i,
|
|
97
|
+
/\bthe work (?:on ["“'’]|you asked for\b)/i,
|
|
98
|
+
/\btime limit\b/i,
|
|
99
|
+
/\bspend cap\b|\bdaily budget\b/i,
|
|
100
|
+
/\bran? (?:out of|past)\s+(?:memory|its time)\b/i,
|
|
101
|
+
/\bi'?m (?:running it again|retrying(?: it)?|re-?running it)\b/i,
|
|
102
|
+
/\bretrying (?:now|it now)\b/i,
|
|
103
|
+
/\bpicked it back up\b/i,
|
|
104
|
+
// THE NEXT-STEP CLAUSE is an apparatus subject too. Every one of these names
|
|
105
|
+
// a RUN being started again, which is a fact about the machine's own schedule
|
|
106
|
+
// and nothing a person asked about. They are the half that stays constant when
|
|
107
|
+
// an author rewords the failure clause, so they are worth listing explicitly.
|
|
108
|
+
/\bhaving another (?:go|crack)\b/i,
|
|
109
|
+
/\bkicking it off again\b/i,
|
|
110
|
+
/\bthe (?:previous|last|first) attempt\b/i,
|
|
111
|
+
/\brunning it (?:again|back)\b/i,
|
|
112
|
+
/\bwill be (?:attempted|tried|run) again\b/i,
|
|
113
|
+
/\bstarting (?:it )?over\b/i,
|
|
114
|
+
/\bi'?ll take another look\b/i,
|
|
115
|
+
// Added 2026-10-02 after an adversarial pass invented four status sentences
|
|
116
|
+
// that named no apparatus noun on this list and therefore went out. Each of
|
|
117
|
+
// these is a machine's own locus — the side it ran on, the box, the window it
|
|
118
|
+
// was given — and none is a phrase a colleague uses about the WORK.
|
|
119
|
+
/\bon my (?:side|end|box)\b/i,
|
|
120
|
+
/\bthe box (?:it|this|that) was running on\b/i,
|
|
121
|
+
/\bthe (?:window|budget) I (?:had|was given)\b/i,
|
|
122
|
+
]);
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* THE STATUS PREDICATE. What the apparatus is being said to have done.
|
|
126
|
+
*
|
|
127
|
+
* Shared with the inbound recogniser. Note these are all about a RUN ending,
|
|
128
|
+
* never about a result being wrong — "the numbers are off" is a fact about the
|
|
129
|
+
* answer and is not here.
|
|
130
|
+
*
|
|
131
|
+
* @type {readonly RegExp[]}
|
|
132
|
+
*/
|
|
133
|
+
export const STATUS_PREDICATE = Object.freeze([
|
|
134
|
+
/\bbroke before it finished\b/i,
|
|
135
|
+
/\bdidn'?t (?:get through|finish|complete)\b/i,
|
|
136
|
+
/\bnever came back\b/i,
|
|
137
|
+
// THE TIME-LIMIT FAMILY, and it is wider than the one phrase that shipped.
|
|
138
|
+
// `classifyFailure`'s cause is "the work ran past its time limit and got cut
|
|
139
|
+
// off", and the first version of this list only carried "outrun its time
|
|
140
|
+
// limit" (the RETIRED wording) plus "got cut off" — so it caught the shipped
|
|
141
|
+
// sentence by its tail and would have let "…ran past its time limit. Having
|
|
142
|
+
// another go." straight through. The invented-sentence test found that, which
|
|
143
|
+
// is the whole reason that test exists: the list has to cover the FAMILY, not
|
|
144
|
+
// the sample.
|
|
145
|
+
/\b(?:ran |run |gone |is )?past its time limit\b/i,
|
|
146
|
+
/\boutrun its time limit\b/i,
|
|
147
|
+
/\bhit (?:its|the) (?:time limit|limit|cap)\b/i,
|
|
148
|
+
/\bran out of (?:time|memory)\b/i,
|
|
149
|
+
/\bnever (?:finished|returned|completed)\b/i,
|
|
150
|
+
/\bgot cut off\b|\bwas cut off\b|\bfell over\b/i,
|
|
151
|
+
/\bstopped (?:trying|retrying)\b/i,
|
|
152
|
+
/\bflagged it\b/i,
|
|
153
|
+
/\bended (?:with an error|unexpectedly|before it finished)\b/i,
|
|
154
|
+
/\bwas (?:killed|replaced|interrupted)\b/i,
|
|
155
|
+
/\b(?:timed out|hit a problem|couldn'?t finish)\b/i,
|
|
156
|
+
/\b(?:my|the) (?:machine|end|session) restarted\b/i,
|
|
157
|
+
// Added 2026-10-02, same adversarial pass. The list covered a run ENDING in
|
|
158
|
+
// the vocabulary the composers happened to use; these are the same event in
|
|
159
|
+
// ordinary English, and all four escaped.
|
|
160
|
+
/\bdidn'?t go through\b/i,
|
|
161
|
+
/\bgave up (?:partway|part-way|halfway|mid-?way)\b/i,
|
|
162
|
+
/\bstalled out\b/i,
|
|
163
|
+
/\bwasn'?t able to (?:wrap|finish|complete|get through)\b/i,
|
|
164
|
+
]);
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Content that makes a body an ANSWER, not a notice.
|
|
168
|
+
*
|
|
169
|
+
* The exoneration half. A message carrying a link, a code fence, a bulleted
|
|
170
|
+
* list or a table is doing work for the reader; one that merely mentions a
|
|
171
|
+
* failure on the way is not the thing this module exists to stop. Deliberately
|
|
172
|
+
* generous: a false refusal silences a real reply, which is the one outcome
|
|
173
|
+
* worse than the defect being fixed.
|
|
174
|
+
*
|
|
175
|
+
* MEASURED ON THE REMAINDER, NOT ON THE WHOLE BODY — see
|
|
176
|
+
* `machineStatusNarration`. The first version of this module checked these
|
|
177
|
+
* markers against the raw text, so appending `\n\n- retry 2 of 3`, or a trace
|
|
178
|
+
* URL, to the 2026-10-01 sentence bought it a pass: the DECORATION was the
|
|
179
|
+
* substance. An adversarial pass on 2026-10-02 demonstrated all three.
|
|
180
|
+
*
|
|
181
|
+
* @type {readonly RegExp[]}
|
|
182
|
+
*/
|
|
183
|
+
const SUBSTANTIVE_CONTENT = Object.freeze([
|
|
184
|
+
/https?:\/\//,
|
|
185
|
+
/```/,
|
|
186
|
+
/^\s*[-*•]\s+\S/m,
|
|
187
|
+
/^\s*\d+[.)]\s+\S/m,
|
|
188
|
+
/\|.*\|/,
|
|
189
|
+
]);
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Longest a body can be and still be only a status narration.
|
|
193
|
+
*
|
|
194
|
+
* `notice-voice.NOTICE_MAX_CHARS` is 400 and that is the ceiling the notices
|
|
195
|
+
* are actually composed under; 600 leaves room for a degraded sentence wearing
|
|
196
|
+
* a long quoted subject line without reaching into the length where a message
|
|
197
|
+
* is plainly carrying content.
|
|
198
|
+
*/
|
|
199
|
+
export const MACHINE_STATUS_MAX_CHARS = 600;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Least non-narration content a marker needs beside it to count as substance.
|
|
203
|
+
*
|
|
204
|
+
* A bullet, a URL or a fence is a SHAPE, and shapes are cheap: `- retry 2 of 3`
|
|
205
|
+
* and a trace link are both markers and neither is an answer. This is the floor
|
|
206
|
+
* that separates them from "Three things to decide:" followed by three of them.
|
|
207
|
+
* Low on purpose — it is a sanity bar against decoration, not a judgement about
|
|
208
|
+
* how much an answer must say.
|
|
209
|
+
*/
|
|
210
|
+
export const SUBSTANTIVE_MIN_CHARS = 60;
|
|
211
|
+
|
|
212
|
+
/** @param {readonly RegExp[]} list @param {string} s */
|
|
213
|
+
function anyMatch(list, s) {
|
|
214
|
+
for (const re of list) if (re.test(s)) return true;
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* One line, normalised the way the register normalises, so a copy that went
|
|
220
|
+
* through a chat client's smart quotes still matches.
|
|
221
|
+
*
|
|
222
|
+
* @param {unknown} text
|
|
223
|
+
* @returns {string}
|
|
224
|
+
*/
|
|
225
|
+
function flatten(text) {
|
|
226
|
+
return String(text == null ? "" : text)
|
|
227
|
+
.replace(/[‘’ʼ]/g, "'")
|
|
228
|
+
.replace(/[“”]/g, '"')
|
|
229
|
+
.replace(/[—–]/g, "-")
|
|
230
|
+
.replace(/\s+/g, " ")
|
|
231
|
+
.trim();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Is this body a machine narrating its own internal failure?
|
|
236
|
+
*
|
|
237
|
+
* Returns the matched apparatus phrase (truthy, useful in a refusal message) or
|
|
238
|
+
* null. Both halves are required; a substantive body is exonerated whatever it
|
|
239
|
+
* matches.
|
|
240
|
+
*
|
|
241
|
+
* @param {unknown} text
|
|
242
|
+
* @returns {string|null} the apparatus phrase that matched, or null
|
|
243
|
+
*/
|
|
244
|
+
/**
|
|
245
|
+
* Split a body into the smallest units worth judging separately: lines first
|
|
246
|
+
* (so a fence, a list row and a table row stay whole), then sentences within a
|
|
247
|
+
* line.
|
|
248
|
+
*
|
|
249
|
+
* @param {string} raw
|
|
250
|
+
* @returns {string[]}
|
|
251
|
+
*/
|
|
252
|
+
function pieces(raw) {
|
|
253
|
+
const out = [];
|
|
254
|
+
for (const line of raw.split(/\r?\n/)) {
|
|
255
|
+
const trimmed = line.trim();
|
|
256
|
+
if (!trimmed) continue;
|
|
257
|
+
for (const sentence of trimmed.split(/(?<=[.!?])\s+/)) {
|
|
258
|
+
if (sentence.trim()) out.push(sentence.trim());
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return out;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Is this body a machine narrating its own internal failure?
|
|
266
|
+
*
|
|
267
|
+
* Returns the matched apparatus phrase (truthy, useful in a refusal message) or
|
|
268
|
+
* null. Both halves are required; a body whose NON-NARRATION remainder carries
|
|
269
|
+
* substance is exonerated.
|
|
270
|
+
*
|
|
271
|
+
* ── WHY THE EXONERATION IS MEASURED ON THE REMAINDER ────────────────────────
|
|
272
|
+
*
|
|
273
|
+
* Because the first version measured it on the whole body, and an adversarial
|
|
274
|
+
* pass on 2026-10-02 walked the 2026-10-01 sentence straight through it three
|
|
275
|
+
* ways: append `\n\n- retry 2 of 3` (a list marker), append a trace URL (a
|
|
276
|
+
* link), or let a long quoted subject line push the body past
|
|
277
|
+
* `MACHINE_STATUS_MAX_CHARS`. In all three the thing providing the "substance"
|
|
278
|
+
* was the narration itself, or decoration about the same dead run. A body does
|
|
279
|
+
* not become an answer by wearing a bullet.
|
|
280
|
+
*
|
|
281
|
+
* So: strip the pieces that ARE narration, then ask whether what is left is
|
|
282
|
+
* worth a person's attention. A piece that carries a marker is never treated as
|
|
283
|
+
* narration, which is what keeps "the working session ended with an error, full
|
|
284
|
+
* log at https://… — the cause is on line 212" an answer: it points the reader
|
|
285
|
+
* at evidence inside the same sentence.
|
|
286
|
+
*
|
|
287
|
+
* WHAT THIS STILL DOES NOT CATCH, stated plainly because the docs over-claimed
|
|
288
|
+
* once already: a body padded with 600+ characters of anything at all is
|
|
289
|
+
* exonerated. That is deliberate. Length is the cheapest reliable signal of a
|
|
290
|
+
* real reply, and refusing long bodies would eat the work product — the one
|
|
291
|
+
* outcome worse than the defect. This function is a HEURISTIC BACKSTOP. The
|
|
292
|
+
* structural guarantee is the origin gate in `deliver()`, which refuses every
|
|
293
|
+
* machine-status `kind` regardless of what the body says.
|
|
294
|
+
*
|
|
295
|
+
* @param {unknown} text
|
|
296
|
+
* @returns {string|null} the apparatus phrase that matched, or null
|
|
297
|
+
*/
|
|
298
|
+
export function machineStatusNarration(text) {
|
|
299
|
+
const raw = String(text == null ? "" : text);
|
|
300
|
+
if (!raw.trim()) return null;
|
|
301
|
+
|
|
302
|
+
let apparatus = null;
|
|
303
|
+
let predicate = false;
|
|
304
|
+
const rest = [];
|
|
305
|
+
for (const piece of pieces(raw)) {
|
|
306
|
+
// A piece carrying a marker is content, never narration — even when it also
|
|
307
|
+
// narrates. It is doing something for the reader inside the same breath.
|
|
308
|
+
if (anyMatch(SUBSTANTIVE_CONTENT, piece)) { rest.push(piece); continue; }
|
|
309
|
+
const flat = flatten(piece);
|
|
310
|
+
const hasPredicate = anyMatch(STATUS_PREDICATE, flat);
|
|
311
|
+
let app = null;
|
|
312
|
+
for (const re of APPARATUS_SUBJECT) {
|
|
313
|
+
const m = flat.match(re);
|
|
314
|
+
if (m) { app = m[0]; break; }
|
|
315
|
+
}
|
|
316
|
+
if (!hasPredicate && !app) { rest.push(piece); continue; }
|
|
317
|
+
if (app && !apparatus) apparatus = app;
|
|
318
|
+
if (hasPredicate) predicate = true;
|
|
319
|
+
}
|
|
320
|
+
// BOTH HALVES, and they may sit in different sentences of the same narration —
|
|
321
|
+
// the shipped sentence put the apparatus and the failure in one clause and
|
|
322
|
+
// "I'm running it again now" in the next.
|
|
323
|
+
if (!apparatus || !predicate) return null;
|
|
324
|
+
|
|
325
|
+
const remainder = rest.join("\n").trim();
|
|
326
|
+
if (remainder.length > MACHINE_STATUS_MAX_CHARS) return null;
|
|
327
|
+
if (remainder.length >= SUBSTANTIVE_MIN_CHARS && anyMatch(SUBSTANTIVE_CONTENT, remainder)) return null;
|
|
328
|
+
return apparatus;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/** The strict judgement, as a boolean. Both halves required. */
|
|
332
|
+
export function readsAsStatusNarration(text) {
|
|
333
|
+
return machineStatusNarration(text) != null;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* THE PREDICATE HALF ALONE — for the INBOUND question only.
|
|
338
|
+
*
|
|
339
|
+
* WHY THE TWO DIRECTIONS NEED DIFFERENT THRESHOLDS, which is the one thing to
|
|
340
|
+
* understand before reusing either of these.
|
|
341
|
+
*
|
|
342
|
+
* OUTBOUND (`machineStatusNarration`) has no idea who wrote the body it is
|
|
343
|
+
* handed, so a false refusal silences a real reply to a real person. It must
|
|
344
|
+
* therefore demand the apparatus subject as well: "the export didn't get
|
|
345
|
+
* through" is a fact about the WORK and has to go out.
|
|
346
|
+
*
|
|
347
|
+
* INBOUND (`assurance.looksLikePeerOutcomeNotice`) has already established that
|
|
348
|
+
* the sender is an agent seat, that the body is short, first-person, and carries
|
|
349
|
+
* no question or imperative. At that point the predicate alone is sufficient, and
|
|
350
|
+
* demanding an apparatus subject too would be strictly worse: a peer's generated
|
|
351
|
+
* notice ("the Q3 export didn't get through on my side — it never came back, so
|
|
352
|
+
* I've stopped trying and flagged it") names no apparatus at all, and letting it
|
|
353
|
+
* through earns it an ack and a 15-45 minute session behind it. That is the
|
|
354
|
+
* 25/27/30 Aug loop and the 142-of-188 day. A false consume there costs one
|
|
355
|
+
* peer's line; a false pass costs a session.
|
|
356
|
+
*
|
|
357
|
+
* So: one shared VOCABULARY, two thresholds, both stated. Collapsing them to one
|
|
358
|
+
* function lost the inbound coverage, and `notice-emission.test.mjs` caught it.
|
|
359
|
+
*
|
|
360
|
+
* @param {unknown} text
|
|
361
|
+
* @returns {boolean}
|
|
362
|
+
*/
|
|
363
|
+
export function hasStatusPredicate(text) {
|
|
364
|
+
const s = flatten(text);
|
|
365
|
+
if (!s) return false;
|
|
366
|
+
return anyMatch(STATUS_PREDICATE, s);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export default {
|
|
370
|
+
APPARATUS_SUBJECT,
|
|
371
|
+
STATUS_PREDICATE,
|
|
372
|
+
MACHINE_STATUS_MAX_CHARS,
|
|
373
|
+
SUBSTANTIVE_MIN_CHARS,
|
|
374
|
+
machineStatusNarration,
|
|
375
|
+
readsAsStatusNarration,
|
|
376
|
+
hasStatusPredicate,
|
|
377
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cohortapp/agent-sdk",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.37",
|
|
4
4
|
"description": "Cohort Agent SDK — autonomous AI colleague runtime. Deploy senior AI colleagues on dedicated Mac minis, wired to the Cohort operating surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -65,11 +65,11 @@ const REPO_ROOT = path.resolve(fileURLToPath(new URL(".", import.meta.url)), "..
|
|
|
65
65
|
* @type {Record<string, string>}
|
|
66
66
|
*/
|
|
67
67
|
export const SANCTIONED_DIRECT_WRITES = {
|
|
68
|
-
"lib/cadence-bus.mjs:
|
|
68
|
+
"lib/cadence-bus.mjs:330":
|
|
69
69
|
"acquireScheduleLock: O_EXCL create. A lock published by rename is not a lock — two processes could both succeed.",
|
|
70
|
-
"lib/cadence-bus.mjs:
|
|
70
|
+
"lib/cadence-bus.mjs:338":
|
|
71
71
|
"acquireScheduleLock: reclaim of a lock already proven stale by mtime; must land in place under the same name.",
|
|
72
|
-
"lib/cadence-bus.mjs:
|
|
72
|
+
"lib/cadence-bus.mjs:343":
|
|
73
73
|
"acquireScheduleLock: second O_EXCL attempt after the stale holder vanished.",
|
|
74
74
|
"lib/collective/capture-slots.mjs:152":
|
|
75
75
|
"tryAcquireLock: O_EXCL create of a capture slot/session lock (the machine-wide capture ceiling). A lock published by rename is not a lock — two workers could both hold one slot.",
|