@cotal-ai/cli 0.48.2 → 0.50.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.
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +8 -0
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts +167 -6
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +151 -61
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +175 -11
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/down.d.ts +18 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +99 -3
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/join.d.ts.map +1 -1
- package/dist/commands/join.js +9 -1
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/meshes.js +5 -5
- package/dist/commands/meshes.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +2 -8
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +1 -1
- package/dist/commands/spawn-manifest.d.ts.map +1 -1
- package/dist/commands/spawn-manifest.js +3 -2
- package/dist/commands/spawn-manifest.js.map +1 -1
- package/dist/commands/status.d.ts +11 -3
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +176 -13
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/up.d.ts +13 -0
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +65 -5
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +19 -7
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/use.js +2 -2
- package/dist/commands/use.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/auth-proc.d.ts.map +1 -1
- package/dist/lib/auth-proc.js +2 -1
- package/dist/lib/auth-proc.js.map +1 -1
- package/dist/lib/control.d.ts +28 -1
- package/dist/lib/control.d.ts.map +1 -1
- package/dist/lib/control.js +58 -11
- package/dist/lib/control.js.map +1 -1
- package/dist/lib/delivery-proc.d.ts +22 -5
- package/dist/lib/delivery-proc.d.ts.map +1 -1
- package/dist/lib/delivery-proc.js +82 -18
- package/dist/lib/delivery-proc.js.map +1 -1
- package/dist/lib/delivery-responder.d.ts +92 -0
- package/dist/lib/delivery-responder.d.ts.map +1 -0
- package/dist/lib/delivery-responder.js +78 -0
- package/dist/lib/delivery-responder.js.map +1 -0
- package/dist/lib/manager-proc.d.ts +15 -13
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +38 -7
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/restore.d.ts.map +1 -1
- package/dist/lib/restore.js +6 -4
- package/dist/lib/restore.js.map +1 -1
- package/dist/lib/self-exec.d.ts +15 -1
- package/dist/lib/self-exec.d.ts.map +1 -1
- package/dist/lib/self-exec.js +30 -3
- package/dist/lib/self-exec.js.map +1 -1
- package/dist/lib/systemd-supervision.d.ts +15 -0
- package/dist/lib/systemd-supervision.d.ts.map +1 -0
- package/dist/lib/systemd-supervision.js +64 -0
- package/dist/lib/systemd-supervision.js.map +1 -0
- package/dist/lib/transient.d.ts +1 -10
- package/dist/lib/transient.d.ts.map +1 -1
- package/dist/lib/transient.js +4 -24
- package/dist/lib/transient.js.map +1 -1
- package/dist/seed/reconcile.d.ts.map +1 -1
- package/dist/seed/reconcile.js +27 -1
- package/dist/seed/reconcile.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-proc.d.ts","sourceRoot":"","sources":["../../src/lib/delivery-proc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delivery-proc.d.ts","sourceRoot":"","sources":["../../src/lib/delivery-proc.ts"],"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AAE,aAA6B,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAuFhJ;AAED;;;mDAGmD;AACnD,wBAAsB,YAAY,CAChC,KAAK,GAAE,aAA6B,EACpC,MAAM,CAAC,EAAE,QAAQ,EACjB,KAAK,GAAE,MAAsB,EAC7B,WAAW,GAAE,aAAkC,GAC9C,OAAO,CAAC,IAAI,CAAC,CA4Ff;AAED;;;;+FAI+F;AAC/F,wBAAsB,kBAAkB,CAAC,CAAC,GAAE,IAAS,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAa9G"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { existsSync, openSync, closeSync, writeFileSync, readFileSync, rmSync } from "node:fs";
|
|
3
|
-
import { DEFAULT_SERVER, LEASE_TTL_MS, mintCreds, newIdentity, waitForDeliveryLease, } from "@cotal-ai/core";
|
|
4
|
-
import { DELIVERY_CREDS_KIND, DELIVERY_LOGFILE, DELIVERY_PIDFILE, authDir, canonicalLocalProcessPath, deliveryCredsKey, findCotalRoot, getSpaceAuth, listSpaceAccounts, localProcessPath, parsePid, probeLiveness, reclaimDeadPreUpgradeRecord, segmentedKey, workspaceSecretStore, identityLegacyWarning, identityRefusal, identityUncertaintyRefusal, removeIdentityPin, verifyIdentityPin, writeIdentityPin } from "@cotal-ai/workspace";
|
|
5
|
-
import { selfArgv } from "./self-exec.js";
|
|
3
|
+
import { DEFAULT_SERVER, LEASE_TTL_MS, mintCreds, newIdentity, waitForDeliveryLease, deliveryLeaseHolderFor, } from "@cotal-ai/core";
|
|
4
|
+
import { DELIVERY_CREDS_KIND, DELIVERY_LOGFILE, DELIVERY_PIDFILE, authDir, canonicalLocalProcessPath, commandIsCotalDelivery, deliveryCredsKey, findCotalRoot, getSpaceAuth, listSpaceAccounts, localProcessPath, parsePid, probeLiveness, readProcessCommand, reclaimDeadPreUpgradeRecord, segmentedKey, workspaceSecretStore, identityLegacyWarning, identityRefusal, identityUncertaintyRefusal, removeIdentityPin, verifyIdentityPin, writeIdentityPin } from "@cotal-ai/workspace";
|
|
5
|
+
import { selfArgv, displayCmd } from "./self-exec.js";
|
|
6
6
|
import { resolveRuntimeSpace } from "./status.js";
|
|
7
7
|
import { cotalRoot } from "./paths.js";
|
|
8
8
|
import { MANAGER_PID_PATH, ensureManager, managerHasDeliveryMarker, managerLiveness, stopManager } from "./manager-proc.js";
|
|
9
|
+
import { RESPONDER_UNBOUND_CONSEQUENCE } from "./delivery-responder.js";
|
|
9
10
|
/** The space this folder's commands mean, and the per-space record paths over it. The daemon is
|
|
10
11
|
* minted a space-scoped cred and binds that space's durables, so a root-scoped record gave one root
|
|
11
12
|
* one daemon by filename; every helper below therefore takes the space it is answering about. */
|
|
@@ -24,8 +25,16 @@ const deliveryCredsKeysToClear = (space) => [segmentedKey(DELIVERY_CREDS_KIND, s
|
|
|
24
25
|
/** The recorded daemon's liveness, THREE-VALUED plus absent. See {@link managerLiveness} for why the
|
|
25
26
|
* boolean collapse is the defect: `unknown` is reachable on a real kernel (a seccomp
|
|
26
27
|
* `SECCOMP_RET_ERRNO` filter or an LSM policy answers `kill(pid, 0)` with an arbitrary errno and
|
|
27
|
-
* libuv preserves it), and both ways of folding it into a boolean fail silently.
|
|
28
|
-
|
|
28
|
+
* libuv preserves it), and both ways of folding it into a boolean fail silently.
|
|
29
|
+
*
|
|
30
|
+
* `foreign` is the same fifth state {@link managerLiveness} already carries, for the same reason and
|
|
31
|
+
* under the same rule (#1528): a live pid is believed only once the process behind it has been READ
|
|
32
|
+
* and names the delivery daemon. A record outliving its daemon is eventually re-pointed at an
|
|
33
|
+
* unrelated process by pid reuse, and from `kill(pid, 0)` alone that reads as a healthy daemon
|
|
34
|
+
* forever. ATTRIBUTION MAY ONLY DOWNGRADE ON PROOF: a read that failed, a platform with no argv
|
|
35
|
+
* source, and a process that died during the read all leave the record trusted, which is exactly
|
|
36
|
+
* how every caller behaved before this existed. */
|
|
37
|
+
export function deliveryLiveness(probe = probeLiveness, space = folderSpace(), readCommand = readProcessCommand) {
|
|
29
38
|
const p = PID_PATH(space);
|
|
30
39
|
if (!existsSync(p))
|
|
31
40
|
return "absent";
|
|
@@ -35,7 +44,13 @@ export function deliveryLiveness(probe = probeLiveness, space = folderSpace()) {
|
|
|
35
44
|
const pid = parsePid(raw);
|
|
36
45
|
if (pid === undefined)
|
|
37
46
|
return "unattributable"; // see managerLiveness: never fold this into absent
|
|
38
|
-
|
|
47
|
+
const liveness = probe(pid);
|
|
48
|
+
if (liveness !== "alive")
|
|
49
|
+
return liveness;
|
|
50
|
+
const cmd = readCommand(pid);
|
|
51
|
+
if (cmd.kind !== "command")
|
|
52
|
+
return "alive"; // gone/unreadable: nothing was established about it
|
|
53
|
+
return commandIsCotalDelivery(cmd.command) ? "alive" : "foreign";
|
|
39
54
|
}
|
|
40
55
|
/** True only if the daemon is PROVABLY running. Callers that ACT on the answer take
|
|
41
56
|
* {@link deliveryLiveness} instead; this cannot express "cannot tell". */
|
|
@@ -94,8 +109,10 @@ export function startDeliveryDetached(o = {}) {
|
|
|
94
109
|
// See startManagerDetached: reclaim a provably dead pre-upgrade record before claiming the
|
|
95
110
|
// canonical slot, and refuse rather than start a second daemon beside a live one.
|
|
96
111
|
reclaimDeadPreUpgradeRecord(DELIVERY_PIDFILE, ctx(space));
|
|
97
|
-
|
|
112
|
+
// Before the log is opened, for the reason startManagerDetached states: a `selfArgv` refusal
|
|
113
|
+
// (#1629) must not leave a delivery log and a leaked descriptor behind.
|
|
98
114
|
const [node, ...self] = selfArgv();
|
|
115
|
+
const fd = openSync(canonicalLocalProcessPath(DELIVERY_LOGFILE, ctx(space)), "a");
|
|
99
116
|
const args = [
|
|
100
117
|
...self,
|
|
101
118
|
"deliver",
|
|
@@ -128,7 +145,13 @@ export function startDeliveryDetached(o = {}) {
|
|
|
128
145
|
* while an old Plane-3-hosting manager is live (the preflight should have stopped it) so the daemon
|
|
129
146
|
* never double-binds. Mints a SCOPED `delivery` cred from the local signer ONCE, writes it to
|
|
130
147
|
* `.cotal/delivery.creds` (0600), and launches the daemon WITHOUT signer access. Best-effort — callers
|
|
131
|
-
* treat it as non-fatal (a missing daemon degrades durable delivery, never live).
|
|
148
|
+
* treat it as non-fatal (a missing daemon degrades durable delivery, never live).
|
|
149
|
+
*
|
|
150
|
+
* RETURNS TWO FACTS, NOT ONE (#1576). `running` is about the PROCESS; `responderBound` is about the
|
|
151
|
+
* `ctl.delivery` responder, which is what spawn, retirement and join actually require. They are not
|
|
152
|
+
* the same question, and collapsing them into one boolean is how a mesh came to report healthy for
|
|
153
|
+
* 22 hours while none of those three operations could complete. `responderBound` is false when the
|
|
154
|
+
* readiness wait elapsed without the lease flipping ready, and absent when no daemon applies. */
|
|
132
155
|
export async function ensureDelivery(o = {}, probe = probeLiveness) {
|
|
133
156
|
if (!hasAuth())
|
|
134
157
|
return { running: false }; // open dev mode — no daemon, agents are live-only
|
|
@@ -169,11 +192,17 @@ export async function ensureDelivery(o = {}, probe = probeLiveness) {
|
|
|
169
192
|
// responder for their boot self-join. Non-fatal on timeout: the boot self-join reconciles with backoff,
|
|
170
193
|
// which is the real safety net for a slow start or a later outage.
|
|
171
194
|
//
|
|
172
|
-
// WHOSE readiness matters. A fresh launch waits for THE DAEMON IT JUST STARTED
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
|
|
195
|
+
// WHOSE readiness matters. A fresh launch waits for THE DAEMON IT JUST STARTED, so the wait cannot
|
|
196
|
+
// be answered by some other daemon's - or a dead one's - leftover `ready:true` record. A reuse
|
|
197
|
+
// adopts a daemon that was already running and cannot know its id, so it waits for any.
|
|
198
|
+
//
|
|
199
|
+
// THROUGH `deliveryLeaseHolderFor`, NOT `id.id`. This asked for the bare nkey, while the daemon's
|
|
200
|
+
// endpoint stamps the PRINCIPAL dot-form into the row, so the comparison could never be true: every
|
|
201
|
+
// fresh launch ran the full 8s timeout and then reported a ready daemon as not-ready. It failed in
|
|
202
|
+
// the safe direction, which is why it went unnoticed, but the #837 guarantee this argument exists
|
|
203
|
+
// to enforce was not actually in force - it was defeated by always-false rather than by accepting
|
|
204
|
+
// anything. Found in review (#1318), where the same two namespaces were confused a third time.
|
|
205
|
+
const ready = await waitForDeliveryLease({ servers: server, space, creds, id: id.id, holder: launched !== undefined ? deliveryLeaseHolderFor(creds) : undefined });
|
|
177
206
|
// A launch we performed whose process is GONE is not a slow start, and reporting it as one is the
|
|
178
207
|
// #837 false-green: the daemon lost the single-flight CAS to a live-or-stale lease and exited (it
|
|
179
208
|
// says so in `.cotal/delivery.log`), while this returned `running: true` over a pidfile fronting a
|
|
@@ -184,14 +213,31 @@ export async function ensureDelivery(o = {}, probe = probeLiveness) {
|
|
|
184
213
|
`Refusing to report a daemon that is not running. The daemon logged its own reason to ${canonicalLocalProcessPath(DELIVERY_LOGFILE, ctx(space))}.\n` +
|
|
185
214
|
`NEXT: read that log; if no other daemon is running, wait for the stale lease to expire and re-run.`);
|
|
186
215
|
if (!ready)
|
|
187
|
-
|
|
188
|
-
|
|
216
|
+
// #1576. THIS USED TO PRINT A PROMISE AND RETURN SUCCESS, and that combination is the defect.
|
|
217
|
+
// The promise was true — `reconcileBootJoin` really does retry with capped backoff and really
|
|
218
|
+
// does establish the memberships once a daemon binds — but it was the ONLY thing said, at info
|
|
219
|
+
// level, once, and it described the RECOVERY rather than the state. A reporter's fleet then ran
|
|
220
|
+
// 22 hours in exactly this condition: `cotal up` alive, systemctl green, and spawn, retirement
|
|
221
|
+
// and join all failing, with nothing anywhere naming the responder.
|
|
222
|
+
//
|
|
223
|
+
// So the line now names the CONSEQUENCE first (what does not work while this holds), then the
|
|
224
|
+
// recovery, and it says the wait is open-ended rather than implying it has been handled. The
|
|
225
|
+
// reconcile keeps its sentence because an operator who respawns agents over this loses live
|
|
226
|
+
// sessions for nothing — the daemon re-mints and the agents rejoin on their own.
|
|
227
|
+
console.error(`! delivery daemon started but its responder is NOT BOUND yet (the shard-0 lease has not flipped ready) - ${RESPONDER_UNBOUND_CONSEQUENCE}.\n` +
|
|
228
|
+
` This does not time out on its own: the boot durable joins retry with backoff and WILL reconcile when the responder binds, however long that takes, and agents rejoin WITHOUT being respawned.\n` +
|
|
229
|
+
` Check it with \`${displayCmd()} status --components\` (delivery row) and read ${canonicalLocalProcessPath(DELIVERY_LOGFILE, ctx(space))} for the daemon's own reason.`);
|
|
230
|
+
// The caller hears WHICH of the two states it got. `running` still means "a daemon process is
|
|
231
|
+
// there" (unchanged for every existing caller), but a caller that needs the responder — anything
|
|
232
|
+
// that is about to spawn, retire or join — can now ask instead of assuming, which it could not do
|
|
233
|
+
// when this returned a bare `running: true` over an admittedly unbound responder.
|
|
234
|
+
return { running: true, responderBound: ready };
|
|
189
235
|
}
|
|
190
236
|
/** Stop the detached delivery daemon if we started one, and drop its creds from the store. The pid
|
|
191
237
|
* kill runs even if the creds delete fails (finally) — a delete error must never leave the daemon
|
|
192
238
|
* alive to outlive the teardown and reattach to a restarted broker; the error still propagates
|
|
193
239
|
* after the kill so the caller can surface it. */
|
|
194
|
-
export async function stopDelivery(probe = probeLiveness, signal, space = folderSpace()) {
|
|
240
|
+
export async function stopDelivery(probe = probeLiveness, signal, space = folderSpace(), readCommand = readProcessCommand) {
|
|
195
241
|
const send = signal ?? ((pid, sig) => process.kill(pid, sig));
|
|
196
242
|
const p = PID_PATH(space);
|
|
197
243
|
// ORDER MATTERS, AND IT USED TO BE BACKWARDS. The credential was deleted FIRST, in a try whose
|
|
@@ -235,6 +281,19 @@ export async function stopDelivery(probe = probeLiveness, signal, space = folder
|
|
|
235
281
|
await removeRecords();
|
|
236
282
|
return;
|
|
237
283
|
}
|
|
284
|
+
// A LIVE pid that is provably NOT a delivery daemon is never signalled, the same rule
|
|
285
|
+
// `stopManager` applies (#1528). The record outlived its daemon and the number was reused, so
|
|
286
|
+
// SIGTERM here would kill an unrelated process. The record is removed because it is PROVABLY
|
|
287
|
+
// stale, and what was found is printed: an operator told only "already stopped" would not learn
|
|
288
|
+
// that their pidfile was pointing at a stranger.
|
|
289
|
+
if (before === "alive") {
|
|
290
|
+
const cmd = readCommand(pid);
|
|
291
|
+
if (cmd.kind === "command" && !commandIsCotalDelivery(cmd.command)) {
|
|
292
|
+
console.error(`! recorded delivery daemon pid ${pid} is alive but is running \`${cmd.command}\`, which is not a delivery daemon - not signalling it; removing the stale record instead.`);
|
|
293
|
+
await removeRecords();
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
238
297
|
if (before === "unknown")
|
|
239
298
|
throw new Error(`refusing to stop the delivery daemon (pid ${pid}): its liveness cannot be determined (a seccomp filter or LSM policy answers kill(pid,0) with an arbitrary errno).\n` +
|
|
240
299
|
`The pidfile and standing credential are LEFT IN PLACE: removing them would strand a daemon that may still be connected, with its renewal source gone.\n` +
|
|
@@ -280,7 +339,12 @@ export async function ensureControlPlane(o = {}) {
|
|
|
280
339
|
// start another's.
|
|
281
340
|
const space = o.space ?? folderSpace();
|
|
282
341
|
await stopOldHostingManagerIfPresent(probeLiveness, undefined, space);
|
|
283
|
-
|
|
284
|
-
return
|
|
342
|
+
// The delivery answer is CARRIED, not discarded (#1576). This used to drop `ensureDelivery`'s
|
|
343
|
+
// result on the floor and return only the manager's, so `cotal up` had no way to say that the
|
|
344
|
+
// dependency every spawn/retirement/join needs had not come up — the boot line inside
|
|
345
|
+
// `ensureDelivery` was the only trace, and it read as a progress note.
|
|
346
|
+
const delivery = await ensureDelivery({ ...o, space });
|
|
347
|
+
const manager = await ensureManager({ ...o, space });
|
|
348
|
+
return { ...manager, responderBound: delivery.responderBound };
|
|
285
349
|
}
|
|
286
350
|
//# sourceMappingURL=delivery-proc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-proc.js","sourceRoot":"","sources":["../../src/lib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AAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE DELIVERY RESPONDER AXIS (#1576) — one reader, used by every surface that answers
|
|
3
|
+
* "can this mesh spawn, retire and join right now".
|
|
4
|
+
*
|
|
5
|
+
* THE DEFECT THIS MODULE EXISTS TO REMOVE. The delivery daemon's PROCESS and its RESPONDER are two
|
|
6
|
+
* different facts, and every operator-facing surface used to report the first while the second was
|
|
7
|
+
* what the mesh actually depends on. A reporter ran a 30-agent fleet for 22 hours against a daemon
|
|
8
|
+
* that never bound: `systemctl is-active` said active (the PARENT `cotal up` was alive), `cotal ps`
|
|
9
|
+
* listed the agents, and bare `cotal status` printed `delivery running (pid 291)` — the identical
|
|
10
|
+
* line it prints when the responder IS bound. Spawn, retirement and join were all failing the whole
|
|
11
|
+
* time, and the only place the real cause was ever named was inside one PTY, on one operation.
|
|
12
|
+
*
|
|
13
|
+
* THE SOURCE OF TRUTH IS THE SHARD-0 LEASE `ready` FLAG, and it is not a new one: the daemon
|
|
14
|
+
* CAS-creates its lease `ready:false` BEFORE binding (the single-flight gate that stops two daemons
|
|
15
|
+
* splitting a durable), then flips it to `ready:true` only AFTER `startPlane3` has bound the
|
|
16
|
+
* `ctl.delivery` responder and the fan-out/reader loops. So `ready === true` is the only fact that
|
|
17
|
+
* distinguishes "the responder is bound" from "a process exists" (pidfile) or "a slot was claimed"
|
|
18
|
+
* (lease present, not ready). See `DeliveryLeaseInfo` in core and the flip site in the daemon.
|
|
19
|
+
*
|
|
20
|
+
* WHY A SHARED MODULE RATHER THAN A SECOND READ. `--components` already computed this correctly and
|
|
21
|
+
* bare `status` did not, which is precisely how the two surfaces came to disagree about a mesh's
|
|
22
|
+
* health. Both now reduce through {@link deliveryResponderFromLease}, so a future change cannot fix
|
|
23
|
+
* one and leave the other green. It reads; it never mints, writes or repairs.
|
|
24
|
+
*
|
|
25
|
+
* The two surfaces differ in ONE deliberate respect, and the split is in the read, not the grading.
|
|
26
|
+
* Bare `status` reduces a failed read to `unchecked` and so calls {@link deliveryResponderState},
|
|
27
|
+
* which wraps the read. `--components` must tell a missing lease stream apart from a refused read
|
|
28
|
+
* and reports them as different verdicts, so it does its own read and calls the pure classifier
|
|
29
|
+
* directly. Neither surface grades a lease by any other rule.
|
|
30
|
+
*/
|
|
31
|
+
import type { DeliveryLeaseInfo } from "@cotal-ai/core";
|
|
32
|
+
/** What is known about the responder, as opposed to the process.
|
|
33
|
+
*
|
|
34
|
+
* `unknown` IS A FIRST-CLASS ANSWER AND MUST NOT BE FOLDED INTO `bound`. A lease read can fail for
|
|
35
|
+
* reasons that say nothing about the daemon (no target resolved, broker unreachable, a denied read
|
|
36
|
+
* on a mesh whose creds predate the read grant). Reporting any of those as health is the original
|
|
37
|
+
* defect in a new place, so the renderer says the axis was not checked and names the surface that
|
|
38
|
+
* can check it.
|
|
39
|
+
*
|
|
40
|
+
* `stale` IS ALSO NOT `bound`. A ready record whose holder is not the daemon this workspace launched
|
|
41
|
+
* is a dead or foreign daemon's leftover, and the mesh it describes cannot spawn, retire or join. It
|
|
42
|
+
* is kept distinct from `unbound` because the OPERATOR'S NEXT MOVE DIFFERS: an unbound responder is
|
|
43
|
+
* usually still starting and wants waiting, while a stale record wants the TTL to expire (or a real
|
|
44
|
+
* replacement to take the slot) and is evidence the daemon DIED rather than never arrived. */
|
|
45
|
+
export type DeliveryResponderState = "bound" | "unbound" | "stale" | "unknown";
|
|
46
|
+
/** The consequence, in the operator's terms rather than the daemon's.
|
|
47
|
+
*
|
|
48
|
+
* This sentence is the whole point of the fix. The boot path used to print a PROMISE
|
|
49
|
+
* ("boot durable joins will reconcile when it is") and nothing else: true, but it told an operator
|
|
50
|
+
* nothing about what was broken MEANWHILE, so a 22-hour outage read as a progress note. The
|
|
51
|
+
* reconcile is real and does run once a daemon binds; what nobody was told is that until it binds,
|
|
52
|
+
* these three operations cannot complete. */
|
|
53
|
+
export declare const RESPONDER_UNBOUND_CONSEQUENCE = "no spawn, no retirement, no join until it binds";
|
|
54
|
+
/** Classify a shard-0 lease record. `undefined` means the lease key is absent, which on a mesh that
|
|
55
|
+
* HAS a delivery daemon recorded is an unbound responder, not a missing opinion: the daemon creates
|
|
56
|
+
* its lease before it binds, so no lease at all means nothing has even claimed the slot.
|
|
57
|
+
*
|
|
58
|
+
* `expectedHolder` IS NOT OPTIONAL INFORMATION WHEN IT IS KNOWABLE, and leaving it out was a real
|
|
59
|
+
* defect in the first cut of this fix, caught by walking the one path no cell walked. A daemon that
|
|
60
|
+
* is SIGKILLed (or dies any way that skips `releaseDeliveryLease`) leaves its `ready:true` record in
|
|
61
|
+
* the bucket for the REST OF THE BUCKET TTL. Measured on a real broker: the record survives the
|
|
62
|
+
* holder's death and `ready` stays true for seconds afterwards. `ready` alone therefore answers
|
|
63
|
+
* "did SOME daemon bind, recently enough that its record has not expired", which is NOT the question
|
|
64
|
+
* an operator is asking. Core learned this at #837 — `waitForDeliveryLease` demands a named holder
|
|
65
|
+
* for exactly this reason — and a surface whose whole purpose is to stop reporting false health had
|
|
66
|
+
* no business asking the weaker question.
|
|
67
|
+
*
|
|
68
|
+
* THE REALISTIC SHAPE IS A RESTART, not a contrived kill: the daemon dies, `cotal up` starts a
|
|
69
|
+
* replacement, and for the rest of the TTL the corpse's ready record sits in front of a live pid
|
|
70
|
+
* that has not bound anything yet. Reporting `bound` there is the reported incident with a new
|
|
71
|
+
* cause. When the caller can name the daemon it means (its creds file is on disk, and the daemon
|
|
72
|
+
* adopts `idFromCreds` of that file as its card id and lease holder), a foreign or dead holder's
|
|
73
|
+
* record classifies as `stale` rather than as health. When it genuinely cannot know — an adopted
|
|
74
|
+
* daemon whose creds this process never wrote — pass `undefined` and the holder is not checked,
|
|
75
|
+
* which is the same concession core makes and no worse than before. */
|
|
76
|
+
export declare function deliveryResponderFromLease(lease: DeliveryLeaseInfo | undefined, expectedHolder?: string): DeliveryResponderState;
|
|
77
|
+
/** Read the axis through a caller-supplied lease reader, mapping a FAILED read to `unknown` rather
|
|
78
|
+
* than to either health state. The reader is injected so the offline surfaces (which must not open
|
|
79
|
+
* a connection) and the connected ones share one classification without sharing a transport.
|
|
80
|
+
*
|
|
81
|
+
* `expectedHolder` is threaded through rather than applied by the caller so the staleness rule lives
|
|
82
|
+
* with the classification: a second surface that reads the lease gets the holder check by using this
|
|
83
|
+
* function, instead of having to remember that `ready` alone is not the question. */
|
|
84
|
+
export declare function deliveryResponderState(readLease: () => Promise<DeliveryLeaseInfo | undefined>, expectedHolder?: string): Promise<DeliveryResponderState>;
|
|
85
|
+
/** The bare-`status` process row's delivery suffix: what the recorded PROCESS means once the
|
|
86
|
+
* responder axis is known.
|
|
87
|
+
*
|
|
88
|
+
* A LIVE PID WITH AN UNBOUND RESPONDER IS THE REPORTED DEFECT, so it is the case that must never
|
|
89
|
+
* render as a bare "running". A live pid whose responder is bound is genuinely serving and says so.
|
|
90
|
+
* An unchecked axis says it is unchecked and names `--components`; it never implies either. */
|
|
91
|
+
export declare function deliveryRowSuffix(live: boolean, state: DeliveryResponderState, componentsHint: string): string;
|
|
92
|
+
//# sourceMappingURL=delivery-responder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-responder.d.ts","sourceRoot":"","sources":["../../src/lib/delivery-responder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;;;;;+FAY+F;AAC/F,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/E;;;;;;8CAM8C;AAC9C,eAAO,MAAM,6BAA6B,oDACS,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;wEAqBwE;AACxE,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,iBAAiB,GAAG,SAAS,EACpC,cAAc,CAAC,EAAE,MAAM,GACtB,sBAAsB,CAKxB;AAED;;;;;;sFAMsF;AACtF,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,EACvD,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,sBAAsB,CAAC,CAMjC;AAED;;;;;gGAKgG;AAChG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAe9G"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** The consequence, in the operator's terms rather than the daemon's.
|
|
2
|
+
*
|
|
3
|
+
* This sentence is the whole point of the fix. The boot path used to print a PROMISE
|
|
4
|
+
* ("boot durable joins will reconcile when it is") and nothing else: true, but it told an operator
|
|
5
|
+
* nothing about what was broken MEANWHILE, so a 22-hour outage read as a progress note. The
|
|
6
|
+
* reconcile is real and does run once a daemon binds; what nobody was told is that until it binds,
|
|
7
|
+
* these three operations cannot complete. */
|
|
8
|
+
export const RESPONDER_UNBOUND_CONSEQUENCE = "no spawn, no retirement, no join until it binds";
|
|
9
|
+
/** Classify a shard-0 lease record. `undefined` means the lease key is absent, which on a mesh that
|
|
10
|
+
* HAS a delivery daemon recorded is an unbound responder, not a missing opinion: the daemon creates
|
|
11
|
+
* its lease before it binds, so no lease at all means nothing has even claimed the slot.
|
|
12
|
+
*
|
|
13
|
+
* `expectedHolder` IS NOT OPTIONAL INFORMATION WHEN IT IS KNOWABLE, and leaving it out was a real
|
|
14
|
+
* defect in the first cut of this fix, caught by walking the one path no cell walked. A daemon that
|
|
15
|
+
* is SIGKILLed (or dies any way that skips `releaseDeliveryLease`) leaves its `ready:true` record in
|
|
16
|
+
* the bucket for the REST OF THE BUCKET TTL. Measured on a real broker: the record survives the
|
|
17
|
+
* holder's death and `ready` stays true for seconds afterwards. `ready` alone therefore answers
|
|
18
|
+
* "did SOME daemon bind, recently enough that its record has not expired", which is NOT the question
|
|
19
|
+
* an operator is asking. Core learned this at #837 — `waitForDeliveryLease` demands a named holder
|
|
20
|
+
* for exactly this reason — and a surface whose whole purpose is to stop reporting false health had
|
|
21
|
+
* no business asking the weaker question.
|
|
22
|
+
*
|
|
23
|
+
* THE REALISTIC SHAPE IS A RESTART, not a contrived kill: the daemon dies, `cotal up` starts a
|
|
24
|
+
* replacement, and for the rest of the TTL the corpse's ready record sits in front of a live pid
|
|
25
|
+
* that has not bound anything yet. Reporting `bound` there is the reported incident with a new
|
|
26
|
+
* cause. When the caller can name the daemon it means (its creds file is on disk, and the daemon
|
|
27
|
+
* adopts `idFromCreds` of that file as its card id and lease holder), a foreign or dead holder's
|
|
28
|
+
* record classifies as `stale` rather than as health. When it genuinely cannot know — an adopted
|
|
29
|
+
* daemon whose creds this process never wrote — pass `undefined` and the holder is not checked,
|
|
30
|
+
* which is the same concession core makes and no worse than before. */
|
|
31
|
+
export function deliveryResponderFromLease(lease, expectedHolder) {
|
|
32
|
+
if (lease === undefined)
|
|
33
|
+
return "unbound";
|
|
34
|
+
if (lease.ready !== true)
|
|
35
|
+
return "unbound";
|
|
36
|
+
if (expectedHolder !== undefined && lease.holder !== expectedHolder)
|
|
37
|
+
return "stale";
|
|
38
|
+
return "bound";
|
|
39
|
+
}
|
|
40
|
+
/** Read the axis through a caller-supplied lease reader, mapping a FAILED read to `unknown` rather
|
|
41
|
+
* than to either health state. The reader is injected so the offline surfaces (which must not open
|
|
42
|
+
* a connection) and the connected ones share one classification without sharing a transport.
|
|
43
|
+
*
|
|
44
|
+
* `expectedHolder` is threaded through rather than applied by the caller so the staleness rule lives
|
|
45
|
+
* with the classification: a second surface that reads the lease gets the holder check by using this
|
|
46
|
+
* function, instead of having to remember that `ready` alone is not the question. */
|
|
47
|
+
export async function deliveryResponderState(readLease, expectedHolder) {
|
|
48
|
+
try {
|
|
49
|
+
return deliveryResponderFromLease(await readLease(), expectedHolder);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return "unknown";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** The bare-`status` process row's delivery suffix: what the recorded PROCESS means once the
|
|
56
|
+
* responder axis is known.
|
|
57
|
+
*
|
|
58
|
+
* A LIVE PID WITH AN UNBOUND RESPONDER IS THE REPORTED DEFECT, so it is the case that must never
|
|
59
|
+
* render as a bare "running". A live pid whose responder is bound is genuinely serving and says so.
|
|
60
|
+
* An unchecked axis says it is unchecked and names `--components`; it never implies either. */
|
|
61
|
+
export function deliveryRowSuffix(live, state, componentsHint) {
|
|
62
|
+
if (!live)
|
|
63
|
+
return "";
|
|
64
|
+
switch (state) {
|
|
65
|
+
case "bound":
|
|
66
|
+
return " · responder bound";
|
|
67
|
+
case "unbound":
|
|
68
|
+
return ` · RESPONDER NOT BOUND - ${RESPONDER_UNBOUND_CONSEQUENCE}`;
|
|
69
|
+
case "stale":
|
|
70
|
+
// NAME THE CORPSE, not just the symptom. An operator who is told "not bound" while a ready
|
|
71
|
+
// record exists will reasonably go looking for a daemon that is doing something; saying the
|
|
72
|
+
// record belongs to a daemon that is gone points at the actual next move.
|
|
73
|
+
return ` · RESPONDER NOT BOUND - a DEAD daemon's ready record is still in the lease (it expires on its own) - ${RESPONDER_UNBOUND_CONSEQUENCE}`;
|
|
74
|
+
case "unknown":
|
|
75
|
+
return ` · responder state unchecked (${componentsHint})`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=delivery-responder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-responder.js","sourceRoot":"","sources":["../../src/lib/delivery-responder.ts"],"names":[],"mappings":"AA+CA;;;;;;8CAM8C;AAC9C,MAAM,CAAC,MAAM,6BAA6B,GACxC,iDAAiD,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;wEAqBwE;AACxE,MAAM,UAAU,0BAA0B,CACxC,KAAoC,EACpC,cAAuB;IAEvB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC3C,IAAI,cAAc,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc;QAAE,OAAO,OAAO,CAAC;IACpF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;sFAMsF;AACtF,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,SAAuD,EACvD,cAAuB;IAEvB,IAAI,CAAC;QACH,OAAO,0BAA0B,CAAC,MAAM,SAAS,EAAE,EAAE,cAAc,CAAC,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;gGAKgG;AAChG,MAAM,UAAU,iBAAiB,CAAC,IAAa,EAAE,KAA6B,EAAE,cAAsB;IACpG,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO;YACV,OAAO,oBAAoB,CAAC;QAC9B,KAAK,SAAS;YACZ,OAAO,4BAA4B,6BAA6B,EAAE,CAAC;QACrE,KAAK,OAAO;YACV,2FAA2F;YAC3F,4FAA4F;YAC5F,0EAA0E;YAC1E,OAAO,yGAAyG,6BAA6B,EAAE,CAAC;QAClJ,KAAK,SAAS;YACZ,OAAO,iCAAiC,cAAc,GAAG,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { type CommandReader, type LivenessProbe } from "@cotal-ai/workspace";
|
|
2
|
+
/** The `--max-sessions` value a live `cotal supervise` argv is actually serving.
|
|
3
|
+
*
|
|
4
|
+
* The manager reads that flag only at start. A refresh that records a different number while this
|
|
5
|
+
* process stays up is a durable lie: MeshEntry claims a ceiling the live plane is not enforcing.
|
|
6
|
+
* Absent from argv means the plane default of 64, not a recorded decision. */
|
|
7
|
+
export declare function maxSessionsFromSuperviseArgv(command: string): number | undefined;
|
|
8
|
+
/** True only when the live supervisor argv is proven to already be serving `requested`.
|
|
9
|
+
* An unreadable command line cannot prove that, so it is a refusal — persist would guess. */
|
|
10
|
+
export declare function liveManagerWouldApplyMaxSessions(command: string | undefined, requested: number): boolean;
|
|
2
11
|
/** The exact logfile the detached-manager writer opens. Exported so operator guidance names the
|
|
3
12
|
* writer-owned path instead of copying its filename template into command output. */
|
|
4
13
|
export declare const managerLogPath: (space: string, root?: string) => string;
|
|
@@ -61,7 +70,7 @@ export declare function managerHasDeliveryMarker(space?: string): boolean;
|
|
|
61
70
|
* composed `cotal` binary registers it; `process.execArgv` carries the tsx loader in dev and is
|
|
62
71
|
* empty in prod. `supervise`'s auto runtime resolves to pty when detached, which answers the
|
|
63
72
|
* control plane (`cotal_spawn`/`despawn`/`purge`/`persona`) with no tmux/cmux needed. */
|
|
64
|
-
export
|
|
73
|
+
export type ManagerStartOpts = {
|
|
65
74
|
space?: string;
|
|
66
75
|
server?: string;
|
|
67
76
|
spawn?: string[];
|
|
@@ -71,7 +80,10 @@ export declare function startManagerDetached(o?: {
|
|
|
71
80
|
resumeAttempt?: string;
|
|
72
81
|
resumeCommitToken?: string;
|
|
73
82
|
wsPort?: number;
|
|
74
|
-
|
|
83
|
+
/** Live-session ceiling forwarded as `supervise --max-sessions`. */
|
|
84
|
+
maxSessions?: number;
|
|
85
|
+
};
|
|
86
|
+
export declare function startManagerDetached(o?: ManagerStartOpts): number;
|
|
75
87
|
/** Make the control plane available: reuse a manager already running for this folder, else start
|
|
76
88
|
* one detached. Best-effort — callers treat it as non-fatal. A caller that needs THE manager to
|
|
77
89
|
* carry a runtime/launch spec (`up -f`) must stop any leftover manager first — a reused one is
|
|
@@ -84,17 +96,7 @@ export declare function startManagerDetached(o?: {
|
|
|
84
96
|
* unattributable record is the same defect as deleting it, reached through a different verb, which
|
|
85
97
|
* is the third time that shape has appeared in this change. Any future starter calls this first. */
|
|
86
98
|
export declare function assertManagerRecordReplaceable(probe?: LivenessProbe, readCommand?: CommandReader, space?: string): void;
|
|
87
|
-
export declare function ensureManager(o?: {
|
|
88
|
-
space?: string;
|
|
89
|
-
server?: string;
|
|
90
|
-
spawn?: string[];
|
|
91
|
-
runtime?: string;
|
|
92
|
-
launch?: string;
|
|
93
|
-
attachHost?: string;
|
|
94
|
-
resumeAttempt?: string;
|
|
95
|
-
resumeCommitToken?: string;
|
|
96
|
-
wsPort?: number;
|
|
97
|
-
}, probe?: LivenessProbe, readCommand?: CommandReader): {
|
|
99
|
+
export declare function ensureManager(o?: ManagerStartOpts, probe?: LivenessProbe, readCommand?: CommandReader): {
|
|
98
100
|
running: boolean;
|
|
99
101
|
};
|
|
100
102
|
/** A signal, injectable for the same reason the probe is: `EPERM` from `kill` is producible only by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager-proc.d.ts","sourceRoot":"","sources":["../../src/lib/manager-proc.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,aAAa,EAAE,KAAK,aAAa,EAEvC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"manager-proc.d.ts","sourceRoot":"","sources":["../../src/lib/manager-proc.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,aAAa,EAAE,KAAK,aAAa,EAEvC,MAAM,qBAAqB,CAAC;AAC7B;;;;+EAI+E;AAC/E,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAehF;AAED;8FAC8F;AAC9F,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAGxG;AAWD;sFACsF;AACtF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,EAAE,OAAM,MAAoB,KAAG,MACd,CAAC;AAE9D,yFAAyF;AACzF,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,OAAM,MAAoB,KAAG,MACrC,CAAC;AAE9C;;uFAEuF;AACvF,e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AE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,CAAC,GAAE,gBAAqB,GACvB,MAAM,CA4DR;AAED;;;mBAGmB;AACnB;;;;;;qGAMqG;AACrG,wBAAgB,8BAA8B,CAC5C,KAAK,GAAE,aAA6B,EACpC,WAAW,GAAE,aAAkC,EAC/C,KAAK,GAAE,MAAsB,GAC5B,IAAI,CA2BN;AAED,wBAAgB,aAAa,CAC3B,CAAC,GAAE,gBAAqB,EACxB,KAAK,GAAE,aAA6B,EACpC,WAAW,GAAE,aAAkC,GAC9C;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAOtB;AAED;;8CAE8C;AAC9C,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC;AAErE,uGAAuG;AACvG,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,cAAc,CAAC;AAErD;;iGAEiG;AAGjG;;;;;;;;;;0FAU0F;AAC1F,wBAAsB,WAAW,CAC/B,KAAK,GAAE,aAA6B,EACpC,MAAM,GAAE,QAAQ,GAAG,SAAqB,EACxC,WAAW,GAAE,aAAkC,EAC/C,KAAK,GAAE,MAAsB,GAC5B,OAAO,CAAC,WAAW,CAAC,CA+FtB"}
|
package/dist/lib/manager-proc.js
CHANGED
|
@@ -5,7 +5,39 @@ import { DEFAULT_SERVER } from "@cotal-ai/core";
|
|
|
5
5
|
import { selfArgv } from "./self-exec.js";
|
|
6
6
|
import { resolveRuntimeSpace } from "./status.js";
|
|
7
7
|
import { cotalRoot } from "./paths.js";
|
|
8
|
-
import { canonicalLocalProcessPath, commandIsCotalSupervisor, localProcessPath, parsePid, probeLiveness, readProcessCommand, reclaimDeadPreUpgradeRecord, MANAGER_DELIVERY_AWARE_MARKER, MANAGER_LOGFILE, MANAGER_PIDFILE, identityLegacyWarning, identityRefusal, identityUncertaintyRefusal, removeIdentityPin, verifyIdentityPin, writeIdentityPin, } from "@cotal-ai/workspace";
|
|
8
|
+
import { canonicalLocalProcessPath, commandIsCotalSupervisor, localProcessPath, parsePid, probeLiveness, readProcessCommand, reclaimDeadPreUpgradeRecord, MANAGER_DELIVERY_AWARE_MARKER, MANAGER_LOGFILE, MANAGER_PIDFILE, identityLegacyWarning, identityRefusal, identityUncertaintyRefusal, parsePositiveIntegerFlag, removeIdentityPin, verifyIdentityPin, writeIdentityPin, } from "@cotal-ai/workspace";
|
|
9
|
+
/** The `--max-sessions` value a live `cotal supervise` argv is actually serving.
|
|
10
|
+
*
|
|
11
|
+
* The manager reads that flag only at start. A refresh that records a different number while this
|
|
12
|
+
* process stays up is a durable lie: MeshEntry claims a ceiling the live plane is not enforcing.
|
|
13
|
+
* Absent from argv means the plane default of 64, not a recorded decision. */
|
|
14
|
+
export function maxSessionsFromSuperviseArgv(command) {
|
|
15
|
+
const tokens = command.trim().split(/\s+/);
|
|
16
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
17
|
+
const token = tokens[i];
|
|
18
|
+
let raw;
|
|
19
|
+
if (token === "--max-sessions")
|
|
20
|
+
raw = tokens[i + 1];
|
|
21
|
+
else if (token.startsWith("--max-sessions="))
|
|
22
|
+
raw = token.slice("--max-sessions=".length);
|
|
23
|
+
if (raw === undefined)
|
|
24
|
+
continue;
|
|
25
|
+
try {
|
|
26
|
+
return parsePositiveIntegerFlag("--max-sessions", raw);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
/** True only when the live supervisor argv is proven to already be serving `requested`.
|
|
35
|
+
* An unreadable command line cannot prove that, so it is a refusal — persist would guess. */
|
|
36
|
+
export function liveManagerWouldApplyMaxSessions(command, requested) {
|
|
37
|
+
if (command === undefined)
|
|
38
|
+
return false;
|
|
39
|
+
return maxSessionsFromSuperviseArgv(command) === requested;
|
|
40
|
+
}
|
|
9
41
|
/** The space whose manager this folder's commands mean. Every helper below defaults to it, and the
|
|
10
42
|
* ones a caller reaches with an explicit `--space` take it as their last argument: the records are
|
|
11
43
|
* per-space now, so a helper that assumed the folder's space would answer about a sibling tenant's
|
|
@@ -96,11 +128,6 @@ export function managerHasDeliveryMarker(space = folderSpace()) {
|
|
|
96
128
|
const livePid = Number(readFileSync(pidPath, "utf8").trim());
|
|
97
129
|
return Number.isFinite(markerPid) && Number.isFinite(livePid) && markerPid === livePid;
|
|
98
130
|
}
|
|
99
|
-
/** Start the control-plane manager detached (pid in `.cotal/manager.<spaceKey>.pid`, output to
|
|
100
|
-
* `.cotal/manager.<spaceKey>.log`), stopped by `cotal down`. Re-execs this same CLI's `supervise` — the
|
|
101
|
-
* composed `cotal` binary registers it; `process.execArgv` carries the tsx loader in dev and is
|
|
102
|
-
* empty in prod. `supervise`'s auto runtime resolves to pty when detached, which answers the
|
|
103
|
-
* control plane (`cotal_spawn`/`despawn`/`purge`/`persona`) with no tmux/cmux needed. */
|
|
104
131
|
export function startManagerDetached(o = {}) {
|
|
105
132
|
const space = o.space ?? folderSpace();
|
|
106
133
|
// Clear a provably dead PRE-UPGRADE record before claiming the canonical slot, so an upgraded root
|
|
@@ -108,6 +135,10 @@ export function startManagerDetached(o = {}) {
|
|
|
108
135
|
// on a live or unattributable one rather than orphaning the daemon behind it.
|
|
109
136
|
reclaimDeadPreUpgradeRecord(MANAGER_PIDFILE, ctx(space));
|
|
110
137
|
reclaimDeadPreUpgradeRecord(MANAGER_DELIVERY_AWARE_MARKER, ctx(space));
|
|
138
|
+
// BEFORE THE LOG IS OPENED. `selfArgv` refuses when this process was not started from the `cotal`
|
|
139
|
+
// entry (#1629), and a refusal must leave the root exactly as it found it: computing the argv after
|
|
140
|
+
// `openSync` would create a manager log and leak its descriptor on every refused start.
|
|
141
|
+
const [node, ...self] = selfArgv();
|
|
111
142
|
const logPath = managerLogPath(space);
|
|
112
143
|
// 0600: the manager prints its console URL here, and that URL carries the console token — a
|
|
113
144
|
// standing credential for every agent's terminal on this mesh, at rest for the life of the file.
|
|
@@ -122,7 +153,6 @@ export function startManagerDetached(o = {}) {
|
|
|
122
153
|
chmodSync(logPath, 0o600);
|
|
123
154
|
}
|
|
124
155
|
catch { /* mode is defence in depth, not the boundary */ }
|
|
125
|
-
const [node, ...self] = selfArgv();
|
|
126
156
|
const args = [
|
|
127
157
|
...self,
|
|
128
158
|
"supervise",
|
|
@@ -142,6 +172,7 @@ export function startManagerDetached(o = {}) {
|
|
|
142
172
|
...(o.resumeCommitToken ? ["--resume-commit-token", o.resumeCommitToken] : []),
|
|
143
173
|
// P2 item 6: the broker ws listener port (loopback) for the console session client's wsUrl.
|
|
144
174
|
...(o.wsPort !== undefined ? ["--ws-port", String(o.wsPort)] : []),
|
|
175
|
+
...(o.maxSessions !== undefined ? ["--max-sessions", String(o.maxSessions)] : []),
|
|
145
176
|
];
|
|
146
177
|
// This is an INTERNAL child re-exec: the `up`/`spawn` that reached here already ran the first-run
|
|
147
178
|
// connector seed, so the manager skips it on boot (a direct `cotal supervise` still seeds).
|